diff --git a/.hgtags b/.hgtags index a3f78b33edc..b8d857ecd41 100644 --- a/.hgtags +++ b/.hgtags @@ -230,3 +230,10 @@ b5ed503c26ad38869c247c5e32debec217fd056b jdk8-b104 514b0b69fb9683ef52062fd962a3e0644431f64d jdk8-b106 892889f445755790ae90e61775bfb59ddc6182b5 jdk8-b107 74049f7a28b48c14910106a75d9f2504169c352e jdk8-b108 +af9a674e12a16da1a4bd53e4990ddb1121a21ef1 jdk8-b109 +b5d2bf482a3ea1cca08c994512804ffbc73de0a1 jdk8-b110 +b9a0f6c693f347a6f4b9bb994957f4eaa05bdedd jdk8-b111 +ad67c34f79c28a8e755f4a49f313868619d6702c jdk8-b112 +4a4dbcf7cb7d3e1a81beaa3b11cd909f69ebc79a jdk8-b113 +dfa34ab293faad9b543a24646dbb381bc3ab5586 jdk8-b114 +3dd9732b17034f45d111996d1d50287b05a3998c jdk8-b115 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index fbcdb0977c0..263edf8e122 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -230,3 +230,10 @@ b7e64be81c8a7690703df5711f4fc2375da8a9cb jdk8-b103 8e7b4d9fb00fdf1334376aeac050c9bca6d1b383 jdk8-b106 0874bb4707b723d5bb108d379c557cf41529d1a7 jdk8-b107 9286a6e61291246d88af713f1ef79adeea30fe2e jdk8-b108 +91f47e8da5c60de58ed195e9b57f3bf192a18f83 jdk8-b109 +4faa09c7fe555de086dd9048d3c5cc92317d6f45 jdk8-b110 +d086227bfc45d124f09b3bd72a07956b4073bf71 jdk8-b111 +547316ea137d83d9c63083a9b83db64198fe0c81 jdk8-b112 +6ba4c7cb623ec612031e05cf8bf279d8f407bd1e jdk8-b113 +4f2011496393a26dcfd7b1f7787a3673ddd32599 jdk8-b114 +763ada2a1d8c5962bc8c3d297e57c562d2e95338 jdk8-b115 diff --git a/NewMakefile.gmk b/NewMakefile.gmk index e15330f5d6b..a3389ff7278 100644 --- a/NewMakefile.gmk +++ b/NewMakefile.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -36,17 +36,15 @@ default: TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1 # Assume we have GNU make, but check version. -ifeq (,$(findstring 3.81,$(MAKE_VERSION))) - ifeq (,$(findstring 3.82,$(MAKE_VERSION))) - $(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.) - endif +ifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), ) + $(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.) endif # Locate this Makefile ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),) - makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST)) + makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST)) else - makefile_path:=$(lastword $(MAKEFILE_LIST)) + makefile_path:=$(lastword $(MAKEFILE_LIST)) endif root_dir:=$(dir $(makefile_path)) @@ -58,27 +56,27 @@ $(eval $(call ParseConfAndSpec)) # Now determine if we have zero, one or several configurations to build. ifeq ($(SPEC),) - # Since we got past ParseConfAndSpec, we must be building a global target. Do nothing. + # Since we got past ParseConfAndSpec, we must be building a global target. Do nothing. else - ifeq ($(words $(SPEC)),1) - # We are building a single configuration. This is the normal case. Execute the Main.gmk file. - include $(root_dir)/common/makefiles/Main.gmk - else - # We are building multiple configurations. - # First, find out the valid targets - # Run the makefile with an arbitraty SPEC using -p -q (quiet dry-run and dump rules) to find - # available PHONY targets. Use this list as valid targets to pass on to the repeated calls. - all_phony_targets=$(filter-out $(global_targets) bundles-only, $(strip $(shell \ - $(MAKE) -p -q -f common/makefiles/Main.gmk FRC SPEC=$(firstword $(SPEC)) | \ - grep ^.PHONY: | head -n 1 | cut -d " " -f 2-))) + ifeq ($(words $(SPEC)),1) + # We are building a single configuration. This is the normal case. Execute the Main.gmk file. + include $(root_dir)/common/makefiles/Main.gmk + else + # We are building multiple configurations. + # First, find out the valid targets + # Run the makefile with an arbitrary SPEC using -p -q (quiet dry-run and dump rules) to find + # available PHONY targets. Use this list as valid targets to pass on to the repeated calls. + all_phony_targets=$(filter-out $(global_targets) bundles-only, $(strip $(shell \ + $(MAKE) -p -q -f common/makefiles/Main.gmk FRC SPEC=$(firstword $(SPEC)) | \ + grep ^.PHONY: | head -n 1 | cut -d " " -f 2-))) - $(all_phony_targets): - @$(foreach spec,$(SPEC),($(MAKE) -f NewMakefile.gmk SPEC=$(spec) \ - $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $@) &&) true + $(all_phony_targets): + @$(foreach spec,$(SPEC),($(MAKE) -f NewMakefile.gmk SPEC=$(spec) \ + $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $@) &&) true - .PHONY: $(all_phony_targets) + .PHONY: $(all_phony_targets) - endif + endif endif # Include this after a potential spec file has been included so that the bundles target diff --git a/common/autoconf/autogen.sh b/common/autoconf/autogen.sh index 96768aa06e2..69bb67ee426 100644 --- a/common/autoconf/autogen.sh +++ b/common/autoconf/autogen.sh @@ -62,7 +62,7 @@ if test -e $custom_hook; then # We have custom sources available; also generate configure script # with custom hooks compiled in. cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | \ - sed -e "s|#CUSTOM_AUTOCONF_INCLUDE|m4_include([$custom_hook])|" | ${AUTOCONF} -W all -I$script_dir - > $custom_script_dir/generated-configure.sh + sed -e "s|#CUSTOM_AUTOCONF_INCLUDE|m4_include([$custom_hook])|" | ${AUTOCONF} -W all -I$script_dir - > $custom_script_dir/generated-configure.sh rm -rf autom4te.cache else echo No custom hook found: $custom_hook diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index f3911ff9bd9..92d755af35f 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -24,23 +24,23 @@ # # Test if $1 is a valid argument to $3 (often is $JAVA passed as $3) -# If so, then append $1 to $2\ +# If so, then append $1 to $2 \ # Also set JVM_ARG_OK to true/false depending on outcome. AC_DEFUN([ADD_JVM_ARG_IF_OK], [ - $ECHO "Check if jvm arg is ok: $1" >&AS_MESSAGE_LOG_FD - $ECHO "Command: $3 $1 -version" >&AS_MESSAGE_LOG_FD - OUTPUT=`$3 $1 -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - $2="[$]$2 $1" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&AS_MESSAGE_LOG_FD - $ECHO "$OUTPUT" >&AS_MESSAGE_LOG_FD - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: $1" >&AS_MESSAGE_LOG_FD + $ECHO "Command: $3 $1 -version" >&AS_MESSAGE_LOG_FD + OUTPUT=`$3 $1 -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + $2="[$]$2 $1" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&AS_MESSAGE_LOG_FD + $ECHO "$OUTPUT" >&AS_MESSAGE_LOG_FD + JVM_ARG_OK=false + fi ]) # Appends a string to a path variable, only adding the : when needed. @@ -82,7 +82,7 @@ AC_DEFUN([BASIC_FIXUP_PATH], AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.]) fi - $1="`cd "$path"; $THEPWDCMD -L`" + $1="`cd "$path"; $THEPWDCMD -L`" fi ]) @@ -129,78 +129,78 @@ AC_DEFUN([BASIC_FIXUP_EXECUTABLE], AC_MSG_NOTICE([Resolving $1 (as $path) failed, using $path directly.]) new_path="$path" fi - + if test "x$new_path" = x; then - 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 - AC_MSG_NOTICE([This might be caused by spaces in the path, which is not allowed.]) - fi - AC_MSG_ERROR([Cannot locate the the path of $1]) + 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 + AC_MSG_NOTICE([This might be caused by spaces in the path, which is not allowed.]) fi + AC_MSG_ERROR([Cannot locate the the path of $1]) + 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], [ - if test "x$OPENJDK_BUILD_OS" != xwindows; then - # Follow a chain of symbolic links. Use readlink - # where it exists, else fall back to horribly - # complicated shell code. - if test "x$READLINK_TESTED" != yes; then - # On MacOSX there is a readlink tool with a different - # purpose than the GNU readlink tool. Check the found readlink. - ISGNU=`$READLINK --version 2>&1 | $GREP GNU` - if test "x$ISGNU" = x; then - # A readlink that we do not know how to use. - # Are there other non-GNU readlinks out there? - READLINK_TESTED=yes - READLINK= - fi - fi - - if test "x$READLINK" != x; then - $1=`$READLINK -f [$]$1` - else - # Save the current directory for restoring afterwards - STARTDIR=$PWD - COUNTER=0 - sym_link_dir=`$DIRNAME [$]$1` - sym_link_file=`$BASENAME [$]$1` - cd $sym_link_dir - # Use -P flag to resolve symlinks in directories. - cd `$THEPWDCMD -P` - sym_link_dir=`$THEPWDCMD -P` - # Resolve file symlinks - while test $COUNTER -lt 20; do - ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` - if test "x$ISLINK" == x; then - # This is not a symbolic link! We are done! - break - fi - # Again resolve directory symlinks since the target of the just found - # link could be in a different directory - cd `$DIRNAME $ISLINK` - sym_link_dir=`$THEPWDCMD -P` - sym_link_file=`$BASENAME $ISLINK` - let COUNTER=COUNTER+1 - done - cd $STARTDIR - $1=$sym_link_dir/$sym_link_file - fi + if test "x$OPENJDK_BUILD_OS" != xwindows; then + # Follow a chain of symbolic links. Use readlink + # where it exists, else fall back to horribly + # complicated shell code. + if test "x$READLINK_TESTED" != yes; then + # On MacOSX there is a readlink tool with a different + # purpose than the GNU readlink tool. Check the found readlink. + ISGNU=`$READLINK --version 2>&1 | $GREP GNU` + if test "x$ISGNU" = x; then + # A readlink that we do not know how to use. + # Are there other non-GNU readlinks out there? + READLINK_TESTED=yes + READLINK= + fi fi + + if test "x$READLINK" != x; then + $1=`$READLINK -f [$]$1` + else + # Save the current directory for restoring afterwards + STARTDIR=$PWD + COUNTER=0 + sym_link_dir=`$DIRNAME [$]$1` + sym_link_file=`$BASENAME [$]$1` + cd $sym_link_dir + # Use -P flag to resolve symlinks in directories. + cd `$THEPWDCMD -P` + sym_link_dir=`$THEPWDCMD -P` + # Resolve file symlinks + while test $COUNTER -lt 20; do + ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` + if test "x$ISLINK" == x; then + # This is not a symbolic link! We are done! + break + fi + # Again resolve directory symlinks since the target of the just found + # link could be in a different directory + cd `$DIRNAME $ISLINK` + sym_link_dir=`$THEPWDCMD -P` + sym_link_file=`$BASENAME $ISLINK` + let COUNTER=COUNTER+1 + done + cd $STARTDIR + $1=$sym_link_dir/$sym_link_file + fi + fi ]) # Register a --with argument but mark it as deprecated @@ -212,14 +212,26 @@ AC_DEFUN([BASIC_DEPRECATED_ARG_WITH], [AC_MSG_WARN([Option --with-$1 is deprecated and will be ignored.])]) ]) +# Register a --enable argument but mark it as deprecated +# $1: The name of the with argument to deprecate, not including --enable- +# $2: The name of the argument to deprecate, in shell variable style (i.e. with _ instead of -) +AC_DEFUN([BASIC_DEPRECATED_ARG_ENABLE], +[ + AC_ARG_ENABLE($1, [AS_HELP_STRING([--enable-$1], + [Deprecated. Option is kept for backwards compatibility and is ignored])]) + if test "x$enable_$2" != x; then + AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.]) + fi +]) + AC_DEFUN_ONCE([BASIC_INIT], [ -# Save the original command line. This is passed to us by the wrapper configure script. -AC_SUBST(CONFIGURE_COMMAND_LINE) -DATE_WHEN_CONFIGURED=`LANG=C date` -AC_SUBST(DATE_WHEN_CONFIGURED) -AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.]) -AC_MSG_NOTICE([configure script generated at timestamp $DATE_WHEN_GENERATED.]) + # Save the original command line. This is passed to us by the wrapper configure script. + AC_SUBST(CONFIGURE_COMMAND_LINE) + DATE_WHEN_CONFIGURED=`LANG=C date` + AC_SUBST(DATE_WHEN_CONFIGURED) + AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.]) + AC_MSG_NOTICE([configure script generated at timestamp $DATE_WHEN_GENERATED.]) ]) # Test that variable $1 denoting a program is not empty. If empty, exit with an error. @@ -227,15 +239,15 @@ AC_MSG_NOTICE([configure script generated at timestamp $DATE_WHEN_GENERATED.]) # $2: executable name to print in warning (optional) AC_DEFUN([BASIC_CHECK_NONEMPTY], [ - if test "x[$]$1" = x; then - if test "x$2" = x; then - PROG_NAME=translit($1,A-Z,a-z) - else - PROG_NAME=$2 - fi - AC_MSG_NOTICE([Could not find $PROG_NAME!]) - AC_MSG_ERROR([Cannot continue]) + if test "x[$]$1" = x; then + if test "x$2" = x; then + PROG_NAME=translit($1,A-Z,a-z) + else + PROG_NAME=$2 fi + AC_MSG_NOTICE([Could not find $PROG_NAME!]) + AC_MSG_ERROR([Cannot continue]) + fi ]) # Does AC_PATH_PROG followed by BASIC_CHECK_NONEMPTY. @@ -244,8 +256,8 @@ AC_DEFUN([BASIC_CHECK_NONEMPTY], # $2: executable name to look for AC_DEFUN([BASIC_REQUIRE_PROG], [ - AC_PATH_PROGS($1, $2) - BASIC_CHECK_NONEMPTY($1, $2) + AC_PATH_PROGS($1, $2) + BASIC_CHECK_NONEMPTY($1, $2) ]) # Setup the most fundamental tools that relies on not much else to set up, @@ -253,171 +265,171 @@ AC_DEFUN([BASIC_REQUIRE_PROG], AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS], [ -# Start with tools that do not need have cross compilation support -# and can be expected to be found in the default PATH. These tools are -# used by configure. Nor are these tools expected to be found in the -# devkit from the builddeps server either, since they are -# needed to download the devkit. + # Start with tools that do not need have cross compilation support + # and can be expected to be found in the default PATH. These tools are + # used by configure. Nor are these tools expected to be found in the + # devkit from the builddeps server either, since they are + # needed to download the devkit. -# First are all the simple required tools. -BASIC_REQUIRE_PROG(BASENAME, basename) -BASIC_REQUIRE_PROG(BASH, bash) -BASIC_REQUIRE_PROG(CAT, cat) -BASIC_REQUIRE_PROG(CHMOD, chmod) -BASIC_REQUIRE_PROG(CMP, cmp) -BASIC_REQUIRE_PROG(COMM, comm) -BASIC_REQUIRE_PROG(CP, cp) -BASIC_REQUIRE_PROG(CPIO, cpio) -BASIC_REQUIRE_PROG(CUT, cut) -BASIC_REQUIRE_PROG(DATE, date) -BASIC_REQUIRE_PROG(DIFF, [gdiff diff]) -BASIC_REQUIRE_PROG(DIRNAME, dirname) -BASIC_REQUIRE_PROG(ECHO, echo) -BASIC_REQUIRE_PROG(EXPR, expr) -BASIC_REQUIRE_PROG(FILE, file) -BASIC_REQUIRE_PROG(FIND, find) -BASIC_REQUIRE_PROG(HEAD, head) -BASIC_REQUIRE_PROG(LN, ln) -BASIC_REQUIRE_PROG(LS, ls) -BASIC_REQUIRE_PROG(MKDIR, mkdir) -BASIC_REQUIRE_PROG(MKTEMP, mktemp) -BASIC_REQUIRE_PROG(MV, mv) -BASIC_REQUIRE_PROG(PRINTF, printf) -BASIC_REQUIRE_PROG(RM, rm) -BASIC_REQUIRE_PROG(SH, sh) -BASIC_REQUIRE_PROG(SORT, sort) -BASIC_REQUIRE_PROG(TAIL, tail) -BASIC_REQUIRE_PROG(TAR, tar) -BASIC_REQUIRE_PROG(TEE, tee) -BASIC_REQUIRE_PROG(TOUCH, touch) -BASIC_REQUIRE_PROG(TR, tr) -BASIC_REQUIRE_PROG(UNAME, uname) -BASIC_REQUIRE_PROG(UNIQ, uniq) -BASIC_REQUIRE_PROG(WC, wc) -BASIC_REQUIRE_PROG(WHICH, which) -BASIC_REQUIRE_PROG(XARGS, xargs) + # First are all the simple required tools. + BASIC_REQUIRE_PROG(BASENAME, basename) + BASIC_REQUIRE_PROG(BASH, bash) + BASIC_REQUIRE_PROG(CAT, cat) + BASIC_REQUIRE_PROG(CHMOD, chmod) + BASIC_REQUIRE_PROG(CMP, cmp) + BASIC_REQUIRE_PROG(COMM, comm) + BASIC_REQUIRE_PROG(CP, cp) + BASIC_REQUIRE_PROG(CPIO, cpio) + BASIC_REQUIRE_PROG(CUT, cut) + BASIC_REQUIRE_PROG(DATE, date) + BASIC_REQUIRE_PROG(DIFF, [gdiff diff]) + BASIC_REQUIRE_PROG(DIRNAME, dirname) + BASIC_REQUIRE_PROG(ECHO, echo) + BASIC_REQUIRE_PROG(EXPR, expr) + BASIC_REQUIRE_PROG(FILE, file) + BASIC_REQUIRE_PROG(FIND, find) + BASIC_REQUIRE_PROG(HEAD, head) + BASIC_REQUIRE_PROG(LN, ln) + BASIC_REQUIRE_PROG(LS, ls) + BASIC_REQUIRE_PROG(MKDIR, mkdir) + BASIC_REQUIRE_PROG(MKTEMP, mktemp) + BASIC_REQUIRE_PROG(MV, mv) + BASIC_REQUIRE_PROG(PRINTF, printf) + BASIC_REQUIRE_PROG(RM, rm) + BASIC_REQUIRE_PROG(SH, sh) + BASIC_REQUIRE_PROG(SORT, sort) + BASIC_REQUIRE_PROG(TAIL, tail) + BASIC_REQUIRE_PROG(TAR, tar) + BASIC_REQUIRE_PROG(TEE, tee) + BASIC_REQUIRE_PROG(TOUCH, touch) + BASIC_REQUIRE_PROG(TR, tr) + BASIC_REQUIRE_PROG(UNAME, uname) + BASIC_REQUIRE_PROG(UNIQ, uniq) + BASIC_REQUIRE_PROG(WC, wc) + BASIC_REQUIRE_PROG(WHICH, which) + BASIC_REQUIRE_PROG(XARGS, xargs) -# Then required tools that require some special treatment. -AC_PROG_AWK -BASIC_CHECK_NONEMPTY(AWK) -AC_PROG_GREP -BASIC_CHECK_NONEMPTY(GREP) -AC_PROG_EGREP -BASIC_CHECK_NONEMPTY(EGREP) -AC_PROG_FGREP -BASIC_CHECK_NONEMPTY(FGREP) -AC_PROG_SED -BASIC_CHECK_NONEMPTY(SED) + # Then required tools that require some special treatment. + AC_PROG_AWK + BASIC_CHECK_NONEMPTY(AWK) + AC_PROG_GREP + BASIC_CHECK_NONEMPTY(GREP) + AC_PROG_EGREP + BASIC_CHECK_NONEMPTY(EGREP) + AC_PROG_FGREP + BASIC_CHECK_NONEMPTY(FGREP) + AC_PROG_SED + BASIC_CHECK_NONEMPTY(SED) -AC_PATH_PROGS(NAWK, [nawk gawk awk]) -BASIC_CHECK_NONEMPTY(NAWK) + AC_PATH_PROGS(NAWK, [nawk gawk awk]) + BASIC_CHECK_NONEMPTY(NAWK) -# Always force rm. -RM="$RM -f" + # Always force rm. + RM="$RM -f" -# pwd behaves differently on various platforms and some don't support the -L flag. -# Always use the bash builtin pwd to get uniform behavior. -THEPWDCMD=pwd + # pwd behaves differently on various platforms and some don't support the -L flag. + # Always use the bash builtin pwd to get uniform behavior. + THEPWDCMD=pwd -# These are not required on all platforms -AC_PATH_PROG(CYGPATH, cygpath) -AC_PATH_PROG(READLINK, readlink) -AC_PATH_PROG(DF, df) -AC_PATH_PROG(SETFILE, SetFile) + # These are not required on all platforms + AC_PATH_PROG(CYGPATH, cygpath) + AC_PATH_PROG(READLINK, readlink) + AC_PATH_PROG(DF, df) + AC_PATH_PROG(SETFILE, SetFile) ]) # Setup basic configuration paths, and platform-specific stuff related to PATHs. AC_DEFUN_ONCE([BASIC_SETUP_PATHS], [ -# Locate the directory of this script. -SCRIPT="[$]0" -AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L` + # Locate the directory of this script. + SCRIPT="[$]0" + AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L` -# Where is the source? It is located two levels above the configure script. -CURDIR="$PWD" -cd "$AUTOCONF_DIR/../.." -SRC_ROOT="`$THEPWDCMD -L`" + # Where is the source? It is located two levels above the configure script. + CURDIR="$PWD" + cd "$AUTOCONF_DIR/../.." + SRC_ROOT="`$THEPWDCMD -L`" -if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - PATH_SEP=";" - BASIC_CHECK_PATHS_WINDOWS -else - PATH_SEP=":" -fi + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + PATH_SEP=";" + BASIC_CHECK_PATHS_WINDOWS + else + PATH_SEP=":" + fi -AC_SUBST(SRC_ROOT) -AC_SUBST(PATH_SEP) -cd "$CURDIR" + AC_SUBST(SRC_ROOT) + AC_SUBST(PATH_SEP) + cd "$CURDIR" -BASIC_FIXUP_PATH(SRC_ROOT) -BASIC_FIXUP_PATH(CURDIR) + BASIC_FIXUP_PATH(SRC_ROOT) + BASIC_FIXUP_PATH(CURDIR) -if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then + if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then # Add extra search paths on solaris for utilities like ar and as etc... PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin" -fi + fi -# You can force the sys-root if the sys-root encoded into the cross compiler tools -# is not correct. -AC_ARG_WITH(sys-root, [AS_HELP_STRING([--with-sys-root], - [pass this sys-root to the compilers and tools (for cross-compiling)])]) + # You can force the sys-root if the sys-root encoded into the cross compiler tools + # is not correct. + AC_ARG_WITH(sys-root, [AS_HELP_STRING([--with-sys-root], + [pass this sys-root to the compilers and tools (for cross-compiling)])]) -if test "x$with_sys_root" != x; then - SYS_ROOT=$with_sys_root -else - SYS_ROOT=/ -fi -AC_SUBST(SYS_ROOT) + if test "x$with_sys_root" != x; then + SYS_ROOT=$with_sys_root + else + SYS_ROOT=/ + fi + AC_SUBST(SYS_ROOT) -AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir], - [search this directory for compilers and tools (for cross-compiling)])], - [TOOLS_DIR=$with_tools_dir] -) + AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir], + [search this directory for compilers and tools (for cross-compiling)])], + [TOOLS_DIR=$with_tools_dir] + ) -AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit], - [use this directory as base for tools-dir and sys-root (for cross-compiling)])], - [ - if test "x$with_sys_root" != x; then - AC_MSG_ERROR([Cannot specify both --with-devkit and --with-sys-root at the same time]) - fi - BASIC_FIXUP_PATH([with_devkit]) - BASIC_APPEND_TO_PATH([TOOLS_DIR],$with_devkit/bin) - if test -d "$with_devkit/$host_alias/libc"; then - SYS_ROOT=$with_devkit/$host_alias/libc - elif test -d "$with_devkit/$host/sys-root"; then - SYS_ROOT=$with_devkit/$host/sys-root - fi - ]) + AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit], + [use this directory as base for tools-dir and sys-root (for cross-compiling)])], + [ + if test "x$with_sys_root" != x; then + AC_MSG_ERROR([Cannot specify both --with-devkit and --with-sys-root at the same time]) + fi + BASIC_FIXUP_PATH([with_devkit]) + BASIC_APPEND_TO_PATH([TOOLS_DIR],$with_devkit/bin) + if test -d "$with_devkit/$host_alias/libc"; then + SYS_ROOT=$with_devkit/$host_alias/libc + elif test -d "$with_devkit/$host/sys-root"; then + SYS_ROOT=$with_devkit/$host/sys-root + fi + ]) ]) AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR], [ -AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name], - [use this as the name of the configuration @<:@generated from important configuration options@:>@])], - [ CONF_NAME=${with_conf_name} ]) + AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name], + [use this as the name of the configuration @<:@generated from important configuration options@:>@])], + [ CONF_NAME=${with_conf_name} ]) -# Test from where we are running configure, in or outside of src root. -if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \ - || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \ - || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then + # Test from where we are running configure, in or outside of src root. + if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \ + || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \ + || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then # We are running configure from the src root. # Create a default ./build/target-variant-debuglevel output root. if test "x${CONF_NAME}" = x; then - CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}" + CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}" fi OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}" $MKDIR -p "$OUTPUT_ROOT" if test ! -d "$OUTPUT_ROOT"; then - AC_MSG_ERROR([Could not create build directory $OUTPUT_ROOT]) + AC_MSG_ERROR([Could not create build directory $OUTPUT_ROOT]) fi -else + else # We are running configure from outside of the src dir. # Then use the current directory as output dir! # If configuration is situated in normal build directory, just use the build # directory name as configuration name, otherwise use the complete path. if test "x${CONF_NAME}" = x; then - CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"` + CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"` fi OUTPUT_ROOT="$CURDIR" @@ -428,10 +440,10 @@ else # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for # other files files_present=`$LS $OUTPUT_ROOT` - # Configure has already touched config.log and confdefs.h in the current dir when this check + # Configure has already touched config.log and confdefs.h in the current dir when this check # is performed. filtered_files=`$ECHO "$files_present" | $SED -e 's/config.log//g' -e 's/confdefs.h//g' -e 's/ //g' \ - | $TR -d '\n'` + | $TR -d '\n'` if test "x$filtered_files" != x; then AC_MSG_NOTICE([Current directory is $CURDIR.]) AC_MSG_NOTICE([Since this is not the source root, configure will output the configuration here]) @@ -443,46 +455,46 @@ else AC_MSG_ERROR([Will not continue creating configuration in $CURDIR]) fi fi -fi -AC_MSG_CHECKING([what configuration name to use]) -AC_MSG_RESULT([$CONF_NAME]) + fi + AC_MSG_CHECKING([what configuration name to use]) + AC_MSG_RESULT([$CONF_NAME]) -BASIC_FIXUP_PATH(OUTPUT_ROOT) + BASIC_FIXUP_PATH(OUTPUT_ROOT) -AC_SUBST(SPEC, $OUTPUT_ROOT/spec.gmk) -AC_SUBST(CONF_NAME, $CONF_NAME) -AC_SUBST(OUTPUT_ROOT, $OUTPUT_ROOT) + AC_SUBST(SPEC, $OUTPUT_ROOT/spec.gmk) + AC_SUBST(CONF_NAME, $CONF_NAME) + AC_SUBST(OUTPUT_ROOT, $OUTPUT_ROOT) -# Most of the probed defines are put into config.h -AC_CONFIG_HEADERS([$OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in]) -# The spec.gmk file contains all variables for the make system. -AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in]) -# The hotspot-spec.gmk file contains legacy variables for the hotspot make system. -AC_CONFIG_FILES([$OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in]) -# The bootcycle-spec.gmk file contains support for boot cycle builds. -AC_CONFIG_FILES([$OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in]) -# The compare.sh is used to compare the build output to other builds. -AC_CONFIG_FILES([$OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in]) -# Spec.sh is currently used by compare-objects.sh -AC_CONFIG_FILES([$OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in]) -# The generated Makefile knows where the spec.gmk is and where the source is. -# You can run make from the OUTPUT_ROOT, or from the top-level Makefile -# which will look for generated configurations -AC_CONFIG_FILES([$OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in]) + # Most of the probed defines are put into config.h + AC_CONFIG_HEADERS([$OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in]) + # The spec.gmk file contains all variables for the make system. + AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in]) + # The hotspot-spec.gmk file contains legacy variables for the hotspot make system. + AC_CONFIG_FILES([$OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in]) + # The bootcycle-spec.gmk file contains support for boot cycle builds. + AC_CONFIG_FILES([$OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in]) + # The compare.sh is used to compare the build output to other builds. + AC_CONFIG_FILES([$OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in]) + # Spec.sh is currently used by compare-objects.sh + AC_CONFIG_FILES([$OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in]) + # The generated Makefile knows where the spec.gmk is and where the source is. + # You can run make from the OUTPUT_ROOT, or from the top-level Makefile + # which will look for generated configurations + AC_CONFIG_FILES([$OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in]) -# Save the arguments given to us -echo "$CONFIGURE_COMMAND_LINE" > $OUTPUT_ROOT/configure-arguments + # Save the arguments given to us + echo "$CONFIGURE_COMMAND_LINE" > $OUTPUT_ROOT/configure-arguments ]) AC_DEFUN_ONCE([BASIC_SETUP_LOGGING], [ -# Setup default logging of stdout and stderr to build.log in the output root. -BUILD_LOG='$(OUTPUT_ROOT)/build.log' -BUILD_LOG_PREVIOUS='$(OUTPUT_ROOT)/build.log.old' -BUILD_LOG_WRAPPER='$(BASH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)' -AC_SUBST(BUILD_LOG) -AC_SUBST(BUILD_LOG_PREVIOUS) -AC_SUBST(BUILD_LOG_WRAPPER) + # Setup default logging of stdout and stderr to build.log in the output root. + BUILD_LOG='$(OUTPUT_ROOT)/build.log' + BUILD_LOG_PREVIOUS='$(OUTPUT_ROOT)/build.log.old' + BUILD_LOG_WRAPPER='$(BASH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)' + AC_SUBST(BUILD_LOG) + AC_SUBST(BUILD_LOG_PREVIOUS) + AC_SUBST(BUILD_LOG_WRAPPER) ]) @@ -502,7 +514,7 @@ AC_DEFUN([BASIC_CHECK_MAKE_VERSION], if test "x$IS_GNU_MAKE" = x; then AC_MSG_NOTICE([Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring.]) else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[[12346789]]'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[[12]]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then AC_MSG_NOTICE([Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring.]) else @@ -581,85 +593,86 @@ AC_DEFUN([BASIC_CHECK_GNU_MAKE], AC_DEFUN([BASIC_CHECK_FIND_DELETE], [ - # Test if find supports -delete - AC_MSG_CHECKING([if find supports -delete]) - FIND_DELETE="-delete" + # Test if find supports -delete + AC_MSG_CHECKING([if find supports -delete]) + FIND_DELETE="-delete" - DELETEDIR=`$MKTEMP -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?) + DELETEDIR=`$MKTEMP -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?) - echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete + echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete - TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1` - if test -f $DELETEDIR/TestIfFindSupportsDelete; then - # No, it does not. - rm $DELETEDIR/TestIfFindSupportsDelete - FIND_DELETE="-exec rm \{\} \+" - AC_MSG_RESULT([no]) - else - AC_MSG_RESULT([yes]) - fi - rmdir $DELETEDIR - AC_SUBST(FIND_DELETE) + TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1` + if test -f $DELETEDIR/TestIfFindSupportsDelete; then + # No, it does not. + rm $DELETEDIR/TestIfFindSupportsDelete + FIND_DELETE="-exec rm \{\} \+" + AC_MSG_RESULT([no]) + else + AC_MSG_RESULT([yes]) + fi + rmdir $DELETEDIR + AC_SUBST(FIND_DELETE) ]) AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS], [ -BASIC_CHECK_GNU_MAKE + BASIC_CHECK_GNU_MAKE -BASIC_CHECK_FIND_DELETE + BASIC_CHECK_FIND_DELETE -# These tools might not be installed by default, -# need hint on how to install them. -BASIC_REQUIRE_PROG(UNZIP, unzip) -BASIC_REQUIRE_PROG(ZIP, zip) + # These tools might not be installed by default, + # need hint on how to install them. + BASIC_REQUIRE_PROG(UNZIP, unzip) + BASIC_REQUIRE_PROG(ZIP, zip) -# Non-required basic tools + # Non-required basic tools -AC_PATH_PROG(LDD, ldd) -if test "x$LDD" = "x"; then + AC_PATH_PROG(LDD, ldd) + if test "x$LDD" = "x"; then # List shared lib dependencies is used for # debug output and checking for forbidden dependencies. # We can build without it. LDD="true" -fi -AC_PATH_PROG(OTOOL, otool) -if test "x$OTOOL" = "x"; then - OTOOL="true" -fi -AC_PATH_PROGS(READELF, [readelf greadelf]) -AC_PATH_PROG(HG, hg) -AC_PATH_PROG(STAT, stat) -AC_PATH_PROG(TIME, time) -# Check if it's GNU time -IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'` -if test "x$IS_GNU_TIME" != x; then - IS_GNU_TIME=yes -else - IS_GNU_TIME=no -fi -AC_SUBST(IS_GNU_TIME) + fi + AC_PATH_PROG(OTOOL, otool) + if test "x$OTOOL" = "x"; then + OTOOL="true" + fi + AC_PATH_PROGS(READELF, [readelf greadelf]) + AC_PATH_PROG(HG, hg) + AC_PATH_PROG(STAT, stat) + AC_PATH_PROG(TIME, time) + # Check if it's GNU time + IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'` + if test "x$IS_GNU_TIME" != x; then + IS_GNU_TIME=yes + else + IS_GNU_TIME=no + fi + AC_SUBST(IS_GNU_TIME) -if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - BASIC_REQUIRE_PROG(COMM, comm) -fi + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + BASIC_REQUIRE_PROG(COMM, comm) + fi -if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - BASIC_REQUIRE_PROG(XATTR, xattr) - AC_PATH_PROG(CODESIGN, codesign) - if test "x$CODESIGN" != "x"; then - # Verify that the openjdk_codesign certificate is present - AC_MSG_CHECKING([if openjdk_codesign certificate is present]) - rm -f codesign-testfile - touch codesign-testfile - codesign -s openjdk_codesign codesign-testfile 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN= - rm -f codesign-testfile - if test "x$CODESIGN" = x; then - AC_MSG_RESULT([no]) - else - AC_MSG_RESULT([yes]) + if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + BASIC_REQUIRE_PROG(DSYMUTIL, dsymutil) + BASIC_REQUIRE_PROG(XATTR, xattr) + AC_PATH_PROG(CODESIGN, codesign) + if test "x$CODESIGN" != "x"; then + # Verify that the openjdk_codesign certificate is present + AC_MSG_CHECKING([if openjdk_codesign certificate is present]) + rm -f codesign-testfile + touch codesign-testfile + codesign -s openjdk_codesign codesign-testfile 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN= + rm -f codesign-testfile + if test "x$CODESIGN" = x; then + AC_MSG_RESULT([no]) + else + AC_MSG_RESULT([yes]) + fi fi fi -fi ]) # Check if build directory is on local disk. If not possible to determine, @@ -669,8 +682,8 @@ fi # Argument 3: what to do otherwise (remote disk or failure) AC_DEFUN([BASIC_CHECK_DIR_ON_LOCAL_DISK], [ - # df -l lists only local disks; if the given directory is not found then - # a non-zero exit code is given + # df -l lists only local disks; if the given directory is not found then + # a non-zero exit code is given if test "x$DF" = x; then if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # msys does not have df; use Windows "net use" instead. @@ -707,32 +720,30 @@ AC_DEFUN_ONCE([BASIC_CHECK_SRC_PERMS], AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES], [ + AC_MSG_CHECKING([if build directory is on local disk]) + BASIC_CHECK_DIR_ON_LOCAL_DISK($OUTPUT_ROOT, + [OUTPUT_DIR_IS_LOCAL="yes"], + [OUTPUT_DIR_IS_LOCAL="no"]) + AC_MSG_RESULT($OUTPUT_DIR_IS_LOCAL) -AC_MSG_CHECKING([if build directory is on local disk]) -BASIC_CHECK_DIR_ON_LOCAL_DISK($OUTPUT_ROOT, - [OUTPUT_DIR_IS_LOCAL="yes"], - [OUTPUT_DIR_IS_LOCAL="no"]) -AC_MSG_RESULT($OUTPUT_DIR_IS_LOCAL) + BASIC_CHECK_SRC_PERMS -BASIC_CHECK_SRC_PERMS + # Check if the user has any old-style ALT_ variables set. + FOUND_ALT_VARIABLES=`env | grep ^ALT_` -# Check if the user has any old-style ALT_ variables set. -FOUND_ALT_VARIABLES=`env | grep ^ALT_` - -# Before generating output files, test if they exist. If they do, this is a reconfigure. -# Since we can't properly handle the dependencies for this, warn the user about the situation -if test -e $OUTPUT_ROOT/spec.gmk; then - IS_RECONFIGURE=yes -else - IS_RECONFIGURE=no -fi - -if test -e $SRC_ROOT/build/.hide-configure-performance-hints; then - HIDE_PERFORMANCE_HINTS=yes -else - HIDE_PERFORMANCE_HINTS=no - # Hide it the next time around... - $TOUCH $SRC_ROOT/build/.hide-configure-performance-hints > /dev/null 2>&1 -fi + # Before generating output files, test if they exist. If they do, this is a reconfigure. + # Since we can't properly handle the dependencies for this, warn the user about the situation + if test -e $OUTPUT_ROOT/spec.gmk; then + IS_RECONFIGURE=yes + else + IS_RECONFIGURE=no + fi + if test -e $SRC_ROOT/build/.hide-configure-performance-hints; then + HIDE_PERFORMANCE_HINTS=yes + else + HIDE_PERFORMANCE_HINTS=no + # Hide it the next time around... + $TOUCH $SRC_ROOT/build/.hide-configure-performance-hints > /dev/null 2>&1 + fi ]) diff --git a/common/autoconf/basics_windows.m4 b/common/autoconf/basics_windows.m4 index 0a26d830239..0d43553fd95 100644 --- a/common/autoconf/basics_windows.m4 +++ b/common/autoconf/basics_windows.m4 @@ -145,7 +145,7 @@ AC_DEFUN([BASIC_FIXUP_PATH_MSYS], # Not in mixed or Windows style, start by that. new_path=`cmd //c echo $path` fi - + BASIC_MAKE_WINDOWS_SPACE_SAFE_MSYS([$new_path]) BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path) if test "x$path" != "x$new_path"; then @@ -175,8 +175,8 @@ AC_DEFUN([BASIC_FIXUP_EXECUTABLE_CYGWIN], # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -191,8 +191,8 @@ AC_DEFUN([BASIC_FIXUP_EXECUTABLE_CYGWIN], # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -218,9 +218,9 @@ AC_DEFUN([BASIC_FIXUP_EXECUTABLE_CYGWIN], # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else AC_MSG_NOTICE([The path of $1, which resolves as "$new_path", is invalid.]) AC_MSG_NOTICE([Neither "$new_path" nor "$new_path.exe/cmd" can be found]) @@ -254,7 +254,7 @@ AC_DEFUN([BASIC_FIXUP_EXECUTABLE_MSYS], # Now try to locate executable using which new_path=`$WHICH "$new_path" 2> /dev/null` - + if test "x$new_path" = x; then # Oops. Which didn't find the executable. # The splitting of arguments from the executable at a space might have been incorrect, @@ -264,9 +264,9 @@ AC_DEFUN([BASIC_FIXUP_EXECUTABLE_MSYS], arguments="EOL" new_path="$path" BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path) - + new_path=`$WHICH "$new_path" 2> /dev/null` - + if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.]) @@ -302,7 +302,7 @@ AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS], [ SRC_ROOT_LENGTH=`$THEPWDCMD -L|$WC -m` if test $SRC_ROOT_LENGTH -gt 100; then - AC_MSG_ERROR([Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported]) + AC_MSG_ERROR([Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported]) fi if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then @@ -311,14 +311,14 @@ AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS], AC_MSG_RESULT([$CYGWIN_VERSION]) WINDOWS_ENV_VENDOR='cygwin' WINDOWS_ENV_VERSION="$CYGWIN_VERSION" - + CYGWIN_VERSION_OK=`$ECHO $CYGWIN_VERSION | $GREP ^1.7.` if test "x$CYGWIN_VERSION_OK" = x; then AC_MSG_NOTICE([Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade.]) AC_MSG_ERROR([Cannot continue]) fi if test "x$CYGPATH" = x; then - AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path]) + AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path]) fi AC_MSG_CHECKING([cygwin root directory as unix-style path]) # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away @@ -329,13 +329,13 @@ AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS], WINDOWS_ENV_ROOT_PATH="$CYGWIN_ROOT_PATH" test_cygdrive_prefix=`$ECHO $CYGWIN_ROOT_PATH | $GREP ^/cygdrive/` if test "x$test_cygdrive_prefix" = x; then - AC_MSG_ERROR([Your cygdrive prefix is not /cygdrive. This is currently not supported. Change with mount -c.]) + AC_MSG_ERROR([Your cygdrive prefix is not /cygdrive. This is currently not supported. Change with mount -c.]) fi elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then AC_MSG_CHECKING([msys release]) MSYS_VERSION=`$UNAME -r` AC_MSG_RESULT([$MSYS_VERSION]) - + WINDOWS_ENV_VENDOR='msys' WINDOWS_ENV_VERSION="$MSYS_VERSION" @@ -367,12 +367,12 @@ AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS], AC_DEFUN_ONCE([BASIC_COMPILE_FIXPATH], [ -# When using cygwin or msys, we need a wrapper binary that renames -# /cygdrive/c/ arguments into c:/ arguments and peeks into -# @files and rewrites these too! This wrapper binary is -# called fixpath. -FIXPATH= -if test "x$OPENJDK_BUILD_OS" = xwindows; then + # When using cygwin or msys, we need a wrapper binary that renames + # /cygdrive/c/ arguments into c:/ arguments and peeks into + # @files and rewrites these too! This wrapper binary is + # called fixpath. + FIXPATH= + if test "x$OPENJDK_BUILD_OS" = xwindows; then AC_MSG_CHECKING([if fixpath can be created]) FIXPATH_SRC="$SRC_ROOT/common/src/fixpath.c" FIXPATH_BIN="$OUTPUT_ROOT/fixpath.exe" @@ -389,7 +389,7 @@ if test "x$OPENJDK_BUILD_OS" = xwindows; then # @ was chosen as separator to minimize risk of other tools messing around with it all_unique_prefixes=`echo "${all_fixpath_prefixes@<:@@@:>@}" | tr ' ' '\n' | grep '^/./' | sort | uniq` fixpath_argument_list=`echo $all_unique_prefixes | tr ' ' '@'` - + FIXPATH="$OUTPUT_ROOT/fixpath -m$fixpath_argument_list" fi rm -f $OUTPUT_ROOT/fixpath* @@ -397,24 +397,24 @@ if test "x$OPENJDK_BUILD_OS" = xwindows; then $CC $FIXPATH_SRC -Fe$FIXPATH_BIN > $OUTPUT_ROOT/fixpath1.log 2>&1 cd $CURDIR - if test ! -x $OUTPUT_ROOT/fixpath.exe; then - AC_MSG_RESULT([no]) - cat $OUTPUT_ROOT/fixpath1.log - AC_MSG_ERROR([Could not create $OUTPUT_ROOT/fixpath.exe]) + if test ! -x $OUTPUT_ROOT/fixpath.exe; then + AC_MSG_RESULT([no]) + cat $OUTPUT_ROOT/fixpath1.log + AC_MSG_ERROR([Could not create $OUTPUT_ROOT/fixpath.exe]) fi AC_MSG_RESULT([yes]) AC_MSG_CHECKING([if fixpath.exe works]) cd $OUTPUT_ROOT - $FIXPATH $CC $SRC_ROOT/common/src/fixpath.c -Fe$OUTPUT_ROOT/fixpath2.exe > $OUTPUT_ROOT/fixpath2.log 2>&1 + $FIXPATH $CC $SRC_ROOT/common/src/fixpath.c -Fe$OUTPUT_ROOT/fixpath2.exe > $OUTPUT_ROOT/fixpath2.log 2>&1 cd $CURDIR - if test ! -x $OUTPUT_ROOT/fixpath2.exe; then - AC_MSG_RESULT([no]) - cat $OUTPUT_ROOT/fixpath2.log - AC_MSG_ERROR([fixpath did not work!]) + if test ! -x $OUTPUT_ROOT/fixpath2.exe; then + AC_MSG_RESULT([no]) + cat $OUTPUT_ROOT/fixpath2.log + AC_MSG_ERROR([fixpath did not work!]) fi AC_MSG_RESULT([yes]) rm -f $OUTPUT_ROOT/fixpath?.??? $OUTPUT_ROOT/fixpath.obj -fi + fi -AC_SUBST(FIXPATH) + AC_SUBST(FIXPATH) ]) diff --git a/common/autoconf/boot-jdk.m4 b/common/autoconf/boot-jdk.m4 index 4a4ea36b50d..27652953114 100644 --- a/common/autoconf/boot-jdk.m4 +++ b/common/autoconf/boot-jdk.m4 @@ -44,7 +44,7 @@ AC_DEFUN([BOOTJDK_DO_CHECK], AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring]) AC_MSG_NOTICE([(This might be an JRE instead of an JDK)]) BOOT_JDK_FOUND=no - else + else # Do we have an rt.jar? (On MacOSX it is called classes.jar) if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring]) @@ -79,70 +79,70 @@ AC_DEFUN([BOOTJDK_DO_CHECK], # Test: Is bootjdk explicitely set by command line arguments? AC_DEFUN([BOOTJDK_CHECK_ARGUMENTS], [ -if test "x$with_boot_jdk" != x; then + if test "x$with_boot_jdk" != x; then BOOT_JDK=$with_boot_jdk BOOT_JDK_FOUND=maybe AC_MSG_NOTICE([Found potential Boot JDK using configure arguments]) -fi + fi ]) # Test: Is bootjdk available from builddeps? AC_DEFUN([BOOTJDK_CHECK_BUILDDEPS], [ - BDEPS_CHECK_MODULE(BOOT_JDK, bootjdk, xxx, [BOOT_JDK_FOUND=maybe], [BOOT_JDK_FOUND=no]) + BDEPS_CHECK_MODULE(BOOT_JDK, bootjdk, xxx, [BOOT_JDK_FOUND=maybe], [BOOT_JDK_FOUND=no]) ]) # Test: Is $JAVA_HOME set? AC_DEFUN([BOOTJDK_CHECK_JAVA_HOME], [ - if test "x$JAVA_HOME" != x; then - JAVA_HOME_PROCESSED="$JAVA_HOME" - BASIC_FIXUP_PATH(JAVA_HOME_PROCESSED) - if test ! -d "$JAVA_HOME_PROCESSED"; then - AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!]) - else - # Aha, the user has set a JAVA_HOME - # let us use that as the Boot JDK. - BOOT_JDK="$JAVA_HOME_PROCESSED" - BOOT_JDK_FOUND=maybe - AC_MSG_NOTICE([Found potential Boot JDK using JAVA_HOME]) - fi + if test "x$JAVA_HOME" != x; then + JAVA_HOME_PROCESSED="$JAVA_HOME" + BASIC_FIXUP_PATH(JAVA_HOME_PROCESSED) + if test ! -d "$JAVA_HOME_PROCESSED"; then + AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!]) + else + # Aha, the user has set a JAVA_HOME + # let us use that as the Boot JDK. + BOOT_JDK="$JAVA_HOME_PROCESSED" + BOOT_JDK_FOUND=maybe + AC_MSG_NOTICE([Found potential Boot JDK using JAVA_HOME]) fi + fi ]) # Test: Is there a java or javac in the PATH, which is a symlink to the JDK? AC_DEFUN([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK], [ - AC_PATH_PROG(JAVAC_CHECK, javac) - AC_PATH_PROG(JAVA_CHECK, java) - BINARY="$JAVAC_CHECK" - if test "x$JAVAC_CHECK" = x; then - BINARY="$JAVA_CHECK" - fi - if test "x$BINARY" != x; then - # So there is a java(c) binary, it might be part of a JDK. - # Lets find the JDK/JRE directory by following symbolic links. - # Linux/GNU systems often have links from /usr/bin/java to - # /etc/alternatives/java to the real JDK binary. - BASIC_REMOVE_SYMBOLIC_LINKS(BINARY) - BOOT_JDK=`dirname "$BINARY"` - BOOT_JDK=`cd "$BOOT_JDK/.."; pwd` - if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then - # Looks like we found ourselves an JDK - BOOT_JDK_FOUND=maybe - AC_MSG_NOTICE([Found potential Boot JDK using java(c) in PATH]) - fi + AC_PATH_PROG(JAVAC_CHECK, javac) + AC_PATH_PROG(JAVA_CHECK, java) + BINARY="$JAVAC_CHECK" + if test "x$JAVAC_CHECK" = x; then + BINARY="$JAVA_CHECK" + fi + if test "x$BINARY" != x; then + # So there is a java(c) binary, it might be part of a JDK. + # Lets find the JDK/JRE directory by following symbolic links. + # Linux/GNU systems often have links from /usr/bin/java to + # /etc/alternatives/java to the real JDK binary. + BASIC_REMOVE_SYMBOLIC_LINKS(BINARY) + BOOT_JDK=`dirname "$BINARY"` + BOOT_JDK=`cd "$BOOT_JDK/.."; pwd` + if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then + # Looks like we found ourselves an JDK + BOOT_JDK_FOUND=maybe + AC_MSG_NOTICE([Found potential Boot JDK using java(c) in PATH]) fi + fi ]) # Test: Is there a /usr/libexec/java_home? (Typically on MacOSX) AC_DEFUN([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME], [ - if test -x /usr/libexec/java_home; then - BOOT_JDK=`/usr/libexec/java_home` - BOOT_JDK_FOUND=maybe - AC_MSG_NOTICE([Found potential Boot JDK using /usr/libexec/java_home]) - fi + if test -x /usr/libexec/java_home; then + BOOT_JDK=`/usr/libexec/java_home` + BOOT_JDK_FOUND=maybe + AC_MSG_NOTICE([Found potential Boot JDK using /usr/libexec/java_home]) + fi ]) # Look for a jdk in the given path. If there are multiple, try to select the newest. @@ -204,123 +204,123 @@ AC_DEFUN([BOOTJDK_CHECK_TOOL_IN_BOOTJDK], AC_MSG_CHECKING([for $2 in Boot JDK]) $1=$BOOT_JDK/bin/$2 if test ! -x [$]$1; then - AC_MSG_RESULT(not found) - AC_MSG_NOTICE([Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk]) - AC_MSG_ERROR([Could not find $2 in the Boot JDK]) + AC_MSG_RESULT(not found) + AC_MSG_NOTICE([Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk]) + AC_MSG_ERROR([Could not find $2 in the Boot JDK]) fi AC_MSG_RESULT(ok) ]) ############################################################################### # -# We need a Boot JDK to bootstrap the build. +# We need a Boot JDK to bootstrap the build. # AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK], [ -BOOT_JDK_FOUND=no -AC_ARG_WITH(boot-jdk, [AS_HELP_STRING([--with-boot-jdk], - [path to Boot JDK (used to bootstrap build) @<:@probed@:>@])]) + BOOT_JDK_FOUND=no + AC_ARG_WITH(boot-jdk, [AS_HELP_STRING([--with-boot-jdk], + [path to Boot JDK (used to bootstrap build) @<:@probed@:>@])]) -# We look for the Boot JDK through various means, going from more certain to -# more of a guess-work. After each test, BOOT_JDK_FOUND is set to "yes" if -# we detected something (if so, the path to the jdk is in BOOT_JDK). But we -# must check if this is indeed valid; otherwise we'll continue looking. + # We look for the Boot JDK through various means, going from more certain to + # more of a guess-work. After each test, BOOT_JDK_FOUND is set to "yes" if + # we detected something (if so, the path to the jdk is in BOOT_JDK). But we + # must check if this is indeed valid; otherwise we'll continue looking. -# Test: Is bootjdk explicitely set by command line arguments? -BOOTJDK_DO_CHECK([BOOTJDK_CHECK_ARGUMENTS]) -if test "x$with_boot_jdk" != x && test "x$BOOT_JDK_FOUND" = xno; then - # Having specified an argument which is incorrect will produce an instant failure; - # we should not go on looking - AC_MSG_ERROR([The path given by --with-boot-jdk does not contain a valid Boot JDK]) -fi + # Test: Is bootjdk explicitely set by command line arguments? + BOOTJDK_DO_CHECK([BOOTJDK_CHECK_ARGUMENTS]) + if test "x$with_boot_jdk" != x && test "x$BOOT_JDK_FOUND" = xno; then + # Having specified an argument which is incorrect will produce an instant failure; + # we should not go on looking + AC_MSG_ERROR([The path given by --with-boot-jdk does not contain a valid Boot JDK]) + fi -# Test: Is bootjdk available from builddeps? -BOOTJDK_DO_CHECK([BOOTJDK_CHECK_BUILDDEPS]) + # Test: Is bootjdk available from builddeps? + BOOTJDK_DO_CHECK([BOOTJDK_CHECK_BUILDDEPS]) -# Test: Is $JAVA_HOME set? -BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_HOME]) + # Test: Is $JAVA_HOME set? + BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_HOME]) -# Test: Is there a /usr/libexec/java_home? (Typically on MacOSX) -BOOTJDK_DO_CHECK([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME]) + # Test: Is there a /usr/libexec/java_home? (Typically on MacOSX) + BOOTJDK_DO_CHECK([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME]) -# Test: Is there a java or javac in the PATH, which is a symlink to the JDK? -BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK]) + # Test: Is there a java or javac in the PATH, which is a symlink to the JDK? + BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK]) -# Test: Is there a JDK installed in default, well-known locations? -BOOTJDK_DO_CHECK([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS]) + # Test: Is there a JDK installed in default, well-known locations? + BOOTJDK_DO_CHECK([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS]) -# If we haven't found anything yet, we've truly lost. Give up. -if test "x$BOOT_JDK_FOUND" = xno; then - HELP_MSG_MISSING_DEPENDENCY([openjdk]) - AC_MSG_NOTICE([Could not find a valid Boot JDK. $HELP_MSG]) - AC_MSG_NOTICE([This might be fixed by explicitely setting --with-boot-jdk]) - AC_MSG_ERROR([Cannot continue]) -fi + # If we haven't found anything yet, we've truly lost. Give up. + if test "x$BOOT_JDK_FOUND" = xno; then + HELP_MSG_MISSING_DEPENDENCY([openjdk]) + AC_MSG_NOTICE([Could not find a valid Boot JDK. $HELP_MSG]) + AC_MSG_NOTICE([This might be fixed by explicitely setting --with-boot-jdk]) + AC_MSG_ERROR([Cannot continue]) + fi -# Setup proper paths for what we found -BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar" -if test ! -f "$BOOT_RTJAR"; then + # Setup proper paths for what we found + BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar" + if test ! -f "$BOOT_RTJAR"; then # On MacOSX it is called classes.jar BOOT_RTJAR="$BOOT_JDK/../Classes/classes.jar" if test -f "$BOOT_RTJAR"; then - # Remove the .. + # Remove the .. BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}" fi -fi -BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar" -BOOT_JDK="$BOOT_JDK" -AC_SUBST(BOOT_RTJAR) -AC_SUBST(BOOT_TOOLSJAR) -AC_SUBST(BOOT_JDK) + fi + BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar" + BOOT_JDK="$BOOT_JDK" + AC_SUBST(BOOT_RTJAR) + AC_SUBST(BOOT_TOOLSJAR) + AC_SUBST(BOOT_JDK) -# Setup tools from the Boot JDK. -BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVA,java) -BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC,javac) -BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAH,javah) -BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAP,javap) -BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR,jar) -BOOTJDK_CHECK_TOOL_IN_BOOTJDK(RMIC,rmic) -BOOTJDK_CHECK_TOOL_IN_BOOTJDK(NATIVE2ASCII,native2ascii) + # Setup tools from the Boot JDK. + BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVA,java) + BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC,javac) + BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAH,javah) + BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAP,javap) + BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR,jar) + BOOTJDK_CHECK_TOOL_IN_BOOTJDK(RMIC,rmic) + BOOTJDK_CHECK_TOOL_IN_BOOTJDK(NATIVE2ASCII,native2ascii) -# Finally, set some other options... + # Finally, set some other options... -# When compiling code to be executed by the Boot JDK, force jdk7 compatibility. -BOOT_JDK_SOURCETARGET="-source 7 -target 7" -AC_SUBST(BOOT_JDK_SOURCETARGET) -AC_SUBST(JAVAC_FLAGS) + # When compiling code to be executed by the Boot JDK, force jdk7 compatibility. + BOOT_JDK_SOURCETARGET="-source 7 -target 7" + AC_SUBST(BOOT_JDK_SOURCETARGET) + AC_SUBST(JAVAC_FLAGS) ]) AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], [ -############################################################################## -# -# Specify options for anything that is run with the Boot JDK. -# -AC_ARG_WITH(boot-jdk-jvmargs, [AS_HELP_STRING([--with-boot-jdk-jvmargs], - [specify JVM arguments to be passed to all invocations of the Boot JDK, overriding the default values, - e.g --with-boot-jdk-jvmargs="-Xmx8G -enableassertions"])]) + ############################################################################## + # + # Specify options for anything that is run with the Boot JDK. + # + AC_ARG_WITH(boot-jdk-jvmargs, [AS_HELP_STRING([--with-boot-jdk-jvmargs], + [specify JVM arguments to be passed to all invocations of the Boot JDK, overriding the default values, + e.g --with-boot-jdk-jvmargs="-Xmx8G -enableassertions"])]) -if test "x$with_boot_jdk_jvmargs" = x; then + if test "x$with_boot_jdk_jvmargs" = x; then # Not all JVM:s accept the same arguments on the command line. # OpenJDK specific increase in thread stack for JDK build, # well more specifically, when running javac. if test "x$BUILD_NUM_BITS" = x32; then - STACK_SIZE=768 + STACK_SIZE=768 else - # Running Javac on a JVM on a 64-bit machine, the stack takes more space - # since 64-bit pointers are pushed on the stach. Apparently, we need - # to increase the stack space when javacing the JDK.... - STACK_SIZE=1536 + # Running Javac on a JVM on a 64-bit machine, the stack takes more space + # since 64-bit pointers are pushed on the stach. Apparently, we need + # to increase the stack space when javacing the JDK.... + STACK_SIZE=1536 fi # Minimum amount of heap memory. ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs,[$JAVA]) if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - # Why does macosx need more heap? Its the huge JDK batch. - ADD_JVM_ARG_IF_OK([-Xmx1600M],boot_jdk_jvmargs,[$JAVA]) + # Why does macosx need more heap? Its the huge JDK batch. + ADD_JVM_ARG_IF_OK([-Xmx1600M],boot_jdk_jvmargs,[$JAVA]) else - ADD_JVM_ARG_IF_OK([-Xmx1100M],boot_jdk_jvmargs,[$JAVA]) + ADD_JVM_ARG_IF_OK([-Xmx1100M],boot_jdk_jvmargs,[$JAVA]) fi # When is adding -client something that speeds up the JVM? # ADD_JVM_ARG_IF_OK([-client],boot_jdk_jvmargs,[$JAVA]) @@ -329,7 +329,7 @@ if test "x$with_boot_jdk_jvmargs" = x; then ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs,[$JAVA]) # Disable special log output when a debug build is used as Boot JDK... ADD_JVM_ARG_IF_OK([-XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput],boot_jdk_jvmargs,[$JAVA]) -fi + fi -AC_SUBST(BOOT_JDK_JVMARGS, $boot_jdk_jvmargs) + AC_SUBST(BOOT_JDK_JVMARGS, $boot_jdk_jvmargs) ]) diff --git a/common/autoconf/bootcycle-spec.gmk.in b/common/autoconf/bootcycle-spec.gmk.in index 9bc4007dbbb..cecc6472d0a 100644 --- a/common/autoconf/bootcycle-spec.gmk.in +++ b/common/autoconf/bootcycle-spec.gmk.in @@ -36,7 +36,7 @@ else JAVA_EXEC_POS=1 endif ifneq ($(word $(JAVA_EXEC_POS),$(SJAVAC_SERVER_JAVA)),$(word $(JAVA_EXEC_POS),$(JAVA))) - $(error Bootcycle builds are not possible if --with-sjavac-server-java is specified) + $(error Bootcycle builds are not possible if --with-sjavac-server-java is specified) endif diff --git a/common/autoconf/build-aux/config.guess b/common/autoconf/build-aux/config.guess index 572ed2be3e8..bd41aec580d 100644 --- a/common/autoconf/build-aux/config.guess +++ b/common/autoconf/build-aux/config.guess @@ -58,6 +58,6 @@ if test $? = 0; then OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'` ;; esac -fi +fi echo $OUT diff --git a/common/autoconf/build-performance.m4 b/common/autoconf/build-performance.m4 index 9c4868ad822..ff7b250508f 100644 --- a/common/autoconf/build-performance.m4 +++ b/common/autoconf/build-performance.m4 @@ -25,78 +25,77 @@ AC_DEFUN([BPERF_CHECK_CORES], [ - AC_MSG_CHECKING([for number of cores]) - NUM_CORES=1 - FOUND_CORES=no - - if test -f /proc/cpuinfo; then - # Looks like a Linux (or cygwin) system - NUM_CORES=`cat /proc/cpuinfo | grep -c processor` - FOUND_CORES=yes - elif test -x /usr/sbin/psrinfo; then - # Looks like a Solaris system - NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line` - FOUND_CORES=yes - elif test -x /usr/sbin/system_profiler; then - # Looks like a MacOSX system - NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print [$]5}'` - FOUND_CORES=yes - elif test -n "$NUMBER_OF_PROCESSORS"; then - # On windows, look in the env - NUM_CORES=$NUMBER_OF_PROCESSORS - FOUND_CORES=yes - fi + AC_MSG_CHECKING([for number of cores]) + NUM_CORES=1 + FOUND_CORES=no - if test "x$FOUND_CORES" = xyes; then - AC_MSG_RESULT([$NUM_CORES]) - else - AC_MSG_RESULT([could not detect number of cores, defaulting to 1]) - AC_MSG_WARN([This will disable all parallelism from build!]) - fi + if test -f /proc/cpuinfo; then + # Looks like a Linux (or cygwin) system + NUM_CORES=`cat /proc/cpuinfo | grep -c processor` + FOUND_CORES=yes + elif test -x /usr/sbin/psrinfo; then + # Looks like a Solaris system + NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line` + FOUND_CORES=yes + elif test -x /usr/sbin/system_profiler; then + # Looks like a MacOSX system + NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print [$]5}'` + FOUND_CORES=yes + elif test -n "$NUMBER_OF_PROCESSORS"; then + # On windows, look in the env + NUM_CORES=$NUMBER_OF_PROCESSORS + FOUND_CORES=yes + fi + if test "x$FOUND_CORES" = xyes; then + AC_MSG_RESULT([$NUM_CORES]) + else + AC_MSG_RESULT([could not detect number of cores, defaulting to 1]) + AC_MSG_WARN([This will disable all parallelism from build!]) + fi ]) AC_DEFUN([BPERF_CHECK_MEMORY_SIZE], [ - AC_MSG_CHECKING([for memory size]) - # Default to 1024 MB - MEMORY_SIZE=1024 - FOUND_MEM=no - - if test -f /proc/meminfo; then - # Looks like a Linux (or cygwin) system - MEMORY_SIZE=`cat /proc/meminfo | grep MemTotal | awk '{print [$]2}'` - MEMORY_SIZE=`expr $MEMORY_SIZE / 1024` - FOUND_MEM=yes - elif test -x /usr/sbin/prtconf; then - # Looks like a Solaris system - MEMORY_SIZE=`/usr/sbin/prtconf | grep "Memory size" | awk '{ print [$]3 }'` - FOUND_MEM=yes - elif test -x /usr/sbin/system_profiler; then - # Looks like a MacOSX system - MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print [$]2}'` - MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024` - FOUND_MEM=yes - elif test "x$OPENJDK_BUILD_OS" = xwindows; then - # Windows, but without cygwin - MEMORY_SIZE=`wmic computersystem get totalphysicalmemory -value | grep = | cut -d "=" -f 2-` - MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024` - FOUND_MEM=yes - fi + AC_MSG_CHECKING([for memory size]) + # Default to 1024 MB + MEMORY_SIZE=1024 + FOUND_MEM=no - if test "x$FOUND_MEM" = xyes; then - AC_MSG_RESULT([$MEMORY_SIZE MB]) - else - AC_MSG_RESULT([could not detect memory size, defaulting to 1024 MB]) - AC_MSG_WARN([This might seriously impact build performance!]) - fi + if test -f /proc/meminfo; then + # Looks like a Linux (or cygwin) system + MEMORY_SIZE=`cat /proc/meminfo | grep MemTotal | awk '{print [$]2}'` + MEMORY_SIZE=`expr $MEMORY_SIZE / 1024` + FOUND_MEM=yes + elif test -x /usr/sbin/prtconf; then + # Looks like a Solaris system + MEMORY_SIZE=`/usr/sbin/prtconf | grep "Memory size" | awk '{ print [$]3 }'` + FOUND_MEM=yes + elif test -x /usr/sbin/system_profiler; then + # Looks like a MacOSX system + MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print [$]2}'` + MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024` + FOUND_MEM=yes + elif test "x$OPENJDK_BUILD_OS" = xwindows; then + # Windows, but without cygwin + MEMORY_SIZE=`wmic computersystem get totalphysicalmemory -value | grep = | cut -d "=" -f 2-` + MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024` + FOUND_MEM=yes + fi + + if test "x$FOUND_MEM" = xyes; then + AC_MSG_RESULT([$MEMORY_SIZE MB]) + else + AC_MSG_RESULT([could not detect memory size, defaulting to 1024 MB]) + AC_MSG_WARN([This might seriously impact build performance!]) + fi ]) AC_DEFUN_ONCE([BPERF_SETUP_BUILD_CORES], [ # How many cores do we have on this build system? AC_ARG_WITH(num-cores, [AS_HELP_STRING([--with-num-cores], - [number of cores in the build system, e.g. --with-num-cores=8 @<:@probed@:>@])]) + [number of cores in the build system, e.g. --with-num-cores=8 @<:@probed@:>@])]) if test "x$with_num_cores" = x; then # The number of cores were not specified, try to probe them. BPERF_CHECK_CORES @@ -110,7 +109,7 @@ AC_DEFUN_ONCE([BPERF_SETUP_BUILD_MEMORY], [ # How much memory do we have on this build system? AC_ARG_WITH(memory-size, [AS_HELP_STRING([--with-memory-size], - [memory (in MB) available in the build system, e.g. --with-memory-size=1024 @<:@probed@:>@])]) + [memory (in MB) available in the build system, e.g. --with-memory-size=1024 @<:@probed@:>@])]) if test "x$with_memory_size" = x; then # The memory size was not specified, try to probe it. BPERF_CHECK_MEMORY_SIZE @@ -122,10 +121,10 @@ AC_DEFUN_ONCE([BPERF_SETUP_BUILD_MEMORY], AC_DEFUN_ONCE([BPERF_SETUP_BUILD_JOBS], [ - # Provide a decent default number of parallel jobs for make depending on + # Provide a decent default number of parallel jobs for make depending on # number of cores, amount of memory and machine architecture. AC_ARG_WITH(jobs, [AS_HELP_STRING([--with-jobs], - [number of parallel jobs to let make run @<:@calculated based on cores and memory@:>@])]) + [number of parallel jobs to let make run @<:@calculated based on cores and memory@:>@])]) if test "x$with_jobs" = x; then # Number of jobs was not specified, calculate. AC_MSG_CHECKING([for appropriate number of jobs to run in parallel]) @@ -157,179 +156,178 @@ AC_DEFUN_ONCE([BPERF_SETUP_BUILD_JOBS], AC_DEFUN([BPERF_SETUP_CCACHE], [ - AC_ARG_ENABLE([ccache], - [AS_HELP_STRING([--disable-ccache], - [disable using ccache to speed up recompilations @<:@enabled@:>@])], - [ENABLE_CCACHE=${enable_ccache}], [ENABLE_CCACHE=yes]) - if test "x$ENABLE_CCACHE" = xyes; then - OLD_PATH="$PATH" - if test "x$TOOLS_DIR" != x; then - PATH=$TOOLS_DIR:$PATH - fi - AC_PATH_PROG(CCACHE, ccache) - PATH="$OLD_PATH" - else - AC_MSG_CHECKING([for ccache]) - AC_MSG_RESULT([explicitly disabled]) - CCACHE= - fi - AC_SUBST(CCACHE) - - AC_ARG_WITH([ccache-dir], - [AS_HELP_STRING([--with-ccache-dir], - [where to store ccache files @<:@~/.ccache@:>@])]) - - if test "x$with_ccache_dir" != x; then - # When using a non home ccache directory, assume the use is to share ccache files - # with other users. Thus change the umask. - SET_CCACHE_DIR="CCACHE_DIR=$with_ccache_dir CCACHE_UMASK=002" + AC_ARG_ENABLE([ccache], + [AS_HELP_STRING([--disable-ccache], + [disable using ccache to speed up recompilations @<:@enabled@:>@])], + [ENABLE_CCACHE=${enable_ccache}], [ENABLE_CCACHE=yes]) + if test "x$ENABLE_CCACHE" = xyes; then + OLD_PATH="$PATH" + if test "x$TOOLS_DIR" != x; then + PATH=$TOOLS_DIR:$PATH fi - CCACHE_FOUND="" - if test "x$CCACHE" != x; then - BPERF_SETUP_CCACHE_USAGE - fi + AC_PATH_PROG(CCACHE, ccache) + PATH="$OLD_PATH" + else + AC_MSG_CHECKING([for ccache]) + AC_MSG_RESULT([explicitly disabled]) + CCACHE= + fi + AC_SUBST(CCACHE) + + AC_ARG_WITH([ccache-dir], + [AS_HELP_STRING([--with-ccache-dir], + [where to store ccache files @<:@~/.ccache@:>@])]) + + if test "x$with_ccache_dir" != x; then + # When using a non home ccache directory, assume the use is to share ccache files + # with other users. Thus change the umask. + SET_CCACHE_DIR="CCACHE_DIR=$with_ccache_dir CCACHE_UMASK=002" + fi + CCACHE_FOUND="" + if test "x$CCACHE" != x; then + BPERF_SETUP_CCACHE_USAGE + fi ]) AC_DEFUN([BPERF_SETUP_CCACHE_USAGE], [ - if test "x$CCACHE" != x; then - CCACHE_FOUND="true" - # Only use ccache if it is 3.1.4 or later, which supports - # precompiled headers. - AC_MSG_CHECKING([if ccache supports precompiled headers]) - HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.@<:@456789@:>@) 2> /dev/null` - if test "x$HAS_GOOD_CCACHE" = x; then - AC_MSG_RESULT([no, disabling ccache]) - CCACHE= - else - AC_MSG_RESULT([yes]) - AC_MSG_CHECKING([if C-compiler supports ccache precompiled headers]) - PUSHED_FLAGS="$CXXFLAGS" - CXXFLAGS="-fpch-preprocess $CXXFLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [CC_KNOWS_CCACHE_TRICK=yes], [CC_KNOWS_CCACHE_TRICK=no]) - CXXFLAGS="$PUSHED_FLAGS" - if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no, disabling ccaching of precompiled headers]) - CCACHE= - fi - fi + if test "x$CCACHE" != x; then + CCACHE_FOUND="true" + # Only use ccache if it is 3.1.4 or later, which supports + # precompiled headers. + AC_MSG_CHECKING([if ccache supports precompiled headers]) + HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.@<:@456789@:>@) 2> /dev/null` + if test "x$HAS_GOOD_CCACHE" = x; then + AC_MSG_RESULT([no, disabling ccache]) + CCACHE= + else + AC_MSG_RESULT([yes]) + AC_MSG_CHECKING([if C-compiler supports ccache precompiled headers]) + PUSHED_FLAGS="$CXXFLAGS" + CXXFLAGS="-fpch-preprocess $CXXFLAGS" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [CC_KNOWS_CCACHE_TRICK=yes], [CC_KNOWS_CCACHE_TRICK=no]) + CXXFLAGS="$PUSHED_FLAGS" + if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no, disabling ccaching of precompiled headers]) + CCACHE= + fi fi + fi - if test "x$CCACHE" != x; then - CCACHE_SLOPPINESS=time_macros - CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS $CCACHE" - CCACHE_FLAGS=-fpch-preprocess + if test "x$CCACHE" != x; then + CCACHE_SLOPPINESS=time_macros + CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS $CCACHE" + CCACHE_FLAGS=-fpch-preprocess - if test "x$SET_CCACHE_DIR" != x; then - mkdir -p $CCACHE_DIR > /dev/null 2>&1 - chmod a+rwxs $CCACHE_DIR > /dev/null 2>&1 - fi + if test "x$SET_CCACHE_DIR" != x; then + mkdir -p $CCACHE_DIR > /dev/null 2>&1 + chmod a+rwxs $CCACHE_DIR > /dev/null 2>&1 fi + fi ]) AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS], [ - -############################################################################### -# -# Can the C/C++ compiler use precompiled headers? -# -AC_ARG_ENABLE([precompiled-headers], [AS_HELP_STRING([--disable-precompiled-headers], - [disable using precompiled headers when compiling C++ @<:@enabled@:>@])], - [ENABLE_PRECOMPH=${enable_precompiled_headers}], [ENABLE_PRECOMPH=yes]) -USE_PRECOMPILED_HEADER=1 -if test "x$ENABLE_PRECOMPH" = xno; then + ############################################################################### + # + # Can the C/C++ compiler use precompiled headers? + # + AC_ARG_ENABLE([precompiled-headers], [AS_HELP_STRING([--disable-precompiled-headers], + [disable using precompiled headers when compiling C++ @<:@enabled@:>@])], + [ENABLE_PRECOMPH=${enable_precompiled_headers}], [ENABLE_PRECOMPH=yes]) + + USE_PRECOMPILED_HEADER=1 + if test "x$ENABLE_PRECOMPH" = xno; then USE_PRECOMPILED_HEADER=0 -fi + fi -if test "x$ENABLE_PRECOMPH" = xyes; then + if test "x$ENABLE_PRECOMPH" = xyes; then # Check that the compiler actually supports precomp headers. if test "x$GCC" = xyes; then - AC_MSG_CHECKING([that precompiled headers work]) - echo "int alfa();" > conftest.h - $CXX -x c++-header conftest.h -o conftest.hpp.gch 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD - if test ! -f conftest.hpp.gch; then - USE_PRECOMPILED_HEADER=0 - AC_MSG_RESULT([no]) - else - AC_MSG_RESULT([yes]) - fi - rm -f conftest.h conftest.hpp.gch + AC_MSG_CHECKING([that precompiled headers work]) + echo "int alfa();" > conftest.h + $CXX -x c++-header conftest.h -o conftest.hpp.gch 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD + if test ! -f conftest.hpp.gch; then + USE_PRECOMPILED_HEADER=0 + AC_MSG_RESULT([no]) + else + AC_MSG_RESULT([yes]) + fi + rm -f conftest.h conftest.hpp.gch fi -fi + fi -AC_SUBST(USE_PRECOMPILED_HEADER) + AC_SUBST(USE_PRECOMPILED_HEADER) ]) AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC], [ -AC_ARG_WITH(sjavac-server-java, [AS_HELP_STRING([--with-sjavac-server-java], - [use this java binary for running the sjavac background server @<:@Boot JDK java@:>@])]) + AC_ARG_WITH(sjavac-server-java, [AS_HELP_STRING([--with-sjavac-server-java], + [use this java binary for running the sjavac background server @<:@Boot JDK java@:>@])]) -if test "x$with_sjavac_server_java" != x; then + if test "x$with_sjavac_server_java" != x; then SJAVAC_SERVER_JAVA="$with_sjavac_server_java" FOUND_VERSION=`$SJAVAC_SERVER_JAVA -version 2>&1 | grep " version \""` if test "x$FOUND_VERSION" = x; then - AC_MSG_ERROR([Could not execute server java: $SJAVAC_SERVER_JAVA]) + AC_MSG_ERROR([Could not execute server java: $SJAVAC_SERVER_JAVA]) fi -else + else SJAVAC_SERVER_JAVA="" # Hotspot specific options. ADD_JVM_ARG_IF_OK([-verbosegc],SJAVAC_SERVER_JAVA,[$JAVA]) # JRockit specific options. ADD_JVM_ARG_IF_OK([-Xverbose:gc],SJAVAC_SERVER_JAVA,[$JAVA]) SJAVAC_SERVER_JAVA="$JAVA $SJAVAC_SERVER_JAVA" -fi -AC_SUBST(SJAVAC_SERVER_JAVA) + fi + AC_SUBST(SJAVAC_SERVER_JAVA) -if test "$MEMORY_SIZE" -gt "2500"; then + if test "$MEMORY_SIZE" -gt "2500"; then ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) if test "$JVM_ARG_OK" = true; then - JVM_64BIT=true - JVM_ARG_OK=false - fi + JVM_64BIT=true + JVM_ARG_OK=false fi + fi -if test "$JVM_64BIT" = true; then + if test "$JVM_64BIT" = true; then if test "$MEMORY_SIZE" -gt "17000"; then - ADD_JVM_ARG_IF_OK([-Xms10G -Xmx10G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) + ADD_JVM_ARG_IF_OK([-Xms10G -Xmx10G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) fi if test "$MEMORY_SIZE" -gt "10000" && test "$JVM_ARG_OK" = false; then - ADD_JVM_ARG_IF_OK([-Xms6G -Xmx6G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) + ADD_JVM_ARG_IF_OK([-Xms6G -Xmx6G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) fi if test "$MEMORY_SIZE" -gt "5000" && test "$JVM_ARG_OK" = false; then - ADD_JVM_ARG_IF_OK([-Xms1G -Xmx3G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) + ADD_JVM_ARG_IF_OK([-Xms1G -Xmx3G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) fi if test "$MEMORY_SIZE" -gt "3800" && test "$JVM_ARG_OK" = false; then - ADD_JVM_ARG_IF_OK([-Xms1G -Xmx2500M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) + ADD_JVM_ARG_IF_OK([-Xms1G -Xmx2500M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) fi -fi -if test "$MEMORY_SIZE" -gt "2500" && test "$JVM_ARG_OK" = false; then + fi + if test "$MEMORY_SIZE" -gt "2500" && test "$JVM_ARG_OK" = false; then ADD_JVM_ARG_IF_OK([-Xms1000M -Xmx1500M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) -fi -if test "$MEMORY_SIZE" -gt "1000" && test "$JVM_ARG_OK" = false; then + fi + if test "$MEMORY_SIZE" -gt "1000" && test "$JVM_ARG_OK" = false; then ADD_JVM_ARG_IF_OK([-Xms400M -Xmx1100M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) -fi -if test "$JVM_ARG_OK" = false; then + fi + if test "$JVM_ARG_OK" = false; then ADD_JVM_ARG_IF_OK([-Xms256M -Xmx512M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) -fi + fi -AC_MSG_CHECKING([whether to use sjavac]) -AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac], - [use sjavac to do fast incremental compiles @<:@disabled@:>@])], - [ENABLE_SJAVAC="${enableval}"], [ENABLE_SJAVAC='no']) -AC_MSG_RESULT([$ENABLE_SJAVAC]) -AC_SUBST(ENABLE_SJAVAC) + AC_MSG_CHECKING([whether to use sjavac]) + AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac], + [use sjavac to do fast incremental compiles @<:@disabled@:>@])], + [ENABLE_SJAVAC="${enableval}"], [ENABLE_SJAVAC='no']) + AC_MSG_RESULT([$ENABLE_SJAVAC]) + AC_SUBST(ENABLE_SJAVAC) -if test "x$ENABLE_SJAVAC" = xyes; then + if test "x$ENABLE_SJAVAC" = xyes; then SJAVAC_SERVER_DIR="$OUTPUT_ROOT/javacservers" -else + else SJAVAC_SERVER_DIR= -fi -AC_SUBST(SJAVAC_SERVER_DIR) - + fi + AC_SUBST(SJAVAC_SERVER_DIR) ]) diff --git a/common/autoconf/builddeps.conf.example b/common/autoconf/builddeps.conf.example index 4573aa23f72..f73bcb187eb 100644 --- a/common/autoconf/builddeps.conf.example +++ b/common/autoconf/builddeps.conf.example @@ -34,7 +34,7 @@ # If no rewrite was found, then rewritten_target=${OPENJDK_TARGET_AUTOCONF_NAME} REWRITE_i686_pc_linux_gnu=i686-unknown-linux-gnu REWRITE_i386_pc_solaris2_10=i686-sun-solaris2_10 - + # The needed cups builddeps are platform independent header files. # I.e. they need not be part of the devkit. builddep_cups=lib/cups_1_3_9.zip diff --git a/common/autoconf/builddeps.conf.nfs.example b/common/autoconf/builddeps.conf.nfs.example index 200b6507463..1f9e16e605a 100644 --- a/common/autoconf/builddeps.conf.nfs.example +++ b/common/autoconf/builddeps.conf.nfs.example @@ -29,7 +29,7 @@ REWRITE_i686_pc_linux_gnu=i686-unknown-linux-gnu REWRITE_i386_pc_solaris2_10=i686-sun-solaris2_10 - + DEVTOOLS=/java/devtools builddep_cups=${DEVTOOLS}/linux/cups/include diff --git a/common/autoconf/builddeps.m4 b/common/autoconf/builddeps.m4 index 207be33c88a..199b9e7e4cf 100644 --- a/common/autoconf/builddeps.m4 +++ b/common/autoconf/builddeps.m4 @@ -25,223 +25,223 @@ AC_DEFUN_ONCE([BDEPS_SCAN_FOR_BUILDDEPS], [ - define(LIST_OF_BUILD_DEPENDENCIES,) - if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then - if test "x$with_builddeps_conf" != x; then - AC_MSG_CHECKING([for supplied builddeps configuration file]) - builddepsfile=$with_builddeps_conf - if test -s $builddepsfile; then - . $builddepsfile - AC_MSG_RESULT([loaded!]) - else - AC_MSG_ERROR([The given builddeps conf file $with_builddeps_conf could not be loaded!]) - fi - else - AC_MSG_CHECKING([for builddeps.conf files in sources...]) - builddepsfile=`mktemp` - touch $builddepsfile - # Put all found confs into a single file. - find ${SRC_ROOT} -name builddeps.conf -exec cat \{\} \; >> $builddepsfile - # Source the file to acquire the variables - if test -s $builddepsfile; then - . $builddepsfile - AC_MSG_RESULT([found at least one!]) - else - AC_MSG_ERROR([Could not find any builddeps.conf at all!]) - fi - fi - # Create build and target names that use _ instead of "-" and ".". - # This is necessary to use them in variable names. - build_var=`echo ${OPENJDK_BUILD_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'` - target_var=`echo ${OPENJDK_TARGET_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'` - # Extract rewrite information for build and target - eval rewritten_build=\${REWRITE_${build_var}} - if test "x$rewritten_build" = x; then - rewritten_build=${OPENJDK_BUILD_AUTOCONF_NAME} - echo Build stays the same $rewritten_build - else - echo Rewriting build for builddeps into $rewritten_build - fi - eval rewritten_target=\${REWRITE_${target_var}} - if test "x$rewritten_target" = x; then - rewritten_target=${OPENJDK_TARGET_AUTOCONF_NAME} - echo Target stays the same $rewritten_target - else - echo Rewriting target for builddeps into $rewritten_target - fi - rewritten_build_var=`echo ${rewritten_build} | tr '-' '_' | tr '.' '_'` - rewritten_target_var=`echo ${rewritten_target} | tr '-' '_' | tr '.' '_'` + define(LIST_OF_BUILD_DEPENDENCIES,) + if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then + if test "x$with_builddeps_conf" != x; then + AC_MSG_CHECKING([for supplied builddeps configuration file]) + builddepsfile=$with_builddeps_conf + if test -s $builddepsfile; then + . $builddepsfile + AC_MSG_RESULT([loaded!]) + else + AC_MSG_ERROR([The given builddeps conf file $with_builddeps_conf could not be loaded!]) + fi + else + AC_MSG_CHECKING([for builddeps.conf files in sources...]) + builddepsfile=`mktemp` + touch $builddepsfile + # Put all found confs into a single file. + find ${SRC_ROOT} -name builddeps.conf -exec cat \{\} \; >> $builddepsfile + # Source the file to acquire the variables + if test -s $builddepsfile; then + . $builddepsfile + AC_MSG_RESULT([found at least one!]) + else + AC_MSG_ERROR([Could not find any builddeps.conf at all!]) + fi fi - AC_CHECK_PROGS(BDEPS_UNZIP, [7z unzip]) - if test "x$BDEPS_UNZIP" = x7z; then - BDEPS_UNZIP="7z x" + # Create build and target names that use _ instead of "-" and ".". + # This is necessary to use them in variable names. + build_var=`echo ${OPENJDK_BUILD_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'` + target_var=`echo ${OPENJDK_TARGET_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'` + # Extract rewrite information for build and target + eval rewritten_build=\${REWRITE_${build_var}} + if test "x$rewritten_build" = x; then + rewritten_build=${OPENJDK_BUILD_AUTOCONF_NAME} + echo Build stays the same $rewritten_build + else + echo Rewriting build for builddeps into $rewritten_build fi + eval rewritten_target=\${REWRITE_${target_var}} + if test "x$rewritten_target" = x; then + rewritten_target=${OPENJDK_TARGET_AUTOCONF_NAME} + echo Target stays the same $rewritten_target + else + echo Rewriting target for builddeps into $rewritten_target + fi + rewritten_build_var=`echo ${rewritten_build} | tr '-' '_' | tr '.' '_'` + rewritten_target_var=`echo ${rewritten_target} | tr '-' '_' | tr '.' '_'` + fi + AC_CHECK_PROGS(BDEPS_UNZIP, [7z unzip]) + if test "x$BDEPS_UNZIP" = x7z; then + BDEPS_UNZIP="7z x" + fi - AC_CHECK_PROGS(BDEPS_FTP, [wget lftp ftp]) + AC_CHECK_PROGS(BDEPS_FTP, [wget lftp ftp]) ]) AC_DEFUN([BDEPS_FTPGET], [ - # $1 is the ftp://abuilddeps.server.com/libs/cups.zip - # $2 is the local file name for the downloaded file. - VALID_TOOL=no - if test "x$BDEPS_FTP" = xwget; then - VALID_TOOL=yes - wget -O $2 $1 - fi - if test "x$BDEPS_FTP" = xlftp; then - VALID_TOOL=yes - lftp -c "get $1 -o $2" - fi - if test "x$BDEPS_FTP" = xftp; then - VALID_TOOL=yes - FTPSERVER=`echo $1 | cut -f 3 -d '/'` - FTPPATH=`echo $1 | cut -f 4- -d '/'` - FTPUSERPWD=${FTPSERVER%%@*} - if test "x$FTPSERVER" != "x$FTPUSERPWD"; then - FTPUSER=${userpwd%%:*} - FTPPWD=${userpwd#*@} - FTPSERVER=${FTPSERVER#*@} - else - FTPUSER=ftp - FTPPWD=ftp - fi - # the "pass" command does not work on some - # ftp clients (read ftp.exe) but if it works, - # passive mode is better! - (\ - echo "user $FTPUSER $FTPPWD" ;\ - echo "pass" ;\ - echo "bin" ;\ - echo "get $FTPPATH $2" ;\ - ) | ftp -in $FTPSERVER - fi - if test "x$VALID_TOOL" != xyes; then - AC_MSG_ERROR([I do not know how to use the tool: $BDEPS_FTP]) + # $1 is the ftp://abuilddeps.server.com/libs/cups.zip + # $2 is the local file name for the downloaded file. + VALID_TOOL=no + if test "x$BDEPS_FTP" = xwget; then + VALID_TOOL=yes + wget -O $2 $1 + fi + if test "x$BDEPS_FTP" = xlftp; then + VALID_TOOL=yes + lftp -c "get $1 -o $2" + fi + if test "x$BDEPS_FTP" = xftp; then + VALID_TOOL=yes + FTPSERVER=`echo $1 | cut -f 3 -d '/'` + FTPPATH=`echo $1 | cut -f 4- -d '/'` + FTPUSERPWD=${FTPSERVER%%@*} + if test "x$FTPSERVER" != "x$FTPUSERPWD"; then + FTPUSER=${userpwd%%:*} + FTPPWD=${userpwd#*@} + FTPSERVER=${FTPSERVER#*@} + else + FTPUSER=ftp + FTPPWD=ftp fi + # the "pass" command does not work on some + # ftp clients (read ftp.exe) but if it works, + # passive mode is better! + ( \ + echo "user $FTPUSER $FTPPWD" ; \ + echo "pass" ; \ + echo "bin" ; \ + echo "get $FTPPATH $2" ; \ + ) | ftp -in $FTPSERVER + fi + if test "x$VALID_TOOL" != xyes; then + AC_MSG_ERROR([I do not know how to use the tool: $BDEPS_FTP]) + fi ]) AC_DEFUN([BDEPS_CHECK_MODULE], [ - define([LIST_OF_BUILD_DEPENDENCIES],LIST_OF_BUILD_DEPENDENCIES[$2=$3'\n']) - if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then - # Source the builddeps file again, to make sure it uses the latest variables! - . $builddepsfile - # Look for a target and build machine specific resource! - eval resource=\${builddep_$2_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}} - if test "x$resource" = x; then - # Ok, lets instead look for a target specific resource - eval resource=\${builddep_$2_TARGET_${rewritten_target_var}} - fi - if test "x$resource" = x; then - # Ok, lets instead look for a build specific resource - eval resource=\${builddep_$2_BUILD_${rewritten_build_var}} - fi - if test "x$resource" = x; then - # Ok, lets instead look for a generic resource - # (The $2 comes from M4 and not the shell, thus no need for eval here.) - resource=${builddep_$2} - fi - if test "x$resource" != x; then - AC_MSG_NOTICE([Using builddeps $resource for $2]) - # If the resource in the builddeps.conf file is an existing directory, - # for example /java/linux/cups - if test -d ${resource}; then - depdir=${resource} - else - BDEPS_FETCH($2, $resource, $with_builddeps_server, $with_builddeps_dir, depdir) - fi - # Source the builddeps file again, because in the previous command, the depdir - # was updated to point at the current build dependency install directory. - . $builddepsfile - # Now extract variables from the builddeps.conf files. - theroot=${builddep_$2_ROOT} - thecflags=${builddep_$2_CFLAGS} - thelibs=${builddep_$2_LIBS} - if test "x$depdir" = x; then - AC_MSG_ERROR([Could not download build dependency $2]) - fi - $1=$depdir - if test "x$theroot" != x; then - $1="$theroot" - fi - if test "x$thecflags" != x; then - $1_CFLAGS="$thecflags" - fi - if test "x$thelibs" != x; then - $1_LIBS="$thelibs" - fi - m4_default([$4], [:]) - m4_ifvaln([$5], [else $5]) - fi - m4_ifvaln([$5], [else $5]) + define([LIST_OF_BUILD_DEPENDENCIES],LIST_OF_BUILD_DEPENDENCIES[$2=$3'\n']) + if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then + # Source the builddeps file again, to make sure it uses the latest variables! + . $builddepsfile + # Look for a target and build machine specific resource! + eval resource=\${builddep_$2_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}} + if test "x$resource" = x; then + # Ok, lets instead look for a target specific resource + eval resource=\${builddep_$2_TARGET_${rewritten_target_var}} fi + if test "x$resource" = x; then + # Ok, lets instead look for a build specific resource + eval resource=\${builddep_$2_BUILD_${rewritten_build_var}} + fi + if test "x$resource" = x; then + # Ok, lets instead look for a generic resource + # (The $2 comes from M4 and not the shell, thus no need for eval here.) + resource=${builddep_$2} + fi + if test "x$resource" != x; then + AC_MSG_NOTICE([Using builddeps $resource for $2]) + # If the resource in the builddeps.conf file is an existing directory, + # for example /java/linux/cups + if test -d ${resource}; then + depdir=${resource} + else + BDEPS_FETCH($2, $resource, $with_builddeps_server, $with_builddeps_dir, depdir) + fi + # Source the builddeps file again, because in the previous command, the depdir + # was updated to point at the current build dependency install directory. + . $builddepsfile + # Now extract variables from the builddeps.conf files. + theroot=${builddep_$2_ROOT} + thecflags=${builddep_$2_CFLAGS} + thelibs=${builddep_$2_LIBS} + if test "x$depdir" = x; then + AC_MSG_ERROR([Could not download build dependency $2]) + fi + $1=$depdir + if test "x$theroot" != x; then + $1="$theroot" + fi + if test "x$thecflags" != x; then + $1_CFLAGS="$thecflags" + fi + if test "x$thelibs" != x; then + $1_LIBS="$thelibs" + fi + m4_default([$4], [:]) + m4_ifvaln([$5], [else $5]) + fi + m4_ifvaln([$5], [else $5]) + fi ]) AC_DEFUN([BDEPS_FETCH], [ -# $1 is for example mymodule -# $2 is for example libs/general/libmymod_1_2_3.zip -# $3 is for example ftp://mybuilddeps.myserver.com/builddeps -# $4 is for example /localhome/builddeps -# $5 is the name of the variable into which we store the depdir, eg MYMOD -# Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and -# unzip into the directory: /localhome/builddeps/libmymod_1_2_3 - filename=`basename $2` - filebase=`echo $filename | sed 's/\.[[^\.]]*$//'` - filebase=${filename%%.*} - extension=${filename#*.} - installdir=$4/$filebase - if test ! -f $installdir/$filename.unpacked; then - AC_MSG_NOTICE([Downloading build dependency $1 from $3/$2 and installing into $installdir]) - if test ! -d $installdir; then - mkdir -p $installdir - fi - if test ! -d $installdir; then - AC_MSG_ERROR([Could not create directory $installdir]) - fi - tmpfile=`mktemp $installdir/$1.XXXXXXXXX` - touch $tmpfile - if test ! -f $tmpfile; then - AC_MSG_ERROR([Could not create files in directory $installdir]) - fi - BDEPS_FTPGET([$3/$2] , [$tmpfile]) - mv $tmpfile $installdir/$filename - if test ! -s $installdir/$filename; then - AC_MSG_ERROR([Could not download $3/$2]) - fi - case "$extension" in - zip) echo "Unzipping $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked) - ;; - tar.gz) echo "Untaring $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) - ;; - tgz) echo "Untaring $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) - ;; - *) AC_MSG_ERROR([Cannot handle build depency archive with extension $extension]) - ;; - esac + # $1 is for example mymodule + # $2 is for example libs/general/libmymod_1_2_3.zip + # $3 is for example ftp://mybuilddeps.myserver.com/builddeps + # $4 is for example /localhome/builddeps + # $5 is the name of the variable into which we store the depdir, eg MYMOD + # Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and + # unzip into the directory: /localhome/builddeps/libmymod_1_2_3 + filename=`basename $2` + filebase=`echo $filename | sed 's/\.[[^\.]]*$//'` + filebase=${filename%%.*} + extension=${filename#*.} + installdir=$4/$filebase + if test ! -f $installdir/$filename.unpacked; then + AC_MSG_NOTICE([Downloading build dependency $1 from $3/$2 and installing into $installdir]) + if test ! -d $installdir; then + mkdir -p $installdir fi - if test -f $installdir/$filename.unpacked; then - $5=$installdir + if test ! -d $installdir; then + AC_MSG_ERROR([Could not create directory $installdir]) fi + tmpfile=`mktemp $installdir/$1.XXXXXXXXX` + touch $tmpfile + if test ! -f $tmpfile; then + AC_MSG_ERROR([Could not create files in directory $installdir]) + fi + BDEPS_FTPGET([$3/$2] , [$tmpfile]) + mv $tmpfile $installdir/$filename + if test ! -s $installdir/$filename; then + AC_MSG_ERROR([Could not download $3/$2]) + fi + case "$extension" in + zip) echo "Unzipping $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked) + ;; + tar.gz) echo "Untaring $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) + ;; + tgz) echo "Untaring $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) + ;; + *) AC_MSG_ERROR([Cannot handle build depency archive with extension $extension]) + ;; + esac + fi + if test -f $installdir/$filename.unpacked; then + $5=$installdir + fi ]) AC_DEFUN_ONCE([BDEPS_CONFIGURE_BUILDDEPS], [ -AC_ARG_WITH(builddeps-conf, [AS_HELP_STRING([--with-builddeps-conf], - [use this configuration file for the builddeps])]) + AC_ARG_WITH(builddeps-conf, [AS_HELP_STRING([--with-builddeps-conf], + [use this configuration file for the builddeps])]) -AC_ARG_WITH(builddeps-server, [AS_HELP_STRING([--with-builddeps-server], - [download and use build dependencies from this server url])]) + AC_ARG_WITH(builddeps-server, [AS_HELP_STRING([--with-builddeps-server], + [download and use build dependencies from this server url])]) -AC_ARG_WITH(builddeps-dir, [AS_HELP_STRING([--with-builddeps-dir], - [store downloaded build dependencies here @<:@/localhome/builddeps@:>@])], - [], - [with_builddeps_dir=/localhome/builddeps]) + AC_ARG_WITH(builddeps-dir, [AS_HELP_STRING([--with-builddeps-dir], + [store downloaded build dependencies here @<:@/localhome/builddeps@:>@])], + [], + [with_builddeps_dir=/localhome/builddeps]) -AC_ARG_WITH(builddeps-group, [AS_HELP_STRING([--with-builddeps-group], - [chgrp the downloaded build dependencies to this group])]) + AC_ARG_WITH(builddeps-group, [AS_HELP_STRING([--with-builddeps-group], + [chgrp the downloaded build dependencies to this group])]) ]) diff --git a/common/autoconf/compare.sh.in b/common/autoconf/compare.sh.in index 1dd9583ddda..eea3039c51c 100644 --- a/common/autoconf/compare.sh.in +++ b/common/autoconf/compare.sh.in @@ -22,7 +22,7 @@ # questions. # -# This script is processed by configure before it's usable. It is run from +# This script is processed by configure before it's usable. It is run from # the root of the build directory. @@ -67,14 +67,14 @@ UNZIP="@UNZIP@" SRC_ROOT="@SRC_ROOT@" if [ "$OPENJDK_TARGET_OS" = "windows" ]; then - PATH="@VS_PATH@" + PATH="@VS_PATH@" fi # Now locate the main script and run it. REAL_COMPARE_SCRIPT="$SRC_ROOT/common/bin/compare.sh" if [ ! -e "$REAL_COMPARE_SCRIPT" ]; then - echo "Error: Cannot locate compare script, it should have been in $REAL_COMPARE_SCRIPT" - exit 1 + echo "Error: Cannot locate compare script, it should have been in $REAL_COMPARE_SCRIPT" + exit 1 fi . "$REAL_COMPARE_SCRIPT" "$@" diff --git a/common/autoconf/config.h.in b/common/autoconf/config.h.in index 275821da639..89f44536c1a 100644 --- a/common/autoconf/config.h.in +++ b/common/autoconf/config.h.in @@ -46,4 +46,4 @@ #define HAVE_LIBGIF #define HAVE_LIBZ #define HAVE_LIBM -#define HAVE_ALTZONE +#define HAVE_ALTZONE diff --git a/common/autoconf/configure b/common/autoconf/configure index 7378efe379d..00a07fccae1 100644 --- a/common/autoconf/configure +++ b/common/autoconf/configure @@ -88,7 +88,6 @@ check_hg_updates() { check_autoconf_timestamps fi fi - fi } @@ -106,7 +105,7 @@ if test -e $conf_custom_script_dir/generated-configure.sh; then fi fi -# Autoconf calls the configure script recursively sometimes. +# Autoconf calls the configure script recursively sometimes. # Don't start logging twice in that case if test "x$conf_debug_configure" = xtrue; then conf_debug_configure=recursive @@ -120,28 +119,28 @@ conf_openjdk_target= for conf_option do case $conf_option in - --openjdk-target=*) - conf_openjdk_target=`expr "X$conf_option" : '[^=]*=\(.*\)'` - continue ;; - --debug-configure) - if test "x$conf_debug_configure" != xrecursive; then - conf_debug_configure=true - export conf_debug_configure - fi - continue ;; - *) - conf_processed_arguments=("${conf_processed_arguments[@]}" "$conf_option") ;; + --openjdk-target=*) + conf_openjdk_target=`expr "X$conf_option" : '[^=]*=\(.*\)'` + continue ;; + --debug-configure) + if test "x$conf_debug_configure" != xrecursive; then + conf_debug_configure=true + export conf_debug_configure + fi + continue ;; + *) + conf_processed_arguments=("${conf_processed_arguments[@]}" "$conf_option") ;; esac case $conf_option in - -build | --build | --buil | --bui | --bu |-build=* | --build=* | --buil=* | --bui=* | --bu=*) - conf_legacy_crosscompile="$conf_legacy_crosscompile $conf_option" ;; - -target | --target | --targe | --targ | --tar | --ta | --t | -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - conf_legacy_crosscompile="$conf_legacy_crosscompile $conf_option" ;; - -host | --host | --hos | --ho | -host=* | --host=* | --hos=* | --ho=*) - conf_legacy_crosscompile="$conf_legacy_crosscompile $conf_option" ;; - -help | --help | --hel | --he | -h) - conf_print_help=true ;; + -build | --build | --buil | --bui | --bu |-build=* | --build=* | --buil=* | --bui=* | --bu=*) + conf_legacy_crosscompile="$conf_legacy_crosscompile $conf_option" ;; + -target | --target | --targe | --targ | --tar | --ta | --t | -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + conf_legacy_crosscompile="$conf_legacy_crosscompile $conf_option" ;; + -host | --host | --hos | --ho | -host=* | --host=* | --hos=* | --ho=*) + conf_legacy_crosscompile="$conf_legacy_crosscompile $conf_option" ;; + -help | --help | --hel | --he | -h) + conf_print_help=true ;; esac done @@ -179,7 +178,7 @@ if test -e $conf_custom_script_dir/generated-configure.sh; then else echo Running generated-configure.sh conf_script_to_run=$conf_script_dir/generated-configure.sh -fi +fi if test "x$conf_debug_configure" != x; then # Turn on shell debug output if requested (initial or recursive) diff --git a/common/autoconf/configure.ac b/common/autoconf/configure.ac index ad8bd97cea3..238e4a44274 100644 --- a/common/autoconf/configure.ac +++ b/common/autoconf/configure.ac @@ -177,6 +177,9 @@ JDKOPT_SETUP_DEBUG_SYMBOLS # ############################################################################### +# After we have toolchain, we can compile fixpath. It's needed by the lib checks. +BASIC_COMPILE_FIXPATH + LIB_SETUP_INIT LIB_SETUP_X11 LIB_SETUP_CUPS @@ -185,8 +188,6 @@ LIB_SETUP_ALSA LIB_SETUP_MISC_LIBS LIB_SETUP_STATIC_LINK_LIBSTDCPP -# After we have toolchain and the paths to all libraries (needed by msys), we can compile the fixpath helper -BASIC_COMPILE_FIXPATH ############################################################################### # @@ -236,7 +237,7 @@ CONFIG_STATUS="$OUTPUT_ROOT/config.status" # Create the actual output files. Now the main work of configure is done. AC_OUTPUT -# Try to move the config.log file to the output directory. +# Try to move the config.log file to the output directory. if test -e ./config.log; then $MV -f ./config.log "$OUTPUT_ROOT/config.log" 2> /dev/null fi diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 7a65a92ecc4..edac17dcbc6 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -634,7 +634,6 @@ NUM_CORES ENABLE_INTREE_EC SALIB_NAME HOTSPOT_MAKE_ARGS -FIXPATH LIBCXX LLVM_LIBS LLVM_LDFLAGS @@ -651,10 +650,9 @@ USE_EXTERNAL_LIBGIF USE_EXTERNAL_LIBJPEG ALSA_LIBS ALSA_CFLAGS -FREETYPE2_LIB_PATH -USING_SYSTEM_FT_LIB -FREETYPE2_LIBS -FREETYPE2_CFLAGS +FREETYPE_BUNDLE_LIB_PATH +FREETYPE_LIBS +FREETYPE_CFLAGS CUPS_CFLAGS OPENWIN_HOME X_EXTRA_LIBS @@ -662,6 +660,7 @@ X_LIBS X_PRE_LIBS X_CFLAGS XMKMF +FIXPATH CXXFLAGS_DEBUG_SYMBOLS CFLAGS_DEBUG_SYMBOLS ZIP_DEBUGINFO_FILES @@ -825,6 +824,7 @@ OS_VERSION_MAJOR PKG_CONFIG CODESIGN XATTR +DSYMUTIL IS_GNU_TIME TIME STAT @@ -869,6 +869,7 @@ SRC_ROOT ZERO_ARCHDEF DEFINE_CROSS_COMPILE_ARCH LP64 +OPENJDK_TARGET_OS_EXPORT_DIR OPENJDK_TARGET_OS_API_DIR OPENJDK_TARGET_CPU_JLI_CFLAGS OPENJDK_TARGET_CPU_OSARCH @@ -1016,8 +1017,8 @@ with_cacerts_file enable_unlimited_crypto with_milestone with_update_version -with_build_number with_user_release_suffix +with_build_number with_boot_jdk with_boot_jdk_jvmargs with_add_source_root @@ -1046,6 +1047,9 @@ with_x with_cups with_cups_include with_freetype +with_freetype_include +with_freetype_lib +enable_freetype_bundling with_alsa with_alsa_include with_alsa_lib @@ -1078,8 +1082,8 @@ OBJCFLAGS CPP CXXCPP XMKMF -FREETYPE2_CFLAGS -FREETYPE2_LIBS +FREETYPE_CFLAGS +FREETYPE_LIBS ALSA_CFLAGS ALSA_LIBS LIBFFI_CFLAGS @@ -1715,9 +1719,13 @@ Optional Features: --disable-debug-symbols disable generation of debug symbols [enabled] --disable-zip-debug-info disable zipping of debug-info files [enabled] - --disable-macosx-runtime-support - disable the use of MacOSX Java runtime support - framework [enabled] + --enable-macosx-runtime-support + Deprecated. Option is kept for backwards + compatibility and is ignored + --disable-freetype-bundling + disable bundling of the freetype library with the + build result [enabled on Windows or when using + --with-freetype, disabled otherwise] --enable-sjavac use sjavac to do fast incremental compiles [disabled] --disable-precompiled-headers @@ -1755,10 +1763,10 @@ Optional Packages: --with-cacerts-file specify alternative cacerts file --with-milestone Set milestone value for build [internal] --with-update-version Set update version value for build [b00] - --with-build-number Set build number value for build [b00] --with-user-release-suffix Add a custom string to the version string if build number isn't set.[username_builddateb00] + --with-build-number Set build number value for build [b00] --with-boot-jdk path to Boot JDK (used to bootstrap build) [probed] --with-boot-jdk-jvmargs specify JVM arguments to be passed to all invocations of the Boot JDK, overriding the default @@ -1803,9 +1811,11 @@ Optional Packages: --with-cups specify prefix directory for the cups package (expecting the headers under PATH/include) --with-cups-include specify directory for the cups include files - --with-freetype specify prefix directory for the freetype2 package + --with-freetype specify prefix directory for the freetype package (expecting the libraries under PATH/lib and the headers under PATH/include) + --with-freetype-include specify directory for the freetype include files + --with-freetype-lib specify directory for the freetype library --with-alsa specify prefix directory for the alsa package (expecting the libraries under PATH/lib and the headers under PATH/include) @@ -1846,10 +1856,10 @@ Some influential environment variables: CPP C preprocessor CXXCPP C++ preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System - FREETYPE2_CFLAGS - C compiler flags for FREETYPE2, overriding pkg-config - FREETYPE2_LIBS - linker flags for FREETYPE2, overriding pkg-config + FREETYPE_CFLAGS + C compiler flags for FREETYPE, overriding pkg-config + FREETYPE_LIBS + linker flags for FREETYPE, overriding pkg-config ALSA_CFLAGS C compiler flags for ALSA, overriding pkg-config ALSA_LIBS linker flags for ALSA, overriding pkg-config LIBFFI_CFLAGS @@ -3112,7 +3122,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # # Test if $1 is a valid argument to $3 (often is $JAVA passed as $3) -# If so, then append $1 to $2\ +# If so, then append $1 to $2 \ # Also set JVM_ARG_OK to true/false depending on outcome. @@ -3148,6 +3158,11 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # $1: The name of the with argument to deprecate, not including --with- +# Register a --enable argument but mark it as deprecated +# $1: The name of the with argument to deprecate, not including --enable- +# $2: The name of the argument to deprecate, in shell variable style (i.e. with _ instead of -) + + # Test that variable $1 denoting a program is not empty. If empty, exit with an error. @@ -3441,74 +3456,100 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. cygwin_help() { - case $1 in + case $1 in unzip) - PKGHANDLER_COMMAND="cd && cmd /c setup -q -P unzip" ;; + PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P unzip )" + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + ;; zip) - PKGHANDLER_COMMAND="cd && cmd /c setup -q -P zip" ;; + PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P zip )" + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + ;; make) - PKGHANDLER_COMMAND="cd && cmd /c setup -q -P make" ;; + PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P make )" + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + ;; + freetype) + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + HELP_MSG="To install freetype, run: +wget \"http://gnuwin32.sourceforge.net/downlinks/freetype.php\" -O /tmp/freetype-setup.exe +chmod +x /tmp/freetype-setup.exe +/tmp/freetype-setup.exe +Follow GUI prompts, and install to default directory \"C:\Program Files (x86)\GnuWin32\". +After installation, locate lib/libfreetype.dll.a and make a copy with the name freetype.dll." + else + HELP_MSG="You need to build a 64-bit version of freetype. +This is not readily available. +You can find source code and build instructions on +http://www.freetype.org/ +If you put the resulting build in \"C:\Program Files\GnuWin32\", it will be found automatically." + fi + ;; * ) - break ;; - esac + break ;; + esac +} + +msys_help() { + PKGHANDLER_COMMAND="" } apt_help() { - case $1 in + case $1 in devkit) - PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;; + PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;; openjdk) - PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;; + PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;; alsa) - PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;; + PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;; cups) - PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;; - freetype2) - PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;; + PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;; + freetype) + PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;; pulse) - PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;; + PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;; x11) - PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;; + PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;; ccache) - PKGHANDLER_COMMAND="sudo apt-get install ccache" ;; + PKGHANDLER_COMMAND="sudo apt-get install ccache" ;; * ) - break ;; - esac + break ;; + esac } yum_help() { - case $1 in + case $1 in devkit) - PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;; + PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;; openjdk) - PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;; + PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;; alsa) - PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;; + PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;; cups) - PKGHANDLER_COMMAND="sudo yum install cups-devel" ;; - freetype2) - PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;; + PKGHANDLER_COMMAND="sudo yum install cups-devel" ;; + freetype) + PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;; pulse) - PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;; + PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;; x11) - PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel" ;; + PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel" ;; ccache) - PKGHANDLER_COMMAND="sudo yum install ccache" ;; + PKGHANDLER_COMMAND="sudo yum install ccache" ;; * ) - break ;; - esac + break ;; + esac } port_help() { - PKGHANDLER_COMMAND="" + PKGHANDLER_COMMAND="" } pkgutil_help() { - PKGHANDLER_COMMAND="" + PKGHANDLER_COMMAND="" } pkgadd_help() { - PKGHANDLER_COMMAND="" + PKGHANDLER_COMMAND="" } @@ -3614,6 +3655,8 @@ fi + + # # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3662,8 +3705,8 @@ fi # doing anything else with these values. - # Setup the legacy variables, for controlling the old makefiles. - # +# Setup the legacy variables, for controlling the old makefiles. +# @@ -3812,13 +3855,17 @@ fi + + + + # This line needs to be here, verbatim, after all includes and the dummy hook # definitions. It is replaced with custom functionality when building # custom sources. #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1379504921 +DATE_WHEN_GENERATED=1383151988 ############################################################################### # @@ -3831,26 +3878,26 @@ DATE_WHEN_GENERATED=1379504921 # Basic initialization that must happen first of all -# Save the original command line. This is passed to us by the wrapper configure script. + # Save the original command line. This is passed to us by the wrapper configure script. -DATE_WHEN_CONFIGURED=`LANG=C date` + DATE_WHEN_CONFIGURED=`LANG=C date` -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuration created at $DATE_WHEN_CONFIGURED." >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: Configuration created at $DATE_WHEN_CONFIGURED." >&5 $as_echo "$as_me: Configuration created at $DATE_WHEN_CONFIGURED." >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: configure script generated at timestamp $DATE_WHEN_GENERATED." >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: configure script generated at timestamp $DATE_WHEN_GENERATED." >&5 $as_echo "$as_me: configure script generated at timestamp $DATE_WHEN_GENERATED." >&6;} -# Start with tools that do not need have cross compilation support -# and can be expected to be found in the default PATH. These tools are -# used by configure. Nor are these tools expected to be found in the -# devkit from the builddeps server either, since they are -# needed to download the devkit. + # Start with tools that do not need have cross compilation support + # and can be expected to be found in the default PATH. These tools are + # used by configure. Nor are these tools expected to be found in the + # devkit from the builddeps server either, since they are + # needed to download the devkit. -# First are all the simple required tools. + # First are all the simple required tools. - for ac_prog in basename + for ac_prog in basename do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -3896,20 +3943,20 @@ fi done - if test "x$BASENAME" = x; then - if test "xbasename" = x; then - PROG_NAME=basename - else - PROG_NAME=basename - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$BASENAME" = x; then + if test "xbasename" = x; then + PROG_NAME=basename + else + PROG_NAME=basename fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in bash + for ac_prog in bash do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -3955,20 +4002,20 @@ fi done - if test "x$BASH" = x; then - if test "xbash" = x; then - PROG_NAME=bash - else - PROG_NAME=bash - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$BASH" = x; then + if test "xbash" = x; then + PROG_NAME=bash + else + PROG_NAME=bash fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in cat + for ac_prog in cat do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4014,20 +4061,20 @@ fi done - if test "x$CAT" = x; then - if test "xcat" = x; then - PROG_NAME=cat - else - PROG_NAME=cat - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$CAT" = x; then + if test "xcat" = x; then + PROG_NAME=cat + else + PROG_NAME=cat fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in chmod + for ac_prog in chmod do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4073,20 +4120,20 @@ fi done - if test "x$CHMOD" = x; then - if test "xchmod" = x; then - PROG_NAME=chmod - else - PROG_NAME=chmod - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$CHMOD" = x; then + if test "xchmod" = x; then + PROG_NAME=chmod + else + PROG_NAME=chmod fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in cmp + for ac_prog in cmp do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4132,20 +4179,20 @@ fi done - if test "x$CMP" = x; then - if test "xcmp" = x; then - PROG_NAME=cmp - else - PROG_NAME=cmp - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$CMP" = x; then + if test "xcmp" = x; then + PROG_NAME=cmp + else + PROG_NAME=cmp fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in comm + for ac_prog in comm do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4191,20 +4238,20 @@ fi done - if test "x$COMM" = x; then - if test "xcomm" = x; then - PROG_NAME=comm - else - PROG_NAME=comm - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$COMM" = x; then + if test "xcomm" = x; then + PROG_NAME=comm + else + PROG_NAME=comm fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in cp + for ac_prog in cp do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4250,20 +4297,20 @@ fi done - if test "x$CP" = x; then - if test "xcp" = x; then - PROG_NAME=cp - else - PROG_NAME=cp - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$CP" = x; then + if test "xcp" = x; then + PROG_NAME=cp + else + PROG_NAME=cp fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in cpio + for ac_prog in cpio do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4309,20 +4356,20 @@ fi done - if test "x$CPIO" = x; then - if test "xcpio" = x; then - PROG_NAME=cpio - else - PROG_NAME=cpio - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$CPIO" = x; then + if test "xcpio" = x; then + PROG_NAME=cpio + else + PROG_NAME=cpio fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in cut + for ac_prog in cut do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4368,20 +4415,20 @@ fi done - if test "x$CUT" = x; then - if test "xcut" = x; then - PROG_NAME=cut - else - PROG_NAME=cut - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$CUT" = x; then + if test "xcut" = x; then + PROG_NAME=cut + else + PROG_NAME=cut fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in date + for ac_prog in date do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4427,20 +4474,20 @@ fi done - if test "x$DATE" = x; then - if test "xdate" = x; then - PROG_NAME=date - else - PROG_NAME=date - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$DATE" = x; then + if test "xdate" = x; then + PROG_NAME=date + else + PROG_NAME=date fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in gdiff diff + for ac_prog in gdiff diff do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4486,20 +4533,20 @@ fi done - if test "x$DIFF" = x; then - if test "xgdiff diff" = x; then - PROG_NAME=diff - else - PROG_NAME=gdiff diff - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$DIFF" = x; then + if test "xgdiff diff" = x; then + PROG_NAME=diff + else + PROG_NAME=gdiff diff fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in dirname + for ac_prog in dirname do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4545,20 +4592,20 @@ fi done - if test "x$DIRNAME" = x; then - if test "xdirname" = x; then - PROG_NAME=dirname - else - PROG_NAME=dirname - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$DIRNAME" = x; then + if test "xdirname" = x; then + PROG_NAME=dirname + else + PROG_NAME=dirname fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in echo + for ac_prog in echo do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4604,20 +4651,20 @@ fi done - if test "x$ECHO" = x; then - if test "xecho" = x; then - PROG_NAME=echo - else - PROG_NAME=echo - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$ECHO" = x; then + if test "xecho" = x; then + PROG_NAME=echo + else + PROG_NAME=echo fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in expr + for ac_prog in expr do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4663,20 +4710,20 @@ fi done - if test "x$EXPR" = x; then - if test "xexpr" = x; then - PROG_NAME=expr - else - PROG_NAME=expr - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$EXPR" = x; then + if test "xexpr" = x; then + PROG_NAME=expr + else + PROG_NAME=expr fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in file + for ac_prog in file do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4722,20 +4769,20 @@ fi done - if test "x$FILE" = x; then - if test "xfile" = x; then - PROG_NAME=file - else - PROG_NAME=file - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$FILE" = x; then + if test "xfile" = x; then + PROG_NAME=file + else + PROG_NAME=file fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in find + for ac_prog in find do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4781,20 +4828,20 @@ fi done - if test "x$FIND" = x; then - if test "xfind" = x; then - PROG_NAME=find - else - PROG_NAME=find - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$FIND" = x; then + if test "xfind" = x; then + PROG_NAME=find + else + PROG_NAME=find fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in head + for ac_prog in head do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4840,20 +4887,20 @@ fi done - if test "x$HEAD" = x; then - if test "xhead" = x; then - PROG_NAME=head - else - PROG_NAME=head - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$HEAD" = x; then + if test "xhead" = x; then + PROG_NAME=head + else + PROG_NAME=head fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in ln + for ac_prog in ln do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4899,20 +4946,20 @@ fi done - if test "x$LN" = x; then - if test "xln" = x; then - PROG_NAME=ln - else - PROG_NAME=ln - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$LN" = x; then + if test "xln" = x; then + PROG_NAME=ln + else + PROG_NAME=ln fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in ls + for ac_prog in ls do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4958,20 +5005,20 @@ fi done - if test "x$LS" = x; then - if test "xls" = x; then - PROG_NAME=ls - else - PROG_NAME=ls - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$LS" = x; then + if test "xls" = x; then + PROG_NAME=ls + else + PROG_NAME=ls fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in mkdir + for ac_prog in mkdir do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5017,20 +5064,20 @@ fi done - if test "x$MKDIR" = x; then - if test "xmkdir" = x; then - PROG_NAME=mkdir - else - PROG_NAME=mkdir - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$MKDIR" = x; then + if test "xmkdir" = x; then + PROG_NAME=mkdir + else + PROG_NAME=mkdir fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in mktemp + for ac_prog in mktemp do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5076,20 +5123,20 @@ fi done - if test "x$MKTEMP" = x; then - if test "xmktemp" = x; then - PROG_NAME=mktemp - else - PROG_NAME=mktemp - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$MKTEMP" = x; then + if test "xmktemp" = x; then + PROG_NAME=mktemp + else + PROG_NAME=mktemp fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in mv + for ac_prog in mv do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5135,20 +5182,20 @@ fi done - if test "x$MV" = x; then - if test "xmv" = x; then - PROG_NAME=mv - else - PROG_NAME=mv - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$MV" = x; then + if test "xmv" = x; then + PROG_NAME=mv + else + PROG_NAME=mv fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in printf + for ac_prog in printf do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5194,20 +5241,20 @@ fi done - if test "x$PRINTF" = x; then - if test "xprintf" = x; then - PROG_NAME=printf - else - PROG_NAME=printf - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$PRINTF" = x; then + if test "xprintf" = x; then + PROG_NAME=printf + else + PROG_NAME=printf fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in rm + for ac_prog in rm do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5253,20 +5300,20 @@ fi done - if test "x$RM" = x; then - if test "xrm" = x; then - PROG_NAME=rm - else - PROG_NAME=rm - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$RM" = x; then + if test "xrm" = x; then + PROG_NAME=rm + else + PROG_NAME=rm fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in sh + for ac_prog in sh do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5312,20 +5359,20 @@ fi done - if test "x$SH" = x; then - if test "xsh" = x; then - PROG_NAME=sh - else - PROG_NAME=sh - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$SH" = x; then + if test "xsh" = x; then + PROG_NAME=sh + else + PROG_NAME=sh fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in sort + for ac_prog in sort do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5371,20 +5418,20 @@ fi done - if test "x$SORT" = x; then - if test "xsort" = x; then - PROG_NAME=sort - else - PROG_NAME=sort - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$SORT" = x; then + if test "xsort" = x; then + PROG_NAME=sort + else + PROG_NAME=sort fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in tail + for ac_prog in tail do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5430,20 +5477,20 @@ fi done - if test "x$TAIL" = x; then - if test "xtail" = x; then - PROG_NAME=tail - else - PROG_NAME=tail - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$TAIL" = x; then + if test "xtail" = x; then + PROG_NAME=tail + else + PROG_NAME=tail fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in tar + for ac_prog in tar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5489,20 +5536,20 @@ fi done - if test "x$TAR" = x; then - if test "xtar" = x; then - PROG_NAME=tar - else - PROG_NAME=tar - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$TAR" = x; then + if test "xtar" = x; then + PROG_NAME=tar + else + PROG_NAME=tar fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in tee + for ac_prog in tee do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5548,20 +5595,20 @@ fi done - if test "x$TEE" = x; then - if test "xtee" = x; then - PROG_NAME=tee - else - PROG_NAME=tee - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$TEE" = x; then + if test "xtee" = x; then + PROG_NAME=tee + else + PROG_NAME=tee fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in touch + for ac_prog in touch do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5607,20 +5654,20 @@ fi done - if test "x$TOUCH" = x; then - if test "xtouch" = x; then - PROG_NAME=touch - else - PROG_NAME=touch - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$TOUCH" = x; then + if test "xtouch" = x; then + PROG_NAME=touch + else + PROG_NAME=touch fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in tr + for ac_prog in tr do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5666,20 +5713,20 @@ fi done - if test "x$TR" = x; then - if test "xtr" = x; then - PROG_NAME=tr - else - PROG_NAME=tr - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$TR" = x; then + if test "xtr" = x; then + PROG_NAME=tr + else + PROG_NAME=tr fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in uname + for ac_prog in uname do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5725,20 +5772,20 @@ fi done - if test "x$UNAME" = x; then - if test "xuname" = x; then - PROG_NAME=uname - else - PROG_NAME=uname - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$UNAME" = x; then + if test "xuname" = x; then + PROG_NAME=uname + else + PROG_NAME=uname fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in uniq + for ac_prog in uniq do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5784,20 +5831,20 @@ fi done - if test "x$UNIQ" = x; then - if test "xuniq" = x; then - PROG_NAME=uniq - else - PROG_NAME=uniq - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$UNIQ" = x; then + if test "xuniq" = x; then + PROG_NAME=uniq + else + PROG_NAME=uniq fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in wc + for ac_prog in wc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5843,20 +5890,20 @@ fi done - if test "x$WC" = x; then - if test "xwc" = x; then - PROG_NAME=wc - else - PROG_NAME=wc - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$WC" = x; then + if test "xwc" = x; then + PROG_NAME=wc + else + PROG_NAME=wc fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in which + for ac_prog in which do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5902,20 +5949,20 @@ fi done - if test "x$WHICH" = x; then - if test "xwhich" = x; then - PROG_NAME=which - else - PROG_NAME=which - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$WHICH" = x; then + if test "xwhich" = x; then + PROG_NAME=which + else + PROG_NAME=which fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in xargs + for ac_prog in xargs do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5961,21 +6008,21 @@ fi done - if test "x$XARGS" = x; then - if test "xxargs" = x; then - PROG_NAME=xargs - else - PROG_NAME=xargs - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$XARGS" = x; then + if test "xxargs" = x; then + PROG_NAME=xargs + else + PROG_NAME=xargs fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi -# Then required tools that require some special treatment. -for ac_prog in gawk mawk nawk awk + # Then required tools that require some special treatment. + for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -6018,18 +6065,18 @@ fi done - if test "x$AWK" = x; then - if test "x" = x; then - PROG_NAME=awk - else - PROG_NAME= - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$AWK" = x; then + if test "x" = x; then + PROG_NAME=awk + else + PROG_NAME= fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 @@ -6093,18 +6140,18 @@ $as_echo "$ac_cv_path_GREP" >&6; } - if test "x$GREP" = x; then - if test "x" = x; then - PROG_NAME=grep - else - PROG_NAME= - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$GREP" = x; then + if test "x" = x; then + PROG_NAME=grep + else + PROG_NAME= fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 @@ -6172,18 +6219,18 @@ $as_echo "$ac_cv_path_EGREP" >&6; } - if test "x$EGREP" = x; then - if test "x" = x; then - PROG_NAME=egrep - else - PROG_NAME= - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$EGREP" = x; then + if test "x" = x; then + PROG_NAME=egrep + else + PROG_NAME= fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 @@ -6251,18 +6298,18 @@ $as_echo "$ac_cv_path_FGREP" >&6; } - if test "x$FGREP" = x; then - if test "x" = x; then - PROG_NAME=fgrep - else - PROG_NAME= - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$FGREP" = x; then + if test "x" = x; then + PROG_NAME=fgrep + else + PROG_NAME= fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 @@ -6332,19 +6379,19 @@ $as_echo "$ac_cv_path_SED" >&6; } rm -f conftest.sed - if test "x$SED" = x; then - if test "x" = x; then - PROG_NAME=sed - else - PROG_NAME= - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$SED" = x; then + if test "x" = x; then + PROG_NAME=sed + else + PROG_NAME= fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi -for ac_prog in nawk gawk awk + for ac_prog in nawk gawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -6390,27 +6437,27 @@ fi done - if test "x$NAWK" = x; then - if test "x" = x; then - PROG_NAME=nawk - else - PROG_NAME= - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$NAWK" = x; then + if test "x" = x; then + PROG_NAME=nawk + else + PROG_NAME= fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi -# Always force rm. -RM="$RM -f" + # Always force rm. + RM="$RM -f" -# pwd behaves differently on various platforms and some don't support the -L flag. -# Always use the bash builtin pwd to get uniform behavior. -THEPWDCMD=pwd + # pwd behaves differently on various platforms and some don't support the -L flag. + # Always use the bash builtin pwd to get uniform behavior. + THEPWDCMD=pwd -# These are not required on all platforms -# Extract the first word of "cygpath", so it can be a program name with args. + # These are not required on all platforms + # Extract the first word of "cygpath", so it can be a program name with args. 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; } @@ -6450,7 +6497,7 @@ $as_echo "no" >&6; } fi -# Extract the first word of "readlink", so it can be a program name with args. + # Extract the first word of "readlink", so it can be a program name with args. 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; } @@ -6490,7 +6537,7 @@ $as_echo "no" >&6; } fi -# Extract the first word of "df", so it can be a program name with args. + # Extract the first word of "df", so it can be a program name with args. 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; } @@ -6530,7 +6577,7 @@ $as_echo "no" >&6; } fi -# Extract the first word of "SetFile", so it can be a program name with args. + # Extract the first word of "SetFile", so it can be a program name with args. 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; } @@ -6685,26 +6732,26 @@ test -n "$target_alias" && NONENONEs,x,x, && program_prefix=${target_alias}- -# Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target" -# is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the -# product you're building. The target of this build is called "host". Since this is confusing to most people, we -# have not adopted that system, but use "target" as the platform we are building for. In some places though we need -# to use the configure naming style. + # Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target" + # is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the + # product you're building. The target of this build is called "host". Since this is confusing to most people, we + # have not adopted that system, but use "target" as the platform we are building for. In some places though we need + # to use the configure naming style. - # Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME - # (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME - # Note that we might later on rewrite e.g. OPENJDK_TARGET_CPU due to reduced build, - # but this will not change the value of OPENJDK_TARGET_AUTOCONF_NAME. - OPENJDK_TARGET_AUTOCONF_NAME="$host" - OPENJDK_BUILD_AUTOCONF_NAME="$build" + # Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME + # (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME + # Note that we might later on rewrite e.g. OPENJDK_TARGET_CPU due to reduced build, + # but this will not change the value of OPENJDK_TARGET_AUTOCONF_NAME. + OPENJDK_TARGET_AUTOCONF_NAME="$host" + OPENJDK_BUILD_AUTOCONF_NAME="$build" - # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. + # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. case "$build_os" in *linux*) @@ -6768,50 +6815,50 @@ test -n "$target_alias" && VAR_CPU_ARCH=ppc VAR_CPU_BITS=32 VAR_CPU_ENDIAN=big - ;; + ;; powerpc64) VAR_CPU=ppc64 VAR_CPU_ARCH=ppc VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big - ;; + ;; s390) VAR_CPU=s390 VAR_CPU_ARCH=s390 VAR_CPU_BITS=32 VAR_CPU_ENDIAN=big - ;; + ;; s390x) VAR_CPU=s390x VAR_CPU_ARCH=s390 VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big - ;; + ;; sparc) VAR_CPU=sparc VAR_CPU_ARCH=sparc VAR_CPU_BITS=32 VAR_CPU_ENDIAN=big - ;; + ;; sparcv9) VAR_CPU=sparcv9 VAR_CPU_ARCH=sparc VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big - ;; + ;; *) as_fn_error $? "unsupported cpu $build_cpu" "$LINENO" 5 ;; esac - # ..and setup our own variables. (Do this explicitely to facilitate searching) - OPENJDK_BUILD_OS="$VAR_OS" - OPENJDK_BUILD_OS_API="$VAR_OS_API" - OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV" - OPENJDK_BUILD_CPU="$VAR_CPU" - OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" - OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" - OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" + # ..and setup our own variables. (Do this explicitely to facilitate searching) + OPENJDK_BUILD_OS="$VAR_OS" + OPENJDK_BUILD_OS_API="$VAR_OS_API" + OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV" + OPENJDK_BUILD_CPU="$VAR_CPU" + OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" + OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" + OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" @@ -6819,12 +6866,12 @@ test -n "$target_alias" && - { $as_echo "$as_me:${as_lineno-$LINENO}: checking openjdk-build os-cpu" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking openjdk-build os-cpu" >&5 $as_echo_n "checking openjdk-build os-cpu... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&5 $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; } - # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. + # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. case "$host_os" in *linux*) @@ -6888,50 +6935,50 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; } VAR_CPU_ARCH=ppc VAR_CPU_BITS=32 VAR_CPU_ENDIAN=big - ;; + ;; powerpc64) VAR_CPU=ppc64 VAR_CPU_ARCH=ppc VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big - ;; + ;; s390) VAR_CPU=s390 VAR_CPU_ARCH=s390 VAR_CPU_BITS=32 VAR_CPU_ENDIAN=big - ;; + ;; s390x) VAR_CPU=s390x VAR_CPU_ARCH=s390 VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big - ;; + ;; sparc) VAR_CPU=sparc VAR_CPU_ARCH=sparc VAR_CPU_BITS=32 VAR_CPU_ENDIAN=big - ;; + ;; sparcv9) VAR_CPU=sparcv9 VAR_CPU_ARCH=sparc VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big - ;; + ;; *) as_fn_error $? "unsupported cpu $host_cpu" "$LINENO" 5 ;; esac - # ... and setup our own variables. (Do this explicitely to facilitate searching) - OPENJDK_TARGET_OS="$VAR_OS" - OPENJDK_TARGET_OS_API="$VAR_OS_API" - OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV" - OPENJDK_TARGET_CPU="$VAR_CPU" - OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" - OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" - OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN" + # ... and setup our own variables. (Do this explicitely to facilitate searching) + OPENJDK_TARGET_OS="$VAR_OS" + OPENJDK_TARGET_OS_API="$VAR_OS_API" + OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV" + OPENJDK_TARGET_CPU="$VAR_CPU" + OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" + OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" + OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN" @@ -6939,9 +6986,9 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking openjdk-target os-cpu" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking openjdk-target os-cpu" >&5 $as_echo_n "checking openjdk-target os-cpu... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" >&5 $as_echo "$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" >&6; } @@ -6991,168 +7038,174 @@ $as_echo "$as_me: --with-target-bits are set to build platform address size; arg fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking compilation type" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking compilation type" >&5 $as_echo_n "checking compilation type... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMPILE_TYPE" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMPILE_TYPE" >&5 $as_echo "$COMPILE_TYPE" >&6; } - if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - REQUIRED_OS_NAME=SunOS - REQUIRED_OS_VERSION=5.10 - fi - if test "x$OPENJDK_TARGET_OS" = "xlinux"; then - REQUIRED_OS_NAME=Linux - REQUIRED_OS_VERSION=2.6 - fi - if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - REQUIRED_OS_NAME=Windows - if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then - REQUIRED_OS_VERSION=5.2 - else - REQUIRED_OS_VERSION=5.1 - fi - fi - if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - REQUIRED_OS_NAME=Darwin - REQUIRED_OS_VERSION=11.2 - fi - - - - - - # Also store the legacy naming of the cpu. - # Ie i586 and amd64 instead of x86 and x86_64 - OPENJDK_TARGET_CPU_LEGACY="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - OPENJDK_TARGET_CPU_LEGACY="i586" - elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - # On all platforms except MacOSX replace x86_64 with amd64. - OPENJDK_TARGET_CPU_LEGACY="amd64" - fi - - - # And the second legacy naming of the cpu. - # Ie i386 and amd64 instead of x86 and x86_64. - OPENJDK_TARGET_CPU_LEGACY_LIB="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - OPENJDK_TARGET_CPU_LEGACY_LIB="i386" - elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then - OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" - fi - - - # This is the name of the cpu (but using i386 and amd64 instead of - # x86 and x86_64, respectively), preceeded by a /, to be used when - # locating libraries. On macosx, it's empty, though. - OPENJDK_TARGET_CPU_LIBDIR="/$OPENJDK_TARGET_CPU_LEGACY_LIB" - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - OPENJDK_TARGET_CPU_LIBDIR="" - fi - - - # OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to - # /amd64 or /sparcv9. This string is appended to some library paths, like this: - # /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so - OPENJDK_TARGET_CPU_ISADIR="" - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - if test "x$OPENJDK_TARGET_CPU" = xx86_64; then - OPENJDK_TARGET_CPU_ISADIR="/amd64" - elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then - OPENJDK_TARGET_CPU_ISADIR="/sparcv9" - fi - fi - - - # Setup OPENJDK_TARGET_CPU_OSARCH, which is used to set the os.arch Java system property - OPENJDK_TARGET_CPU_OSARCH="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xx86; then - # On linux only, we replace x86 with i386. - OPENJDK_TARGET_CPU_OSARCH="i386" - elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - # On all platforms except macosx, we replace x86_64 with amd64. - OPENJDK_TARGET_CPU_OSARCH="amd64" - fi - - - OPENJDK_TARGET_CPU_JLI="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - OPENJDK_TARGET_CPU_JLI="i386" - elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - # On all platforms except macosx, we replace x86_64 with amd64. - OPENJDK_TARGET_CPU_JLI="amd64" - fi - # Now setup the -D flags for building libjli. - OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - if test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc; then - OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'" - elif test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then - OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'" - fi - fi - - - # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. - if test "x$OPENJDK_TARGET_OS_API" = xposix; then - OPENJDK_TARGET_OS_API_DIR="solaris" - fi - if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then - OPENJDK_TARGET_OS_API_DIR="windows" - fi - - - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - A_LP64="LP64:=" - # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in - # unpack200.exe - if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xmacosx; then - ADD_LP64="-D_LP64=1" - fi - fi - LP64=$A_LP64 - - - if test "x$COMPILE_TYPE" = "xcross"; then - # FIXME: ... or should this include reduced builds..? - DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_TARGET_CPU_LEGACY" + if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then + REQUIRED_OS_NAME=SunOS + REQUIRED_OS_VERSION=5.10 + fi + if test "x$OPENJDK_TARGET_OS" = "xlinux"; then + REQUIRED_OS_NAME=Linux + REQUIRED_OS_VERSION=2.6 + fi + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + REQUIRED_OS_NAME=Windows + if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then + REQUIRED_OS_VERSION=5.2 else - DEFINE_CROSS_COMPILE_ARCH="" + REQUIRED_OS_VERSION=5.1 fi + fi + if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + REQUIRED_OS_NAME=Darwin + REQUIRED_OS_VERSION=11.2 + fi - # ZERO_ARCHDEF is used to enable architecture-specific code - case "${OPENJDK_TARGET_CPU}" in - ppc*) ZERO_ARCHDEF=PPC ;; - s390*) ZERO_ARCHDEF=S390 ;; - sparc*) ZERO_ARCHDEF=SPARC ;; - x86_64*) ZERO_ARCHDEF=AMD64 ;; - x86) ZERO_ARCHDEF=IA32 ;; - *) ZERO_ARCHDEF=$(echo "${OPENJDK_TARGET_CPU_LEGACY_LIB}" | tr a-z A-Z) - esac + # Also store the legacy naming of the cpu. + # Ie i586 and amd64 instead of x86 and x86_64 + OPENJDK_TARGET_CPU_LEGACY="$OPENJDK_TARGET_CPU" + if test "x$OPENJDK_TARGET_CPU" = xx86; then + OPENJDK_TARGET_CPU_LEGACY="i586" + elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then + # On all platforms except MacOSX replace x86_64 with amd64. + OPENJDK_TARGET_CPU_LEGACY="amd64" + fi + + + # And the second legacy naming of the cpu. + # Ie i386 and amd64 instead of x86 and x86_64. + OPENJDK_TARGET_CPU_LEGACY_LIB="$OPENJDK_TARGET_CPU" + if test "x$OPENJDK_TARGET_CPU" = xx86; then + OPENJDK_TARGET_CPU_LEGACY_LIB="i386" + elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then + OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" + fi + + + # This is the name of the cpu (but using i386 and amd64 instead of + # x86 and x86_64, respectively), preceeded by a /, to be used when + # locating libraries. On macosx, it's empty, though. + OPENJDK_TARGET_CPU_LIBDIR="/$OPENJDK_TARGET_CPU_LEGACY_LIB" + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + OPENJDK_TARGET_CPU_LIBDIR="" + fi + + + # OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to + # /amd64 or /sparcv9. This string is appended to some library paths, like this: + # /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so + OPENJDK_TARGET_CPU_ISADIR="" + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + if test "x$OPENJDK_TARGET_CPU" = xx86_64; then + OPENJDK_TARGET_CPU_ISADIR="/amd64" + elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then + OPENJDK_TARGET_CPU_ISADIR="/sparcv9" + fi + fi + + + # Setup OPENJDK_TARGET_CPU_OSARCH, which is used to set the os.arch Java system property + OPENJDK_TARGET_CPU_OSARCH="$OPENJDK_TARGET_CPU" + if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xx86; then + # On linux only, we replace x86 with i386. + OPENJDK_TARGET_CPU_OSARCH="i386" + elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then + # On all platforms except macosx, we replace x86_64 with amd64. + OPENJDK_TARGET_CPU_OSARCH="amd64" + fi + + + OPENJDK_TARGET_CPU_JLI="$OPENJDK_TARGET_CPU" + if test "x$OPENJDK_TARGET_CPU" = xx86; then + OPENJDK_TARGET_CPU_JLI="i386" + elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then + # On all platforms except macosx, we replace x86_64 with amd64. + OPENJDK_TARGET_CPU_JLI="amd64" + fi + # Now setup the -D flags for building libjli. + OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + if test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc; then + OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'" + elif test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then + OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'" + fi + fi + + + # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. + if test "x$OPENJDK_TARGET_OS_API" = xposix; then + OPENJDK_TARGET_OS_API_DIR="solaris" + fi + if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then + OPENJDK_TARGET_OS_API_DIR="windows" + fi + + + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + OPENJDK_TARGET_OS_EXPORT_DIR=macosx + else + OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_API_DIR} + fi + + + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + A_LP64="LP64:=" + # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in + # unpack200.exe + if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xmacosx; then + ADD_LP64="-D_LP64=1" + fi + fi + LP64=$A_LP64 + + + if test "x$COMPILE_TYPE" = "xcross"; then + # FIXME: ... or should this include reduced builds..? + DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_TARGET_CPU_LEGACY" + else + DEFINE_CROSS_COMPILE_ARCH="" + fi + + + # ZERO_ARCHDEF is used to enable architecture-specific code + case "${OPENJDK_TARGET_CPU}" in + ppc*) ZERO_ARCHDEF=PPC ;; + s390*) ZERO_ARCHDEF=S390 ;; + sparc*) ZERO_ARCHDEF=SPARC ;; + x86_64*) ZERO_ARCHDEF=AMD64 ;; + x86) ZERO_ARCHDEF=IA32 ;; + *) ZERO_ARCHDEF=$(echo "${OPENJDK_TARGET_CPU_LEGACY_LIB}" | tr a-z A-Z) + esac + + # Continue setting up basic stuff. Most remaining code require fundamental tools. -# Locate the directory of this script. -SCRIPT="$0" -AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L` + # Locate the directory of this script. + SCRIPT="$0" + AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L` -# Where is the source? It is located two levels above the configure script. -CURDIR="$PWD" -cd "$AUTOCONF_DIR/../.." -SRC_ROOT="`$THEPWDCMD -L`" + # Where is the source? It is located two levels above the configure script. + CURDIR="$PWD" + cd "$AUTOCONF_DIR/../.." + SRC_ROOT="`$THEPWDCMD -L`" -if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - PATH_SEP=";" + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + PATH_SEP=";" SRC_ROOT_LENGTH=`$THEPWDCMD -L|$WC -m` if test $SRC_ROOT_LENGTH -gt 100; then - as_fn_error $? "Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported" "$LINENO" 5 + as_fn_error $? "Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported" "$LINENO" 5 fi if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then @@ -7171,7 +7224,7 @@ $as_echo "$as_me: Your cygwin is too old. You are running $CYGWIN_VERSION, but a as_fn_error $? "Cannot continue" "$LINENO" 5 fi if test "x$CYGPATH" = x; then - as_fn_error $? "Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path" "$LINENO" 5 + as_fn_error $? "Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking cygwin root directory as unix-style path" >&5 $as_echo_n "checking cygwin root directory as unix-style path... " >&6; } @@ -7184,7 +7237,7 @@ $as_echo "$CYGWIN_ROOT_PATH" >&6; } WINDOWS_ENV_ROOT_PATH="$CYGWIN_ROOT_PATH" test_cygdrive_prefix=`$ECHO $CYGWIN_ROOT_PATH | $GREP ^/cygdrive/` if test "x$test_cygdrive_prefix" = x; then - as_fn_error $? "Your cygdrive prefix is not /cygdrive. This is currently not supported. Change with mount -c." "$LINENO" 5 + as_fn_error $? "Your cygdrive prefix is not /cygdrive. This is currently not supported. Change with mount -c." "$LINENO" 5 fi elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking msys release" >&5 @@ -7239,13 +7292,13 @@ $as_echo "unknown" >&6; } $as_echo "$as_me: WARNING: It seems that your find utility is non-standard." >&2;} fi -else - PATH_SEP=":" -fi + else + PATH_SEP=":" + fi -cd "$CURDIR" + cd "$CURDIR" if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then @@ -7492,13 +7545,13 @@ $as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." fi -if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then + if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then # Add extra search paths on solaris for utilities like ar and as etc... PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin" -fi + fi -# You can force the sys-root if the sys-root encoded into the cross compiler tools -# is not correct. + # You can force the sys-root if the sys-root encoded into the cross compiler tools + # is not correct. # Check whether --with-sys-root was given. if test "${with_sys_root+set}" = set; then : @@ -7506,11 +7559,11 @@ if test "${with_sys_root+set}" = set; then : fi -if test "x$with_sys_root" != x; then - SYS_ROOT=$with_sys_root -else - SYS_ROOT=/ -fi + if test "x$with_sys_root" != x; then + SYS_ROOT=$with_sys_root + else + SYS_ROOT=/ + fi @@ -7525,9 +7578,9 @@ fi # Check whether --with-devkit was given. if test "${with_devkit+set}" = set; then : withval=$with_devkit; - if test "x$with_sys_root" != x; then - as_fn_error $? "Cannot specify both --with-devkit and --with-sys-root at the same time" "$LINENO" 5 - fi + if test "x$with_sys_root" != x; then + as_fn_error $? "Cannot specify both --with-devkit and --with-sys-root at the same time" "$LINENO" 5 + fi if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then @@ -7657,20 +7710,20 @@ $as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is inval TOOLS_DIR="$TOOLS_DIR:$with_devkit/bin" fi - if test -d "$with_devkit/$host_alias/libc"; then - SYS_ROOT=$with_devkit/$host_alias/libc - elif test -d "$with_devkit/$host/sys-root"; then - SYS_ROOT=$with_devkit/$host/sys-root - fi + if test -d "$with_devkit/$host_alias/libc"; then + SYS_ROOT=$with_devkit/$host_alias/libc + elif test -d "$with_devkit/$host/sys-root"; then + SYS_ROOT=$with_devkit/$host/sys-root + fi fi -# Setup default logging of stdout and stderr to build.log in the output root. -BUILD_LOG='$(OUTPUT_ROOT)/build.log' -BUILD_LOG_PREVIOUS='$(OUTPUT_ROOT)/build.log.old' -BUILD_LOG_WRAPPER='$(BASH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)' + # Setup default logging of stdout and stderr to build.log in the output root. + BUILD_LOG='$(OUTPUT_ROOT)/build.log' + BUILD_LOG_PREVIOUS='$(OUTPUT_ROOT)/build.log.old' + BUILD_LOG_WRAPPER='$(BASH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)' @@ -7725,18 +7778,18 @@ $as_echo "$as_me: WARNING: No closed source present, --enable-openjdk-only makes # These are needed to be able to create a configuration name (and thus the output directory) -############################################################################### -# -# Check which variant of the JDK that we want to build. -# Currently we have: -# normal: standard edition -# but the custom make system may add other variants -# -# Effectively the JDK variant gives a name to a specific set of -# modules to compile into the JDK. In the future, these modules -# might even be Jigsaw modules. -# -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of the JDK to build" >&5 + ############################################################################### + # + # Check which variant of the JDK that we want to build. + # Currently we have: + # normal: standard edition + # but the custom make system may add other variants + # + # Effectively the JDK variant gives a name to a specific set of + # modules to compile into the JDK. In the future, these modules + # might even be Jigsaw modules. + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of the JDK to build" >&5 $as_echo_n "checking which variant of the JDK to build... " >&6; } # Check whether --with-jdk-variant was given. @@ -7745,31 +7798,31 @@ if test "${with_jdk_variant+set}" = set; then : fi -if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then + if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then JDK_VARIANT="normal" -else + else as_fn_error $? "The available JDK variants are: normal" "$LINENO" 5 -fi + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $JDK_VARIANT" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JDK_VARIANT" >&5 $as_echo "$JDK_VARIANT" >&6; } -############################################################################### -# -# Check which variants of the JVM that we want to build. -# 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which variants of the JVM to build" >&5 + ############################################################################### + # + # Check which variants of the JVM that we want to build. + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variants of the JVM to build" >&5 $as_echo_n "checking which variants of the JVM to build... " >&6; } # Check whether --with-jvm-variants was given. @@ -7778,50 +7831,50 @@ if test "${with_jvm_variants+set}" = set; then : fi -if test "x$with_jvm_variants" = x; then - with_jvm_variants="server" -fi + 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/minimal1,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'` + JVM_VARIANTS=",$with_jvm_variants," + 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, minimal1, kernel, zero, zeroshark" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_jvm_variants" >&5 + if test "x$TEST_VARIANTS" != "x,"; then + 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'` + 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'` -if test "x$JVM_VARIANT_CLIENT" = xtrue; then + if test "x$JVM_VARIANT_CLIENT" = xtrue; then if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - as_fn_error $? "You cannot build a client JVM for a 64-bit machine." "$LINENO" 5 + as_fn_error $? "You cannot build a client JVM for a 64-bit machine." "$LINENO" 5 fi -fi -if test "x$JVM_VARIANT_KERNEL" = xtrue; then + fi + if test "x$JVM_VARIANT_KERNEL" = xtrue; then if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - as_fn_error $? "You cannot build a kernel JVM for a 64-bit machine." "$LINENO" 5 + 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 + 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 + as_fn_error $? "You cannot build a minimal JVM for a 64-bit machine." "$LINENO" 5 fi -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/minimal1,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/'` -if test "x$COUNT_VARIANTS" != "x,1"; then + # 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/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 + else BUILDING_MULTIPLE_JVM_VARIANTS=no -fi + fi @@ -7831,34 +7884,33 @@ fi -INCLUDE_SA=true -if test "x$JVM_VARIANT_ZERO" = xtrue ; then + INCLUDE_SA=true + if test "x$JVM_VARIANT_ZERO" = xtrue ; then INCLUDE_SA=false -fi -if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then + fi + if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then INCLUDE_SA=false -fi + fi -if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - MACOSX_UNIVERSAL="true" -fi + if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + MACOSX_UNIVERSAL="true" + fi - -############################################################################### -# -# Set the debug level -# release: no debug information, all optimizations, no asserts. -# fastdebug: debug information (-g), all optimizations, all asserts -# slowdebug: debug information (-g), no optimizations, all asserts -# -DEBUG_LEVEL="release" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which debug level to use" >&5 + ############################################################################### + # + # Set the debug level + # release: no debug information, all optimizations, no asserts. + # fastdebug: debug information (-g), all optimizations, all asserts + # slowdebug: debug information (-g), no optimizations, all asserts + # + DEBUG_LEVEL="release" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which debug level to use" >&5 $as_echo_n "checking which debug level to use... " >&6; } -# Check whether --enable-debug was given. + # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; ENABLE_DEBUG="${enableval}" @@ -7875,96 +7927,96 @@ if test "${with_debug_level+set}" = set; then : withval=$with_debug_level; DEBUG_LEVEL="${withval}" if test "x$ENABLE_DEBUG" = xyes; then - as_fn_error $? "You cannot use both --enable-debug and --with-debug-level at the same time." "$LINENO" 5 + as_fn_error $? "You cannot use both --enable-debug and --with-debug-level at the same time." "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEBUG_LEVEL" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEBUG_LEVEL" >&5 $as_echo "$DEBUG_LEVEL" >&6; } -if test "x$DEBUG_LEVEL" != xrelease && \ - test "x$DEBUG_LEVEL" != xfastdebug && \ - test "x$DEBUG_LEVEL" != xslowdebug; then - as_fn_error $? "Allowed debug levels are: release, fastdebug and slowdebug" "$LINENO" 5 -fi + if test "x$DEBUG_LEVEL" != xrelease && \ + test "x$DEBUG_LEVEL" != xfastdebug && \ + test "x$DEBUG_LEVEL" != xslowdebug; then + as_fn_error $? "Allowed debug levels are: release, fastdebug and slowdebug" "$LINENO" 5 + fi -############################################################################### -# -# Setup legacy vars/targets and new vars to deal with different debug levels. -# + ############################################################################### + # + # Setup legacy vars/targets and new vars to deal with different debug levels. + # -case $DEBUG_LEVEL in - release ) - VARIANT="OPT" - FASTDEBUG="false" - DEBUG_CLASSFILES="false" - BUILD_VARIANT_RELEASE="" - HOTSPOT_DEBUG_LEVEL="product" - HOTSPOT_EXPORT="product" - ;; - fastdebug ) - VARIANT="DBG" - FASTDEBUG="true" - DEBUG_CLASSFILES="true" - BUILD_VARIANT_RELEASE="-fastdebug" - HOTSPOT_DEBUG_LEVEL="fastdebug" - HOTSPOT_EXPORT="fastdebug" - ;; - slowdebug ) - VARIANT="DBG" - FASTDEBUG="false" - DEBUG_CLASSFILES="true" - BUILD_VARIANT_RELEASE="-debug" - HOTSPOT_DEBUG_LEVEL="jvmg" - HOTSPOT_EXPORT="debug" - ;; -esac + case $DEBUG_LEVEL in + release ) + VARIANT="OPT" + FASTDEBUG="false" + DEBUG_CLASSFILES="false" + BUILD_VARIANT_RELEASE="" + HOTSPOT_DEBUG_LEVEL="product" + HOTSPOT_EXPORT="product" + ;; + fastdebug ) + VARIANT="DBG" + FASTDEBUG="true" + DEBUG_CLASSFILES="true" + BUILD_VARIANT_RELEASE="-fastdebug" + HOTSPOT_DEBUG_LEVEL="fastdebug" + HOTSPOT_EXPORT="fastdebug" + ;; + slowdebug ) + VARIANT="DBG" + FASTDEBUG="false" + DEBUG_CLASSFILES="true" + BUILD_VARIANT_RELEASE="-debug" + HOTSPOT_DEBUG_LEVEL="jvmg" + HOTSPOT_EXPORT="debug" + ;; + esac -##### -# 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="" + ##### + # 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 + if test "x$JVM_VARIANT_SERVER" = xtrue; then HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} " -fi + fi -if test "x$JVM_VARIANT_CLIENT" = xtrue; then + if test "x$JVM_VARIANT_CLIENT" = xtrue; then HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 " -fi + fi -if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then + if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 " -fi + fi -if test "x$JVM_VARIANT_KERNEL" = xtrue; then + if test "x$JVM_VARIANT_KERNEL" = xtrue; then HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel " -fi + fi -if test "x$JVM_VARIANT_ZERO" = xtrue; then + if test "x$JVM_VARIANT_ZERO" = xtrue; then HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero " -fi + fi -if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then + if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark " -fi + fi -HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT" + HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT" -# On Macosx universal binaries are produced, but they only contain -# 64 bit intel. This invalidates control of which jvms are built -# from configure, but only server is valid anyway. Fix this -# when hotspot makefiles are rewritten. -if test "x$MACOSX_UNIVERSAL" = xtrue; then + # On Macosx universal binaries are produced, but they only contain + # 64 bit intel. This invalidates control of which jvms are built + # from configure, but only server is valid anyway. Fix this + # when hotspot makefiles are rewritten. + if test "x$MACOSX_UNIVERSAL" = xtrue; then HOTSPOT_TARGET=universal_${HOTSPOT_EXPORT} -fi + fi -##### + ##### @@ -7987,27 +8039,27 @@ if test "${with_conf_name+set}" = set; then : fi -# Test from where we are running configure, in or outside of src root. -if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \ - || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \ - || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then + # Test from where we are running configure, in or outside of src root. + if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \ + || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \ + || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then # We are running configure from the src root. # Create a default ./build/target-variant-debuglevel output root. if test "x${CONF_NAME}" = x; then - CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}" + CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}" fi OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}" $MKDIR -p "$OUTPUT_ROOT" if test ! -d "$OUTPUT_ROOT"; then - as_fn_error $? "Could not create build directory $OUTPUT_ROOT" "$LINENO" 5 + as_fn_error $? "Could not create build directory $OUTPUT_ROOT" "$LINENO" 5 fi -else + else # We are running configure from outside of the src dir. # Then use the current directory as output dir! # If configuration is situated in normal build directory, just use the build # directory name as configuration name, otherwise use the complete path. if test "x${CONF_NAME}" = x; then - CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"` + CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"` fi OUTPUT_ROOT="$CURDIR" @@ -8021,7 +8073,7 @@ else # Configure has already touched config.log and confdefs.h in the current dir when this check # is performed. filtered_files=`$ECHO "$files_present" | $SED -e 's/config.log//g' -e 's/confdefs.h//g' -e 's/ //g' \ - | $TR -d '\n'` + | $TR -d '\n'` if test "x$filtered_files" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Current directory is $CURDIR." >&5 $as_echo "$as_me: Current directory is $CURDIR." >&6;} @@ -8040,10 +8092,10 @@ $as_echo "$as_me: (or create a new empty directory and cd to it)." >&6;} as_fn_error $? "Will not continue creating configuration in $CURDIR" "$LINENO" 5 fi fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what configuration name to use" >&5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking what configuration name to use" >&5 $as_echo_n "checking what configuration name to use... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONF_NAME" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONF_NAME" >&5 $as_echo "$CONF_NAME" >&6; } @@ -8169,44 +8221,44 @@ $as_echo "$as_me: The path of OUTPUT_ROOT, which resolves as \"$path\", is inval fi -SPEC=$OUTPUT_ROOT/spec.gmk + SPEC=$OUTPUT_ROOT/spec.gmk -CONF_NAME=$CONF_NAME + CONF_NAME=$CONF_NAME -OUTPUT_ROOT=$OUTPUT_ROOT + OUTPUT_ROOT=$OUTPUT_ROOT -# Most of the probed defines are put into config.h -ac_config_headers="$ac_config_headers $OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in" + # Most of the probed defines are put into config.h + ac_config_headers="$ac_config_headers $OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in" -# The spec.gmk file contains all variables for the make system. -ac_config_files="$ac_config_files $OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in" + # The spec.gmk file contains all variables for the make system. + ac_config_files="$ac_config_files $OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in" -# The hotspot-spec.gmk file contains legacy variables for the hotspot make system. -ac_config_files="$ac_config_files $OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in" + # The hotspot-spec.gmk file contains legacy variables for the hotspot make system. + ac_config_files="$ac_config_files $OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in" -# The bootcycle-spec.gmk file contains support for boot cycle builds. -ac_config_files="$ac_config_files $OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in" + # The bootcycle-spec.gmk file contains support for boot cycle builds. + ac_config_files="$ac_config_files $OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in" -# The compare.sh is used to compare the build output to other builds. -ac_config_files="$ac_config_files $OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in" + # The compare.sh is used to compare the build output to other builds. + ac_config_files="$ac_config_files $OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in" -# Spec.sh is currently used by compare-objects.sh -ac_config_files="$ac_config_files $OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in" + # Spec.sh is currently used by compare-objects.sh + ac_config_files="$ac_config_files $OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in" -# The generated Makefile knows where the spec.gmk is and where the source is. -# You can run make from the OUTPUT_ROOT, or from the top-level Makefile -# which will look for generated configurations -ac_config_files="$ac_config_files $OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in" + # The generated Makefile knows where the spec.gmk is and where the source is. + # You can run make from the OUTPUT_ROOT, or from the top-level Makefile + # which will look for generated configurations + ac_config_files="$ac_config_files $OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in" -# Save the arguments given to us -echo "$CONFIGURE_COMMAND_LINE" > $OUTPUT_ROOT/configure-arguments + # Save the arguments given to us + echo "$CONFIGURE_COMMAND_LINE" > $OUTPUT_ROOT/configure-arguments # Must be done before we can call HELP_MSG_MISSING_DEPENDENCY. - for ac_prog in apt-get yum port pkgutil pkgadd + for ac_prog in apt-get yum port pkgutil pkgadd do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -8271,7 +8323,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -8314,8 +8366,8 @@ $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -8330,8 +8382,8 @@ $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -8359,9 +8411,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} @@ -8537,29 +8589,29 @@ $as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + 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 - 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 @@ -8628,7 +8680,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -8671,8 +8723,8 @@ $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -8687,8 +8739,8 @@ $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -8716,9 +8768,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} @@ -8894,29 +8946,29 @@ $as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + 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 - 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 @@ -8982,7 +9034,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -9025,8 +9077,8 @@ $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -9041,8 +9093,8 @@ $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -9070,9 +9122,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} @@ -9248,29 +9300,29 @@ $as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + 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 - 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 @@ -9341,7 +9393,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -9384,8 +9436,8 @@ $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -9400,8 +9452,8 @@ $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -9429,9 +9481,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} @@ -9607,29 +9659,29 @@ $as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + 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 - 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 @@ -9694,7 +9746,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -9737,8 +9789,8 @@ $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -9753,8 +9805,8 @@ $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -9782,9 +9834,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} @@ -9960,29 +10012,29 @@ $as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + 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 - 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 @@ -10006,34 +10058,34 @@ $as_echo "$as_me: Using GNU make 3.81 (or later) at $FOUND_MAKE (version: $MAKE_ - # Test if find supports -delete - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if find supports -delete" >&5 + # Test if find supports -delete + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if find supports -delete" >&5 $as_echo_n "checking if find supports -delete... " >&6; } - FIND_DELETE="-delete" + FIND_DELETE="-delete" - DELETEDIR=`$MKTEMP -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?) + DELETEDIR=`$MKTEMP -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?) - echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete + echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete - TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1` - if test -f $DELETEDIR/TestIfFindSupportsDelete; then - # No, it does not. - rm $DELETEDIR/TestIfFindSupportsDelete - FIND_DELETE="-exec rm \{\} \+" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1` + if test -f $DELETEDIR/TestIfFindSupportsDelete; then + # No, it does not. + rm $DELETEDIR/TestIfFindSupportsDelete + FIND_DELETE="-exec rm \{\} \+" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - fi - rmdir $DELETEDIR + fi + rmdir $DELETEDIR -# These tools might not be installed by default, -# need hint on how to install them. + # These tools might not be installed by default, + # need hint on how to install them. - for ac_prog in unzip + for ac_prog in unzip do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -10079,20 +10131,20 @@ fi done - if test "x$UNZIP" = x; then - if test "xunzip" = x; then - PROG_NAME=unzip - else - PROG_NAME=unzip - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$UNZIP" = x; then + if test "xunzip" = x; then + PROG_NAME=unzip + else + PROG_NAME=unzip fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - for ac_prog in zip + for ac_prog in zip do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -10138,22 +10190,22 @@ fi done - if test "x$ZIP" = x; then - if test "xzip" = x; then - PROG_NAME=zip - else - PROG_NAME=zip - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$ZIP" = x; then + if test "xzip" = x; then + PROG_NAME=zip + else + PROG_NAME=zip fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi -# Non-required basic tools + # Non-required basic tools -# Extract the first word of "ldd", so it can be a program name with args. + # Extract the first word of "ldd", so it can be a program name with args. 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; } @@ -10193,13 +10245,13 @@ $as_echo "no" >&6; } fi -if test "x$LDD" = "x"; then + if test "x$LDD" = "x"; then # List shared lib dependencies is used for # debug output and checking for forbidden dependencies. # We can build without it. LDD="true" -fi -# Extract the first word of "otool", so it can be a program name with args. + fi + # Extract the first word of "otool", so it can be a program name with args. 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; } @@ -10239,10 +10291,10 @@ $as_echo "no" >&6; } fi -if test "x$OTOOL" = "x"; then - OTOOL="true" -fi -for ac_prog in readelf greadelf + if test "x$OTOOL" = "x"; then + OTOOL="true" + fi + for ac_prog in readelf greadelf do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -10287,7 +10339,7 @@ fi test -n "$READELF" && break done -# Extract the first word of "hg", so it can be a program name with args. + # Extract the first word of "hg", so it can be a program name with args. 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; } @@ -10327,7 +10379,7 @@ $as_echo "no" >&6; } fi -# Extract the first word of "stat", so it can be a program name with args. + # Extract the first word of "stat", so it can be a program name with args. 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; } @@ -10367,7 +10419,7 @@ $as_echo "no" >&6; } fi -# Extract the first word of "time", so it can be a program name with args. + # Extract the first word of "time", so it can be a program name with args. 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; } @@ -10407,18 +10459,18 @@ $as_echo "no" >&6; } fi -# Check if it's GNU time -IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'` -if test "x$IS_GNU_TIME" != x; then - IS_GNU_TIME=yes -else - IS_GNU_TIME=no -fi + # Check if it's GNU time + IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'` + if test "x$IS_GNU_TIME" != x; then + IS_GNU_TIME=yes + else + IS_GNU_TIME=no + fi -if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - for ac_prog in comm + for ac_prog in comm do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -10464,23 +10516,82 @@ fi done - if test "x$COMM" = x; then - if test "xcomm" = x; then - PROG_NAME=comm - else - PROG_NAME=comm - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$COMM" = x; then + if test "xcomm" = x; then + PROG_NAME=comm + else + PROG_NAME=comm fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + fi + + if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + + for ac_prog in dsymutil +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $DSYMUTIL in + [\\/]* | ?:[\\/]*) + ac_cv_path_DSYMUTIL="$DSYMUTIL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DSYMUTIL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DSYMUTIL=$ac_cv_path_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - for ac_prog in xattr + test -n "$DSYMUTIL" && break +done + + + if test "x$DSYMUTIL" = x; then + if test "xdsymutil" = x; then + PROG_NAME=dsymutil + else + PROG_NAME=dsymutil + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + + + + for ac_prog in xattr do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -10526,19 +10637,19 @@ fi done - if test "x$XATTR" = x; then - if test "xxattr" = x; then - PROG_NAME=xattr - else - PROG_NAME=xattr - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$XATTR" = x; then + if test "xxattr" = x; then + PROG_NAME=xattr + else + PROG_NAME=xattr fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi - # Extract the first word of "codesign", so it can be a program name with args. + # Extract the first word of "codesign", so it can be a program name with args. set dummy codesign; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } @@ -10578,23 +10689,23 @@ $as_echo "no" >&6; } fi - if test "x$CODESIGN" != "x"; then - # Verify that the openjdk_codesign certificate is present - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if openjdk_codesign certificate is present" >&5 + if test "x$CODESIGN" != "x"; then + # Verify that the openjdk_codesign certificate is present + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if openjdk_codesign certificate is present" >&5 $as_echo_n "checking if openjdk_codesign certificate is present... " >&6; } - rm -f codesign-testfile - touch codesign-testfile - codesign -s openjdk_codesign codesign-testfile 2>&5 >&5 || CODESIGN= - rm -f codesign-testfile - if test "x$CODESIGN" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + rm -f codesign-testfile + touch codesign-testfile + codesign -s openjdk_codesign codesign-testfile 2>&5 >&5 || CODESIGN= + rm -f codesign-testfile + if test "x$CODESIGN" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } + fi fi fi -fi # Check if pkg-config is available. @@ -10717,14 +10828,14 @@ fi # After basic tools have been setup, we can check build os specific details. -############################################################################### + ############################################################################### -# Note that this is the build platform OS version! + # Note that this is the build platform OS version! -OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`" -OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`" -OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`" -OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`" + OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`" + OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`" + OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`" + OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`" @@ -10766,57 +10877,57 @@ fi - if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then - if test "x$with_builddeps_conf" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for supplied builddeps configuration file" >&5 + if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then + if test "x$with_builddeps_conf" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for supplied builddeps configuration file" >&5 $as_echo_n "checking for supplied builddeps configuration file... " >&6; } - builddepsfile=$with_builddeps_conf - if test -s $builddepsfile; then - . $builddepsfile - { $as_echo "$as_me:${as_lineno-$LINENO}: result: loaded!" >&5 + builddepsfile=$with_builddeps_conf + if test -s $builddepsfile; then + . $builddepsfile + { $as_echo "$as_me:${as_lineno-$LINENO}: result: loaded!" >&5 $as_echo "loaded!" >&6; } - else - as_fn_error $? "The given builddeps conf file $with_builddeps_conf could not be loaded!" "$LINENO" 5 - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builddeps.conf files in sources..." >&5 + else + as_fn_error $? "The given builddeps conf file $with_builddeps_conf could not be loaded!" "$LINENO" 5 + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builddeps.conf files in sources..." >&5 $as_echo_n "checking for builddeps.conf files in sources...... " >&6; } - builddepsfile=`mktemp` - touch $builddepsfile - # Put all found confs into a single file. - find ${SRC_ROOT} -name builddeps.conf -exec cat \{\} \; >> $builddepsfile - # Source the file to acquire the variables - if test -s $builddepsfile; then - . $builddepsfile - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found at least one!" >&5 + builddepsfile=`mktemp` + touch $builddepsfile + # Put all found confs into a single file. + find ${SRC_ROOT} -name builddeps.conf -exec cat \{\} \; >> $builddepsfile + # Source the file to acquire the variables + if test -s $builddepsfile; then + . $builddepsfile + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found at least one!" >&5 $as_echo "found at least one!" >&6; } - else - as_fn_error $? "Could not find any builddeps.conf at all!" "$LINENO" 5 - fi - fi - # Create build and target names that use _ instead of "-" and ".". - # This is necessary to use them in variable names. - build_var=`echo ${OPENJDK_BUILD_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'` - target_var=`echo ${OPENJDK_TARGET_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'` - # Extract rewrite information for build and target - eval rewritten_build=\${REWRITE_${build_var}} - if test "x$rewritten_build" = x; then - rewritten_build=${OPENJDK_BUILD_AUTOCONF_NAME} - echo Build stays the same $rewritten_build - else - echo Rewriting build for builddeps into $rewritten_build - fi - eval rewritten_target=\${REWRITE_${target_var}} - if test "x$rewritten_target" = x; then - rewritten_target=${OPENJDK_TARGET_AUTOCONF_NAME} - echo Target stays the same $rewritten_target - else - echo Rewriting target for builddeps into $rewritten_target - fi - rewritten_build_var=`echo ${rewritten_build} | tr '-' '_' | tr '.' '_'` - rewritten_target_var=`echo ${rewritten_target} | tr '-' '_' | tr '.' '_'` + else + as_fn_error $? "Could not find any builddeps.conf at all!" "$LINENO" 5 + fi fi - for ac_prog in 7z unzip + # Create build and target names that use _ instead of "-" and ".". + # This is necessary to use them in variable names. + build_var=`echo ${OPENJDK_BUILD_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'` + target_var=`echo ${OPENJDK_TARGET_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'` + # Extract rewrite information for build and target + eval rewritten_build=\${REWRITE_${build_var}} + if test "x$rewritten_build" = x; then + rewritten_build=${OPENJDK_BUILD_AUTOCONF_NAME} + echo Build stays the same $rewritten_build + else + echo Rewriting build for builddeps into $rewritten_build + fi + eval rewritten_target=\${REWRITE_${target_var}} + if test "x$rewritten_target" = x; then + rewritten_target=${OPENJDK_TARGET_AUTOCONF_NAME} + echo Target stays the same $rewritten_target + else + echo Rewriting target for builddeps into $rewritten_target + fi + rewritten_build_var=`echo ${rewritten_build} | tr '-' '_' | tr '.' '_'` + rewritten_target_var=`echo ${rewritten_target} | tr '-' '_' | tr '.' '_'` + fi + for ac_prog in 7z unzip do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -10858,11 +10969,11 @@ fi test -n "$BDEPS_UNZIP" && break done - if test "x$BDEPS_UNZIP" = x7z; then - BDEPS_UNZIP="7z x" - fi + if test "x$BDEPS_UNZIP" = x7z; then + BDEPS_UNZIP="7z x" + fi - for ac_prog in wget lftp ftp + for ac_prog in wget lftp ftp do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -10915,14 +11026,14 @@ done # We need build & target for this. -############################################################################### -# -# Should we build a JDK/JVM with headful support (ie a graphical ui)? -# We always build headless support. -# -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking headful support" >&5 + ############################################################################### + # + # Should we build a JDK/JVM with headful support (ie a graphical ui)? + # We always build headless support. + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking headful support" >&5 $as_echo_n "checking headful support... " >&6; } -# Check whether --enable-headful was given. + # Check whether --enable-headful was given. if test "${enable_headful+set}" = set; then : enableval=$enable_headful; SUPPORT_HEADFUL=${enable_headful} else @@ -10930,110 +11041,110 @@ else fi -SUPPORT_HEADLESS=yes -BUILD_HEADLESS="BUILD_HEADLESS:=true" + SUPPORT_HEADLESS=yes + BUILD_HEADLESS="BUILD_HEADLESS:=true" -if test "x$SUPPORT_HEADFUL" = xyes; then + if test "x$SUPPORT_HEADFUL" = xyes; then # We are building both headful and headless. - headful_msg="inlude support for both headful and headless" -fi + headful_msg="include support for both headful and headless" + fi -if test "x$SUPPORT_HEADFUL" = xno; then + if test "x$SUPPORT_HEADFUL" = xno; then # Thus we are building headless only. BUILD_HEADLESS="BUILD_HEADLESS:=true" headful_msg="headless only" -fi + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $headful_msg" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $headful_msg" >&5 $as_echo "$headful_msg" >&6; } -# Control wether Hotspot runs Queens test after build. -# Check whether --enable-hotspot-test-in-build was given. + # Control wether Hotspot runs Queens test after build. + # Check whether --enable-hotspot-test-in-build was given. if test "${enable_hotspot_test_in_build+set}" = set; then : enableval=$enable_hotspot_test_in_build; else enable_hotspot_test_in_build=no fi -if test "x$enable_hotspot_test_in_build" = "xyes"; then + if test "x$enable_hotspot_test_in_build" = "xyes"; then TEST_IN_BUILD=true -else + else TEST_IN_BUILD=false -fi + fi -############################################################################### -# -# Choose cacerts source file -# + ############################################################################### + # + # Choose cacerts source file + # # Check whether --with-cacerts-file was given. if test "${with_cacerts_file+set}" = set; then : withval=$with_cacerts_file; fi -if test "x$with_cacerts_file" != x; then + if test "x$with_cacerts_file" != x; then CACERTS_FILE=$with_cacerts_file -else + else CACERTS_FILE=${SRC_ROOT}/jdk/src/share/lib/security/cacerts -fi + fi -############################################################################### -# -# Enable or disable unlimited crypto -# -# Check whether --enable-unlimited-crypto was given. + ############################################################################### + # + # Enable or disable unlimited crypto + # + # Check whether --enable-unlimited-crypto was given. if test "${enable_unlimited_crypto+set}" = set; then : enableval=$enable_unlimited_crypto; else enable_unlimited_crypto=no fi -if test "x$enable_unlimited_crypto" = "xyes"; then + if test "x$enable_unlimited_crypto" = "xyes"; then UNLIMITED_CRYPTO=true -else + else UNLIMITED_CRYPTO=false -fi + fi -############################################################################### -# -# Enable or disable the elliptic curve crypto implementation -# + ############################################################################### + # + # Enable or disable the elliptic curve crypto implementation + # -############################################################################### -# -# Compress jars -# -COMPRESS_JARS=false + ############################################################################### + # + # Compress jars + # + COMPRESS_JARS=false -# Source the version numbers -. $AUTOCONF_DIR/version-numbers + # Source the version numbers + . $AUTOCONF_DIR/version-numbers -# Get the settings from parameters + # Get the settings from parameters # Check whether --with-milestone was given. if test "${with_milestone+set}" = set; then : withval=$with_milestone; fi -if test "x$with_milestone" = xyes; then - as_fn_error $? "Milestone must have a value" "$LINENO" 5 -elif test "x$with_milestone" != x; then + if test "x$with_milestone" = xyes; then + as_fn_error $? "Milestone must have a value" "$LINENO" 5 + elif test "x$with_milestone" != x; then MILESTONE="$with_milestone" -fi -if test "x$MILESTONE" = x; then - MILESTONE=internal -fi + fi + if test "x$MILESTONE" = x; then + MILESTONE=internal + fi # Check whether --with-update-version was given. @@ -11041,26 +11152,11 @@ if test "${with_update_version+set}" = set; then : withval=$with_update_version; fi -if test "x$with_update_version" = xyes; then - as_fn_error $? "Update version must have a value" "$LINENO" 5 -elif test "x$with_update_version" != x; then - JDK_UPDATE_VERSION="$with_update_version" -fi - - -# Check whether --with-build-number was given. -if test "${with_build_number+set}" = set; then : - withval=$with_build_number; -fi - -if test "x$with_build_number" = xyes; then - as_fn_error $? "Build number must have a value" "$LINENO" 5 -elif test "x$with_build_number" != x; then - JDK_BUILD_NUMBER="$with_build_number" -fi -if test "x$JDK_BUILD_NUMBER" = x; then - JDK_BUILD_NUMBER=b00 -fi + if test "x$with_update_version" = xyes; then + as_fn_error $? "Update version must have a value" "$LINENO" 5 + elif test "x$with_update_version" != x; then + JDK_UPDATE_VERSION="$with_update_version" + fi # Check whether --with-user-release-suffix was given. @@ -11068,19 +11164,35 @@ if test "${with_user_release_suffix+set}" = set; then : withval=$with_user_release_suffix; fi -if test "x$with_user_release_suffix" = xyes; then - as_fn_error $? "Release suffix must have a value" "$LINENO" 5 -elif test "x$with_user_release_suffix" != x; then - USER_RELEASE_SUFFIX="$with_user_release_suffix" -else - BUILD_DATE=`date '+%Y_%m_%d_%H_%M'` - # Avoid [:alnum:] since it depends on the locale. - CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'` - USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + if test "x$with_user_release_suffix" = xyes; then + as_fn_error $? "Release suffix must have a value" "$LINENO" 5 + elif test "x$with_user_release_suffix" != x; then + USER_RELEASE_SUFFIX="$with_user_release_suffix" + fi + + +# Check whether --with-build-number was given. +if test "${with_build_number+set}" = set; then : + withval=$with_build_number; fi + if test "x$with_build_number" = xyes; then + as_fn_error $? "Build number must have a value" "$LINENO" 5 + elif test "x$with_build_number" != x; then + JDK_BUILD_NUMBER="$with_build_number" + fi + # Define default USER_RELEASE_SUFFIX if BUILD_NUMBER and USER_RELEASE_SUFFIX are not set + if test "x$JDK_BUILD_NUMBER" = x; then + JDK_BUILD_NUMBER=b00 + if test "x$USER_RELEASE_SUFFIX" = x; then + BUILD_DATE=`date '+%Y_%m_%d_%H_%M'` + # Avoid [:alnum:] since it depends on the locale. + CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'` + USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + fi -# Now set the JDK version, milestone, build number etc. + # Now set the JDK version, milestone, build number etc. @@ -11095,17 +11207,18 @@ fi -COPYRIGHT_YEAR=`date +'%Y'` + + COPYRIGHT_YEAR=`date +'%Y'` -if test "x$JDK_UPDATE_VERSION" != x; then - JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}_${JDK_UPDATE_VERSION}" -else - JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}" -fi + if test "x$JDK_UPDATE_VERSION" != x; then + JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}_${JDK_UPDATE_VERSION}" + else + JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}" + fi -COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'` + COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'` @@ -11116,7 +11229,7 @@ COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'` ############################################################################### -BOOT_JDK_FOUND=no + BOOT_JDK_FOUND=no # Check whether --with-boot-jdk was given. if test "${with_boot_jdk+set}" = set; then : @@ -11124,22 +11237,22 @@ if test "${with_boot_jdk+set}" = set; then : fi -# We look for the Boot JDK through various means, going from more certain to -# more of a guess-work. After each test, BOOT_JDK_FOUND is set to "yes" if -# we detected something (if so, the path to the jdk is in BOOT_JDK). But we -# must check if this is indeed valid; otherwise we'll continue looking. + # We look for the Boot JDK through various means, going from more certain to + # more of a guess-work. After each test, BOOT_JDK_FOUND is set to "yes" if + # we detected something (if so, the path to the jdk is in BOOT_JDK). But we + # must check if this is indeed valid; otherwise we'll continue looking. -# Test: Is bootjdk explicitely set by command line arguments? + # Test: Is bootjdk explicitely set by command line arguments? if test "x$BOOT_JDK_FOUND" = xno; then # Now execute the test -if test "x$with_boot_jdk" != x; then + if test "x$with_boot_jdk" != x; then BOOT_JDK=$with_boot_jdk BOOT_JDK_FOUND=maybe { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using configure arguments" >&5 $as_echo "$as_me: Found potential Boot JDK using configure arguments" >&6;} -fi + fi # If previous step claimed to have found a JDK, check it to see if it seems to be valid. @@ -11316,161 +11429,161 @@ $as_echo "$BOOT_JDK_VERSION" >&6; } fi # end check boot jdk found fi -if test "x$with_boot_jdk" != x && test "x$BOOT_JDK_FOUND" = xno; then - # Having specified an argument which is incorrect will produce an instant failure; - # we should not go on looking - as_fn_error $? "The path given by --with-boot-jdk does not contain a valid Boot JDK" "$LINENO" 5 -fi + if test "x$with_boot_jdk" != x && test "x$BOOT_JDK_FOUND" = xno; then + # Having specified an argument which is incorrect will produce an instant failure; + # we should not go on looking + as_fn_error $? "The path given by --with-boot-jdk does not contain a valid Boot JDK" "$LINENO" 5 + fi -# Test: Is bootjdk available from builddeps? + # Test: Is bootjdk available from builddeps? if test "x$BOOT_JDK_FOUND" = xno; then # Now execute the test - if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then - # Source the builddeps file again, to make sure it uses the latest variables! - . $builddepsfile - # Look for a target and build machine specific resource! - eval resource=\${builddep_bootjdk_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}} - if test "x$resource" = x; then - # Ok, lets instead look for a target specific resource - eval resource=\${builddep_bootjdk_TARGET_${rewritten_target_var}} - fi - if test "x$resource" = x; then - # Ok, lets instead look for a build specific resource - eval resource=\${builddep_bootjdk_BUILD_${rewritten_build_var}} - fi - if test "x$resource" = x; then - # Ok, lets instead look for a generic resource - # (The bootjdk comes from M4 and not the shell, thus no need for eval here.) - resource=${builddep_bootjdk} - fi - if test "x$resource" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for bootjdk" >&5 + if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then + # Source the builddeps file again, to make sure it uses the latest variables! + . $builddepsfile + # Look for a target and build machine specific resource! + eval resource=\${builddep_bootjdk_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}} + if test "x$resource" = x; then + # Ok, lets instead look for a target specific resource + eval resource=\${builddep_bootjdk_TARGET_${rewritten_target_var}} + fi + if test "x$resource" = x; then + # Ok, lets instead look for a build specific resource + eval resource=\${builddep_bootjdk_BUILD_${rewritten_build_var}} + fi + if test "x$resource" = x; then + # Ok, lets instead look for a generic resource + # (The bootjdk comes from M4 and not the shell, thus no need for eval here.) + resource=${builddep_bootjdk} + fi + if test "x$resource" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for bootjdk" >&5 $as_echo "$as_me: Using builddeps $resource for bootjdk" >&6;} - # If the resource in the builddeps.conf file is an existing directory, - # for example /java/linux/cups - if test -d ${resource}; then - depdir=${resource} - else + # If the resource in the builddeps.conf file is an existing directory, + # for example /java/linux/cups + if test -d ${resource}; then + depdir=${resource} + else -# bootjdk is for example mymodule -# $resource is for example libs/general/libmymod_1_2_3.zip -# $with_builddeps_server is for example ftp://mybuilddeps.myserver.com/builddeps -# $with_builddeps_dir is for example /localhome/builddeps -# depdir is the name of the variable into which we store the depdir, eg MYMOD -# Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and -# unzip into the directory: /localhome/builddeps/libmymod_1_2_3 - filename=`basename $resource` - filebase=`echo $filename | sed 's/\.[^\.]*$//'` - filebase=${filename%%.*} - extension=${filename#*.} - installdir=$with_builddeps_dir/$filebase - if test ! -f $installdir/$filename.unpacked; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency bootjdk from $with_builddeps_server/$resource and installing into $installdir" >&5 + # bootjdk is for example mymodule + # $resource is for example libs/general/libmymod_1_2_3.zip + # $with_builddeps_server is for example ftp://mybuilddeps.myserver.com/builddeps + # $with_builddeps_dir is for example /localhome/builddeps + # depdir is the name of the variable into which we store the depdir, eg MYMOD + # Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and + # unzip into the directory: /localhome/builddeps/libmymod_1_2_3 + filename=`basename $resource` + filebase=`echo $filename | sed 's/\.[^\.]*$//'` + filebase=${filename%%.*} + extension=${filename#*.} + installdir=$with_builddeps_dir/$filebase + if test ! -f $installdir/$filename.unpacked; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency bootjdk from $with_builddeps_server/$resource and installing into $installdir" >&5 $as_echo "$as_me: Downloading build dependency bootjdk from $with_builddeps_server/$resource and installing into $installdir" >&6;} - if test ! -d $installdir; then - mkdir -p $installdir - fi - if test ! -d $installdir; then - as_fn_error $? "Could not create directory $installdir" "$LINENO" 5 - fi - tmpfile=`mktemp $installdir/bootjdk.XXXXXXXXX` - touch $tmpfile - if test ! -f $tmpfile; then - as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5 - fi - - # $with_builddeps_server/$resource is the ftp://abuilddeps.server.com/libs/cups.zip - # $tmpfile is the local file name for the downloaded file. - VALID_TOOL=no - if test "x$BDEPS_FTP" = xwget; then - VALID_TOOL=yes - wget -O $tmpfile $with_builddeps_server/$resource + if test ! -d $installdir; then + mkdir -p $installdir fi - if test "x$BDEPS_FTP" = xlftp; then - VALID_TOOL=yes - lftp -c "get $with_builddeps_server/$resource -o $tmpfile" + if test ! -d $installdir; then + as_fn_error $? "Could not create directory $installdir" "$LINENO" 5 fi - if test "x$BDEPS_FTP" = xftp; then - VALID_TOOL=yes - FTPSERVER=`echo $with_builddeps_server/$resource | cut -f 3 -d '/'` - FTPPATH=`echo $with_builddeps_server/$resource | cut -f 4- -d '/'` - FTPUSERPWD=${FTPSERVER%%@*} - if test "x$FTPSERVER" != "x$FTPUSERPWD"; then - FTPUSER=${userpwd%%:*} - FTPPWD=${userpwd#*@} - FTPSERVER=${FTPSERVER#*@} - else - FTPUSER=ftp - FTPPWD=ftp - fi - # the "pass" command does not work on some - # ftp clients (read ftp.exe) but if it works, - # passive mode is better! - (\ - echo "user $FTPUSER $FTPPWD" ;\ - echo "pass" ;\ - echo "bin" ;\ - echo "get $FTPPATH $tmpfile" ;\ - ) | ftp -in $FTPSERVER - fi - if test "x$VALID_TOOL" != xyes; then - as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5 + tmpfile=`mktemp $installdir/bootjdk.XXXXXXXXX` + touch $tmpfile + if test ! -f $tmpfile; then + as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5 fi - mv $tmpfile $installdir/$filename - if test ! -s $installdir/$filename; then - as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5 - fi - case "$extension" in - zip) echo "Unzipping $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked) - ;; - tar.gz) echo "Untaring $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) - ;; - tgz) echo "Untaring $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) - ;; - *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5 - ;; - esac + # $with_builddeps_server/$resource is the ftp://abuilddeps.server.com/libs/cups.zip + # $tmpfile is the local file name for the downloaded file. + VALID_TOOL=no + if test "x$BDEPS_FTP" = xwget; then + VALID_TOOL=yes + wget -O $tmpfile $with_builddeps_server/$resource + fi + if test "x$BDEPS_FTP" = xlftp; then + VALID_TOOL=yes + lftp -c "get $with_builddeps_server/$resource -o $tmpfile" + fi + if test "x$BDEPS_FTP" = xftp; then + VALID_TOOL=yes + FTPSERVER=`echo $with_builddeps_server/$resource | cut -f 3 -d '/'` + FTPPATH=`echo $with_builddeps_server/$resource | cut -f 4- -d '/'` + FTPUSERPWD=${FTPSERVER%%@*} + if test "x$FTPSERVER" != "x$FTPUSERPWD"; then + FTPUSER=${userpwd%%:*} + FTPPWD=${userpwd#*@} + FTPSERVER=${FTPSERVER#*@} + else + FTPUSER=ftp + FTPPWD=ftp fi - if test -f $installdir/$filename.unpacked; then - depdir=$installdir + # the "pass" command does not work on some + # ftp clients (read ftp.exe) but if it works, + # passive mode is better! + ( \ + echo "user $FTPUSER $FTPPWD" ; \ + echo "pass" ; \ + echo "bin" ; \ + echo "get $FTPPATH $tmpfile" ; \ + ) | ftp -in $FTPSERVER + fi + if test "x$VALID_TOOL" != xyes; then + as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5 + fi + + mv $tmpfile $installdir/$filename + if test ! -s $installdir/$filename; then + as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5 fi + case "$extension" in + zip) echo "Unzipping $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked) + ;; + tar.gz) echo "Untaring $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) + ;; + tgz) echo "Untaring $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) + ;; + *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5 + ;; + esac + fi + if test -f $installdir/$filename.unpacked; then + depdir=$installdir + fi - fi - # Source the builddeps file again, because in the previous command, the depdir - # was updated to point at the current build dependency install directory. - . $builddepsfile - # Now extract variables from the builddeps.conf files. - theroot=${builddep_bootjdk_ROOT} - thecflags=${builddep_bootjdk_CFLAGS} - thelibs=${builddep_bootjdk_LIBS} - if test "x$depdir" = x; then - as_fn_error $? "Could not download build dependency bootjdk" "$LINENO" 5 - fi - BOOT_JDK=$depdir - if test "x$theroot" != x; then - BOOT_JDK="$theroot" - fi - if test "x$thecflags" != x; then - BOOT_JDK_CFLAGS="$thecflags" - fi - if test "x$thelibs" != x; then - BOOT_JDK_LIBS="$thelibs" - fi - BOOT_JDK_FOUND=maybe - else BOOT_JDK_FOUND=no - - fi - else BOOT_JDK_FOUND=no + fi + # Source the builddeps file again, because in the previous command, the depdir + # was updated to point at the current build dependency install directory. + . $builddepsfile + # Now extract variables from the builddeps.conf files. + theroot=${builddep_bootjdk_ROOT} + thecflags=${builddep_bootjdk_CFLAGS} + thelibs=${builddep_bootjdk_LIBS} + if test "x$depdir" = x; then + as_fn_error $? "Could not download build dependency bootjdk" "$LINENO" 5 + fi + BOOT_JDK=$depdir + if test "x$theroot" != x; then + BOOT_JDK="$theroot" + fi + if test "x$thecflags" != x; then + BOOT_JDK_CFLAGS="$thecflags" + fi + if test "x$thelibs" != x; then + BOOT_JDK_LIBS="$thelibs" + fi + BOOT_JDK_FOUND=maybe + else BOOT_JDK_FOUND=no fi + else BOOT_JDK_FOUND=no + + fi @@ -11649,13 +11762,13 @@ $as_echo "$BOOT_JDK_VERSION" >&6; } fi -# Test: Is $JAVA_HOME set? + # Test: Is $JAVA_HOME set? if test "x$BOOT_JDK_FOUND" = xno; then # Now execute the test - if test "x$JAVA_HOME" != x; then - JAVA_HOME_PROCESSED="$JAVA_HOME" + if test "x$JAVA_HOME" != x; then + JAVA_HOME_PROCESSED="$JAVA_HOME" if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then @@ -11778,18 +11891,18 @@ $as_echo "$as_me: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", JAVA_HOME_PROCESSED="`cd "$path"; $THEPWDCMD -L`" fi - if test ! -d "$JAVA_HOME_PROCESSED"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Your JAVA_HOME points to a non-existing directory!" >&5 + if test ! -d "$JAVA_HOME_PROCESSED"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Your JAVA_HOME points to a non-existing directory!" >&5 $as_echo "$as_me: Your JAVA_HOME points to a non-existing directory!" >&6;} - else - # Aha, the user has set a JAVA_HOME - # let us use that as the Boot JDK. - BOOT_JDK="$JAVA_HOME_PROCESSED" - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using JAVA_HOME" >&5 + else + # Aha, the user has set a JAVA_HOME + # let us use that as the Boot JDK. + BOOT_JDK="$JAVA_HOME_PROCESSED" + BOOT_JDK_FOUND=maybe + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using JAVA_HOME" >&5 $as_echo "$as_me: Found potential Boot JDK using JAVA_HOME" >&6;} - fi fi + fi # If previous step claimed to have found a JDK, check it to see if it seems to be valid. @@ -11967,17 +12080,17 @@ $as_echo "$BOOT_JDK_VERSION" >&6; } fi -# Test: Is there a /usr/libexec/java_home? (Typically on MacOSX) + # Test: Is there a /usr/libexec/java_home? (Typically on MacOSX) if test "x$BOOT_JDK_FOUND" = xno; then # Now execute the test - if test -x /usr/libexec/java_home; then - BOOT_JDK=`/usr/libexec/java_home` - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using /usr/libexec/java_home" >&5 + if test -x /usr/libexec/java_home; then + BOOT_JDK=`/usr/libexec/java_home` + BOOT_JDK_FOUND=maybe + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using /usr/libexec/java_home" >&5 $as_echo "$as_me: Found potential Boot JDK using /usr/libexec/java_home" >&6;} - fi + fi # If previous step claimed to have found a JDK, check it to see if it seems to be valid. @@ -12155,12 +12268,12 @@ $as_echo "$BOOT_JDK_VERSION" >&6; } fi -# Test: Is there a java or javac in the PATH, which is a symlink to the JDK? + # Test: Is there a java or javac in the PATH, which is a symlink to the JDK? if test "x$BOOT_JDK_FOUND" = xno; then # Now execute the test - # Extract the first word of "javac", so it can be a program name with args. + # Extract the first word of "javac", so it can be a program name with args. 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; } @@ -12200,7 +12313,7 @@ $as_echo "no" >&6; } fi - # Extract the first word of "java", so it can be a program name with args. + # Extract the first word of "java", so it can be a program name with args. 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; } @@ -12240,72 +12353,72 @@ $as_echo "no" >&6; } fi - BINARY="$JAVAC_CHECK" - if test "x$JAVAC_CHECK" = x; then - BINARY="$JAVA_CHECK" - fi - if test "x$BINARY" != x; then - # So there is a java(c) binary, it might be part of a JDK. - # Lets find the JDK/JRE directory by following symbolic links. - # Linux/GNU systems often have links from /usr/bin/java to - # /etc/alternatives/java to the real JDK binary. + BINARY="$JAVAC_CHECK" + if test "x$JAVAC_CHECK" = x; then + BINARY="$JAVA_CHECK" + fi + if test "x$BINARY" != x; then + # So there is a java(c) binary, it might be part of a JDK. + # Lets find the JDK/JRE directory by following symbolic links. + # Linux/GNU systems often have links from /usr/bin/java to + # /etc/alternatives/java to the real JDK binary. - if test "x$OPENJDK_BUILD_OS" != xwindows; then - # Follow a chain of symbolic links. Use readlink - # where it exists, else fall back to horribly - # complicated shell code. - if test "x$READLINK_TESTED" != yes; then - # On MacOSX there is a readlink tool with a different - # purpose than the GNU readlink tool. Check the found readlink. - ISGNU=`$READLINK --version 2>&1 | $GREP GNU` - if test "x$ISGNU" = x; then - # A readlink that we do not know how to use. - # Are there other non-GNU readlinks out there? - READLINK_TESTED=yes - READLINK= - fi - fi - - if test "x$READLINK" != x; then - BINARY=`$READLINK -f $BINARY` - else - # Save the current directory for restoring afterwards - STARTDIR=$PWD - COUNTER=0 - sym_link_dir=`$DIRNAME $BINARY` - sym_link_file=`$BASENAME $BINARY` - cd $sym_link_dir - # Use -P flag to resolve symlinks in directories. - cd `$THEPWDCMD -P` - sym_link_dir=`$THEPWDCMD -P` - # Resolve file symlinks - while test $COUNTER -lt 20; do - ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` - if test "x$ISLINK" == x; then - # This is not a symbolic link! We are done! - break - fi - # Again resolve directory symlinks since the target of the just found - # link could be in a different directory - cd `$DIRNAME $ISLINK` - sym_link_dir=`$THEPWDCMD -P` - sym_link_file=`$BASENAME $ISLINK` - let COUNTER=COUNTER+1 - done - cd $STARTDIR - BINARY=$sym_link_dir/$sym_link_file - fi + if test "x$OPENJDK_BUILD_OS" != xwindows; then + # Follow a chain of symbolic links. Use readlink + # where it exists, else fall back to horribly + # complicated shell code. + if test "x$READLINK_TESTED" != yes; then + # On MacOSX there is a readlink tool with a different + # purpose than the GNU readlink tool. Check the found readlink. + ISGNU=`$READLINK --version 2>&1 | $GREP GNU` + if test "x$ISGNU" = x; then + # A readlink that we do not know how to use. + # Are there other non-GNU readlinks out there? + READLINK_TESTED=yes + READLINK= + fi fi - BOOT_JDK=`dirname "$BINARY"` - BOOT_JDK=`cd "$BOOT_JDK/.."; pwd` - if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then - # Looks like we found ourselves an JDK - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using java(c) in PATH" >&5 + if test "x$READLINK" != x; then + BINARY=`$READLINK -f $BINARY` + else + # Save the current directory for restoring afterwards + STARTDIR=$PWD + COUNTER=0 + sym_link_dir=`$DIRNAME $BINARY` + sym_link_file=`$BASENAME $BINARY` + cd $sym_link_dir + # Use -P flag to resolve symlinks in directories. + cd `$THEPWDCMD -P` + sym_link_dir=`$THEPWDCMD -P` + # Resolve file symlinks + while test $COUNTER -lt 20; do + ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` + if test "x$ISLINK" == x; then + # This is not a symbolic link! We are done! + break + fi + # Again resolve directory symlinks since the target of the just found + # link could be in a different directory + cd `$DIRNAME $ISLINK` + sym_link_dir=`$THEPWDCMD -P` + sym_link_file=`$BASENAME $ISLINK` + let COUNTER=COUNTER+1 + done + cd $STARTDIR + BINARY=$sym_link_dir/$sym_link_file + fi + fi + + BOOT_JDK=`dirname "$BINARY"` + BOOT_JDK=`cd "$BOOT_JDK/.."; pwd` + if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then + # Looks like we found ourselves an JDK + BOOT_JDK_FOUND=maybe + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using java(c) in PATH" >&5 $as_echo "$as_me: Found potential Boot JDK using java(c) in PATH" >&6;} - fi fi + fi # If previous step claimed to have found a JDK, check it to see if it seems to be valid. @@ -12483,7 +12596,7 @@ $as_echo "$BOOT_JDK_VERSION" >&6; } fi -# Test: Is there a JDK installed in default, well-known locations? + # Test: Is there a JDK installed in default, well-known locations? if test "x$BOOT_JDK_FOUND" = xno; then # Now execute the test @@ -15713,67 +15826,74 @@ $as_echo "$BOOT_JDK_VERSION" >&6; } fi -# If we haven't found anything yet, we've truly lost. Give up. -if test "x$BOOT_JDK_FOUND" = xno; then + # If we haven't found anything yet, we've truly lost. Give up. + if test "x$BOOT_JDK_FOUND" = xno; then - # Print a helpful message on how to acquire the necessary build dependency. - # openjdk is the help tag: freetyp2, cups, pulse, alsa etc - MISSING_DEPENDENCY=openjdk + # Print a helpful message on how to acquire the necessary build dependency. + # openjdk is the help tag: freetype, cups, pulse, alsa etc + MISSING_DEPENDENCY=openjdk + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else PKGHANDLER_COMMAND= case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; esac if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." fi + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find a valid Boot JDK. $HELP_MSG" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find a valid Boot JDK. $HELP_MSG" >&5 $as_echo "$as_me: Could not find a valid Boot JDK. $HELP_MSG" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be fixed by explicitely setting --with-boot-jdk" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be fixed by explicitely setting --with-boot-jdk" >&5 $as_echo "$as_me: This might be fixed by explicitely setting --with-boot-jdk" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 -fi + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi -# Setup proper paths for what we found -BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar" -if test ! -f "$BOOT_RTJAR"; then + # Setup proper paths for what we found + BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar" + if test ! -f "$BOOT_RTJAR"; then # On MacOSX it is called classes.jar BOOT_RTJAR="$BOOT_JDK/../Classes/classes.jar" if test -f "$BOOT_RTJAR"; then # Remove the .. BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}" fi -fi -BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar" -BOOT_JDK="$BOOT_JDK" + fi + BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar" + BOOT_JDK="$BOOT_JDK" -# Setup tools from the Boot JDK. + # Setup tools from the Boot JDK. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for java in Boot JDK" >&5 $as_echo_n "checking for java in Boot JDK... " >&6; } JAVA=$BOOT_JDK/bin/java if test ! -x $JAVA; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5 $as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find java in the Boot JDK" "$LINENO" 5 + as_fn_error $? "Could not find java in the Boot JDK" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } @@ -15783,11 +15903,11 @@ $as_echo "ok" >&6; } $as_echo_n "checking for javac in Boot JDK... " >&6; } JAVAC=$BOOT_JDK/bin/javac if test ! -x $JAVAC; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5 $as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find javac in the Boot JDK" "$LINENO" 5 + as_fn_error $? "Could not find javac in the Boot JDK" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } @@ -15797,11 +15917,11 @@ $as_echo "ok" >&6; } $as_echo_n "checking for javah in Boot JDK... " >&6; } JAVAH=$BOOT_JDK/bin/javah if test ! -x $JAVAH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5 $as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find javah in the Boot JDK" "$LINENO" 5 + as_fn_error $? "Could not find javah in the Boot JDK" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } @@ -15811,11 +15931,11 @@ $as_echo "ok" >&6; } $as_echo_n "checking for javap in Boot JDK... " >&6; } JAVAP=$BOOT_JDK/bin/javap if test ! -x $JAVAP; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5 $as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find javap in the Boot JDK" "$LINENO" 5 + as_fn_error $? "Could not find javap in the Boot JDK" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } @@ -15825,11 +15945,11 @@ $as_echo "ok" >&6; } $as_echo_n "checking for jar in Boot JDK... " >&6; } JAR=$BOOT_JDK/bin/jar if test ! -x $JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5 $as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find jar in the Boot JDK" "$LINENO" 5 + as_fn_error $? "Could not find jar in the Boot JDK" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } @@ -15839,11 +15959,11 @@ $as_echo "ok" >&6; } $as_echo_n "checking for rmic in Boot JDK... " >&6; } RMIC=$BOOT_JDK/bin/rmic if test ! -x $RMIC; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5 $as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find rmic in the Boot JDK" "$LINENO" 5 + as_fn_error $? "Could not find rmic in the Boot JDK" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } @@ -15853,28 +15973,28 @@ $as_echo "ok" >&6; } $as_echo_n "checking for native2ascii in Boot JDK... " >&6; } NATIVE2ASCII=$BOOT_JDK/bin/native2ascii if test ! -x $NATIVE2ASCII; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5 $as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;} - as_fn_error $? "Could not find native2ascii in the Boot JDK" "$LINENO" 5 + as_fn_error $? "Could not find native2ascii in the Boot JDK" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } -# Finally, set some other options... + # Finally, set some other options... -# When compiling code to be executed by the Boot JDK, force jdk7 compatibility. -BOOT_JDK_SOURCETARGET="-source 7 -target 7" + # When compiling code to be executed by the Boot JDK, force jdk7 compatibility. + BOOT_JDK_SOURCETARGET="-source 7 -target 7" -############################################################################## -# -# Specify options for anything that is run with the Boot JDK. -# + ############################################################################## + # + # Specify options for anything that is run with the Boot JDK. + # # Check whether --with-boot-jdk-jvmargs was given. if test "${with_boot_jdk_jvmargs+set}" = set; then : @@ -15882,135 +16002,135 @@ if test "${with_boot_jdk_jvmargs+set}" = set; then : fi -if test "x$with_boot_jdk_jvmargs" = x; then + if test "x$with_boot_jdk_jvmargs" = x; then # Not all JVM:s accept the same arguments on the command line. # OpenJDK specific increase in thread stack for JDK build, # well more specifically, when running javac. if test "x$BUILD_NUM_BITS" = x32; then - STACK_SIZE=768 + STACK_SIZE=768 else - # Running Javac on a JVM on a 64-bit machine, the stack takes more space - # since 64-bit pointers are pushed on the stach. Apparently, we need - # to increase the stack space when javacing the JDK.... - STACK_SIZE=1536 + # Running Javac on a JVM on a 64-bit machine, the stack takes more space + # since 64-bit pointers are pushed on the stach. Apparently, we need + # to increase the stack space when javacing the JDK.... + STACK_SIZE=1536 fi # Minimum amount of heap memory. - $ECHO "Check if jvm arg is ok: -Xms64M" >&5 - $ECHO "Command: $JAVA -Xms64M -version" >&5 - OUTPUT=`$JAVA -Xms64M -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs -Xms64M" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -Xms64M" >&5 + $ECHO "Command: $JAVA -Xms64M -version" >&5 + OUTPUT=`$JAVA -Xms64M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + boot_jdk_jvmargs="$boot_jdk_jvmargs -Xms64M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - # Why does macosx need more heap? Its the huge JDK batch. + # Why does macosx need more heap? Its the huge JDK batch. - $ECHO "Check if jvm arg is ok: -Xmx1600M" >&5 - $ECHO "Command: $JAVA -Xmx1600M -version" >&5 - OUTPUT=`$JAVA -Xmx1600M -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs -Xmx1600M" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -Xmx1600M" >&5 + $ECHO "Command: $JAVA -Xmx1600M -version" >&5 + OUTPUT=`$JAVA -Xmx1600M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + boot_jdk_jvmargs="$boot_jdk_jvmargs -Xmx1600M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi else - $ECHO "Check if jvm arg is ok: -Xmx1100M" >&5 - $ECHO "Command: $JAVA -Xmx1100M -version" >&5 - OUTPUT=`$JAVA -Xmx1100M -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs -Xmx1100M" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -Xmx1100M" >&5 + $ECHO "Command: $JAVA -Xmx1100M -version" >&5 + OUTPUT=`$JAVA -Xmx1100M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + boot_jdk_jvmargs="$boot_jdk_jvmargs -Xmx1100M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi fi # When is adding -client something that speeds up the JVM? # ADD_JVM_ARG_IF_OK([-client],boot_jdk_jvmargs,[$JAVA]) - $ECHO "Check if jvm arg is ok: -XX:PermSize=32m" >&5 - $ECHO "Command: $JAVA -XX:PermSize=32m -version" >&5 - OUTPUT=`$JAVA -XX:PermSize=32m -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:PermSize=32m" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -XX:PermSize=32m" >&5 + $ECHO "Command: $JAVA -XX:PermSize=32m -version" >&5 + OUTPUT=`$JAVA -XX:PermSize=32m -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:PermSize=32m" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi - $ECHO "Check if jvm arg is ok: -XX:MaxPermSize=160m" >&5 - $ECHO "Command: $JAVA -XX:MaxPermSize=160m -version" >&5 - OUTPUT=`$JAVA -XX:MaxPermSize=160m -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:MaxPermSize=160m" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -XX:MaxPermSize=160m" >&5 + $ECHO "Command: $JAVA -XX:MaxPermSize=160m -version" >&5 + OUTPUT=`$JAVA -XX:MaxPermSize=160m -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:MaxPermSize=160m" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi - $ECHO "Check if jvm arg is ok: -XX:ThreadStackSize=$STACK_SIZE" >&5 - $ECHO "Command: $JAVA -XX:ThreadStackSize=$STACK_SIZE -version" >&5 - OUTPUT=`$JAVA -XX:ThreadStackSize=$STACK_SIZE -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:ThreadStackSize=$STACK_SIZE" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -XX:ThreadStackSize=$STACK_SIZE" >&5 + $ECHO "Command: $JAVA -XX:ThreadStackSize=$STACK_SIZE -version" >&5 + OUTPUT=`$JAVA -XX:ThreadStackSize=$STACK_SIZE -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:ThreadStackSize=$STACK_SIZE" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi # Disable special log output when a debug build is used as Boot JDK... - $ECHO "Check if jvm arg is ok: -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput" >&5 - $ECHO "Command: $JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version" >&5 - OUTPUT=`$JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput" >&5 + $ECHO "Command: $JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version" >&5 + OUTPUT=`$JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi -fi + fi -BOOT_JDK_JVMARGS=$boot_jdk_jvmargs + BOOT_JDK_JVMARGS=$boot_jdk_jvmargs @@ -16021,16 +16141,15 @@ BOOT_JDK_JVMARGS=$boot_jdk_jvmargs ############################################################################### - -# Where are the sources. Any of these can be overridden -# using --with-override-corba and the likes. -LANGTOOLS_TOPDIR="$SRC_ROOT/langtools" -CORBA_TOPDIR="$SRC_ROOT/corba" -JAXP_TOPDIR="$SRC_ROOT/jaxp" -JAXWS_TOPDIR="$SRC_ROOT/jaxws" -HOTSPOT_TOPDIR="$SRC_ROOT/hotspot" -NASHORN_TOPDIR="$SRC_ROOT/nashorn" -JDK_TOPDIR="$SRC_ROOT/jdk" + # Where are the sources. Any of these can be overridden + # using --with-override-corba and the likes. + LANGTOOLS_TOPDIR="$SRC_ROOT/langtools" + CORBA_TOPDIR="$SRC_ROOT/corba" + JAXP_TOPDIR="$SRC_ROOT/jaxp" + JAXWS_TOPDIR="$SRC_ROOT/jaxws" + HOTSPOT_TOPDIR="$SRC_ROOT/hotspot" + NASHORN_TOPDIR="$SRC_ROOT/nashorn" + JDK_TOPDIR="$SRC_ROOT/jdk" @@ -16041,11 +16160,11 @@ JDK_TOPDIR="$SRC_ROOT/jdk" -############################################################################### -# -# Pickup additional source for a component from outside of the source root -# or override source for a component. -# + ############################################################################### + # + # Pickup additional source for a component from outside of the source root + # or override source for a component. + # # Check whether --with-add-source-root was given. if test "${with_add_source_root+set}" = set; then : @@ -16067,14 +16186,14 @@ if test "${with_adds_and_overrides+set}" = set; then : fi -if test "x$with_adds_and_overrides" != x; then + if test "x$with_adds_and_overrides" != x; then with_add_source_root="$with_adds_and_overrides/adds" with_override_source_root="$with_adds_and_overrides/overrides" -fi + fi -if test "x$with_add_source_root" != x; then + if test "x$with_add_source_root" != x; then if ! test -d $with_add_source_root; then - as_fn_error $? "Trying to use a non-existant add-source-root $with_add_source_root" "$LINENO" 5 + as_fn_error $? "Trying to use a non-existant add-source-root $with_add_source_root" "$LINENO" 5 fi CURDIR="$PWD" cd "$with_add_source_root" @@ -16083,93 +16202,93 @@ if test "x$with_add_source_root" != x; then # Verify that the addon source root does not have any root makefiles. # If it does, then it is usually an error, prevent this. if test -f $with_add_source_root/langtools/makefiles/Makefile || \ - test -f $with_add_source_root/langtools/make/Makefile; then - as_fn_error $? "Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources." "$LINENO" 5 + test -f $with_add_source_root/langtools/make/Makefile; then + as_fn_error $? "Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources." "$LINENO" 5 fi if test -f $with_add_source_root/corba/makefiles/Makefile || \ - test -f $with_add_source_root/corba/make/Makefile; then - as_fn_error $? "Your add source root seems to contain a full corba repo! An add source root should only contain additional sources." "$LINENO" 5 + test -f $with_add_source_root/corba/make/Makefile; then + as_fn_error $? "Your add source root seems to contain a full corba repo! An add source root should only contain additional sources." "$LINENO" 5 fi if test -f $with_add_source_root/jaxp/makefiles/Makefile || \ - test -f $with_add_source_root/jaxp/make/Makefile; then - as_fn_error $? "Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources." "$LINENO" 5 + test -f $with_add_source_root/jaxp/make/Makefile; then + as_fn_error $? "Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources." "$LINENO" 5 fi if test -f $with_add_source_root/jaxws/makefiles/Makefile || \ - test -f $with_add_source_root/jaxws/make/Makefile; then - as_fn_error $? "Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources." "$LINENO" 5 + test -f $with_add_source_root/jaxws/make/Makefile; then + as_fn_error $? "Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources." "$LINENO" 5 fi if test -f $with_add_source_root/hotspot/makefiles/Makefile || \ - test -f $with_add_source_root/hotspot/make/Makefile; then - as_fn_error $? "Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources." "$LINENO" 5 + test -f $with_add_source_root/hotspot/make/Makefile; then + as_fn_error $? "Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources." "$LINENO" 5 fi if test -f $with_add_source_root/nashorn/makefiles/Makefile || \ - test -f $with_add_source_root/nashorn/make/Makefile; then - as_fn_error $? "Your add source root seems to contain a full nashorn repo! An add source root should only contain additional sources." "$LINENO" 5 + test -f $with_add_source_root/nashorn/make/Makefile; then + as_fn_error $? "Your add source root seems to contain a full nashorn repo! An add source root should only contain additional sources." "$LINENO" 5 fi if test -f $with_add_source_root/jdk/makefiles/Makefile || \ - test -f $with_add_source_root/jdk/make/Makefile; then - as_fn_error $? "Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources." "$LINENO" 5 + test -f $with_add_source_root/jdk/make/Makefile; then + as_fn_error $? "Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources." "$LINENO" 5 fi -fi + fi -if test "x$with_override_source_root" != x; then + if test "x$with_override_source_root" != x; then if ! test -d $with_override_source_root; then - as_fn_error $? "Trying to use a non-existant override-source-root $with_override_source_root" "$LINENO" 5 + as_fn_error $? "Trying to use a non-existant override-source-root $with_override_source_root" "$LINENO" 5 fi CURDIR="$PWD" cd "$with_override_source_root" OVERRIDE_SRC_ROOT="`pwd`" cd "$CURDIR" if test -f $with_override_source_root/langtools/makefiles/Makefile || \ - test -f $with_override_source_root/langtools/make/Makefile; then - as_fn_error $? "Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override." "$LINENO" 5 + test -f $with_override_source_root/langtools/make/Makefile; then + as_fn_error $? "Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override." "$LINENO" 5 fi if test -f $with_override_source_root/corba/makefiles/Makefile || \ - test -f $with_override_source_root/corba/make/Makefile; then - as_fn_error $? "Your override source root seems to contain a full corba repo! An override source root should only contain sources that override." "$LINENO" 5 + test -f $with_override_source_root/corba/make/Makefile; then + as_fn_error $? "Your override source root seems to contain a full corba repo! An override source root should only contain sources that override." "$LINENO" 5 fi if test -f $with_override_source_root/jaxp/makefiles/Makefile || \ - test -f $with_override_source_root/jaxp/make/Makefile; then - as_fn_error $? "Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override." "$LINENO" 5 + test -f $with_override_source_root/jaxp/make/Makefile; then + as_fn_error $? "Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override." "$LINENO" 5 fi if test -f $with_override_source_root/jaxws/makefiles/Makefile || \ - test -f $with_override_source_root/jaxws/make/Makefile; then - as_fn_error $? "Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override." "$LINENO" 5 + test -f $with_override_source_root/jaxws/make/Makefile; then + as_fn_error $? "Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override." "$LINENO" 5 fi if test -f $with_override_source_root/hotspot/makefiles/Makefile || \ - test -f $with_override_source_root/hotspot/make/Makefile; then - as_fn_error $? "Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override." "$LINENO" 5 + test -f $with_override_source_root/hotspot/make/Makefile; then + as_fn_error $? "Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override." "$LINENO" 5 fi if test -f $with_override_source_root/nashorn/makefiles/Makefile || \ - test -f $with_override_source_root/nashorn/make/Makefile; then - as_fn_error $? "Your override source root seems to contain a full nashorn repo! An override source root should only contain sources that override." "$LINENO" 5 + test -f $with_override_source_root/nashorn/make/Makefile; then + as_fn_error $? "Your override source root seems to contain a full nashorn repo! An override source root should only contain sources that override." "$LINENO" 5 fi if test -f $with_override_source_root/jdk/makefiles/Makefile || \ - test -f $with_override_source_root/jdk/make/Makefile; then - as_fn_error $? "Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override." "$LINENO" 5 + test -f $with_override_source_root/jdk/make/Makefile; then + as_fn_error $? "Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override." "$LINENO" 5 fi -fi + fi -############################################################################### -# -# Override a repo completely, this is used for example when you have 3 small -# development sandboxes of the langtools sources and want to avoid having 3 full -# OpenJDK sources checked out on disk. -# -# Assuming that the 3 langtools sandboxes are located here: -# /home/fredrik/sandbox1/langtools -# /home/fredrik/sandbox2/langtools -# /home/fredrik/sandbox3/langtools -# -# From the source root you create build subdirs manually: -# mkdir -p build1 build2 build3 -# in each build directory run: -# (cd build1 && ../configure --with-override-langtools=/home/fredrik/sandbox1 && make) -# (cd build2 && ../configure --with-override-langtools=/home/fredrik/sandbox2 && make) -# (cd build3 && ../configure --with-override-langtools=/home/fredrik/sandbox3 && make) -# + ############################################################################### + # + # Override a repo completely, this is used for example when you have 3 small + # development sandboxes of the langtools sources and want to avoid having 3 full + # OpenJDK sources checked out on disk. + # + # Assuming that the 3 langtools sandboxes are located here: + # /home/fredrik/sandbox1/langtools + # /home/fredrik/sandbox2/langtools + # /home/fredrik/sandbox3/langtools + # + # From the source root you create build subdirs manually: + # mkdir -p build1 build2 build3 + # in each build directory run: + # (cd build1 && ../configure --with-override-langtools=/home/fredrik/sandbox1 && make) + # (cd build2 && ../configure --with-override-langtools=/home/fredrik/sandbox2 && make) + # (cd build3 && ../configure --with-override-langtools=/home/fredrik/sandbox3 && make) + # # Check whether --with-override-langtools was given. @@ -16220,106 +16339,105 @@ if test "${with_override_jdk+set}" = set; then : fi -if test "x$with_override_langtools" != x; then + if test "x$with_override_langtools" != x; then CURDIR="$PWD" cd "$with_override_langtools" LANGTOOLS_TOPDIR="`pwd`" cd "$CURDIR" if ! test -f $LANGTOOLS_TOPDIR/makefiles/Makefile; then - as_fn_error $? "You have to override langtools with a full langtools repo!" "$LINENO" 5 + as_fn_error $? "You have to override langtools with a full langtools repo!" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if langtools should be overridden" >&5 $as_echo_n "checking if langtools should be overridden... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $LANGTOOLS_TOPDIR" >&5 $as_echo "yes with $LANGTOOLS_TOPDIR" >&6; } -fi -if test "x$with_override_corba" != x; then + fi + if test "x$with_override_corba" != x; then CURDIR="$PWD" cd "$with_override_corba" CORBA_TOPDIR="`pwd`" cd "$CURDIR" if ! test -f $CORBA_TOPDIR/makefiles/Makefile; then - as_fn_error $? "You have to override corba with a full corba repo!" "$LINENO" 5 + as_fn_error $? "You have to override corba with a full corba repo!" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if corba should be overridden" >&5 $as_echo_n "checking if corba should be overridden... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $CORBA_TOPDIR" >&5 $as_echo "yes with $CORBA_TOPDIR" >&6; } -fi -if test "x$with_override_jaxp" != x; then + fi + if test "x$with_override_jaxp" != x; then CURDIR="$PWD" cd "$with_override_jaxp" JAXP_TOPDIR="`pwd`" cd "$CURDIR" if ! test -f $JAXP_TOPDIR/makefiles/Makefile; then - as_fn_error $? "You have to override jaxp with a full jaxp repo!" "$LINENO" 5 + as_fn_error $? "You have to override jaxp with a full jaxp repo!" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if jaxp should be overridden" >&5 $as_echo_n "checking if jaxp should be overridden... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $JAXP_TOPDIR" >&5 $as_echo "yes with $JAXP_TOPDIR" >&6; } -fi -if test "x$with_override_jaxws" != x; then + fi + if test "x$with_override_jaxws" != x; then CURDIR="$PWD" cd "$with_override_jaxws" JAXWS_TOPDIR="`pwd`" cd "$CURDIR" if ! test -f $JAXWS_TOPDIR/makefiles/Makefile; then - as_fn_error $? "You have to override jaxws with a full jaxws repo!" "$LINENO" 5 + as_fn_error $? "You have to override jaxws with a full jaxws repo!" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if jaxws should be overridden" >&5 $as_echo_n "checking if jaxws should be overridden... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $JAXWS_TOPDIR" >&5 $as_echo "yes with $JAXWS_TOPDIR" >&6; } -fi -if test "x$with_override_hotspot" != x; then + fi + if test "x$with_override_hotspot" != x; then CURDIR="$PWD" cd "$with_override_hotspot" HOTSPOT_TOPDIR="`pwd`" cd "$CURDIR" if ! test -f $HOTSPOT_TOPDIR/make/Makefile && \ - ! test -f $HOTSPOT_TOPDIR/makefiles/Makefile; then - as_fn_error $? "You have to override hotspot with a full hotspot repo!" "$LINENO" 5 + ! test -f $HOTSPOT_TOPDIR/makefiles/Makefile; then + as_fn_error $? "You have to override hotspot with a full hotspot repo!" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if hotspot should be overridden" >&5 $as_echo_n "checking if hotspot should be overridden... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $HOTSPOT_TOPDIR" >&5 $as_echo "yes with $HOTSPOT_TOPDIR" >&6; } -fi -if test "x$with_override_nashorn" != x; then + fi + if test "x$with_override_nashorn" != x; then CURDIR="$PWD" cd "$with_override_nashorn" NASHORN_TOPDIR="`pwd`" cd "$CURDIR" if ! test -f $NASHORN_TOPDIR/makefiles/Makefile; then - as_fn_error $? "You have to override nashorn with a full nashorn repo!" "$LINENO" 5 + as_fn_error $? "You have to override nashorn with a full nashorn repo!" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if nashorn should be overridden" >&5 $as_echo_n "checking if nashorn should be overridden... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $NASHORN_TOPDIR" >&5 $as_echo "yes with $NASHORN_TOPDIR" >&6; } -fi -if test "x$with_override_jdk" != x; then + fi + if test "x$with_override_jdk" != x; then CURDIR="$PWD" cd "$with_override_jdk" JDK_TOPDIR="`pwd`" cd "$CURDIR" if ! test -f $JDK_TOPDIR/makefiles/Makefile; then - as_fn_error $? "You have to override JDK with a full JDK repo!" "$LINENO" 5 + as_fn_error $? "You have to override JDK with a full JDK repo!" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if JDK should be overridden" >&5 $as_echo_n "checking if JDK should be overridden... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $JDK_TOPDIR" >&5 $as_echo "yes with $JDK_TOPDIR" >&6; } -fi + fi - -BUILD_OUTPUT="$OUTPUT_ROOT" + BUILD_OUTPUT="$OUTPUT_ROOT" -HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist" -BUILD_HOTSPOT=true + HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist" + BUILD_HOTSPOT=true @@ -16328,22 +16446,22 @@ if test "${with_import_hotspot+set}" = set; then : withval=$with_import_hotspot; fi -if test "x$with_import_hotspot" != x; then + if test "x$with_import_hotspot" != x; then CURDIR="$PWD" cd "$with_import_hotspot" HOTSPOT_DIST="`pwd`" cd "$CURDIR" if ! (test -d $HOTSPOT_DIST/lib && test -d $HOTSPOT_DIST/jre/lib); then - as_fn_error $? "You have to import hotspot from a full jdk image or hotspot build dist dir!" "$LINENO" 5 + as_fn_error $? "You have to import hotspot from a full jdk image or hotspot build dist dir!" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if hotspot should be imported" >&5 $as_echo_n "checking if hotspot should be imported... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes from $HOTSPOT_DIST" >&5 $as_echo "yes from $HOTSPOT_DIST" >&6; } BUILD_HOTSPOT=false -fi + fi -JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk" + JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk" ############################################################################### @@ -16354,26 +16472,26 @@ JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk" ############################################################################### -############################################################################### -# -# Configure the development tool paths and potential sysroot. -# -ac_ext=cpp + ############################################################################### + # + # Configure the development tool paths and potential sysroot. + # + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -# The option used to specify the target .o,.a or .so file. -# When compiling, how to specify the to be created object file. -CC_OUT_OPTION='-o$(SPACE)' -# When linking, how to specify the to be created executable. -EXE_OUT_OPTION='-o$(SPACE)' -# When linking, how to specify the to be created dynamically linkable library. -LD_OUT_OPTION='-o$(SPACE)' -# When archiving, how to specify the to be create static archive for object files. -AR_OUT_OPTION='rcs$(SPACE)' + # The option used to specify the target .o,.a or .so file. + # When compiling, how to specify the to be created object file. + CC_OUT_OPTION='-o$(SPACE)' + # When linking, how to specify the to be created executable. + EXE_OUT_OPTION='-o$(SPACE)' + # When linking, how to specify the to be created dynamically linkable library. + LD_OUT_OPTION='-o$(SPACE)' + # When archiving, how to specify the to be create static archive for object files. + AR_OUT_OPTION='rcs$(SPACE)' @@ -16542,7 +16660,7 @@ $as_echo "$JTREGEXE" >&6; } else # try to find jtreg on path - for ac_prog in jtreg + for ac_prog in jtreg do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -16588,16 +16706,16 @@ fi done - if test "x$JTREGEXE" = x; then - if test "xjtreg" = x; then - PROG_NAME=jtregexe - else - PROG_NAME=jtreg - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 + if test "x$JTREGEXE" = x; then + if test "xjtreg" = x; then + PROG_NAME=jtregexe + else + PROG_NAME=jtreg fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi JT_HOME="`$DIRNAME $JTREGEXE`" @@ -16608,7 +16726,7 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;} -if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then # Store path to cygwin link.exe to help excluding it when searching for # VS linker. This must be done before changing the PATH when looking for VS. @@ -17063,8 +17181,8 @@ $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignori # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -17079,8 +17197,8 @@ $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignori # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -17108,9 +17226,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$new_path\", is invalid." >&6;} @@ -17286,29 +17404,29 @@ $as_echo "$as_me: Resolving VS_ENV_CMD (as $path) failed, using $path directly." 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5 + 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 - 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 @@ -17417,63 +17535,303 @@ $as_echo "$as_me: or run \"bash.exe -l\" from a VS command prompt and then run c as_fn_error $? "Cannot continue" "$LINENO" 5 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } + # Check whether --with-msvcr-dll was given. if test "${with_msvcr_dll+set}" = set; then : withval=$with_msvcr_dll; fi + if test "x$with_msvcr_dll" != x; then - MSVCR_DLL="$with_msvcr_dll" - else - if test "x$VCINSTALLDIR" != x; then - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x64 | head --lines 1` - else - MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x86 | grep -v ia64 | grep -v x64 | head --lines 1` - if test "x$MSVCR_DLL" = x; then - MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | head --lines 1` - fi - fi - if test "x$MSVCR_DLL" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR" >&5 -$as_echo "$as_me: msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR" >&5 -$as_echo "$as_me: Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR" >&6;} - fi + # If given explicitely by user, do not probe. If not present, fail directly. + + POSSIBLE_MSVCR_DLL="$with_msvcr_dll" + METHOD="--with-msvcr-dll" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 fi - # Try some fallback alternatives - if test "x$MSVCR_DLL" = x; then - # If visual studio express is installed, there is usually one with the debugger - if test "x$VS100COMNTOOLS" != x; then - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - MSVCR_DLL=`find "$VS100COMNTOOLS/.." -name msvcr100.dll | grep -i x64 | head --lines 1` - { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in $VS100COMNTOOLS..: $VS100COMNTOOLS.." >&5 -$as_echo "$as_me: msvcr100.dll found in $VS100COMNTOOLS..: $VS100COMNTOOLS.." >&6;} - fi - fi - fi - if test "x$MSVCR_DLL" = x; then - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - # Fallback for 32bit builds, look in the windows directory. - if test -f "$SYSTEMROOT/system32/msvcr100.dll"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in $SYSTEMROOT/system32" >&5 -$as_echo "$as_me: msvcr100.dll found in $SYSTEMROOT/system32" >&6;} - MSVCR_DLL="$SYSTEMROOT/system32/msvcr100.dll" - fi - fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} fi fi + + if test "x$MSVCR_DLL" = x; then + as_fn_error $? "Could not find a proper msvcr100.dll as specified by --with-msvcr-dll" "$LINENO" 5 + fi + fi + if test "x$MSVCR_DLL" = x; then + # Probe: Using well-known location from Visual Studio 10.0 + if test "x$VCINSTALLDIR" != x; then + CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR" + + windows_path="$CYGWIN_VC_INSTALL_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + CYGWIN_VC_INSTALL_DIR="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + CYGWIN_VC_INSTALL_DIR="$unix_path" + fi + + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC100.CRT/msvcr100.dll" + else + POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC100.CRT/msvcr100.dll" + fi + + POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + METHOD="well-known location in VCINSTALLDIR" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + fi + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: Check in the Boot JDK directory. + POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll" + + POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + METHOD="well-known location in Boot JDK" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: Look in the Windows system32 directory + CYGWIN_SYSTEMROOT="$SYSTEMROOT" + + windows_path="$CYGWIN_SYSTEMROOT" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + CYGWIN_SYSTEMROOT="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + CYGWIN_SYSTEMROOT="$unix_path" + fi + + POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll" + + POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + METHOD="well-known location in SYSTEMROOT" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: If Visual Studio Express is installed, there is usually one with the debugger + if test "x$VS100COMNTOOLS" != x; then + CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.." + + windows_path="$CYGWIN_VS_TOOLS_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + CYGWIN_VS_TOOLS_DIR="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + CYGWIN_VS_TOOLS_DIR="$unix_path" + fi + + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x64/ | $HEAD --lines 1` + else + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x86/ | $HEAD --lines 1` + fi + + POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + METHOD="search of VS100COMNTOOLS" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + fi + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now. + # (This was the original behaviour; kept since it might turn up something) + if test "x$CYGWIN_VC_INSTALL_DIR" != x; then + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x64 | $HEAD --lines 1` + else + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1` + if test "x$POSSIBLE_MSVCR_DLL" = x; then + # We're grasping at straws now... + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1` + fi + fi + + + POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + METHOD="search of VCINSTALLDIR" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + fi + fi + + if test "x$MSVCR_DLL" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - as_fn_error $? "Could not find msvcr100.dll !" "$LINENO" 5 + as_fn_error $? "Could not find msvcr100.dll. Please specify using --with-msvcr-dll." "$LINENO" 5 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 -$as_echo "$MSVCR_DLL" >&6; } + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then @@ -17624,21 +17982,21 @@ $as_echo "$as_me: WARNING: Option --with-dxsdk-include is deprecated and will be fi -fi + fi -# If --build AND --host is set, then the configure script will find any -# cross compilation tools in the PATH. Cross compilation tools -# follows the cross compilation standard where they are prefixed with ${host}. -# For example the binary i686-sun-solaris2.10-gcc -# will cross compile for i686-sun-solaris2.10 -# If neither of build and host is not set, then build=host and the -# default compiler found in the path will be used. -# Setting only --host, does not seem to be really supported. -# Please set both --build and --host if you want to cross compile. + # If --build AND --host is set, then the configure script will find any + # cross compilation tools in the PATH. Cross compilation tools + # follows the cross compilation standard where they are prefixed with ${host}. + # For example the binary i686-sun-solaris2.10-gcc + # will cross compile for i686-sun-solaris2.10 + # If neither of build and host is not set, then build=host and the + # default compiler found in the path will be used. + # Setting only --host, does not seem to be really supported. + # Please set both --build and --host if you want to cross compile. -if test "x$COMPILE_TYPE" = "xcross"; then + if test "x$COMPILE_TYPE" = "xcross"; then # Now we to find a C/C++ compiler that can build executables for the build # platform. We can't use the AC_PROG_CC macro, since it can only be used # once. Also, we need to do this before adding a tools dir to the path, @@ -17709,8 +18067,8 @@ done # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -17725,8 +18083,8 @@ done # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -17754,9 +18112,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of BUILD_CC, which resolves as \"$new_path\", is invalid." >&6;} @@ -17932,29 +18290,29 @@ $as_echo "$as_me: Resolving BUILD_CC (as $path) failed, using $path directly." > 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 + 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 - 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 @@ -18020,8 +18378,8 @@ done # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -18036,8 +18394,8 @@ done # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -18065,9 +18423,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$new_path\", is invalid." >&6;} @@ -18243,29 +18601,29 @@ $as_echo "$as_me: Resolving BUILD_CXX (as $path) failed, using $path directly." 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 + 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 - 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 @@ -18326,8 +18684,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -18342,8 +18700,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -18371,9 +18729,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of BUILD_LD, which resolves as \"$new_path\", is invalid." >&6;} @@ -18549,219 +18907,220 @@ $as_echo "$as_me: Resolving BUILD_LD (as $path) failed, using $path directly." > 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5 + 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 - 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 + + + + + # If a devkit is found on the builddeps server, then prepend its path to the + # PATH variable. If there are cross compilers available in the devkit, these + # will be found by AC_PROG_CC et al. + DEVKIT= + + + if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then + # Source the builddeps file again, to make sure it uses the latest variables! + . $builddepsfile + # Look for a target and build machine specific resource! + eval resource=\${builddep_devkit_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}} + if test "x$resource" = x; then + # Ok, lets instead look for a target specific resource + eval resource=\${builddep_devkit_TARGET_${rewritten_target_var}} fi - -fi - - - - -# If a devkit is found on the builddeps server, then prepend its path to the -# PATH variable. If there are cross compilers available in the devkit, these -# will be found by AC_PROG_CC et al. -DEVKIT= - - - if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then - # Source the builddeps file again, to make sure it uses the latest variables! - . $builddepsfile - # Look for a target and build machine specific resource! - eval resource=\${builddep_devkit_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}} - if test "x$resource" = x; then - # Ok, lets instead look for a target specific resource - eval resource=\${builddep_devkit_TARGET_${rewritten_target_var}} - fi - if test "x$resource" = x; then - # Ok, lets instead look for a build specific resource - eval resource=\${builddep_devkit_BUILD_${rewritten_build_var}} - fi - if test "x$resource" = x; then - # Ok, lets instead look for a generic resource - # (The devkit comes from M4 and not the shell, thus no need for eval here.) - resource=${builddep_devkit} - fi - if test "x$resource" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for devkit" >&5 + if test "x$resource" = x; then + # Ok, lets instead look for a build specific resource + eval resource=\${builddep_devkit_BUILD_${rewritten_build_var}} + fi + if test "x$resource" = x; then + # Ok, lets instead look for a generic resource + # (The devkit comes from M4 and not the shell, thus no need for eval here.) + resource=${builddep_devkit} + fi + if test "x$resource" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for devkit" >&5 $as_echo "$as_me: Using builddeps $resource for devkit" >&6;} - # If the resource in the builddeps.conf file is an existing directory, - # for example /java/linux/cups - if test -d ${resource}; then - depdir=${resource} - else + # If the resource in the builddeps.conf file is an existing directory, + # for example /java/linux/cups + if test -d ${resource}; then + depdir=${resource} + else -# devkit is for example mymodule -# $resource is for example libs/general/libmymod_1_2_3.zip -# $with_builddeps_server is for example ftp://mybuilddeps.myserver.com/builddeps -# $with_builddeps_dir is for example /localhome/builddeps -# depdir is the name of the variable into which we store the depdir, eg MYMOD -# Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and -# unzip into the directory: /localhome/builddeps/libmymod_1_2_3 - filename=`basename $resource` - filebase=`echo $filename | sed 's/\.[^\.]*$//'` - filebase=${filename%%.*} - extension=${filename#*.} - installdir=$with_builddeps_dir/$filebase - if test ! -f $installdir/$filename.unpacked; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency devkit from $with_builddeps_server/$resource and installing into $installdir" >&5 + # devkit is for example mymodule + # $resource is for example libs/general/libmymod_1_2_3.zip + # $with_builddeps_server is for example ftp://mybuilddeps.myserver.com/builddeps + # $with_builddeps_dir is for example /localhome/builddeps + # depdir is the name of the variable into which we store the depdir, eg MYMOD + # Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and + # unzip into the directory: /localhome/builddeps/libmymod_1_2_3 + filename=`basename $resource` + filebase=`echo $filename | sed 's/\.[^\.]*$//'` + filebase=${filename%%.*} + extension=${filename#*.} + installdir=$with_builddeps_dir/$filebase + if test ! -f $installdir/$filename.unpacked; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency devkit from $with_builddeps_server/$resource and installing into $installdir" >&5 $as_echo "$as_me: Downloading build dependency devkit from $with_builddeps_server/$resource and installing into $installdir" >&6;} - if test ! -d $installdir; then - mkdir -p $installdir + if test ! -d $installdir; then + mkdir -p $installdir + fi + if test ! -d $installdir; then + as_fn_error $? "Could not create directory $installdir" "$LINENO" 5 + fi + tmpfile=`mktemp $installdir/devkit.XXXXXXXXX` + touch $tmpfile + if test ! -f $tmpfile; then + as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5 + fi + + # $with_builddeps_server/$resource is the ftp://abuilddeps.server.com/libs/cups.zip + # $tmpfile is the local file name for the downloaded file. + VALID_TOOL=no + if test "x$BDEPS_FTP" = xwget; then + VALID_TOOL=yes + wget -O $tmpfile $with_builddeps_server/$resource + fi + if test "x$BDEPS_FTP" = xlftp; then + VALID_TOOL=yes + lftp -c "get $with_builddeps_server/$resource -o $tmpfile" + fi + if test "x$BDEPS_FTP" = xftp; then + VALID_TOOL=yes + FTPSERVER=`echo $with_builddeps_server/$resource | cut -f 3 -d '/'` + FTPPATH=`echo $with_builddeps_server/$resource | cut -f 4- -d '/'` + FTPUSERPWD=${FTPSERVER%%@*} + if test "x$FTPSERVER" != "x$FTPUSERPWD"; then + FTPUSER=${userpwd%%:*} + FTPPWD=${userpwd#*@} + FTPSERVER=${FTPSERVER#*@} + else + FTPUSER=ftp + FTPPWD=ftp + fi + # the "pass" command does not work on some + # ftp clients (read ftp.exe) but if it works, + # passive mode is better! + ( \ + echo "user $FTPUSER $FTPPWD" ; \ + echo "pass" ; \ + echo "bin" ; \ + echo "get $FTPPATH $tmpfile" ; \ + ) | ftp -in $FTPSERVER + fi + if test "x$VALID_TOOL" != xyes; then + as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5 + fi + + mv $tmpfile $installdir/$filename + if test ! -s $installdir/$filename; then + as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5 + fi + case "$extension" in + zip) echo "Unzipping $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked) + ;; + tar.gz) echo "Untaring $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) + ;; + tgz) echo "Untaring $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) + ;; + *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5 + ;; + esac + fi + if test -f $installdir/$filename.unpacked; then + depdir=$installdir + fi + + fi + # Source the builddeps file again, because in the previous command, the depdir + # was updated to point at the current build dependency install directory. + . $builddepsfile + # Now extract variables from the builddeps.conf files. + theroot=${builddep_devkit_ROOT} + thecflags=${builddep_devkit_CFLAGS} + thelibs=${builddep_devkit_LIBS} + if test "x$depdir" = x; then + as_fn_error $? "Could not download build dependency devkit" "$LINENO" 5 + fi + DEVKIT=$depdir + if test "x$theroot" != x; then + DEVKIT="$theroot" + fi + if test "x$thecflags" != x; then + DEVKIT_CFLAGS="$thecflags" + fi + if test "x$thelibs" != x; then + DEVKIT_LIBS="$thelibs" + fi + + # Found devkit + PATH="$DEVKIT/bin:$PATH" + SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root" + if test "x$x_includes" = "xNONE"; then + x_includes="$SYS_ROOT/usr/include/X11" fi - if test ! -d $installdir; then - as_fn_error $? "Could not create directory $installdir" "$LINENO" 5 - fi - tmpfile=`mktemp $installdir/devkit.XXXXXXXXX` - touch $tmpfile - if test ! -f $tmpfile; then - as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5 + if test "x$x_libraries" = "xNONE"; then + x_libraries="$SYS_ROOT/usr/lib" fi - # $with_builddeps_server/$resource is the ftp://abuilddeps.server.com/libs/cups.zip - # $tmpfile is the local file name for the downloaded file. - VALID_TOOL=no - if test "x$BDEPS_FTP" = xwget; then - VALID_TOOL=yes - wget -O $tmpfile $with_builddeps_server/$resource - fi - if test "x$BDEPS_FTP" = xlftp; then - VALID_TOOL=yes - lftp -c "get $with_builddeps_server/$resource -o $tmpfile" - fi - if test "x$BDEPS_FTP" = xftp; then - VALID_TOOL=yes - FTPSERVER=`echo $with_builddeps_server/$resource | cut -f 3 -d '/'` - FTPPATH=`echo $with_builddeps_server/$resource | cut -f 4- -d '/'` - FTPUSERPWD=${FTPSERVER%%@*} - if test "x$FTPSERVER" != "x$FTPUSERPWD"; then - FTPUSER=${userpwd%%:*} - FTPPWD=${userpwd#*@} - FTPSERVER=${FTPSERVER#*@} - else - FTPUSER=ftp - FTPPWD=ftp - fi - # the "pass" command does not work on some - # ftp clients (read ftp.exe) but if it works, - # passive mode is better! - (\ - echo "user $FTPUSER $FTPPWD" ;\ - echo "pass" ;\ - echo "bin" ;\ - echo "get $FTPPATH $tmpfile" ;\ - ) | ftp -in $FTPSERVER - fi - if test "x$VALID_TOOL" != xyes; then - as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5 - fi - - mv $tmpfile $installdir/$filename - if test ! -s $installdir/$filename; then - as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5 - fi - case "$extension" in - zip) echo "Unzipping $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked) - ;; - tar.gz) echo "Untaring $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) - ;; - tgz) echo "Untaring $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) - ;; - *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5 - ;; - esac - fi - if test -f $installdir/$filename.unpacked; then - depdir=$installdir - fi - - fi - # Source the builddeps file again, because in the previous command, the depdir - # was updated to point at the current build dependency install directory. - . $builddepsfile - # Now extract variables from the builddeps.conf files. - theroot=${builddep_devkit_ROOT} - thecflags=${builddep_devkit_CFLAGS} - thelibs=${builddep_devkit_LIBS} - if test "x$depdir" = x; then - as_fn_error $? "Could not download build dependency devkit" "$LINENO" 5 - fi - DEVKIT=$depdir - if test "x$theroot" != x; then - DEVKIT="$theroot" - fi - if test "x$thecflags" != x; then - DEVKIT_CFLAGS="$thecflags" - fi - if test "x$thelibs" != x; then - DEVKIT_LIBS="$thelibs" - fi - # Found devkit - PATH="$DEVKIT/bin:$PATH" - SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root" - if test "x$x_includes" = "xNONE"; then - x_includes="$SYS_ROOT/usr/include/X11" - fi - if test "x$x_libraries" = "xNONE"; then - x_libraries="$SYS_ROOT/usr/lib" - fi - - - fi fi - -# Store the CFLAGS etal passed to the configure script. -ORG_CFLAGS="$CFLAGS" -ORG_CXXFLAGS="$CXXFLAGS" -ORG_OBJCFLAGS="$OBJCFLAGS" - -# autoconf magic only relies on PATH, so update it if tools dir is specified -OLD_PATH="$PATH" -if test "x$TOOLS_DIR" != x; then - PATH=$TOOLS_DIR:$PATH -fi + fi -### Locate C compiler (CC) + # Store the CFLAGS etal passed to the configure script. + ORG_CFLAGS="$CFLAGS" + ORG_CXXFLAGS="$CXXFLAGS" + ORG_OBJCFLAGS="$OBJCFLAGS" -# On windows, only cl.exe is supported. -# On Solaris, cc is preferred to gcc. -# Elsewhere, gcc is preferred to cc. + # autoconf magic only relies on PATH, so update it if tools dir is specified + OLD_PATH="$PATH" + if test "x$TOOLS_DIR" != x; then + PATH=$TOOLS_DIR:$PATH + fi -if test "x$CC" != x; then - COMPILER_CHECK_LIST="$CC" -elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then - COMPILER_CHECK_LIST="cl" -elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - COMPILER_CHECK_LIST="cc gcc" -else - COMPILER_CHECK_LIST="gcc cc" -fi + + ### Locate C compiler (CC) + + # On windows, only cl.exe is supported. + # On Solaris, cc is preferred to gcc. + # Elsewhere, gcc is preferred to cc. + + if test "x$CC" != x; then + COMPILER_CHECK_LIST="$CC" + elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then + COMPILER_CHECK_LIST="cl" + elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then + COMPILER_CHECK_LIST="cc gcc" + else + COMPILER_CHECK_LIST="gcc cc" + fi COMPILER_NAME=C @@ -18874,31 +19233,38 @@ done if test "x$CC" = x; then - # Print a helpful message on how to acquire the necessary build dependency. - # devkit is the help tag: freetyp2, cups, pulse, alsa etc - MISSING_DEPENDENCY=devkit + # Print a helpful message on how to acquire the necessary build dependency. + # devkit is the help tag: freetype, cups, pulse, alsa etc + MISSING_DEPENDENCY=devkit + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else PKGHANDLER_COMMAND= case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; esac if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." fi + fi - as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5 + as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5 fi if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then @@ -18919,8 +19285,8 @@ done # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -18935,8 +19301,8 @@ done # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -18964,9 +19330,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of CC, which resolves as \"$new_path\", is invalid." >&6;} @@ -19142,81 +19508,81 @@ $as_echo "$as_me: Resolving CC (as $path) failed, using $path directly." >&6;} 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 + 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 - 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; } TEST_COMPILER="$CC" - if test "x$OPENJDK_BUILD_OS" != xwindows; then - # Follow a chain of symbolic links. Use readlink - # where it exists, else fall back to horribly - # complicated shell code. - if test "x$READLINK_TESTED" != yes; then - # On MacOSX there is a readlink tool with a different - # purpose than the GNU readlink tool. Check the found readlink. - ISGNU=`$READLINK --version 2>&1 | $GREP GNU` - if test "x$ISGNU" = x; then - # A readlink that we do not know how to use. - # Are there other non-GNU readlinks out there? - READLINK_TESTED=yes - READLINK= - fi - fi - - if test "x$READLINK" != x; then - TEST_COMPILER=`$READLINK -f $TEST_COMPILER` - else - # Save the current directory for restoring afterwards - STARTDIR=$PWD - COUNTER=0 - sym_link_dir=`$DIRNAME $TEST_COMPILER` - sym_link_file=`$BASENAME $TEST_COMPILER` - cd $sym_link_dir - # Use -P flag to resolve symlinks in directories. - cd `$THEPWDCMD -P` - sym_link_dir=`$THEPWDCMD -P` - # Resolve file symlinks - while test $COUNTER -lt 20; do - ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` - if test "x$ISLINK" == x; then - # This is not a symbolic link! We are done! - break - fi - # Again resolve directory symlinks since the target of the just found - # link could be in a different directory - cd `$DIRNAME $ISLINK` - sym_link_dir=`$THEPWDCMD -P` - sym_link_file=`$BASENAME $ISLINK` - let COUNTER=COUNTER+1 - done - cd $STARTDIR - TEST_COMPILER=$sym_link_dir/$sym_link_file - fi + if test "x$OPENJDK_BUILD_OS" != xwindows; then + # Follow a chain of symbolic links. Use readlink + # where it exists, else fall back to horribly + # complicated shell code. + if test "x$READLINK_TESTED" != yes; then + # On MacOSX there is a readlink tool with a different + # purpose than the GNU readlink tool. Check the found readlink. + ISGNU=`$READLINK --version 2>&1 | $GREP GNU` + if test "x$ISGNU" = x; then + # A readlink that we do not know how to use. + # Are there other non-GNU readlinks out there? + READLINK_TESTED=yes + READLINK= + fi fi + if test "x$READLINK" != x; then + TEST_COMPILER=`$READLINK -f $TEST_COMPILER` + else + # Save the current directory for restoring afterwards + STARTDIR=$PWD + COUNTER=0 + sym_link_dir=`$DIRNAME $TEST_COMPILER` + sym_link_file=`$BASENAME $TEST_COMPILER` + cd $sym_link_dir + # Use -P flag to resolve symlinks in directories. + cd `$THEPWDCMD -P` + sym_link_dir=`$THEPWDCMD -P` + # Resolve file symlinks + while test $COUNTER -lt 20; do + ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` + if test "x$ISLINK" == x; then + # This is not a symbolic link! We are done! + break + fi + # Again resolve directory symlinks since the target of the just found + # link could be in a different directory + cd `$DIRNAME $ISLINK` + sym_link_dir=`$THEPWDCMD -P` + sym_link_file=`$BASENAME $ISLINK` + let COUNTER=COUNTER+1 + done + cd $STARTDIR + TEST_COMPILER=$sym_link_dir/$sym_link_file + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST_COMPILER" >&5 $as_echo "$TEST_COMPILER" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CC is disguised ccache" >&5 @@ -19355,8 +19721,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -19371,8 +19737,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -19400,9 +19766,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$new_path\", is invalid." >&6;} @@ -19578,82 +19944,82 @@ $as_echo "$as_me: Resolving PROPER_COMPILER_CC (as $path) failed, using $path di 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5 + 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 - 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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resolved symbolic links for CC" >&5 $as_echo_n "checking for resolved symbolic links for CC... " >&6; } - if test "x$OPENJDK_BUILD_OS" != xwindows; then - # Follow a chain of symbolic links. Use readlink - # where it exists, else fall back to horribly - # complicated shell code. - if test "x$READLINK_TESTED" != yes; then - # On MacOSX there is a readlink tool with a different - # purpose than the GNU readlink tool. Check the found readlink. - ISGNU=`$READLINK --version 2>&1 | $GREP GNU` - if test "x$ISGNU" = x; then - # A readlink that we do not know how to use. - # Are there other non-GNU readlinks out there? - READLINK_TESTED=yes - READLINK= - fi - fi - - if test "x$READLINK" != x; then - PROPER_COMPILER_CC=`$READLINK -f $PROPER_COMPILER_CC` - else - # Save the current directory for restoring afterwards - STARTDIR=$PWD - COUNTER=0 - sym_link_dir=`$DIRNAME $PROPER_COMPILER_CC` - sym_link_file=`$BASENAME $PROPER_COMPILER_CC` - cd $sym_link_dir - # Use -P flag to resolve symlinks in directories. - cd `$THEPWDCMD -P` - sym_link_dir=`$THEPWDCMD -P` - # Resolve file symlinks - while test $COUNTER -lt 20; do - ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` - if test "x$ISLINK" == x; then - # This is not a symbolic link! We are done! - break - fi - # Again resolve directory symlinks since the target of the just found - # link could be in a different directory - cd `$DIRNAME $ISLINK` - sym_link_dir=`$THEPWDCMD -P` - sym_link_file=`$BASENAME $ISLINK` - let COUNTER=COUNTER+1 - done - cd $STARTDIR - PROPER_COMPILER_CC=$sym_link_dir/$sym_link_file - fi + if test "x$OPENJDK_BUILD_OS" != xwindows; then + # Follow a chain of symbolic links. Use readlink + # where it exists, else fall back to horribly + # complicated shell code. + if test "x$READLINK_TESTED" != yes; then + # On MacOSX there is a readlink tool with a different + # purpose than the GNU readlink tool. Check the found readlink. + ISGNU=`$READLINK --version 2>&1 | $GREP GNU` + if test "x$ISGNU" = x; then + # A readlink that we do not know how to use. + # Are there other non-GNU readlinks out there? + READLINK_TESTED=yes + READLINK= + fi fi + if test "x$READLINK" != x; then + PROPER_COMPILER_CC=`$READLINK -f $PROPER_COMPILER_CC` + else + # Save the current directory for restoring afterwards + STARTDIR=$PWD + COUNTER=0 + sym_link_dir=`$DIRNAME $PROPER_COMPILER_CC` + sym_link_file=`$BASENAME $PROPER_COMPILER_CC` + cd $sym_link_dir + # Use -P flag to resolve symlinks in directories. + cd `$THEPWDCMD -P` + sym_link_dir=`$THEPWDCMD -P` + # Resolve file symlinks + while test $COUNTER -lt 20; do + ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` + if test "x$ISLINK" == x; then + # This is not a symbolic link! We are done! + break + fi + # Again resolve directory symlinks since the target of the just found + # link could be in a different directory + cd `$DIRNAME $ISLINK` + sym_link_dir=`$THEPWDCMD -P` + sym_link_file=`$BASENAME $ISLINK` + let COUNTER=COUNTER+1 + done + cd $STARTDIR + PROPER_COMPILER_CC=$sym_link_dir/$sym_link_file + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CC" >&5 $as_echo "$PROPER_COMPILER_CC" >&6; } CC="$PROPER_COMPILER_CC" @@ -19684,7 +20050,7 @@ $as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_TEST\ fi elif test "x$OPENJDK_TARGET_OS" = xwindows; then # First line typically looks something like: - # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 + # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*Version \([1-9][0-9.]*\) .*/\1/p"` COMPILER_VENDOR="Microsoft CL.EXE" @@ -19724,8 +20090,8 @@ $as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSIO $as_echo "$as_me: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&6;} -# Now that we have resolved CC ourself, let autoconf have its go at it -ac_ext=c + # Now that we have resolved CC ourself, let autoconf have its go at it + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -20323,17 +20689,17 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -### Locate C++ compiler (CXX) + ### Locate C++ compiler (CXX) -if test "x$CXX" != x; then - COMPILER_CHECK_LIST="$CXX" -elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then - COMPILER_CHECK_LIST="cl" -elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - COMPILER_CHECK_LIST="CC g++" -else - COMPILER_CHECK_LIST="g++ CC" -fi + if test "x$CXX" != x; then + COMPILER_CHECK_LIST="$CXX" + elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then + COMPILER_CHECK_LIST="cl" + elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then + COMPILER_CHECK_LIST="CC g++" + else + COMPILER_CHECK_LIST="g++ CC" + fi COMPILER_NAME=C++ @@ -20446,31 +20812,38 @@ done if test "x$CXX" = x; then - # Print a helpful message on how to acquire the necessary build dependency. - # devkit is the help tag: freetyp2, cups, pulse, alsa etc - MISSING_DEPENDENCY=devkit + # Print a helpful message on how to acquire the necessary build dependency. + # devkit is the help tag: freetype, cups, pulse, alsa etc + MISSING_DEPENDENCY=devkit + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else PKGHANDLER_COMMAND= case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; esac if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." fi + fi - as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5 + as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5 fi if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then @@ -20491,8 +20864,8 @@ done # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -20507,8 +20880,8 @@ done # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -20536,9 +20909,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of CXX, which resolves as \"$new_path\", is invalid." >&6;} @@ -20714,81 +21087,81 @@ $as_echo "$as_me: Resolving CXX (as $path) failed, using $path directly." >&6;} 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 + 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 - 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; } TEST_COMPILER="$CXX" - if test "x$OPENJDK_BUILD_OS" != xwindows; then - # Follow a chain of symbolic links. Use readlink - # where it exists, else fall back to horribly - # complicated shell code. - if test "x$READLINK_TESTED" != yes; then - # On MacOSX there is a readlink tool with a different - # purpose than the GNU readlink tool. Check the found readlink. - ISGNU=`$READLINK --version 2>&1 | $GREP GNU` - if test "x$ISGNU" = x; then - # A readlink that we do not know how to use. - # Are there other non-GNU readlinks out there? - READLINK_TESTED=yes - READLINK= - fi - fi - - if test "x$READLINK" != x; then - TEST_COMPILER=`$READLINK -f $TEST_COMPILER` - else - # Save the current directory for restoring afterwards - STARTDIR=$PWD - COUNTER=0 - sym_link_dir=`$DIRNAME $TEST_COMPILER` - sym_link_file=`$BASENAME $TEST_COMPILER` - cd $sym_link_dir - # Use -P flag to resolve symlinks in directories. - cd `$THEPWDCMD -P` - sym_link_dir=`$THEPWDCMD -P` - # Resolve file symlinks - while test $COUNTER -lt 20; do - ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` - if test "x$ISLINK" == x; then - # This is not a symbolic link! We are done! - break - fi - # Again resolve directory symlinks since the target of the just found - # link could be in a different directory - cd `$DIRNAME $ISLINK` - sym_link_dir=`$THEPWDCMD -P` - sym_link_file=`$BASENAME $ISLINK` - let COUNTER=COUNTER+1 - done - cd $STARTDIR - TEST_COMPILER=$sym_link_dir/$sym_link_file - fi + if test "x$OPENJDK_BUILD_OS" != xwindows; then + # Follow a chain of symbolic links. Use readlink + # where it exists, else fall back to horribly + # complicated shell code. + if test "x$READLINK_TESTED" != yes; then + # On MacOSX there is a readlink tool with a different + # purpose than the GNU readlink tool. Check the found readlink. + ISGNU=`$READLINK --version 2>&1 | $GREP GNU` + if test "x$ISGNU" = x; then + # A readlink that we do not know how to use. + # Are there other non-GNU readlinks out there? + READLINK_TESTED=yes + READLINK= + fi fi + if test "x$READLINK" != x; then + TEST_COMPILER=`$READLINK -f $TEST_COMPILER` + else + # Save the current directory for restoring afterwards + STARTDIR=$PWD + COUNTER=0 + sym_link_dir=`$DIRNAME $TEST_COMPILER` + sym_link_file=`$BASENAME $TEST_COMPILER` + cd $sym_link_dir + # Use -P flag to resolve symlinks in directories. + cd `$THEPWDCMD -P` + sym_link_dir=`$THEPWDCMD -P` + # Resolve file symlinks + while test $COUNTER -lt 20; do + ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` + if test "x$ISLINK" == x; then + # This is not a symbolic link! We are done! + break + fi + # Again resolve directory symlinks since the target of the just found + # link could be in a different directory + cd `$DIRNAME $ISLINK` + sym_link_dir=`$THEPWDCMD -P` + sym_link_file=`$BASENAME $ISLINK` + let COUNTER=COUNTER+1 + done + cd $STARTDIR + TEST_COMPILER=$sym_link_dir/$sym_link_file + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST_COMPILER" >&5 $as_echo "$TEST_COMPILER" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CXX is disguised ccache" >&5 @@ -20927,8 +21300,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -20943,8 +21316,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -20972,9 +21345,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$new_path\", is invalid." >&6;} @@ -21150,82 +21523,82 @@ $as_echo "$as_me: Resolving PROPER_COMPILER_CXX (as $path) failed, using $path d 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5 + 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 - 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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resolved symbolic links for CXX" >&5 $as_echo_n "checking for resolved symbolic links for CXX... " >&6; } - if test "x$OPENJDK_BUILD_OS" != xwindows; then - # Follow a chain of symbolic links. Use readlink - # where it exists, else fall back to horribly - # complicated shell code. - if test "x$READLINK_TESTED" != yes; then - # On MacOSX there is a readlink tool with a different - # purpose than the GNU readlink tool. Check the found readlink. - ISGNU=`$READLINK --version 2>&1 | $GREP GNU` - if test "x$ISGNU" = x; then - # A readlink that we do not know how to use. - # Are there other non-GNU readlinks out there? - READLINK_TESTED=yes - READLINK= - fi - fi - - if test "x$READLINK" != x; then - PROPER_COMPILER_CXX=`$READLINK -f $PROPER_COMPILER_CXX` - else - # Save the current directory for restoring afterwards - STARTDIR=$PWD - COUNTER=0 - sym_link_dir=`$DIRNAME $PROPER_COMPILER_CXX` - sym_link_file=`$BASENAME $PROPER_COMPILER_CXX` - cd $sym_link_dir - # Use -P flag to resolve symlinks in directories. - cd `$THEPWDCMD -P` - sym_link_dir=`$THEPWDCMD -P` - # Resolve file symlinks - while test $COUNTER -lt 20; do - ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` - if test "x$ISLINK" == x; then - # This is not a symbolic link! We are done! - break - fi - # Again resolve directory symlinks since the target of the just found - # link could be in a different directory - cd `$DIRNAME $ISLINK` - sym_link_dir=`$THEPWDCMD -P` - sym_link_file=`$BASENAME $ISLINK` - let COUNTER=COUNTER+1 - done - cd $STARTDIR - PROPER_COMPILER_CXX=$sym_link_dir/$sym_link_file - fi + if test "x$OPENJDK_BUILD_OS" != xwindows; then + # Follow a chain of symbolic links. Use readlink + # where it exists, else fall back to horribly + # complicated shell code. + if test "x$READLINK_TESTED" != yes; then + # On MacOSX there is a readlink tool with a different + # purpose than the GNU readlink tool. Check the found readlink. + ISGNU=`$READLINK --version 2>&1 | $GREP GNU` + if test "x$ISGNU" = x; then + # A readlink that we do not know how to use. + # Are there other non-GNU readlinks out there? + READLINK_TESTED=yes + READLINK= + fi fi + if test "x$READLINK" != x; then + PROPER_COMPILER_CXX=`$READLINK -f $PROPER_COMPILER_CXX` + else + # Save the current directory for restoring afterwards + STARTDIR=$PWD + COUNTER=0 + sym_link_dir=`$DIRNAME $PROPER_COMPILER_CXX` + sym_link_file=`$BASENAME $PROPER_COMPILER_CXX` + cd $sym_link_dir + # Use -P flag to resolve symlinks in directories. + cd `$THEPWDCMD -P` + sym_link_dir=`$THEPWDCMD -P` + # Resolve file symlinks + while test $COUNTER -lt 20; do + ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` + if test "x$ISLINK" == x; then + # This is not a symbolic link! We are done! + break + fi + # Again resolve directory symlinks since the target of the just found + # link could be in a different directory + cd `$DIRNAME $ISLINK` + sym_link_dir=`$THEPWDCMD -P` + sym_link_file=`$BASENAME $ISLINK` + let COUNTER=COUNTER+1 + done + cd $STARTDIR + PROPER_COMPILER_CXX=$sym_link_dir/$sym_link_file + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CXX" >&5 $as_echo "$PROPER_COMPILER_CXX" >&6; } CXX="$PROPER_COMPILER_CXX" @@ -21256,7 +21629,7 @@ $as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_TEST\ fi elif test "x$OPENJDK_TARGET_OS" = xwindows; then # First line typically looks something like: - # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 + # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*Version \([1-9][0-9.]*\) .*/\1/p"` COMPILER_VENDOR="Microsoft CL.EXE" @@ -21296,8 +21669,8 @@ $as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSIO $as_echo "$as_me: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&6;} -# Now that we have resolved CXX ourself, let autoconf have its go at it -ac_ext=cpp + # Now that we have resolved CXX ourself, let autoconf have its go at it + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -21555,9 +21928,9 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -### Locate other tools + ### Locate other tools -if test "x$OPENJDK_TARGET_OS" = xmacosx; then + if test "x$OPENJDK_TARGET_OS" = xmacosx; then ac_ext=m ac_cpp='$OBJCPP $CPPFLAGS' ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -21828,8 +22201,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -21844,8 +22217,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -21873,9 +22246,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJC, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of OBJC, which resolves as \"$new_path\", is invalid." >&6;} @@ -22051,53 +22424,53 @@ $as_echo "$as_me: Resolving OBJC (as $path) failed, using $path directly." >&6;} 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of OBJC" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of OBJC" "$LINENO" 5 + 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 - 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 + else OBJC= -fi + fi -# Restore the flags to the user specified values. -# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" -CFLAGS="$ORG_CFLAGS" -CXXFLAGS="$ORG_CXXFLAGS" -OBJCFLAGS="$ORG_OBJCFLAGS" + # Restore the flags to the user specified values. + # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" + CFLAGS="$ORG_CFLAGS" + CXXFLAGS="$ORG_CXXFLAGS" + OBJCFLAGS="$ORG_OBJCFLAGS" -LD="$CC" -LDEXE="$CC" -LDCXX="$CXX" -LDEXECXX="$CXX" + LD="$CC" + LDEXE="$CC" + LDCXX="$CXX" + LDEXECXX="$CXX" -# LDEXE is the linker to use, when creating executables. + # LDEXE is the linker to use, when creating executables. -# Linking C++ libraries. + # Linking C++ libraries. -# Linking C++ executables. + # Linking C++ executables. -if test "x$OPENJDK_TARGET_OS" != xwindows; then + if test "x$OPENJDK_TARGET_OS" != xwindows; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 @@ -22209,8 +22582,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -22225,8 +22598,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -22254,9 +22627,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of AR, which resolves as \"$new_path\", is invalid." >&6;} @@ -22432,47 +22805,47 @@ $as_echo "$as_me: Resolving AR (as $path) failed, using $path directly." >&6;} 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 + 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 - 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 + fi + if test "x$OPENJDK_TARGET_OS" = xmacosx; then ARFLAGS="-r" -else + else ARFLAGS="" -fi + fi -# For hotspot, we need these in Windows mixed path; other platforms keep them the same -HOTSPOT_CXX="$CXX" -HOTSPOT_LD="$LD" + # For hotspot, we need these in Windows mixed path; other platforms keep them the same + HOTSPOT_CXX="$CXX" + HOTSPOT_LD="$LD" -COMPILER_NAME=gcc -COMPILER_TYPE=CC -if test "x$OPENJDK_TARGET_OS" = xwindows; then : + COMPILER_NAME=gcc + COMPILER_TYPE=CC + if test "x$OPENJDK_TARGET_OS" = xwindows; then : # For now, assume that we are always compiling using cl.exe. CC_OUT_OPTION=-Fo @@ -22556,8 +22929,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -22572,8 +22945,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -22601,9 +22974,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINLD, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of WINLD, which resolves as \"$new_path\", is invalid." >&6;} @@ -22779,29 +23152,29 @@ $as_echo "$as_me: Resolving WINLD (as $path) failed, using $path directly." >&6; 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5 + 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 - 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 @@ -22893,8 +23266,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -22909,8 +23282,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -22938,9 +23311,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of MT, which resolves as \"$new_path\", is invalid." >&6;} @@ -23116,29 +23489,29 @@ $as_echo "$as_me: Resolving MT (as $path) failed, using $path directly." >&6;} 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5 + 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 - 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. @@ -23214,8 +23587,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -23230,8 +23603,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -23259,9 +23632,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of RC, which resolves as \"$new_path\", is invalid." >&6;} @@ -23437,29 +23810,29 @@ $as_echo "$as_me: Resolving RC (as $path) failed, using $path directly." >&6;} 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5 + 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 - 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, @@ -23514,26 +23887,26 @@ $as_echo "$as_me: Rewriting RC to \"$new_complete\"" >&6;} RC_FLAGS="-nologo -l 0x409 -r" if test "x$VARIANT" = xOPT; then : - RC_FLAGS="$RC_FLAGS -d NDEBUG" + RC_FLAGS="$RC_FLAGS -d NDEBUG" fi - # The version variables used to create RC_FLAGS may be overridden - # in a custom configure script, or possibly the command line. - # Let those variables be expanded at make time in spec.gmk. - # The \$ are escaped to the shell, and the $(...) variables - # are evaluated by make. - RC_FLAGS="$RC_FLAGS \ - -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \ - -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \ - -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \ - -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \ - -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \ - -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \ - -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\"" + # The version variables used to create RC_FLAGS may be overridden + # in a custom configure script, or possibly the command line. + # Let those variables be expanded at make time in spec.gmk. + # The \$ are escaped to the shell, and the $(...) variables + # are evaluated by make. + RC_FLAGS="$RC_FLAGS \ + -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \ + -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \ + -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \ + -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \ + -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \ + -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \ + -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\"" - # lib.exe is used to create static libraries. - # Extract the first word of "lib", so it can be a program name with args. + # lib.exe is used to create static libraries. + # Extract the first word of "lib", so it can be a program name with args. 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; } @@ -23589,8 +23962,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -23605,8 +23978,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -23634,9 +24007,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINAR, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of WINAR, which resolves as \"$new_path\", is invalid." >&6;} @@ -23812,34 +24185,34 @@ $as_echo "$as_me: Resolving WINAR (as $path) failed, using $path directly." >&6; 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5 + 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 - 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" + AR="$WINAR" + ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT" - # Extract the first word of "dumpbin", so it can be a program name with args. + # Extract the first word of "dumpbin", so it can be a program name with args. 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; } @@ -23895,8 +24268,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -23911,8 +24284,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -23940,9 +24313,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of DUMPBIN, which resolves as \"$new_path\", is invalid." >&6;} @@ -24118,39 +24491,39 @@ $as_echo "$as_me: Resolving DUMPBIN (as $path) failed, using $path directly." >& 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 + 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 - 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 - CCXXFLAGS="$CCXXFLAGS -nologo" + COMPILER_TYPE=CL + CCXXFLAGS="$CCXXFLAGS -nologo" fi -ac_ext=c + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -24306,8 +24679,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -24322,8 +24695,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -24351,9 +24724,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of CPP, which resolves as \"$new_path\", is invalid." >&6;} @@ -24529,32 +24902,32 @@ $as_echo "$as_me: Resolving CPP (as $path) failed, using $path directly." >&6;} 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 + 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 - 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 + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -24706,8 +25079,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -24722,8 +25095,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -24751,9 +25124,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of CXXCPP, which resolves as \"$new_path\", is invalid." >&6;} @@ -24929,32 +25302,32 @@ $as_echo "$as_me: Resolving CXXCPP (as $path) failed, using $path directly." >&6 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 + 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 - 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 + if test "x$COMPILE_TYPE" != "xcross"; then # If we are not cross compiling, use the same compilers for # building the build platform executables. The cross-compilation # case needed to be done earlier, but this can only be done after @@ -24962,20 +25335,20 @@ if test "x$COMPILE_TYPE" != "xcross"; then BUILD_CC="$CC" BUILD_CXX="$CXX" BUILD_LD="$LD" -fi + fi -# for solaris we really need solaris tools, and not gnu equivalent -# these seems to normally reside in /usr/ccs/bin so add that to path before -# starting to probe -# -# NOTE: I add this /usr/ccs/bin after TOOLS but before OLD_PATH -# so that it can be overriden --with-tools-dir -if test "x$OPENJDK_BUILD_OS" = xsolaris; then + # for solaris we really need solaris tools, and not gnu equivalent + # these seems to normally reside in /usr/ccs/bin so add that to path before + # starting to probe + # + # NOTE: I add this /usr/ccs/bin after TOOLS but before OLD_PATH + # so that it can be overriden --with-tools-dir + if test "x$OPENJDK_BUILD_OS" = xsolaris; then PATH="${TOOLS_DIR}:/usr/ccs/bin:${OLD_PATH}" -fi + fi -# Find the right assembler. -if test "x$OPENJDK_TARGET_OS" = xsolaris; then + # Find the right assembler. + if test "x$OPENJDK_TARGET_OS" = xsolaris; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -25035,8 +25408,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -25051,8 +25424,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -25080,9 +25453,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of AS, which resolves as \"$new_path\", is invalid." >&6;} @@ -25258,36 +25631,36 @@ $as_echo "$as_me: Resolving AS (as $path) failed, using $path directly." >&6;} 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 + 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 - 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 + else AS="$CC -c" -fi + fi -if test "x$OPENJDK_TARGET_OS" = xsolaris; then + if test "x$OPENJDK_TARGET_OS" = xsolaris; then # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -25347,8 +25720,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -25363,8 +25736,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -25392,9 +25765,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of NM, which resolves as \"$new_path\", is invalid." >&6;} @@ -25570,29 +25943,29 @@ $as_echo "$as_me: Resolving NM (as $path) failed, using $path directly." >&6;} 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + 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 - 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 "gnm", so it can be a program name with args. set dummy gnm; ac_word=$2 @@ -25653,8 +26026,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -25669,8 +26042,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -25698,9 +26071,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of GNM, which resolves as \"$new_path\", is invalid." >&6;} @@ -25876,29 +26249,29 @@ $as_echo "$as_me: Resolving GNM (as $path) failed, using $path directly." >&6;} fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$complete\", is not found." >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$complete\", is not found." >&5 $as_echo "$as_me: The path of GNM, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5 + 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 - GNM="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting GNM to \"$new_complete\"" >&5 + GNM="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting GNM to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting GNM 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 @@ -25959,8 +26332,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -25975,8 +26348,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -26004,9 +26377,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of STRIP, which resolves as \"$new_path\", is invalid." >&6;} @@ -26182,29 +26555,29 @@ $as_echo "$as_me: Resolving STRIP (as $path) failed, using $path directly." >&6; 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + 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 - 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 @@ -26265,8 +26638,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -26281,8 +26654,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -26310,9 +26683,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of MCS, which resolves as \"$new_path\", is invalid." >&6;} @@ -26488,31 +26861,31 @@ $as_echo "$as_me: Resolving MCS (as $path) failed, using $path directly." >&6;} 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 + 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 - 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 + elif test "x$OPENJDK_TARGET_OS" != xwindows; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 @@ -26624,8 +26997,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -26640,8 +27013,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -26669,9 +27042,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of NM, which resolves as \"$new_path\", is invalid." >&6;} @@ -26847,29 +27220,29 @@ $as_echo "$as_me: Resolving NM (as $path) failed, using $path directly." >&6;} 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + 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 - 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 GNM="$NM" @@ -26984,8 +27357,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -27000,8 +27373,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -27029,9 +27402,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of STRIP, which resolves as \"$new_path\", is invalid." >&6;} @@ -27207,35 +27580,35 @@ $as_echo "$as_me: Resolving STRIP (as $path) failed, using $path directly." >&6; 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + 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 - 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 + fi -# objcopy is used for moving debug symbols to separate files when -# full debug symbols are enabled. -if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then + # objcopy is used for moving debug symbols to separate files when + # full debug symbols are enabled. + if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then if test -n "$ac_tool_prefix"; then for ac_prog in gobjcopy objcopy do @@ -27357,8 +27730,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -27373,8 +27746,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -27402,9 +27775,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of OBJCOPY, which resolves as \"$new_path\", is invalid." >&6;} @@ -27580,34 +27953,34 @@ $as_echo "$as_me: Resolving OBJCOPY (as $path) failed, using $path directly." >& 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 + 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 - 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 + fi -if test -n "$ac_tool_prefix"; then + if test -n "$ac_tool_prefix"; then for ac_prog in gobjdump objdump do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. @@ -27707,8 +28080,8 @@ esac fi fi -if test "x$OBJDUMP" != x; then - # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE bails if argument is missing. + if test "x$OBJDUMP" != x; then + # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE bails if argument is missing. if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then @@ -27728,8 +28101,8 @@ if test "x$OBJDUMP" != x; then # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -27744,8 +28117,8 @@ if test "x$OBJDUMP" != x; then # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -27773,9 +28146,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of OBJDUMP, which resolves as \"$new_path\", is invalid." >&6;} @@ -27951,34 +28324,34 @@ $as_echo "$as_me: Resolving OBJDUMP (as $path) failed, using $path directly." >& 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 + 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 - 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 + fi -if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - # Extract the first word of "lipo", so it can be a program name with args. + if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + # Extract the first word of "lipo", so it can be a program name with args. 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; } @@ -28037,8 +28410,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -28053,8 +28426,8 @@ fi # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then new_path=`$CYGPATH -u "$path"` fi if test "x$new_path" = x; then @@ -28082,9 +28455,9 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # Short path failed, file does not exist as specified. # Try adding .exe or .cmd if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" + input_to_shortpath="${new_path}.exe" elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" + input_to_shortpath="${new_path}.cmd" else { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$new_path\", is invalid." >&5 $as_echo "$as_me: The path of LIPO, which resolves as \"$new_path\", is invalid." >&6;} @@ -28260,36 +28633,36 @@ $as_echo "$as_me: Resolving LIPO (as $path) failed, using $path directly." >&6;} 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:${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 " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5 fi + as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5 + 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 - 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 + fi -# Restore old path without tools dir -PATH="$OLD_PATH" + # Restore old path without tools dir + PATH="$OLD_PATH" # FIXME: Currently we must test this after paths but before flags. Fix! @@ -28427,15 +28800,15 @@ done -############################################################################### -# -# Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code. -# (The JVM can use 32 or 64 bit Java pointers but that decision -# is made at runtime.) -# + ############################################################################### + # + # Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code. + # (The JVM can use 32 or 64 bit Java pointers but that decision + # is made at runtime.) + # -if test "x$OPENJDK_TARGET_OS" = xsolaris; then - # Always specify -m flags on Solaris + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + # Always specify -m flags on Solaris # When we add flags to the "official" CFLAGS etc, we need to # keep track of these additions in ADDED_CFLAGS etc. These @@ -28453,9 +28826,9 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris; then CXXFLAGS_JDK="${CXXFLAGS_JDK}${ADDED_CXXFLAGS}" LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}" -elif test "x$COMPILE_TYPE" = xreduced; then - if test "x$OPENJDK_TARGET_OS" != xwindows; then - # Specify -m if running reduced on other Posix platforms + elif test "x$COMPILE_TYPE" = xreduced; then + if test "x$OPENJDK_TARGET_OS" != xwindows; then + # Specify -m if running reduced on other Posix platforms # When we add flags to the "official" CFLAGS etc, we need to # keep track of these additions in ADDED_CFLAGS etc. These @@ -28473,11 +28846,11 @@ elif test "x$COMPILE_TYPE" = xreduced; then CXXFLAGS_JDK="${CXXFLAGS_JDK}${ADDED_CXXFLAGS}" LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}" + fi fi -fi -# Make compilation sanity check -for ac_header in stdio.h + # Make compilation sanity check + for ac_header in stdio.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" if test "x$ac_cv_header_stdio_h" = xyes; then : @@ -28487,23 +28860,23 @@ _ACEOF else - { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to compile stdio.h. This likely implies missing compile dependencies." >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to compile stdio.h. This likely implies missing compile dependencies." >&5 $as_echo "$as_me: Failed to compile stdio.h. This likely implies missing compile dependencies." >&6;} - if test "x$COMPILE_TYPE" = xreduced; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a reduced build. Check that you have 32-bit libraries installed." >&5 + if test "x$COMPILE_TYPE" = xreduced; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a reduced build. Check that you have 32-bit libraries installed." >&5 $as_echo "$as_me: You are doing a reduced build. Check that you have 32-bit libraries installed." >&6;} - elif test "x$COMPILE_TYPE" = xcross; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&5 + elif test "x$COMPILE_TYPE" = xcross; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&5 $as_echo "$as_me: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&6;} - fi - as_fn_error $? "Cannot continue." "$LINENO" 5 + fi + as_fn_error $? "Cannot continue." "$LINENO" 5 fi done -# The cast to long int works around a bug in the HP C Compiler + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -28537,34 +28910,34 @@ _ACEOF -if test "x$SIZEOF_INT_P" != "x$ac_cv_sizeof_int_p"; then - # Workaround autoconf bug, see http://lists.gnu.org/archive/html/autoconf/2010-07/msg00004.html - SIZEOF_INT_P="$ac_cv_sizeof_int_p" -fi + if test "x$SIZEOF_INT_P" != "x$ac_cv_sizeof_int_p"; then + # Workaround autoconf bug, see http://lists.gnu.org/archive/html/autoconf/2010-07/msg00004.html + SIZEOF_INT_P="$ac_cv_sizeof_int_p" + fi -if test "x$SIZEOF_INT_P" = x; then + if test "x$SIZEOF_INT_P" = x; then # The test failed, lets stick to the assumed value. { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS." >&5 $as_echo "$as_me: WARNING: The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS." >&2;} -else + else TESTED_TARGET_CPU_BITS=`expr 8 \* $SIZEOF_INT_P` if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then - as_fn_error $? "The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" "$LINENO" 5 + as_fn_error $? "The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" "$LINENO" 5 fi -fi + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for target address size" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for target address size" >&5 $as_echo_n "checking for target address size... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_TARGET_CPU_BITS bits" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_TARGET_CPU_BITS bits" >&5 $as_echo "$OPENJDK_TARGET_CPU_BITS bits" >&6; } -############################################################################### -# -# Is the target little of big endian? -# - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 + ############################################################################### + # + # Is the target little of big endian? + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 @@ -28785,23 +29158,23 @@ $as_echo "$ac_cv_c_bigendian" >&6; } esac -if test "x$ENDIAN" = xuniversal_endianness; then + if test "x$ENDIAN" = xuniversal_endianness; then as_fn_error $? "Building with both big and little endianness is not supported" "$LINENO" 5 -fi -if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then + fi + if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then as_fn_error $? "The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)" "$LINENO" 5 -fi + fi # Configure flags for the tools -############################################################################### -# -# How to compile shared libraries. -# + ############################################################################### + # + # How to compile shared libraries. + # -if test "x$GCC" = xyes; then + if test "x$GCC" = xyes; then COMPILER_NAME=gcc PICFLAG="-fPIC" LIBRARY_PREFIX=lib @@ -28826,61 +29199,61 @@ if test "x$GCC" = xyes; then # Linking is different on MacOSX if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # Might change in the future to clang. - COMPILER_NAME=gcc - SHARED_LIBRARY='lib$1.dylib' - SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" - SHARED_LIBRARY_SUFFIX='.dylib' - EXE_SUFFIX='' - SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/$1' - SET_SHARED_LIBRARY_MAPFILE='' - SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.' - SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" - POST_STRIP_CMD="$STRIP -S" + # Might change in the future to clang. + COMPILER_NAME=gcc + SHARED_LIBRARY='lib$1.dylib' + SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" + SHARED_LIBRARY_SUFFIX='.dylib' + EXE_SUFFIX='' + SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/$1' + SET_SHARED_LIBRARY_MAPFILE='' + SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.' + SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" + POST_STRIP_CMD="$STRIP -S" fi -else + else if test "x$OPENJDK_TARGET_OS" = xsolaris; then - # If it is not gcc, then assume it is the Oracle Solaris Studio Compiler - COMPILER_NAME=ossc - PICFLAG="-KPIC" - LIBRARY_PREFIX=lib - SHARED_LIBRARY='lib$1.so' - STATIC_LIBRARY='lib$1.a' - SHARED_LIBRARY_FLAGS="-G" - SHARED_LIBRARY_SUFFIX='.so' - STATIC_LIBRARY_SUFFIX='.a' - OBJ_SUFFIX='.o' - EXE_SUFFIX='' - SET_SHARED_LIBRARY_NAME='' - SET_SHARED_LIBRARY_MAPFILE='-M$1' - C_FLAG_REORDER='-xF' - CXX_FLAG_REORDER='-xF' - SET_SHARED_LIBRARY_ORIGIN='-R\$$$$ORIGIN$1' - SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" - CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__" - CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__" - CFLAGS_JDKLIB_EXTRA='-xstrconst' - POST_STRIP_CMD="$STRIP -x" - POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\"" + # If it is not gcc, then assume it is the Oracle Solaris Studio Compiler + COMPILER_NAME=ossc + PICFLAG="-KPIC" + LIBRARY_PREFIX=lib + SHARED_LIBRARY='lib$1.so' + STATIC_LIBRARY='lib$1.a' + SHARED_LIBRARY_FLAGS="-G" + SHARED_LIBRARY_SUFFIX='.so' + STATIC_LIBRARY_SUFFIX='.a' + OBJ_SUFFIX='.o' + EXE_SUFFIX='' + SET_SHARED_LIBRARY_NAME='' + SET_SHARED_LIBRARY_MAPFILE='-M$1' + C_FLAG_REORDER='-xF' + CXX_FLAG_REORDER='-xF' + SET_SHARED_LIBRARY_ORIGIN='-R\$$$$ORIGIN$1' + SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" + CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__" + CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__" + CFLAGS_JDKLIB_EXTRA='-xstrconst' + POST_STRIP_CMD="$STRIP -x" + POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\"" fi if test "x$OPENJDK_TARGET_OS" = xwindows; then - # If it is not gcc, then assume it is the MS Visual Studio compiler - COMPILER_NAME=cl - PICFLAG="" - LIBRARY_PREFIX= - SHARED_LIBRARY='$1.dll' - STATIC_LIBRARY='$1.lib' - SHARED_LIBRARY_FLAGS="-LD" - SHARED_LIBRARY_SUFFIX='.dll' - STATIC_LIBRARY_SUFFIX='.lib' - OBJ_SUFFIX='.obj' - EXE_SUFFIX='.exe' - SET_SHARED_LIBRARY_NAME='' - SET_SHARED_LIBRARY_MAPFILE='' - SET_SHARED_LIBRARY_ORIGIN='' - SET_EXECUTABLE_ORIGIN='' + # If it is not gcc, then assume it is the MS Visual Studio compiler + COMPILER_NAME=cl + PICFLAG="" + LIBRARY_PREFIX= + SHARED_LIBRARY='$1.dll' + STATIC_LIBRARY='$1.lib' + SHARED_LIBRARY_FLAGS="-LD" + SHARED_LIBRARY_SUFFIX='.dll' + STATIC_LIBRARY_SUFFIX='.lib' + OBJ_SUFFIX='.obj' + EXE_SUFFIX='.exe' + SET_SHARED_LIBRARY_NAME='' + SET_SHARED_LIBRARY_MAPFILE='' + SET_SHARED_LIBRARY_ORIGIN='' + SET_EXECUTABLE_ORIGIN='' fi -fi + fi @@ -28900,21 +29273,21 @@ fi -# The (cross) compiler is now configured, we can now test capabilities -# of the target platform. + # The (cross) compiler is now configured, we can now test capabilities + # of the target platform. -############################################################################### -# -# Setup the opt flags for different compilers -# and different operating systems. -# + ############################################################################### + # + # Setup the opt flags for different compilers + # and different operating systems. + # -# -# NOTE: check for -mstackrealign needs to be below potential addition of -m32 -# -if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then + # + # NOTE: check for -mstackrealign needs to be below potential addition of -m32 + # + if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then # On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned. # While waiting for a better solution, the current workaround is to use -mstackrealign. CFLAGS="$CFLAGS -mstackrealign" @@ -28926,148 +29299,149 @@ int main() { return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - as_fn_error $? "The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path." "$LINENO" 5 + as_fn_error $? "The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path." "$LINENO" 5 + fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi + fi -C_FLAG_DEPS="-MMD -MF" -CXX_FLAG_DEPS="-MMD -MF" + C_FLAG_DEPS="-MMD -MF" + CXX_FLAG_DEPS="-MMD -MF" -case $COMPILER_TYPE in - CC ) - case $COMPILER_NAME in - gcc ) - case $OPENJDK_TARGET_OS in - macosx ) - # On MacOSX we optimize for size, something - # we should do for all platforms? - C_O_FLAG_HI="-Os" - C_O_FLAG_NORM="-Os" - C_O_FLAG_NONE="" - ;; - *) - C_O_FLAG_HI="-O3" - C_O_FLAG_NORM="-O2" - C_O_FLAG_NONE="-O0" - ;; - esac - CXX_O_FLAG_HI="$C_O_FLAG_HI" - CXX_O_FLAG_NORM="$C_O_FLAG_NORM" - CXX_O_FLAG_NONE="$C_O_FLAG_NONE" - CFLAGS_DEBUG_SYMBOLS="-g" - CXXFLAGS_DEBUG_SYMBOLS="-g" - if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then + case $COMPILER_TYPE in + CC ) + case $COMPILER_NAME in + gcc ) + case $OPENJDK_TARGET_OS in + macosx ) + # On MacOSX we optimize for size, something + # we should do for all platforms? + C_O_FLAG_HI="-Os" + C_O_FLAG_NORM="-Os" + C_O_FLAG_NONE="" + ;; + *) + C_O_FLAG_HI="-O3" + C_O_FLAG_NORM="-O2" + C_O_FLAG_NONE="-O0" + ;; + esac + CXX_O_FLAG_HI="$C_O_FLAG_HI" + CXX_O_FLAG_NORM="$C_O_FLAG_NORM" + CXX_O_FLAG_NONE="$C_O_FLAG_NONE" + CFLAGS_DEBUG_SYMBOLS="-g" + CXXFLAGS_DEBUG_SYMBOLS="-g" + if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then CFLAGS_DEBUG_SYMBOLS="-g1" CXXFLAGS_DEBUG_SYMBOLS="-g1" - fi - ;; - ossc ) - # - # Forte has different names for this with their C++ compiler... - # - C_FLAG_DEPS="-xMMD -xMF" - CXX_FLAG_DEPS="-xMMD -xMF" + fi + ;; + ossc ) + # + # Forte has different names for this with their C++ compiler... + # + C_FLAG_DEPS="-xMMD -xMF" + CXX_FLAG_DEPS="-xMMD -xMF" - # Extra options used with HIGHEST - # - # WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be - # done with care, there are some assumptions below that need to - # be understood about the use of pointers, and IEEE behavior. - # - # Use non-standard floating point mode (not IEEE 754) - CC_HIGHEST="$CC_HIGHEST -fns" - # Do some simplification of floating point arithmetic (not IEEE 754) - CC_HIGHEST="$CC_HIGHEST -fsimple" - # Use single precision floating point with 'float' - CC_HIGHEST="$CC_HIGHEST -fsingle" - # Assume memory references via basic pointer types do not alias - # (Source with excessing pointer casting and data access with mixed - # pointer types are not recommended) - CC_HIGHEST="$CC_HIGHEST -xalias_level=basic" - # Use intrinsic or inline versions for math/std functions - # (If you expect perfect errno behavior, do not use this) - CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all" - # Loop data dependency optimizations (need -xO3 or higher) - CC_HIGHEST="$CC_HIGHEST -xdepend" - # Pointer parameters to functions do not overlap - # (Similar to -xalias_level=basic usage, but less obvious sometimes. - # If you pass in multiple pointers to the same data, do not use this) - CC_HIGHEST="$CC_HIGHEST -xrestrict" - # Inline some library routines - # (If you expect perfect errno behavior, do not use this) - CC_HIGHEST="$CC_HIGHEST -xlibmil" - # Use optimized math routines - # (If you expect perfect errno behavior, do not use this) - # Can cause undefined external on Solaris 8 X86 on __sincos, removing for now - #CC_HIGHEST="$CC_HIGHEST -xlibmopt" + # Extra options used with HIGHEST + # + # WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be + # done with care, there are some assumptions below that need to + # be understood about the use of pointers, and IEEE behavior. + # + # Use non-standard floating point mode (not IEEE 754) + CC_HIGHEST="$CC_HIGHEST -fns" + # Do some simplification of floating point arithmetic (not IEEE 754) + CC_HIGHEST="$CC_HIGHEST -fsimple" + # Use single precision floating point with 'float' + CC_HIGHEST="$CC_HIGHEST -fsingle" + # Assume memory references via basic pointer types do not alias + # (Source with excessing pointer casting and data access with mixed + # pointer types are not recommended) + CC_HIGHEST="$CC_HIGHEST -xalias_level=basic" + # Use intrinsic or inline versions for math/std functions + # (If you expect perfect errno behavior, do not use this) + CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all" + # Loop data dependency optimizations (need -xO3 or higher) + CC_HIGHEST="$CC_HIGHEST -xdepend" + # Pointer parameters to functions do not overlap + # (Similar to -xalias_level=basic usage, but less obvious sometimes. + # If you pass in multiple pointers to the same data, do not use this) + CC_HIGHEST="$CC_HIGHEST -xrestrict" + # Inline some library routines + # (If you expect perfect errno behavior, do not use this) + CC_HIGHEST="$CC_HIGHEST -xlibmil" + # Use optimized math routines + # (If you expect perfect errno behavior, do not use this) + # Can cause undefined external on Solaris 8 X86 on __sincos, removing for now + #CC_HIGHEST="$CC_HIGHEST -xlibmopt" - if test "x$OPENJDK_TARGET_CPU" = xsparc; then - CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" - CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s" - fi + if test "x$OPENJDK_TARGET_CPU" = xsparc; then + CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" + CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s" + fi - case $OPENJDK_TARGET_CPU_ARCH in - x86) - C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr" - C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr" - C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr" - C_O_FLAG_NONE="-xregs=no%frameptr" - CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr" - CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr" - CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr" - CXX_O_FLAG_NONE="-xregs=no%frameptr" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium" - CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium" - fi - ;; - sparc) - CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" - CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" - C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" - C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0" - C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0" - C_O_FLAG_NONE="" - CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" - CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" - CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" - CXX_O_FLAG_NONE="" - ;; - esac + case $OPENJDK_TARGET_CPU_ARCH in + x86) + C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr" + C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr" + C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr" + C_O_FLAG_NONE="-xregs=no%frameptr" + CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr" + CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr" + CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr" + CXX_O_FLAG_NONE="-xregs=no%frameptr" + if test "x$OPENJDK_TARGET_CPU" = xx86; then + C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium" + CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium" + fi + ;; + sparc) + CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" + CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" + C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" + C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0" + C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0" + C_O_FLAG_NONE="" + CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" + CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" + CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" + CXX_O_FLAG_NONE="" + ;; + esac - CFLAGS_DEBUG_SYMBOLS="-g -xs" - CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" - esac - ;; - CL ) - C_O_FLAG_HIGHEST="-O2" - C_O_FLAG_HI="-O1" - C_O_FLAG_NORM="-O1" - C_O_FLAG_NONE="-Od" - CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST" - CXX_O_FLAG_HI="$C_O_FLAG_HI" - CXX_O_FLAG_NORM="$C_O_FLAG_NORM" - CXX_O_FLAG_NONE="$C_O_FLAG_NONE" - ;; -esac + CFLAGS_DEBUG_SYMBOLS="-g -xs" + CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" + esac + ;; + CL ) + C_O_FLAG_HIGHEST="-O2" + C_O_FLAG_HI="-O1" + C_O_FLAG_NORM="-O1" + C_O_FLAG_NONE="-Od" + CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST" + CXX_O_FLAG_HI="$C_O_FLAG_HI" + CXX_O_FLAG_NORM="$C_O_FLAG_NORM" + CXX_O_FLAG_NONE="$C_O_FLAG_NONE" + ;; + esac -if test -z "$C_O_FLAG_HIGHEST"; then - C_O_FLAG_HIGHEST="$C_O_FLAG_HI" -fi + if test -z "$C_O_FLAG_HIGHEST"; then + C_O_FLAG_HIGHEST="$C_O_FLAG_HI" + fi -if test -z "$CXX_O_FLAG_HIGHEST"; then - CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HI" -fi + if test -z "$CXX_O_FLAG_HIGHEST"; then + CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HI" + fi @@ -29082,20 +29456,20 @@ fi -if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&5 + if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&5 $as_echo "$as_me: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&2;} -fi + fi -if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&5 + if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&5 $as_echo "$as_me: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&2;} -fi + fi -if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&5 + if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&5 $as_echo "$as_me: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&2;} -fi + fi # Check whether --with-extra-cflags was given. @@ -29118,128 +29492,128 @@ if test "${with_extra_ldflags+set}" = set; then : fi -CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags" -CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags" -LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags" + CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags" + CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags" + LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags" -# Hotspot needs these set in their legacy form -LEGACY_EXTRA_CFLAGS=$with_extra_cflags -LEGACY_EXTRA_CXXFLAGS=$with_extra_cxxflags -LEGACY_EXTRA_LDFLAGS=$with_extra_ldflags + # Hotspot needs these set in their legacy form + LEGACY_EXTRA_CFLAGS=$with_extra_cflags + LEGACY_EXTRA_CXXFLAGS=$with_extra_cxxflags + LEGACY_EXTRA_LDFLAGS=$with_extra_ldflags -############################################################################### -# -# Now setup the CFLAGS and LDFLAGS for the JDK build. -# Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build. -# -case $COMPILER_NAME in - gcc ) - CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \ - -pipe \ - -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" - case $OPENJDK_TARGET_CPU_ARCH in - arm ) - # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - ppc ) - # on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing - ;; - * ) - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer" - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ############################################################################### + # + # Now setup the CFLAGS and LDFLAGS for the JDK build. + # Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build. + # + case $COMPILER_NAME in + gcc ) + CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \ + -pipe \ + -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" + case $OPENJDK_TARGET_CPU_ARCH in + arm ) + # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" ;; - esac + ppc ) + # on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing ;; - ossc ) - CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" - case $OPENJDK_TARGET_CPU_ARCH in - x86 ) - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB" - CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE" + * ) + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer" + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" ;; - esac - - CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" - CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib" - - LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext" - LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib" + esac + ;; + ossc ) + CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" + case $OPENJDK_TARGET_CPU_ARCH in + x86 ) + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB" + CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE" ;; - cl ) - CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ - -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \ - -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ - -DWIN32 -DIAL" - case $OPENJDK_TARGET_CPU in - x86 ) - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86" - ;; - x86_64 ) - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64" - ;; - esac + esac + + CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" + CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib" + + LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext" + LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib" + ;; + cl ) + CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ + -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \ + -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ + -DWIN32 -DIAL" + case $OPENJDK_TARGET_CPU in + x86 ) + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86" ;; -esac + x86_64 ) + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64" + ;; + esac + ;; + esac -############################################################################### + ############################################################################### -# Adjust flags according to debug level. -case $DEBUG_LEVEL in - fastdebug ) - CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS" - CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS" - C_O_FLAG_HI="$C_O_FLAG_NORM" - C_O_FLAG_NORM="$C_O_FLAG_NORM" - CXX_O_FLAG_HI="$CXX_O_FLAG_NORM" - CXX_O_FLAG_NORM="$CXX_O_FLAG_NORM" - JAVAC_FLAGS="$JAVAC_FLAGS -g" - ;; - slowdebug ) - CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS" - CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS" - C_O_FLAG_HI="$C_O_FLAG_NONE" - C_O_FLAG_NORM="$C_O_FLAG_NONE" - CXX_O_FLAG_HI="$CXX_O_FLAG_NONE" - CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE" - JAVAC_FLAGS="$JAVAC_FLAGS -g" - ;; -esac + # Adjust flags according to debug level. + case $DEBUG_LEVEL in + fastdebug ) + CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS" + CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS" + C_O_FLAG_HI="$C_O_FLAG_NORM" + C_O_FLAG_NORM="$C_O_FLAG_NORM" + CXX_O_FLAG_HI="$CXX_O_FLAG_NORM" + CXX_O_FLAG_NORM="$CXX_O_FLAG_NORM" + JAVAC_FLAGS="$JAVAC_FLAGS -g" + ;; + slowdebug ) + CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS" + CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS" + C_O_FLAG_HI="$C_O_FLAG_NONE" + C_O_FLAG_NORM="$C_O_FLAG_NONE" + CXX_O_FLAG_HI="$CXX_O_FLAG_NONE" + CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE" + JAVAC_FLAGS="$JAVAC_FLAGS -g" + ;; + esac -CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64" -# The package path is used only on macosx? -PACKAGE_PATH=/opt/local + # The package path is used only on macosx? + PACKAGE_PATH=/opt/local -if test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then + if test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the # Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN # (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h). # Note: -Dmacro is the same as #define macro 1 - # -Dmacro= is the same as #define macro + # -Dmacro= is the same as #define macro if test "x$OPENJDK_TARGET_OS" = xsolaris; then - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN=" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN=" else - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN" fi -else + else CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN" -fi -if test "x$OPENJDK_TARGET_OS" = xlinux; then + fi + if test "x$OPENJDK_TARGET_OS" = xlinux; then CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DLINUX" -fi -if test "x$OPENJDK_TARGET_OS" = xwindows; then + fi + if test "x$OPENJDK_TARGET_OS" = xwindows; then CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DWINDOWS" -fi -if test "x$OPENJDK_TARGET_OS" = xsolaris; then + fi + if test "x$OPENJDK_TARGET_OS" = xsolaris; then CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DSOLARIS" -fi -if test "x$OPENJDK_TARGET_OS" = xmacosx; then + fi + if test "x$OPENJDK_TARGET_OS" = xmacosx; then CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT" # Setting these parameters makes it an error to link to macosx APIs that are # newer than the given OS version and makes the linked binaries compatible even @@ -29252,106 +29626,106 @@ if test "x$OPENJDK_TARGET_OS" = xmacosx; then # command line. CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" -fi -if test "x$OPENJDK_TARGET_OS" = xbsd; then + fi + if test "x$OPENJDK_TARGET_OS" = xbsd; then CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DBSD -D_ALLBSD_SOURCE" -fi -if test "x$DEBUG_LEVEL" = xrelease; then + fi + if test "x$DEBUG_LEVEL" = xrelease; then CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG" - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED" - fi -else + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED" + fi + else CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG" -fi + fi -CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY" -CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'" -CCXXFLAGS_JDK="$CCXXFLAGS_JDK \ - -I${JDK_OUTPUTDIR}/include \ - -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \ - -I${JDK_TOPDIR}/src/share/javavm/export \ - -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/javavm/export \ - -I${JDK_TOPDIR}/src/share/native/common \ - -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK \ + -I${JDK_OUTPUTDIR}/include \ + -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \ + -I${JDK_TOPDIR}/src/share/javavm/export \ + -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_EXPORT_DIR/javavm/export \ + -I${JDK_TOPDIR}/src/share/native/common \ + -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common" -# The shared libraries are compiled using the picflag. -CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" -CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA " + # The shared libraries are compiled using the picflag. + CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" + CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA " -# Executable flags -CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK" -CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK" + # Executable flags + CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK" + CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK" -# Now this is odd. The JDK native libraries have to link against libjvm.so -# On 32-bit machines there is normally two distinct libjvm.so:s, client and server. -# Which should we link to? Are we lucky enough that the binary api to the libjvm.so library -# is identical for client and server? Yes. Which is picked at runtime (client or server)? -# Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following -# libraries will link to whatever is in memory. Yuck. -# -# Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh. -if test "x$COMPILER_NAME" = xcl; then + # Now this is odd. The JDK native libraries have to link against libjvm.so + # On 32-bit machines there is normally two distinct libjvm.so:s, client and server. + # Which should we link to? Are we lucky enough that the binary api to the libjvm.so library + # is identical for client and server? Yes. Which is picked at runtime (client or server)? + # Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following + # libraries will link to whatever is in memory. Yuck. + # + # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh. + if test "x$COMPILER_NAME" = xcl; then LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no" if test "x$OPENJDK_TARGET_CPU" = xx86; then - LDFLAGS_JDK="$LDFLAGS_JDK -safeseh" + LDFLAGS_JDK="$LDFLAGS_JDK -safeseh" fi # TODO: make -debug optional "--disable-full-debug-symbols" LDFLAGS_JDK="$LDFLAGS_JDK -debug" LDFLAGS_JDKLIB="${LDFLAGS_JDK} -dll -libpath:${JDK_OUTPUTDIR}/lib" LDFLAGS_JDKLIB_SUFFIX="" if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then - LDFLAGS_STACK_SIZE=1048576 + LDFLAGS_STACK_SIZE=1048576 else - LDFLAGS_STACK_SIZE=327680 + LDFLAGS_STACK_SIZE=327680 fi LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE" -else + else if test "x$COMPILER_NAME" = xgcc; then - # If this is a --hash-style=gnu system, use --hash-style=both, why? - HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` - if test -n "$HAS_GNU_HASH"; then - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both " - fi - if test "x$OPENJDK_TARGET_OS" = xlinux; then - # And since we now know that the linker is gnu, then add -z defs, to forbid - # undefined symbols in object files. - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs" - if test "x$DEBUG_LEVEL" = "xrelease"; then - # When building release libraries, tell the linker optimize them. - # Should this be supplied to the OSS linker as well? - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1" - fi + # If this is a --hash-style=gnu system, use --hash-style=both, why? + HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` + if test -n "$HAS_GNU_HASH"; then + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both " + fi + if test "x$OPENJDK_TARGET_OS" = xlinux; then + # And since we now know that the linker is gnu, then add -z defs, to forbid + # undefined symbols in object files. + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs" + if test "x$DEBUG_LEVEL" = "xrelease"; then + # When building release libraries, tell the linker optimize them. + # Should this be supplied to the OSS linker as well? + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1" fi + fi fi LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \ - -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}" + -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}" # 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. 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" + 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" + 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" + 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" + LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server" fi LDFLAGS_JDKLIB_SUFFIX="-ljava -ljvm" if test "x$COMPILER_NAME" = xossc; then - LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc" + LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc" fi LDFLAGS_JDKEXE="${LDFLAGS_JDK}" if test "x$OPENJDK_TARGET_OS" = xlinux; then - LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined" + LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined" fi -fi + fi @@ -29391,9 +29765,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - - int i; - +int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -29419,9 +29791,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - - int i; - +int i; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : @@ -29464,9 +29834,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - - int i; - +int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -29492,9 +29860,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - - int i; - +int i; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : @@ -29523,64 +29889,64 @@ $as_echo "$supports" >&6; } # Setup debug symbols (need objcopy from the toolchain for that) -# -# ENABLE_DEBUG_SYMBOLS -# This must be done after the toolchain is setup, since we're looking at objcopy. -# -# Check whether --enable-debug-symbols was given. + # + # ENABLE_DEBUG_SYMBOLS + # This must be done after the toolchain is setup, since we're looking at objcopy. + # + # Check whether --enable-debug-symbols was given. if test "${enable_debug_symbols+set}" = set; then : enableval=$enable_debug_symbols; fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should generate debug symbols" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should generate debug symbols" >&5 $as_echo_n "checking if we should generate debug symbols... " >&6; } -if test "x$enable_debug_symbols" = "xyes" && test "x$OBJCOPY" = x; then - # explicit enabling of enable-debug-symbols and can't find objcopy - # this is an error - as_fn_error $? "Unable to find objcopy, cannot enable debug-symbols" "$LINENO" 5 -fi - -if test "x$enable_debug_symbols" = "xyes"; then - ENABLE_DEBUG_SYMBOLS=true -elif test "x$enable_debug_symbols" = "xno"; then - ENABLE_DEBUG_SYMBOLS=false -else - # default on macosx is false - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - ENABLE_DEBUG_SYMBOLS=false - # Default is on if objcopy is found, otherwise off - elif test "x$OBJCOPY" != x || test "x$OPENJDK_TARGET_OS" = xwindows; then - ENABLE_DEBUG_SYMBOLS=true - else - ENABLE_DEBUG_SYMBOLS=false + if test "x$enable_debug_symbols" = "xyes" && test "x$OBJCOPY" = x; then + # explicit enabling of enable-debug-symbols and can't find objcopy + # this is an error + as_fn_error $? "Unable to find objcopy, cannot enable debug-symbols" "$LINENO" 5 fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_DEBUG_SYMBOLS" >&5 + if test "x$enable_debug_symbols" = "xyes"; then + ENABLE_DEBUG_SYMBOLS=true + elif test "x$enable_debug_symbols" = "xno"; then + ENABLE_DEBUG_SYMBOLS=false + else + # Default is on if objcopy is found + if test "x$OBJCOPY" != x; then + ENABLE_DEBUG_SYMBOLS=true + # MacOS X and Windows don't use objcopy but default is on for those OSes + elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then + ENABLE_DEBUG_SYMBOLS=true + else + ENABLE_DEBUG_SYMBOLS=false + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_DEBUG_SYMBOLS" >&5 $as_echo "$ENABLE_DEBUG_SYMBOLS" >&6; } -# -# ZIP_DEBUGINFO_FILES -# -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should zip debug-info files" >&5 + # + # ZIP_DEBUGINFO_FILES + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should zip debug-info files" >&5 $as_echo_n "checking if we should zip debug-info files... " >&6; } -# Check whether --enable-zip-debug-info was given. + # Check whether --enable-zip-debug-info was given. if test "${enable_zip_debug_info+set}" = set; then : enableval=$enable_zip_debug_info; enable_zip_debug_info="${enableval}" else enable_zip_debug_info="yes" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enable_zip_debug_info}" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enable_zip_debug_info}" >&5 $as_echo "${enable_zip_debug_info}" >&6; } -if test "x${enable_zip_debug_info}" = "xno"; then - ZIP_DEBUGINFO_FILES=false -else - ZIP_DEBUGINFO_FILES=true -fi + if test "x${enable_zip_debug_info}" = "xno"; then + ZIP_DEBUGINFO_FILES=false + else + ZIP_DEBUGINFO_FILES=true + fi @@ -29594,30 +29960,90 @@ fi # ############################################################################### +# After we have toolchain, we can compile fixpath. It's needed by the lib checks. + + # When using cygwin or msys, we need a wrapper binary that renames + # /cygdrive/c/ arguments into c:/ arguments and peeks into + # @files and rewrites these too! This wrapper binary is + # called fixpath. + FIXPATH= + if test "x$OPENJDK_BUILD_OS" = xwindows; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fixpath can be created" >&5 +$as_echo_n "checking if fixpath can be created... " >&6; } + FIXPATH_SRC="$SRC_ROOT/common/src/fixpath.c" + FIXPATH_BIN="$OUTPUT_ROOT/fixpath.exe" + if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin; then + FIXPATH_SRC=`$CYGPATH -m $FIXPATH_SRC` + FIXPATH_BIN=`$CYGPATH -m $FIXPATH_BIN` + # Important to keep the .exe suffix on Cygwin for Hotspot makefiles + FIXPATH="$OUTPUT_ROOT/fixpath.exe -c" + elif test "x$OPENJDK_BUILD_OS_ENV" = xwindows.msys; then + FIXPATH_SRC=`cmd //c echo $FIXPATH_SRC` + FIXPATH_BIN=`cmd //c echo $FIXPATH_BIN` + + # Take all collected prefixes and turn them into a -m/c/foo@/c/bar@... command line + # @ was chosen as separator to minimize risk of other tools messing around with it + all_unique_prefixes=`echo "${all_fixpath_prefixes[@]}" | tr ' ' '\n' | grep '^/./' | sort | uniq` + fixpath_argument_list=`echo $all_unique_prefixes | tr ' ' '@'` + + FIXPATH="$OUTPUT_ROOT/fixpath -m$fixpath_argument_list" + fi + rm -f $OUTPUT_ROOT/fixpath* + cd $OUTPUT_ROOT + $CC $FIXPATH_SRC -Fe$FIXPATH_BIN > $OUTPUT_ROOT/fixpath1.log 2>&1 + cd $CURDIR + + if test ! -x $OUTPUT_ROOT/fixpath.exe; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + cat $OUTPUT_ROOT/fixpath1.log + as_fn_error $? "Could not create $OUTPUT_ROOT/fixpath.exe" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fixpath.exe works" >&5 +$as_echo_n "checking if fixpath.exe works... " >&6; } + cd $OUTPUT_ROOT + $FIXPATH $CC $SRC_ROOT/common/src/fixpath.c -Fe$OUTPUT_ROOT/fixpath2.exe > $OUTPUT_ROOT/fixpath2.log 2>&1 + cd $CURDIR + if test ! -x $OUTPUT_ROOT/fixpath2.exe; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + cat $OUTPUT_ROOT/fixpath2.log + as_fn_error $? "fixpath did not work!" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + rm -f $OUTPUT_ROOT/fixpath?.??? $OUTPUT_ROOT/fixpath.obj + fi -############################################################################### -# -# OS specific settings that we never will need to probe. -# -if test "x$OPENJDK_TARGET_OS" = xlinux; then + + + + + ############################################################################### + # + # OS specific settings that we never will need to probe. + # + if test "x$OPENJDK_TARGET_OS" = xlinux; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking what is not needed on Linux?" >&5 $as_echo_n "checking what is not needed on Linux?... " >&6; } PULSE_NOT_NEEDED=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: pulse" >&5 $as_echo "pulse" >&6; } -fi + fi -if test "x$OPENJDK_TARGET_OS" = xsolaris; then + if test "x$OPENJDK_TARGET_OS" = xsolaris; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking what is not needed on Solaris?" >&5 $as_echo_n "checking what is not needed on Solaris?... " >&6; } ALSA_NOT_NEEDED=yes PULSE_NOT_NEEDED=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa pulse" >&5 $as_echo "alsa pulse" >&6; } -fi + fi -if test "x$OPENJDK_TARGET_OS" = xwindows; then + if test "x$OPENJDK_TARGET_OS" = xwindows; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking what is not needed on Windows?" >&5 $as_echo_n "checking what is not needed on Windows?... " >&6; } CUPS_NOT_NEEDED=yes @@ -29626,108 +30052,94 @@ $as_echo_n "checking what is not needed on Windows?... " >&6; } X11_NOT_NEEDED=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa cups pulse x11" >&5 $as_echo "alsa cups pulse x11" >&6; } -fi + fi -if test "x$OPENJDK_TARGET_OS" = xmacosx; then + if test "x$OPENJDK_TARGET_OS" = xmacosx; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking what is not needed on MacOSX?" >&5 $as_echo_n "checking what is not needed on MacOSX?... " >&6; } ALSA_NOT_NEEDED=yes PULSE_NOT_NEEDED=yes X11_NOT_NEEDED=yes - FREETYPE2_NOT_NEEDED=yes # If the java runtime framework is disabled, then we need X11. # This will be adjusted below. { $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa pulse x11" >&5 $as_echo "alsa pulse x11" >&6; } -fi + fi -if test "x$OPENJDK_TARGET_OS" = xbsd; then + if test "x$OPENJDK_TARGET_OS" = xbsd; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking what is not needed on bsd?" >&5 $as_echo_n "checking what is not needed on bsd?... " >&6; } ALSA_NOT_NEEDED=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa" >&5 $as_echo "alsa" >&6; } -fi + fi -if test "x$OPENJDK" = "xfalse"; then - FREETYPE2_NOT_NEEDED=yes -fi + if test "x$OPENJDK" = "xfalse"; then + FREETYPE_NOT_NEEDED=yes + fi -if test "x$SUPPORT_HEADFUL" = xno; then + if test "x$SUPPORT_HEADFUL" = xno; then X11_NOT_NEEDED=yes -fi + fi -############################################################################### -# -# Check for MacOSX support for OpenJDK. If this exists, try to build a JVM -# that uses this API. -# -# Check whether --enable-macosx-runtime-support was given. + ############################################################################### + # + # Check for MacOSX support for OpenJDK. + # + + + # Check whether --enable-macosx-runtime-support was given. if test "${enable_macosx_runtime_support+set}" = set; then : - enableval=$enable_macosx_runtime_support; MACOSX_RUNTIME_SUPPORT="${enableval}" -else - MACOSX_RUNTIME_SUPPORT="no" + enableval=$enable_macosx_runtime_support; fi + if test "x$enable_macosx_runtime_support" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --enable-macosx-runtime-support is deprecated and will be ignored." >&5 +$as_echo "$as_me: WARNING: Option --enable-macosx-runtime-support is deprecated and will be ignored." >&2;} + fi -USE_MACOSX_RUNTIME_SUPPORT=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit Java runtime support in the OS" >&5 -$as_echo_n "checking for explicit Java runtime support in the OS... " >&6; } -if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then - if test "x$MACOSX_RUNTIME_SUPPORT" != xno; then - MACOSX_RUNTIME_SUPPORT=yes - USE_MACOSX_RUNTIME_SUPPORT=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, does not need alsa freetype2 pulse and X11" >&5 -$as_echo "yes, does not need alsa freetype2 pulse and X11" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, but explicitly disabled." >&5 -$as_echo "yes, but explicitly disabled." >&6; } - fi -else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mac OS X Java Framework" >&5 +$as_echo_n "checking for Mac OS X Java Framework... " >&6; } + if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: /System/Library/Frameworks/JavaVM.framework" >&5 +$as_echo "/System/Library/Frameworks/JavaVM.framework" >&6; } + else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } -fi - -if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$USE_MACOSX_RUNTIME_SUPPORT" = xno; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking what is not needed on an X11 build on MacOSX?" >&5 -$as_echo_n "checking what is not needed on an X11 build on MacOSX?... " >&6; } - X11_NOT_NEEDED= - FREETYPE2_NOT_NEEDED= - { $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa pulse" >&5 -$as_echo "alsa pulse" >&6; } -fi + fi -############################################################################### -# -# Check for X Windows -# + ############################################################################### + # + # Check for X Windows + # -# Check if the user has specified sysroot, but not --x-includes or --x-libraries. -# Make a simple check for the libraries at the sysroot, and setup --x-includes and -# --x-libraries for the sysroot, if that seems to be correct. -if test "x$SYS_ROOT" != "x/"; then - if test "x$x_includes" = xNONE; then - if test -f "$SYS_ROOT/usr/X11R6/include/X11/Xlib.h"; then - x_includes="$SYS_ROOT/usr/X11R6/include" - elif test -f "$SYS_ROOT/usr/include/X11/Xlib.h"; then - x_includes="$SYS_ROOT/usr/include" + # Check if the user has specified sysroot, but not --x-includes or --x-libraries. + # Make a simple check for the libraries at the sysroot, and setup --x-includes and + # --x-libraries for the sysroot, if that seems to be correct. + if test "x$SYS_ROOT" != "x/"; then + if test "x$x_includes" = xNONE; then + if test -f "$SYS_ROOT/usr/X11R6/include/X11/Xlib.h"; then + x_includes="$SYS_ROOT/usr/X11R6/include" + elif test -f "$SYS_ROOT/usr/include/X11/Xlib.h"; then + x_includes="$SYS_ROOT/usr/include" + fi + fi + if test "x$x_libraries" = xNONE; then + if test -f "$SYS_ROOT/usr/X11R6/lib/libX11.so"; then + x_libraries="$SYS_ROOT/usr/X11R6/lib" + elif test "$SYS_ROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + x_libraries="$SYS_ROOT/usr/lib64" + elif test -f "$SYS_ROOT/usr/lib/libX11.so"; then + x_libraries="$SYS_ROOT/usr/lib" + fi fi fi - if test "x$x_libraries" = xNONE; then - if test -f "$SYS_ROOT/usr/X11R6/lib/libX11.so"; then - x_libraries="$SYS_ROOT/usr/X11R6/lib" - elif test "$SYS_ROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - x_libraries="$SYS_ROOT/usr/lib64" - elif test -f "$SYS_ROOT/usr/lib/libX11.so"; then - x_libraries="$SYS_ROOT/usr/lib" - fi - fi -fi -# Now let autoconf do it's magic -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 + # Now let autoconf do it's magic + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } @@ -29920,7 +30332,7 @@ else $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi -if test "$no_x" = yes; then + if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. $as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h @@ -30411,83 +30823,82 @@ fi fi -# AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling -# this doesn't make sense so we remove it. -if test "x$COMPILE_TYPE" = xcross; then - X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[^ ]*//g'` -fi + # AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling + # this doesn't make sense so we remove it. + if test "x$COMPILE_TYPE" = xcross; then + X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[^ ]*//g'` + fi -if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then + if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then - # Print a helpful message on how to acquire the necessary build dependency. - # x11 is the help tag: freetyp2, cups, pulse, alsa etc - MISSING_DEPENDENCY=x11 + # Print a helpful message on how to acquire the necessary build dependency. + # x11 is the help tag: freetype, cups, pulse, alsa etc + MISSING_DEPENDENCY=x11 + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else PKGHANDLER_COMMAND= case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; esac if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." fi + fi as_fn_error $? "Could not find X11 libraries. $HELP_MSG" "$LINENO" 5 -fi - -# Some of the old makefiles require a setting of OPENWIN_HOME -# Since the X11R6 directory has disappeared on later Linuxes, -# we need to probe for it. -if test "x$OPENJDK_TARGET_OS" = xlinux; then - if test -d "$SYS_ROOT/usr/X11R6"; then - OPENWIN_HOME="$SYS_ROOT/usr/X11R6" - elif test -d "$SYS_ROOT/usr/include/X11"; then - OPENWIN_HOME="$SYS_ROOT/usr" - fi -fi -if test "x$OPENJDK_TARGET_OS" = xsolaris; then - OPENWIN_HOME="/usr/openwin" -fi - - - -# -# Weird Sol10 something check...TODO change to try compile -# -if test "x${OPENJDK_TARGET_OS}" = xsolaris; then - if test "`uname -r`" = "5.10"; then - if test "`${EGREP} -c XLinearGradient ${OPENWIN_HOME}/share/include/X11/extensions/Xrender.h`" = "0"; then - X_CFLAGS="${X_CFLAGS} -DSOLARIS10_NO_XRENDER_STRUCTS" - fi fi -fi -ac_ext=c + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + OPENWIN_HOME="/usr/openwin" + fi + + + + # + # Weird Sol10 something check...TODO change to try compile + # + if test "x${OPENJDK_TARGET_OS}" = xsolaris; then + if test "`uname -r`" = "5.10"; then + if test "`${EGREP} -c XLinearGradient ${OPENWIN_HOME}/share/include/X11/extensions/Xrender.h`" = "0"; then + X_CFLAGS="${X_CFLAGS} -DSOLARIS10_NO_XRENDER_STRUCTS" + fi + fi + fi + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $X_CFLAGS" + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $X_CFLAGS" -# Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10 -for ac_header in X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h + # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10 + for ac_header in X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " # include - # include +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " + # include + # include + " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : @@ -30502,52 +30913,59 @@ fi done -CFLAGS="$OLD_CFLAGS" -ac_ext=cpp + CFLAGS="$OLD_CFLAGS" + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then + if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then - # Print a helpful message on how to acquire the necessary build dependency. - # x11 is the help tag: freetyp2, cups, pulse, alsa etc - MISSING_DEPENDENCY=x11 + # Print a helpful message on how to acquire the necessary build dependency. + # x11 is the help tag: freetype, cups, pulse, alsa etc + MISSING_DEPENDENCY=x11 + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else PKGHANDLER_COMMAND= case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; esac if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." fi + fi as_fn_error $? "Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG" "$LINENO" 5 -fi + fi -############################################################################### -# -# The common unix printing system cups is used to print from java. -# + ############################################################################### + # + # The common unix printing system cups is used to print from java. + # # Check whether --with-cups was given. if test "${with_cups+set}" = set; then : @@ -30561,175 +30979,175 @@ if test "${with_cups_include+set}" = set; then : fi -if test "x$CUPS_NOT_NEEDED" = xyes; then - if test "x${with_cups}" != x || test "x${with_cups_include}" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cups not used, so --with-cups is ignored" >&5 + if test "x$CUPS_NOT_NEEDED" = xyes; then + if test "x${with_cups}" != x || test "x${with_cups_include}" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cups not used, so --with-cups is ignored" >&5 $as_echo "$as_me: WARNING: cups not used, so --with-cups is ignored" >&2;} - fi - CUPS_CFLAGS= -else - CUPS_FOUND=no + fi + CUPS_CFLAGS= + else + CUPS_FOUND=no - if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then - as_fn_error $? "It is not possible to disable the use of cups. Remove the --without-cups option." "$LINENO" 5 - fi + if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then + as_fn_error $? "It is not possible to disable the use of cups. Remove the --without-cups option." "$LINENO" 5 + fi - if test "x${with_cups}" != x; then - CUPS_CFLAGS="-I${with_cups}/include" - CUPS_FOUND=yes - fi - if test "x${with_cups_include}" != x; then - CUPS_CFLAGS="-I${with_cups_include}" - CUPS_FOUND=yes - fi - if test "x$CUPS_FOUND" = xno; then + if test "x${with_cups}" != x; then + CUPS_CFLAGS="-I${with_cups}/include" + CUPS_FOUND=yes + fi + if test "x${with_cups_include}" != x; then + CUPS_CFLAGS="-I${with_cups_include}" + CUPS_FOUND=yes + fi + if test "x$CUPS_FOUND" = xno; then - if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then - # Source the builddeps file again, to make sure it uses the latest variables! - . $builddepsfile - # Look for a target and build machine specific resource! - eval resource=\${builddep_cups_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}} - if test "x$resource" = x; then - # Ok, lets instead look for a target specific resource - eval resource=\${builddep_cups_TARGET_${rewritten_target_var}} - fi - if test "x$resource" = x; then - # Ok, lets instead look for a build specific resource - eval resource=\${builddep_cups_BUILD_${rewritten_build_var}} - fi - if test "x$resource" = x; then - # Ok, lets instead look for a generic resource - # (The cups comes from M4 and not the shell, thus no need for eval here.) - resource=${builddep_cups} - fi - if test "x$resource" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for cups" >&5 + if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then + # Source the builddeps file again, to make sure it uses the latest variables! + . $builddepsfile + # Look for a target and build machine specific resource! + eval resource=\${builddep_cups_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}} + if test "x$resource" = x; then + # Ok, lets instead look for a target specific resource + eval resource=\${builddep_cups_TARGET_${rewritten_target_var}} + fi + if test "x$resource" = x; then + # Ok, lets instead look for a build specific resource + eval resource=\${builddep_cups_BUILD_${rewritten_build_var}} + fi + if test "x$resource" = x; then + # Ok, lets instead look for a generic resource + # (The cups comes from M4 and not the shell, thus no need for eval here.) + resource=${builddep_cups} + fi + if test "x$resource" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for cups" >&5 $as_echo "$as_me: Using builddeps $resource for cups" >&6;} - # If the resource in the builddeps.conf file is an existing directory, - # for example /java/linux/cups - if test -d ${resource}; then - depdir=${resource} - else + # If the resource in the builddeps.conf file is an existing directory, + # for example /java/linux/cups + if test -d ${resource}; then + depdir=${resource} + else -# cups is for example mymodule -# $resource is for example libs/general/libmymod_1_2_3.zip -# $with_builddeps_server is for example ftp://mybuilddeps.myserver.com/builddeps -# $with_builddeps_dir is for example /localhome/builddeps -# depdir is the name of the variable into which we store the depdir, eg MYMOD -# Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and -# unzip into the directory: /localhome/builddeps/libmymod_1_2_3 - filename=`basename $resource` - filebase=`echo $filename | sed 's/\.[^\.]*$//'` - filebase=${filename%%.*} - extension=${filename#*.} - installdir=$with_builddeps_dir/$filebase - if test ! -f $installdir/$filename.unpacked; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency cups from $with_builddeps_server/$resource and installing into $installdir" >&5 + # cups is for example mymodule + # $resource is for example libs/general/libmymod_1_2_3.zip + # $with_builddeps_server is for example ftp://mybuilddeps.myserver.com/builddeps + # $with_builddeps_dir is for example /localhome/builddeps + # depdir is the name of the variable into which we store the depdir, eg MYMOD + # Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and + # unzip into the directory: /localhome/builddeps/libmymod_1_2_3 + filename=`basename $resource` + filebase=`echo $filename | sed 's/\.[^\.]*$//'` + filebase=${filename%%.*} + extension=${filename#*.} + installdir=$with_builddeps_dir/$filebase + if test ! -f $installdir/$filename.unpacked; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency cups from $with_builddeps_server/$resource and installing into $installdir" >&5 $as_echo "$as_me: Downloading build dependency cups from $with_builddeps_server/$resource and installing into $installdir" >&6;} - if test ! -d $installdir; then - mkdir -p $installdir - fi - if test ! -d $installdir; then - as_fn_error $? "Could not create directory $installdir" "$LINENO" 5 - fi - tmpfile=`mktemp $installdir/cups.XXXXXXXXX` - touch $tmpfile - if test ! -f $tmpfile; then - as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5 - fi - - # $with_builddeps_server/$resource is the ftp://abuilddeps.server.com/libs/cups.zip - # $tmpfile is the local file name for the downloaded file. - VALID_TOOL=no - if test "x$BDEPS_FTP" = xwget; then - VALID_TOOL=yes - wget -O $tmpfile $with_builddeps_server/$resource + if test ! -d $installdir; then + mkdir -p $installdir fi - if test "x$BDEPS_FTP" = xlftp; then - VALID_TOOL=yes - lftp -c "get $with_builddeps_server/$resource -o $tmpfile" + if test ! -d $installdir; then + as_fn_error $? "Could not create directory $installdir" "$LINENO" 5 fi - if test "x$BDEPS_FTP" = xftp; then - VALID_TOOL=yes - FTPSERVER=`echo $with_builddeps_server/$resource | cut -f 3 -d '/'` - FTPPATH=`echo $with_builddeps_server/$resource | cut -f 4- -d '/'` - FTPUSERPWD=${FTPSERVER%%@*} - if test "x$FTPSERVER" != "x$FTPUSERPWD"; then - FTPUSER=${userpwd%%:*} - FTPPWD=${userpwd#*@} - FTPSERVER=${FTPSERVER#*@} - else - FTPUSER=ftp - FTPPWD=ftp - fi - # the "pass" command does not work on some - # ftp clients (read ftp.exe) but if it works, - # passive mode is better! - (\ - echo "user $FTPUSER $FTPPWD" ;\ - echo "pass" ;\ - echo "bin" ;\ - echo "get $FTPPATH $tmpfile" ;\ - ) | ftp -in $FTPSERVER - fi - if test "x$VALID_TOOL" != xyes; then - as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5 + tmpfile=`mktemp $installdir/cups.XXXXXXXXX` + touch $tmpfile + if test ! -f $tmpfile; then + as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5 fi - mv $tmpfile $installdir/$filename - if test ! -s $installdir/$filename; then - as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5 - fi - case "$extension" in - zip) echo "Unzipping $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked) - ;; - tar.gz) echo "Untaring $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) - ;; - tgz) echo "Untaring $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) - ;; - *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5 - ;; - esac + # $with_builddeps_server/$resource is the ftp://abuilddeps.server.com/libs/cups.zip + # $tmpfile is the local file name for the downloaded file. + VALID_TOOL=no + if test "x$BDEPS_FTP" = xwget; then + VALID_TOOL=yes + wget -O $tmpfile $with_builddeps_server/$resource + fi + if test "x$BDEPS_FTP" = xlftp; then + VALID_TOOL=yes + lftp -c "get $with_builddeps_server/$resource -o $tmpfile" + fi + if test "x$BDEPS_FTP" = xftp; then + VALID_TOOL=yes + FTPSERVER=`echo $with_builddeps_server/$resource | cut -f 3 -d '/'` + FTPPATH=`echo $with_builddeps_server/$resource | cut -f 4- -d '/'` + FTPUSERPWD=${FTPSERVER%%@*} + if test "x$FTPSERVER" != "x$FTPUSERPWD"; then + FTPUSER=${userpwd%%:*} + FTPPWD=${userpwd#*@} + FTPSERVER=${FTPSERVER#*@} + else + FTPUSER=ftp + FTPPWD=ftp fi - if test -f $installdir/$filename.unpacked; then - depdir=$installdir + # the "pass" command does not work on some + # ftp clients (read ftp.exe) but if it works, + # passive mode is better! + ( \ + echo "user $FTPUSER $FTPPWD" ; \ + echo "pass" ; \ + echo "bin" ; \ + echo "get $FTPPATH $tmpfile" ; \ + ) | ftp -in $FTPSERVER + fi + if test "x$VALID_TOOL" != xyes; then + as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5 + fi + + mv $tmpfile $installdir/$filename + if test ! -s $installdir/$filename; then + as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5 fi + case "$extension" in + zip) echo "Unzipping $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked) + ;; + tar.gz) echo "Untaring $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) + ;; + tgz) echo "Untaring $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) + ;; + *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5 + ;; + esac + fi + if test -f $installdir/$filename.unpacked; then + depdir=$installdir + fi - fi - # Source the builddeps file again, because in the previous command, the depdir - # was updated to point at the current build dependency install directory. - . $builddepsfile - # Now extract variables from the builddeps.conf files. - theroot=${builddep_cups_ROOT} - thecflags=${builddep_cups_CFLAGS} - thelibs=${builddep_cups_LIBS} - if test "x$depdir" = x; then - as_fn_error $? "Could not download build dependency cups" "$LINENO" 5 - fi - CUPS=$depdir - if test "x$theroot" != x; then - CUPS="$theroot" - fi - if test "x$thecflags" != x; then - CUPS_CFLAGS="$thecflags" - fi - if test "x$thelibs" != x; then - CUPS_LIBS="$thelibs" - fi - CUPS_FOUND=yes - - fi + fi + # Source the builddeps file again, because in the previous command, the depdir + # was updated to point at the current build dependency install directory. + . $builddepsfile + # Now extract variables from the builddeps.conf files. + theroot=${builddep_cups_ROOT} + thecflags=${builddep_cups_CFLAGS} + thelibs=${builddep_cups_LIBS} + if test "x$depdir" = x; then + as_fn_error $? "Could not download build dependency cups" "$LINENO" 5 + fi + CUPS=$depdir + if test "x$theroot" != x; then + CUPS="$theroot" + fi + if test "x$thecflags" != x; then + CUPS_CFLAGS="$thecflags" + fi + if test "x$thelibs" != x; then + CUPS_LIBS="$thelibs" + fi + CUPS_FOUND=yes fi - fi - if test "x$CUPS_FOUND" = xno; then - # Are the cups headers installed in the default /usr/include location? - for ac_header in cups/cups.h cups/ppd.h + fi + + fi + if test "x$CUPS_FOUND" = xno; then + # Are the cups headers installed in the default /usr/include location? + for ac_header in cups/cups.h cups/ppd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -30737,70 +31155,80 @@ if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - CUPS_FOUND=yes - CUPS_CFLAGS= - DEFAULT_CUPS=yes + + CUPS_FOUND=yes + CUPS_CFLAGS= + DEFAULT_CUPS=yes + + fi done - fi - if test "x$CUPS_FOUND" = xno; then - # Getting nervous now? Lets poke around for standard Solaris third-party - # package installation locations. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cups headers" >&5 + fi + if test "x$CUPS_FOUND" = xno; then + # Getting nervous now? Lets poke around for standard Solaris third-party + # package installation locations. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cups headers" >&5 $as_echo_n "checking for cups headers... " >&6; } - if test -s /opt/sfw/cups/include/cups/cups.h; then - # An SFW package seems to be installed! - CUPS_FOUND=yes - CUPS_CFLAGS="-I/opt/sfw/cups/include" - elif test -s /opt/csw/include/cups/cups.h; then - # A CSW package seems to be installed! - CUPS_FOUND=yes - CUPS_CFLAGS="-I/opt/csw/include" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUPS_FOUND" >&5 + if test -s /opt/sfw/cups/include/cups/cups.h; then + # An SFW package seems to be installed! + CUPS_FOUND=yes + CUPS_CFLAGS="-I/opt/sfw/cups/include" + elif test -s /opt/csw/include/cups/cups.h; then + # A CSW package seems to be installed! + CUPS_FOUND=yes + CUPS_CFLAGS="-I/opt/csw/include" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUPS_FOUND" >&5 $as_echo "$CUPS_FOUND" >&6; } - fi - if test "x$CUPS_FOUND" = xno; then + fi + if test "x$CUPS_FOUND" = xno; then - # Print a helpful message on how to acquire the necessary build dependency. - # cups is the help tag: freetyp2, cups, pulse, alsa etc - MISSING_DEPENDENCY=cups + # Print a helpful message on how to acquire the necessary build dependency. + # cups is the help tag: freetype, cups, pulse, alsa etc + MISSING_DEPENDENCY=cups + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else PKGHANDLER_COMMAND= case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; esac if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." fi + fi - as_fn_error $? "Could not find cups! $HELP_MSG " "$LINENO" 5 - fi -fi + as_fn_error $? "Could not find cups! $HELP_MSG " "$LINENO" 5 + fi + fi -############################################################################### -# -# The ubiquitous freetype2 library is used to render fonts. -# + ############################################################################### + # + # The ubiquitous freetype library is used to render fonts. + # # Check whether --with-freetype was given. if test "${with_freetype+set}" = set; then : @@ -30808,27 +31236,103 @@ if test "${with_freetype+set}" = set; then : fi -# If we are using the OS installed system lib for freetype, then we do not need to copy it to the build tree -USING_SYSTEM_FT_LIB=false +# Check whether --with-freetype-include was given. +if test "${with_freetype_include+set}" = set; then : + withval=$with_freetype_include; +fi -if test "x$FREETYPE2_NOT_NEEDED" = xyes; then - if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: freetype not used, so --with-freetype is ignored" >&5 + +# Check whether --with-freetype-lib was given. +if test "${with_freetype_lib+set}" = set; then : + withval=$with_freetype_lib; +fi + + # Check whether --enable-freetype-bundling was given. +if test "${enable_freetype_bundling+set}" = set; then : + enableval=$enable_freetype_bundling; +fi + + + FREETYPE_CFLAGS= + FREETYPE_LIBS= + FREETYPE_BUNDLE_LIB_PATH= + + if test "x$FREETYPE_NOT_NEEDED" = xyes; then + if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: freetype not used, so --with-freetype is ignored" >&5 $as_echo "$as_me: WARNING: freetype not used, so --with-freetype is ignored" >&2;} - fi - FREETYPE2_CFLAGS= - FREETYPE2_LIBS= - FREETYPE2_LIB_PATH= -else - FREETYPE2_FOUND=no + fi + if test "x$enable_freetype_bundling" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: freetype not used, so --enable-freetype-bundling is ignored" >&5 +$as_echo "$as_me: WARNING: freetype not used, so --enable-freetype-bundling is ignored" >&2;} + fi + else + # freetype is needed to build; go get it! - if test "x$with_freetype" != x; then + BUNDLE_FREETYPE="$enable_freetype_bundling" + + if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then + # User has specified settings + + if test "x$BUNDLE_FREETYPE" = x; then + # If not specified, default is to bundle freetype + BUNDLE_FREETYPE=yes + fi + + if test "x$with_freetype" != x; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include" + POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib" + fi + + # Allow --with-freetype-lib and --with-freetype-include to override + if test "x$with_freetype_include" != x; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include" + fi + if test "x$with_freetype_lib" != x; then + POTENTIAL_FREETYPE_LIB_PATH="$with_freetype_lib" + fi + + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x && test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then + # Okay, we got it. Check that it works. + + POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + METHOD="--with-freetype" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. - path="$with_freetype" + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" new_path=`$CYGPATH -u "$path"` # Cygwin tries to hide some aspects of the Windows file system, such that binaries are @@ -30840,9 +31344,9 @@ else # It is also a way to make sure we got the proper file name for the real test later on. test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_freetype, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of with_freetype, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of with_freetype" "$LINENO" 5 + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 fi # Call helper function which possibly converts this using DOS-style short mode. @@ -30880,14 +31384,14 @@ $as_echo "$as_me: The path of with_freetype, which resolves as \"$path\", is inv if test "x$path" != "x$new_path"; then - with_freetype="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_freetype to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting with_freetype to \"$new_path\"" >&6;} + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - path="$with_freetype" + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_colon=`$ECHO $path | $GREP ^.:` new_path="$path" if test "x$has_colon" = x; then @@ -30918,9 +31422,9 @@ $as_echo "$as_me: Rewriting with_freetype to \"$new_path\"" >&6;} fi if test "x$path" != "x$new_path"; then - with_freetype="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_freetype to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting with_freetype to \"$new_path\"" >&6;} + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi # Save the first 10 bytes of this path to the storage, so fixpath can work. @@ -30928,351 +31432,357 @@ $as_echo "$as_me: Rewriting with_freetype to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) - path="$with_freetype" + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_freetype, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of with_freetype, which resolves as \"$path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi # Use eval to expand a potential ~ eval path="$path" if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of with_freetype, which resolves as \"$path\", is not found." "$LINENO" 5 + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 fi - with_freetype="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" fi - FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype" - FREETYPE2_LIB_PATH="$with_freetype/lib" - if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -d "$with_freetype/lib/amd64"; then - FREETYPE2_LIBS="-L$with_freetype/lib/amd64 -lfreetype" - FREETYPE2_LIB_PATH="$with_freetype/lib/amd64" - fi - if test "x$OPENJDK_TARGET_OS" = xwindows; then - FREETYPE2_LIBS="$with_freetype/lib/freetype.lib" - fi - FREETYPE2_CFLAGS="-I$with_freetype/include" - if test -s $with_freetype/include/ft2build.h && test -d $with_freetype/include/freetype2/freetype; then - FREETYPE2_CFLAGS="-I$with_freetype/include/freetype2 -I$with_freetype/include" - fi - FREETYPE2_FOUND=yes - if test "x$FREETYPE2_FOUND" = xyes; then - # Verify that the directories exist - if ! test -d "$with_freetype/lib" || ! test -d "$with_freetype/include"; then - as_fn_error $? "Could not find the expected directories $with_freetype/lib and $with_freetype/include" "$LINENO" 5 - fi - # List the contents of the lib. - FREETYPELIB=`ls $with_freetype/lib/libfreetype.so $with_freetype/lib/freetype.dll 2> /dev/null` - if test "x$FREETYPELIB" = x; then - as_fn_error $? "Could not find libfreetype.so nor freetype.dll in $with_freetype/lib" "$LINENO" 5 - fi - # Check one h-file - if ! test -s "$with_freetype/include/ft2build.h"; then - as_fn_error $? "Could not find $with_freetype/include/ft2build.h" "$LINENO" 5 - fi - fi - fi - if test "x$FREETYPE2_FOUND" = xno; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then - # Source the builddeps file again, to make sure it uses the latest variables! - . $builddepsfile - # Look for a target and build machine specific resource! - eval resource=\${builddep_freetype2_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}} - if test "x$resource" = x; then - # Ok, lets instead look for a target specific resource - eval resource=\${builddep_freetype2_TARGET_${rewritten_target_var}} - fi - if test "x$resource" = x; then - # Ok, lets instead look for a build specific resource - eval resource=\${builddep_freetype2_BUILD_${rewritten_build_var}} - fi - if test "x$resource" = x; then - # Ok, lets instead look for a generic resource - # (The freetype2 comes from M4 and not the shell, thus no need for eval here.) - resource=${builddep_freetype2} - fi - if test "x$resource" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for freetype2" >&5 -$as_echo "$as_me: Using builddeps $resource for freetype2" >&6;} - # If the resource in the builddeps.conf file is an existing directory, - # for example /java/linux/cups - if test -d ${resource}; then - depdir=${resource} - else + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` -# freetype2 is for example mymodule -# $resource is for example libs/general/libmymod_1_2_3.zip -# $with_builddeps_server is for example ftp://mybuilddeps.myserver.com/builddeps -# $with_builddeps_dir is for example /localhome/builddeps -# depdir is the name of the variable into which we store the depdir, eg MYMOD -# Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and -# unzip into the directory: /localhome/builddeps/libmymod_1_2_3 - filename=`basename $resource` - filebase=`echo $filename | sed 's/\.[^\.]*$//'` - filebase=${filename%%.*} - extension=${filename#*.} - installdir=$with_builddeps_dir/$filebase - if test ! -f $installdir/$filename.unpacked; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency freetype2 from $with_builddeps_server/$resource and installing into $installdir" >&5 -$as_echo "$as_me: Downloading build dependency freetype2 from $with_builddeps_server/$resource and installing into $installdir" >&6;} - if test ! -d $installdir; then - mkdir -p $installdir - fi - if test ! -d $installdir; then - as_fn_error $? "Could not create directory $installdir" "$LINENO" 5 - fi - tmpfile=`mktemp $installdir/freetype2.XXXXXXXXX` - touch $tmpfile - if test ! -f $tmpfile; then - as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5 - fi + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi - # $with_builddeps_server/$resource is the ftp://abuilddeps.server.com/libs/cups.zip - # $tmpfile is the local file name for the downloaded file. - VALID_TOOL=no - if test "x$BDEPS_FTP" = xwget; then - VALID_TOOL=yes - wget -O $tmpfile $with_builddeps_server/$resource + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" fi - if test "x$BDEPS_FTP" = xlftp; then - VALID_TOOL=yes - lftp -c "get $with_builddeps_server/$resource -o $tmpfile" + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" fi - if test "x$BDEPS_FTP" = xftp; then - VALID_TOOL=yes - FTPSERVER=`echo $with_builddeps_server/$resource | cut -f 3 -d '/'` - FTPPATH=`echo $with_builddeps_server/$resource | cut -f 4- -d '/'` - FTPUSERPWD=${FTPSERVER%%@*} - if test "x$FTPSERVER" != "x$FTPUSERPWD"; then - FTPUSER=${userpwd%%:*} - FTPPWD=${userpwd#*@} - FTPSERVER=${FTPSERVER#*@} + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + if test "x$FOUND_FREETYPE" != xyes; then + as_fn_error $? "Can not find or use freetype at location given by --with-freetype" "$LINENO" 5 + fi + else + # User specified only one of lib or include. This is an error. + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" = x ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: User specified --with-freetype-lib but not --with-freetype-include" >&5 +$as_echo "$as_me: User specified --with-freetype-lib but not --with-freetype-include" >&6;} + as_fn_error $? "Need both freetype lib and include paths. Consider using --with-freetype instead." "$LINENO" 5 else - FTPUSER=ftp - FTPPWD=ftp + { $as_echo "$as_me:${as_lineno-$LINENO}: User specified --with-freetype-include but not --with-freetype-lib" >&5 +$as_echo "$as_me: User specified --with-freetype-include but not --with-freetype-lib" >&6;} + as_fn_error $? "Need both freetype lib and include paths. Consider using --with-freetype instead." "$LINENO" 5 fi - # the "pass" command does not work on some - # ftp clients (read ftp.exe) but if it works, - # passive mode is better! - (\ - echo "user $FTPUSER $FTPPWD" ;\ - echo "pass" ;\ - echo "bin" ;\ - echo "get $FTPPATH $tmpfile" ;\ - ) | ftp -in $FTPSERVER - fi - if test "x$VALID_TOOL" != xyes; then - as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5 - fi + fi + else + # User did not specify settings, but we need freetype. Try to locate it. - mv $tmpfile $installdir/$filename - if test ! -s $installdir/$filename; then - as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5 + if test "x$BUNDLE_FREETYPE" = x; then + # If not specified, default is to bundle freetype only on windows + if test "x$OPENJDK_TARGET_OS" = xwindows; then + BUNDLE_FREETYPE=yes + else + BUNDLE_FREETYPE=no fi - case "$extension" in - zip) echo "Unzipping $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked) - ;; - tar.gz) echo "Untaring $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) - ;; - tgz) echo "Untaring $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) - ;; - *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5 - ;; - esac + fi + + if test "x$FOUND_FREETYPE" != xyes; then + # Check builddeps + + + if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then + # Source the builddeps file again, to make sure it uses the latest variables! + . $builddepsfile + # Look for a target and build machine specific resource! + eval resource=\${builddep_freetype2_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}} + if test "x$resource" = x; then + # Ok, lets instead look for a target specific resource + eval resource=\${builddep_freetype2_TARGET_${rewritten_target_var}} fi - if test -f $installdir/$filename.unpacked; then - depdir=$installdir + if test "x$resource" = x; then + # Ok, lets instead look for a build specific resource + eval resource=\${builddep_freetype2_BUILD_${rewritten_build_var}} + fi + if test "x$resource" = x; then + # Ok, lets instead look for a generic resource + # (The freetype2 comes from M4 and not the shell, thus no need for eval here.) + resource=${builddep_freetype2} + fi + if test "x$resource" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for freetype2" >&5 +$as_echo "$as_me: Using builddeps $resource for freetype2" >&6;} + # If the resource in the builddeps.conf file is an existing directory, + # for example /java/linux/cups + if test -d ${resource}; then + depdir=${resource} + else + + # freetype2 is for example mymodule + # $resource is for example libs/general/libmymod_1_2_3.zip + # $with_builddeps_server is for example ftp://mybuilddeps.myserver.com/builddeps + # $with_builddeps_dir is for example /localhome/builddeps + # depdir is the name of the variable into which we store the depdir, eg MYMOD + # Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and + # unzip into the directory: /localhome/builddeps/libmymod_1_2_3 + filename=`basename $resource` + filebase=`echo $filename | sed 's/\.[^\.]*$//'` + filebase=${filename%%.*} + extension=${filename#*.} + installdir=$with_builddeps_dir/$filebase + if test ! -f $installdir/$filename.unpacked; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency freetype2 from $with_builddeps_server/$resource and installing into $installdir" >&5 +$as_echo "$as_me: Downloading build dependency freetype2 from $with_builddeps_server/$resource and installing into $installdir" >&6;} + if test ! -d $installdir; then + mkdir -p $installdir + fi + if test ! -d $installdir; then + as_fn_error $? "Could not create directory $installdir" "$LINENO" 5 + fi + tmpfile=`mktemp $installdir/freetype2.XXXXXXXXX` + touch $tmpfile + if test ! -f $tmpfile; then + as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5 fi - fi - # Source the builddeps file again, because in the previous command, the depdir - # was updated to point at the current build dependency install directory. - . $builddepsfile - # Now extract variables from the builddeps.conf files. - theroot=${builddep_freetype2_ROOT} - thecflags=${builddep_freetype2_CFLAGS} - thelibs=${builddep_freetype2_LIBS} - if test "x$depdir" = x; then - as_fn_error $? "Could not download build dependency freetype2" "$LINENO" 5 - fi - FREETYPE2=$depdir - if test "x$theroot" != x; then - FREETYPE2="$theroot" - fi - if test "x$thecflags" != x; then - FREETYPE2_CFLAGS="$thecflags" - fi - if test "x$thelibs" != x; then - FREETYPE2_LIBS="$thelibs" - fi - FREETYPE2_FOUND=yes - else FREETYPE2_FOUND=no + # $with_builddeps_server/$resource is the ftp://abuilddeps.server.com/libs/cups.zip + # $tmpfile is the local file name for the downloaded file. + VALID_TOOL=no + if test "x$BDEPS_FTP" = xwget; then + VALID_TOOL=yes + wget -O $tmpfile $with_builddeps_server/$resource + fi + if test "x$BDEPS_FTP" = xlftp; then + VALID_TOOL=yes + lftp -c "get $with_builddeps_server/$resource -o $tmpfile" + fi + if test "x$BDEPS_FTP" = xftp; then + VALID_TOOL=yes + FTPSERVER=`echo $with_builddeps_server/$resource | cut -f 3 -d '/'` + FTPPATH=`echo $with_builddeps_server/$resource | cut -f 4- -d '/'` + FTPUSERPWD=${FTPSERVER%%@*} + if test "x$FTPSERVER" != "x$FTPUSERPWD"; then + FTPUSER=${userpwd%%:*} + FTPPWD=${userpwd#*@} + FTPSERVER=${FTPSERVER#*@} + else + FTPUSER=ftp + FTPPWD=ftp + fi + # the "pass" command does not work on some + # ftp clients (read ftp.exe) but if it works, + # passive mode is better! + ( \ + echo "user $FTPUSER $FTPPWD" ; \ + echo "pass" ; \ + echo "bin" ; \ + echo "get $FTPPATH $tmpfile" ; \ + ) | ftp -in $FTPSERVER + fi + if test "x$VALID_TOOL" != xyes; then + as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5 + fi + mv $tmpfile $installdir/$filename + if test ! -s $installdir/$filename; then + as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5 + fi + case "$extension" in + zip) echo "Unzipping $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked) + ;; + tar.gz) echo "Untaring $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) + ;; + tgz) echo "Untaring $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) + ;; + *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5 + ;; + esac + fi + if test -f $installdir/$filename.unpacked; then + depdir=$installdir + fi + + fi + # Source the builddeps file again, because in the previous command, the depdir + # was updated to point at the current build dependency install directory. + . $builddepsfile + # Now extract variables from the builddeps.conf files. + theroot=${builddep_freetype2_ROOT} + thecflags=${builddep_freetype2_CFLAGS} + thelibs=${builddep_freetype2_LIBS} + if test "x$depdir" = x; then + as_fn_error $? "Could not download build dependency freetype2" "$LINENO" 5 + fi + FREETYPE=$depdir + if test "x$theroot" != x; then + FREETYPE="$theroot" + fi + if test "x$thecflags" != x; then + FREETYPE_CFLAGS="$thecflags" + fi + if test "x$thelibs" != x; then + FREETYPE_LIBS="$thelibs" + fi + FOUND_FREETYPE=yes + else FOUND_FREETYPE=no + + fi + else FOUND_FREETYPE=no + + fi + + # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. + if test "x$FOUND_FREETYPE" = xyes; then + if test "x$BUNDLE_FREETYPE" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype using builddeps, but ignoring since we can not bundle that" >&5 +$as_echo "$as_me: Found freetype using builddeps, but ignoring since we can not bundle that" >&6;} + FOUND_FREETYPE=no + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype" >&5 +$as_echo_n "checking for freetype... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (using builddeps)" >&5 +$as_echo "yes (using builddeps)" >&6; } + fi fi - else FREETYPE2_FOUND=no + fi - fi - - USING_SYSTEM_FT_LIB=true - fi - if test "x$FREETYPE2_FOUND" = xno && test "x$OPENJDK_TARGET_OS" = xwindows; then - FREETYPELOCATION="$PROGRAMFILES/GnuWin32" - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$FREETYPELOCATION" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of FREETYPELOCATION" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-stile (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - FREETYPELOCATION="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPELOCATION to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting FREETYPELOCATION to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$FREETYPELOCATION" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - FREETYPELOCATION="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPELOCATION to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting FREETYPELOCATION to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a posix platform. Hooray! :) - path="$FREETYPELOCATION" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of FREETYPELOCATION, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - FREETYPELOCATION="`cd "$path"; $THEPWDCMD -L`" - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype in some standard windows locations" >&5 -$as_echo_n "checking for freetype in some standard windows locations... " >&6; } - if test -s "$FREETYPELOCATION/include/ft2build.h" && test -d "$FREETYPELOCATION/include/freetype2/freetype"; then - FREETYPE2_CFLAGS="-I$FREETYPELOCATION/include/freetype2 -I$FREETYPELOCATION/include" - FREETYPE2_LIBS="$FREETYPELOCATION/lib/freetype.lib" - FREETYPE2_LIB_PATH="$FREETYPELOCATION/lib" - if ! test -s "$FREETYPE2_LIBS"; then - as_fn_error $? "Could not find $FREETYPE2_LIBS" "$LINENO" 5 - fi - if ! test -s "$FREETYPE2_LIB_PATH/freetype.dll"; then - as_fn_error $? "Could not find $FREETYPE2_LIB_PATH/freetype.dll" "$LINENO" 5 - fi - USING_SYSTEM_FT_LIB=true - FREETYPE2_FOUND=yes - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE2_FOUND" >&5 -$as_echo "$FREETYPE2_FOUND" >&6; } - fi - if test "x$FREETYPE2_FOUND" = xno; then + if test "x$FOUND_FREETYPE" != xyes; then + # Check modules using pkg-config, but only if we have it (ugly output results otherwise) + if test "x$PKG_CONFIG" != x; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FREETYPE2" >&5 -$as_echo_n "checking for FREETYPE2... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FREETYPE" >&5 +$as_echo_n "checking for FREETYPE... " >&6; } -if test -n "$FREETYPE2_CFLAGS"; then - pkg_cv_FREETYPE2_CFLAGS="$FREETYPE2_CFLAGS" +if test -n "$FREETYPE_CFLAGS"; then + pkg_cv_FREETYPE_CFLAGS="$FREETYPE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 @@ -31280,15 +31790,15 @@ if test -n "$FREETYPE2_CFLAGS"; then ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags "freetype2" 2>/dev/null` + pkg_cv_FREETYPE_CFLAGS=`$PKG_CONFIG --cflags "freetype2" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi -if test -n "$FREETYPE2_LIBS"; then - pkg_cv_FREETYPE2_LIBS="$FREETYPE2_LIBS" +if test -n "$FREETYPE_LIBS"; then + pkg_cv_FREETYPE_LIBS="$FREETYPE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 @@ -31296,7 +31806,7 @@ if test -n "$FREETYPE2_LIBS"; then ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_FREETYPE2_LIBS=`$PKG_CONFIG --libs "freetype2" 2>/dev/null` + pkg_cv_FREETYPE_LIBS=`$PKG_CONFIG --libs "freetype2" 2>/dev/null` else pkg_failed=yes fi @@ -31314,155 +31824,2523 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - FREETYPE2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "freetype2" 2>&1` + FREETYPE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "freetype2" 2>&1` else - FREETYPE2_PKG_ERRORS=`$PKG_CONFIG --print-errors "freetype2" 2>&1` + FREETYPE_PKG_ERRORS=`$PKG_CONFIG --print-errors "freetype2" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$FREETYPE2_PKG_ERRORS" >&5 + echo "$FREETYPE_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - FREETYPE2_FOUND=no + FOUND_FREETYPE=no elif test $pkg_failed = untried; then - FREETYPE2_FOUND=no + FOUND_FREETYPE=no else - FREETYPE2_CFLAGS=$pkg_cv_FREETYPE2_CFLAGS - FREETYPE2_LIBS=$pkg_cv_FREETYPE2_LIBS + FREETYPE_CFLAGS=$pkg_cv_FREETYPE_CFLAGS + FREETYPE_LIBS=$pkg_cv_FREETYPE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - FREETYPE2_FOUND=yes + FOUND_FREETYPE=yes fi + if test "x$FOUND_FREETYPE" = xyes; then # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. - FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's/-lz//g'` - USING_SYSTEM_FT_LIB=true + FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'` # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 - if test "x$FREETYPE2_FOUND" = xyes && test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's?/lib?/lib/amd64?g'` + if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then + FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'` fi - fi - if test "x$FREETYPE2_FOUND" = xno; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype in some standard locations" >&5 -$as_echo_n "checking for freetype in some standard locations... " >&6; } + # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. + if test "x$BUNDLE_FREETYPE" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype using pkg-config, but ignoring since we can not bundle that" >&5 +$as_echo "$as_me: Found freetype using pkg-config, but ignoring since we can not bundle that" >&6;} + FOUND_FREETYPE=no + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype" >&5 +$as_echo_n "checking for freetype... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (using pkg-config)" >&5 +$as_echo "yes (using pkg-config)" >&6; } + fi + fi + fi + fi - if test -s $SYS_ROOT/usr/X11/include/ft2build.h && test -d $SYS_ROOT/usr/X11/include/freetype2/freetype; then - DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/X11/include/freetype2 -I$SYS_ROOT/usr/X11/include" - DEFAULT_FREETYPE_LIBS="-L$SYS_ROOT/usr/X11/lib -lfreetype" - fi - if test -s $SYS_ROOT/usr/include/ft2build.h && test -d $SYS_ROOT/usr/include/freetype2/freetype; then - DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/include/freetype2" - DEFAULT_FREETYPE_LIBS="-lfreetype" - fi + if test "x$FOUND_FREETYPE" != xyes; then + # Check in well-known locations + if test "x$OPENJDK_TARGET_OS" = xwindows; then + FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32" - PREV_CXXCFLAGS="$CXXFLAGS" - PREV_LDFLAGS="$LDFLAGS" - CXXFLAGS="$CXXFLAGS $DEFAULT_FREETYPE_CFLAGS" - LDFLAGS="$LDFLAGS $DEFAULT_FREETYPE_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include FT_FREETYPE_H - int main() { return 0; } + windows_path="$FREETYPE_BASE_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + FREETYPE_BASE_DIR="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + FREETYPE_BASE_DIR="$unix_path" + fi -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - # Yes, the default cflags and libs did the trick. - FREETYPE2_FOUND=yes - FREETYPE2_CFLAGS="$DEFAULT_FREETYPE_CFLAGS" - FREETYPE2_LIBS="$DEFAULT_FREETYPE_LIBS" + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" + POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib" + METHOD="well-known location" -else + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes - FREETYPE2_FOUND=no + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CXXCFLAGS="$PREV_CXXFLAGS" - LDFLAGS="$PREV_LDFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE2_FOUND" >&5 -$as_echo "$FREETYPE2_FOUND" >&6; } - USING_SYSTEM_FT_LIB=true - fi - if test "x$FREETYPE2_FOUND" = xno; then + if test "x$FOUND_FREETYPE" = xyes; then - # Print a helpful message on how to acquire the necessary build dependency. - # freetype2 is the help tag: freetyp2, cups, pulse, alsa etc - MISSING_DEPENDENCY=freetype2 + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + if test "x$FOUND_FREETYPE" != xyes; then + FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32" + + windows_path="$FREETYPE_BASE_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + FREETYPE_BASE_DIR="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + FREETYPE_BASE_DIR="$unix_path" + fi + + + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" + POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib" + METHOD="well-known location" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + fi + else + if test "x$SYS_ROOT" = "x/"; then + FREETYPE_ROOT= + else + FREETYPE_ROOT="$SYS_ROOT" + fi + FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr" + + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" + POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib" + METHOD="well-known location" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + + if test "x$FOUND_FREETYPE" != xyes; then + FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr/X11" + + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" + POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib" + METHOD="well-known location" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + fi + + if test "x$FOUND_FREETYPE" != xyes; then + FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr" + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" + POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib/x86_64-linux-gnu" + METHOD="well-known location" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + else + + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" + POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib/i386-linux-gnu" + METHOD="well-known location" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + if test "x$FOUND_FREETYPE" != xyes; then + + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" + POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib32" + METHOD="well-known location" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + fi + fi + fi + fi + fi # end check in well-known locations + + if test "x$FOUND_FREETYPE" != xyes; then + + # Print a helpful message on how to acquire the necessary build dependency. + # freetype is the help tag: freetype, cups, pulse, alsa etc + MISSING_DEPENDENCY=freetype + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else PKGHANDLER_COMMAND= case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; esac if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi + fi + + as_fn_error $? "Could not find freetype! $HELP_MSG " "$LINENO" 5 + fi + fi # end user specified settings + + # Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir. + if test "x$FREETYPE_CFLAGS" = x; then + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi - as_fn_error $? "Could not find freetype2! $HELP_MSG " "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - if test "x$OPENJDK_TARGET_OS" != xwindows; then - # AC_CHECK_LIB does not support use of cl.exe - PREV_LDFLAGS="$LDFLAGS" - LDFLAGS="$FREETYPE2_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT_Init_FreeType in -lfreetype" >&5 -$as_echo_n "checking for FT_Init_FreeType in -lfreetype... " >&6; } -if ${ac_cv_lib_freetype_FT_Init_FreeType+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfreetype $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then + FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH/freetype2 -I$FREETYPE_INCLUDE_PATH" + else + FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH" + fi + fi + + if test "x$FREETYPE_LIBS" = x; then + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + if test "x$OPENJDK_TARGET_OS" = xwindows; then + FREETYPE_LIBS="$FREETYPE_LIB_PATH/freetype.lib" + else + FREETYPE_LIBS="-L$FREETYPE_LIB_PATH -lfreetype" + fi + fi + + # Try to compile it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can compile and link with freetype" >&5 +$as_echo_n "checking if we can compile and link with freetype... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + PREV_CXXCFLAGS="$CXXFLAGS" + PREV_LIBS="$LIBS" + PREV_CXX="$CXX" + CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + LIBS="$LIBS $FREETYPE_LIBS" + CXX="$FIXPATH $CXX" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char FT_Init_FreeType (); -int -main () -{ -return FT_Init_FreeType (); - ; - return 0; -} + #include + #include FT_FREETYPE_H + int main () { + FT_Init_FreeType(NULL); + return 0; + } + _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_freetype_FT_Init_FreeType=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else - ac_cv_lib_freetype_FT_Init_FreeType=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not compile and link with freetype. This might be a 32/64-bit mismatch." >&5 +$as_echo "$as_me: Could not compile and link with freetype. This might be a 32/64-bit mismatch." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS" >&5 +$as_echo "$as_me: Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS" >&6;} + + + # Print a helpful message on how to acquire the necessary build dependency. + # freetype is the help tag: freetype, cups, pulse, alsa etc + MISSING_DEPENDENCY=freetype + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else + PKGHANDLER_COMMAND= + + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; + esac + + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi + fi + + + as_fn_error $? "Can not continue without freetype. $HELP_MSG" "$LINENO" 5 + + fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5 -$as_echo "$ac_cv_lib_freetype_FT_Init_FreeType" >&6; } -if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = xyes; then : - FREETYPE2_FOUND=true -else - as_fn_error $? "Could not find freetype2! $HELP_MSG " "$LINENO" 5 -fi + CXXCFLAGS="$PREV_CXXFLAGS" + LIBS="$PREV_LIBS" + CXX="$PREV_CXX" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - LDFLAGS="$PREV_LDFLAGS" - fi -fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should bundle freetype" >&5 +$as_echo_n "checking if we should bundle freetype... " >&6; } + if test "x$BUNDLE_FREETYPE" = xyes; then + FREETYPE_BUNDLE_LIB_PATH="$FREETYPE_LIB_PATH" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUNDLE_FREETYPE" >&5 +$as_echo "$BUNDLE_FREETYPE" >&6; } + + fi # end freetype needed @@ -31470,12 +34348,10 @@ fi - - -############################################################################### -# -# Check for alsa headers and libraries. Used on Linux/GNU systems. -# + ############################################################################### + # + # Check for alsa headers and libraries. Used on Linux/GNU systems. + # # Check whether --with-alsa was given. if test "${with_alsa+set}" = set; then : @@ -31495,181 +34371,181 @@ if test "${with_alsa_lib+set}" = set; then : fi -if test "x$ALSA_NOT_NEEDED" = xyes; then - if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: alsa not used, so --with-alsa is ignored" >&5 + if test "x$ALSA_NOT_NEEDED" = xyes; then + if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: alsa not used, so --with-alsa is ignored" >&5 $as_echo "$as_me: WARNING: alsa not used, so --with-alsa is ignored" >&2;} - fi - ALSA_CFLAGS= - ALSA_LIBS= -else - ALSA_FOUND=no + fi + ALSA_CFLAGS= + ALSA_LIBS= + else + ALSA_FOUND=no - if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then - as_fn_error $? "It is not possible to disable the use of alsa. Remove the --without-alsa option." "$LINENO" 5 - fi + if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then + as_fn_error $? "It is not possible to disable the use of alsa. Remove the --without-alsa option." "$LINENO" 5 + fi - if test "x${with_alsa}" != x; then - ALSA_LIBS="-L${with_alsa}/lib -lalsa" - ALSA_CFLAGS="-I${with_alsa}/include" - ALSA_FOUND=yes - fi - if test "x${with_alsa_include}" != x; then - ALSA_CFLAGS="-I${with_alsa_include}" - ALSA_FOUND=yes - fi - if test "x${with_alsa_lib}" != x; then - ALSA_LIBS="-L${with_alsa_lib} -lalsa" - ALSA_FOUND=yes - fi - if test "x$ALSA_FOUND" = xno; then + if test "x${with_alsa}" != x; then + ALSA_LIBS="-L${with_alsa}/lib -lalsa" + ALSA_CFLAGS="-I${with_alsa}/include" + ALSA_FOUND=yes + fi + if test "x${with_alsa_include}" != x; then + ALSA_CFLAGS="-I${with_alsa_include}" + ALSA_FOUND=yes + fi + if test "x${with_alsa_lib}" != x; then + ALSA_LIBS="-L${with_alsa_lib} -lalsa" + ALSA_FOUND=yes + fi + if test "x$ALSA_FOUND" = xno; then - if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then - # Source the builddeps file again, to make sure it uses the latest variables! - . $builddepsfile - # Look for a target and build machine specific resource! - eval resource=\${builddep_alsa_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}} - if test "x$resource" = x; then - # Ok, lets instead look for a target specific resource - eval resource=\${builddep_alsa_TARGET_${rewritten_target_var}} - fi - if test "x$resource" = x; then - # Ok, lets instead look for a build specific resource - eval resource=\${builddep_alsa_BUILD_${rewritten_build_var}} - fi - if test "x$resource" = x; then - # Ok, lets instead look for a generic resource - # (The alsa comes from M4 and not the shell, thus no need for eval here.) - resource=${builddep_alsa} - fi - if test "x$resource" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for alsa" >&5 + if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then + # Source the builddeps file again, to make sure it uses the latest variables! + . $builddepsfile + # Look for a target and build machine specific resource! + eval resource=\${builddep_alsa_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}} + if test "x$resource" = x; then + # Ok, lets instead look for a target specific resource + eval resource=\${builddep_alsa_TARGET_${rewritten_target_var}} + fi + if test "x$resource" = x; then + # Ok, lets instead look for a build specific resource + eval resource=\${builddep_alsa_BUILD_${rewritten_build_var}} + fi + if test "x$resource" = x; then + # Ok, lets instead look for a generic resource + # (The alsa comes from M4 and not the shell, thus no need for eval here.) + resource=${builddep_alsa} + fi + if test "x$resource" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for alsa" >&5 $as_echo "$as_me: Using builddeps $resource for alsa" >&6;} - # If the resource in the builddeps.conf file is an existing directory, - # for example /java/linux/cups - if test -d ${resource}; then - depdir=${resource} - else + # If the resource in the builddeps.conf file is an existing directory, + # for example /java/linux/cups + if test -d ${resource}; then + depdir=${resource} + else -# alsa is for example mymodule -# $resource is for example libs/general/libmymod_1_2_3.zip -# $with_builddeps_server is for example ftp://mybuilddeps.myserver.com/builddeps -# $with_builddeps_dir is for example /localhome/builddeps -# depdir is the name of the variable into which we store the depdir, eg MYMOD -# Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and -# unzip into the directory: /localhome/builddeps/libmymod_1_2_3 - filename=`basename $resource` - filebase=`echo $filename | sed 's/\.[^\.]*$//'` - filebase=${filename%%.*} - extension=${filename#*.} - installdir=$with_builddeps_dir/$filebase - if test ! -f $installdir/$filename.unpacked; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency alsa from $with_builddeps_server/$resource and installing into $installdir" >&5 + # alsa is for example mymodule + # $resource is for example libs/general/libmymod_1_2_3.zip + # $with_builddeps_server is for example ftp://mybuilddeps.myserver.com/builddeps + # $with_builddeps_dir is for example /localhome/builddeps + # depdir is the name of the variable into which we store the depdir, eg MYMOD + # Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and + # unzip into the directory: /localhome/builddeps/libmymod_1_2_3 + filename=`basename $resource` + filebase=`echo $filename | sed 's/\.[^\.]*$//'` + filebase=${filename%%.*} + extension=${filename#*.} + installdir=$with_builddeps_dir/$filebase + if test ! -f $installdir/$filename.unpacked; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency alsa from $with_builddeps_server/$resource and installing into $installdir" >&5 $as_echo "$as_me: Downloading build dependency alsa from $with_builddeps_server/$resource and installing into $installdir" >&6;} - if test ! -d $installdir; then - mkdir -p $installdir - fi - if test ! -d $installdir; then - as_fn_error $? "Could not create directory $installdir" "$LINENO" 5 - fi - tmpfile=`mktemp $installdir/alsa.XXXXXXXXX` - touch $tmpfile - if test ! -f $tmpfile; then - as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5 - fi - - # $with_builddeps_server/$resource is the ftp://abuilddeps.server.com/libs/cups.zip - # $tmpfile is the local file name for the downloaded file. - VALID_TOOL=no - if test "x$BDEPS_FTP" = xwget; then - VALID_TOOL=yes - wget -O $tmpfile $with_builddeps_server/$resource + if test ! -d $installdir; then + mkdir -p $installdir fi - if test "x$BDEPS_FTP" = xlftp; then - VALID_TOOL=yes - lftp -c "get $with_builddeps_server/$resource -o $tmpfile" + if test ! -d $installdir; then + as_fn_error $? "Could not create directory $installdir" "$LINENO" 5 fi - if test "x$BDEPS_FTP" = xftp; then - VALID_TOOL=yes - FTPSERVER=`echo $with_builddeps_server/$resource | cut -f 3 -d '/'` - FTPPATH=`echo $with_builddeps_server/$resource | cut -f 4- -d '/'` - FTPUSERPWD=${FTPSERVER%%@*} - if test "x$FTPSERVER" != "x$FTPUSERPWD"; then - FTPUSER=${userpwd%%:*} - FTPPWD=${userpwd#*@} - FTPSERVER=${FTPSERVER#*@} - else - FTPUSER=ftp - FTPPWD=ftp - fi - # the "pass" command does not work on some - # ftp clients (read ftp.exe) but if it works, - # passive mode is better! - (\ - echo "user $FTPUSER $FTPPWD" ;\ - echo "pass" ;\ - echo "bin" ;\ - echo "get $FTPPATH $tmpfile" ;\ - ) | ftp -in $FTPSERVER - fi - if test "x$VALID_TOOL" != xyes; then - as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5 + tmpfile=`mktemp $installdir/alsa.XXXXXXXXX` + touch $tmpfile + if test ! -f $tmpfile; then + as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5 fi - mv $tmpfile $installdir/$filename - if test ! -s $installdir/$filename; then - as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5 - fi - case "$extension" in - zip) echo "Unzipping $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked) - ;; - tar.gz) echo "Untaring $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) - ;; - tgz) echo "Untaring $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) - ;; - *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5 - ;; - esac + # $with_builddeps_server/$resource is the ftp://abuilddeps.server.com/libs/cups.zip + # $tmpfile is the local file name for the downloaded file. + VALID_TOOL=no + if test "x$BDEPS_FTP" = xwget; then + VALID_TOOL=yes + wget -O $tmpfile $with_builddeps_server/$resource + fi + if test "x$BDEPS_FTP" = xlftp; then + VALID_TOOL=yes + lftp -c "get $with_builddeps_server/$resource -o $tmpfile" + fi + if test "x$BDEPS_FTP" = xftp; then + VALID_TOOL=yes + FTPSERVER=`echo $with_builddeps_server/$resource | cut -f 3 -d '/'` + FTPPATH=`echo $with_builddeps_server/$resource | cut -f 4- -d '/'` + FTPUSERPWD=${FTPSERVER%%@*} + if test "x$FTPSERVER" != "x$FTPUSERPWD"; then + FTPUSER=${userpwd%%:*} + FTPPWD=${userpwd#*@} + FTPSERVER=${FTPSERVER#*@} + else + FTPUSER=ftp + FTPPWD=ftp fi - if test -f $installdir/$filename.unpacked; then - depdir=$installdir + # the "pass" command does not work on some + # ftp clients (read ftp.exe) but if it works, + # passive mode is better! + ( \ + echo "user $FTPUSER $FTPPWD" ; \ + echo "pass" ; \ + echo "bin" ; \ + echo "get $FTPPATH $tmpfile" ; \ + ) | ftp -in $FTPSERVER + fi + if test "x$VALID_TOOL" != xyes; then + as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5 + fi + + mv $tmpfile $installdir/$filename + if test ! -s $installdir/$filename; then + as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5 fi + case "$extension" in + zip) echo "Unzipping $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked) + ;; + tar.gz) echo "Untaring $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) + ;; + tgz) echo "Untaring $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) + ;; + *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5 + ;; + esac + fi + if test -f $installdir/$filename.unpacked; then + depdir=$installdir + fi - fi - # Source the builddeps file again, because in the previous command, the depdir - # was updated to point at the current build dependency install directory. - . $builddepsfile - # Now extract variables from the builddeps.conf files. - theroot=${builddep_alsa_ROOT} - thecflags=${builddep_alsa_CFLAGS} - thelibs=${builddep_alsa_LIBS} - if test "x$depdir" = x; then - as_fn_error $? "Could not download build dependency alsa" "$LINENO" 5 - fi - ALSA=$depdir - if test "x$theroot" != x; then - ALSA="$theroot" - fi - if test "x$thecflags" != x; then - ALSA_CFLAGS="$thecflags" - fi - if test "x$thelibs" != x; then - ALSA_LIBS="$thelibs" - fi - ALSA_FOUND=yes - else ALSA_FOUND=no - - fi - else ALSA_FOUND=no + fi + # Source the builddeps file again, because in the previous command, the depdir + # was updated to point at the current build dependency install directory. + . $builddepsfile + # Now extract variables from the builddeps.conf files. + theroot=${builddep_alsa_ROOT} + thecflags=${builddep_alsa_CFLAGS} + thelibs=${builddep_alsa_LIBS} + if test "x$depdir" = x; then + as_fn_error $? "Could not download build dependency alsa" "$LINENO" 5 + fi + ALSA=$depdir + if test "x$theroot" != x; then + ALSA="$theroot" + fi + if test "x$thecflags" != x; then + ALSA_CFLAGS="$thecflags" + fi + if test "x$thelibs" != x; then + ALSA_LIBS="$thelibs" + fi + ALSA_FOUND=yes + else ALSA_FOUND=no fi + else ALSA_FOUND=no - fi - if test "x$ALSA_FOUND" = xno; then + fi + + fi + if test "x$ALSA_FOUND" = xno; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA" >&5 @@ -31737,69 +34613,77 @@ else $as_echo "yes" >&6; } ALSA_FOUND=yes fi - fi - if test "x$ALSA_FOUND" = xno; then - for ac_header in alsa/asoundlib.h + fi + if test "x$ALSA_FOUND" = xno; then + for ac_header in alsa/asoundlib.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "alsa/asoundlib.h" "ac_cv_header_alsa_asoundlib_h" "$ac_includes_default" if test "x$ac_cv_header_alsa_asoundlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ALSA_ASOUNDLIB_H 1 _ACEOF - ALSA_FOUND=yes - ALSA_CFLAGS=-Iignoreme - ALSA_LIBS=-lasound - DEFAULT_ALSA=yes + + ALSA_FOUND=yes + ALSA_CFLAGS=-Iignoreme + ALSA_LIBS=-lasound + DEFAULT_ALSA=yes + else ALSA_FOUND=no fi done - fi - if test "x$ALSA_FOUND" = xno; then + fi + if test "x$ALSA_FOUND" = xno; then - # Print a helpful message on how to acquire the necessary build dependency. - # alsa is the help tag: freetyp2, cups, pulse, alsa etc - MISSING_DEPENDENCY=alsa + # Print a helpful message on how to acquire the necessary build dependency. + # alsa is the help tag: freetype, cups, pulse, alsa etc + MISSING_DEPENDENCY=alsa + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else PKGHANDLER_COMMAND= case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; esac if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." fi + fi - as_fn_error $? "Could not find alsa! $HELP_MSG " "$LINENO" 5 - fi -fi + as_fn_error $? "Could not find alsa! $HELP_MSG " "$LINENO" 5 + fi + fi + ############################################################################### + # + # Check for the jpeg library + # -############################################################################### -# -# Check for the jpeg library -# - -USE_EXTERNAL_LIBJPEG=true -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ljpeg" >&5 + USE_EXTERNAL_LIBJPEG=true + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ljpeg" >&5 $as_echo_n "checking for main in -ljpeg... " >&6; } if ${ac_cv_lib_jpeg_main+:} false; then : $as_echo_n "(cached) " >&6 @@ -31838,17 +34722,17 @@ _ACEOF else USE_EXTERNAL_LIBJPEG=false - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use jpeg decoder bundled with the OpenJDK source" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use jpeg decoder bundled with the OpenJDK source" >&5 $as_echo "$as_me: Will use jpeg decoder bundled with the OpenJDK source" >&6;} fi -############################################################################### -# -# Check for the gif library -# + ############################################################################### + # + # Check for the gif library + # # Check whether --with-giflib was given. @@ -31858,25 +34742,25 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for which giflib to use" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which giflib to use" >&5 $as_echo_n "checking for which giflib to use... " >&6; } -# default is bundled -DEFAULT_GIFLIB=bundled + # default is bundled + DEFAULT_GIFLIB=bundled -# -# if user didn't specify, use DEFAULT_GIFLIB -# -if test "x${with_giflib}" = "x"; then + # + # if user didn't specify, use DEFAULT_GIFLIB + # + if test "x${with_giflib}" = "x"; then with_giflib=${DEFAULT_GIFLIB} -fi + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_giflib}" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_giflib}" >&5 $as_echo "${with_giflib}" >&6; } -if test "x${with_giflib}" = "xbundled"; then + if test "x${with_giflib}" = "xbundled"; then USE_EXTERNAL_LIBGIF=false -elif test "x${with_giflib}" = "xsystem"; then + elif test "x${with_giflib}" = "xsystem"; then ac_fn_cxx_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default" if test "x$ac_cv_header_gif_lib_h" = xyes; then : @@ -31934,15 +34818,15 @@ fi USE_EXTERNAL_LIBGIF=true -else + else as_fn_error $? "Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled'" "$LINENO" 5 -fi + fi -############################################################################### -# -# Check for the zlib library -# + ############################################################################### + # + # Check for the zlib library + # # Check whether --with-zlib was given. @@ -31951,7 +34835,7 @@ if test "${with_zlib+set}" = set; then : fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5 $as_echo_n "checking for compress in -lz... " >&6; } if ${ac_cv_lib_z_compress+:} false; then : $as_echo_n "(cached) " >&6 @@ -31994,62 +34878,62 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for which zlib to use" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which zlib to use" >&5 $as_echo_n "checking for which zlib to use... " >&6; } -DEFAULT_ZLIB=bundled -if test "x$OPENJDK_TARGET_OS" = xmacosx; then -# -# On macosx default is system...on others default is -# + DEFAULT_ZLIB=bundled + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + # + # On macosx default is system...on others default is + # DEFAULT_ZLIB=system -fi + fi -if test "x${ZLIB_FOUND}" != "xyes"; then -# -# If we don't find any system...set default to bundled -# + if test "x${ZLIB_FOUND}" != "xyes"; then + # + # If we don't find any system...set default to bundled + # DEFAULT_ZLIB=bundled -fi + fi -# -# If user didn't specify, use DEFAULT_ZLIB -# -if test "x${with_zlib}" = "x"; then + # + # If user didn't specify, use DEFAULT_ZLIB + # + if test "x${with_zlib}" = "x"; then with_zlib=${DEFAULT_ZLIB} -fi + fi -if test "x${with_zlib}" = "xbundled"; then + if test "x${with_zlib}" = "xbundled"; then USE_EXTERNAL_LIBZ=false { $as_echo "$as_me:${as_lineno-$LINENO}: result: bundled" >&5 $as_echo "bundled" >&6; } -elif test "x${with_zlib}" = "xsystem"; then + elif test "x${with_zlib}" = "xsystem"; then if test "x${ZLIB_FOUND}" = "xyes"; then - USE_EXTERNAL_LIBZ=true - { $as_echo "$as_me:${as_lineno-$LINENO}: result: system" >&5 + USE_EXTERNAL_LIBZ=true + { $as_echo "$as_me:${as_lineno-$LINENO}: result: system" >&5 $as_echo "system" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: system not found" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: system not found" >&5 $as_echo "system not found" >&6; } - as_fn_error $? "--with-zlib=system specified, but no zlib found!" "$LINENO" 5 + as_fn_error $? "--with-zlib=system specified, but no zlib found!" "$LINENO" 5 fi -else + else as_fn_error $? "Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled'" "$LINENO" 5 -fi + fi -############################################################################### -LIBZIP_CAN_USE_MMAP=true + ############################################################################### + LIBZIP_CAN_USE_MMAP=true -############################################################################### -# -# Check if altzone exists in time.h -# + ############################################################################### + # + # Check if altzone exists in time.h + # -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -32067,18 +34951,18 @@ else fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test "x$has_altzone" = xyes; then + if test "x$has_altzone" = xyes; then $as_echo "#define HAVE_ALTZONE 1" >>confdefs.h -fi + fi -############################################################################### -# -# Check the maths library -# + ############################################################################### + # + # Check the maths library + # -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 $as_echo_n "checking for cos in -lm... " >&6; } if ${ac_cv_lib_m_cos+:} false; then : $as_echo_n "(cached) " >&6 @@ -32123,20 +35007,21 @@ _ACEOF else - { $as_echo "$as_me:${as_lineno-$LINENO}: Maths library was not found" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: Maths library was not found" >&5 $as_echo "$as_me: Maths library was not found" >&6;} + fi -############################################################################### -# -# Check for libdl.so + ############################################################################### + # + # Check for libdl.so -save_LIBS="$LIBS" -LIBS="" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 + save_LIBS="$LIBS" + LIBS="" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 @@ -32181,25 +35066,24 @@ _ACEOF fi -LIBDL="$LIBS" + LIBDL="$LIBS" -LIBS="$save_LIBS" + LIBS="$save_LIBS" - -############################################################################### -# -# statically link libstdc++ before C++ ABI is stablized on Linux unless -# dynamic build is configured on command line. -# + ############################################################################### + # + # statically link libstdc++ before C++ ABI is stablized on Linux unless + # dynamic build is configured on command line. + # # Check whether --with-stdc++lib was given. if test "${with_stdc__lib+set}" = set; then : withval=$with_stdc__lib; - if test "x$with_stdc__lib" != xdynamic && test "x$with_stdc__lib" != xstatic \ - && test "x$with_stdc__lib" != xdefault; then - as_fn_error $? "Bad parameter value --with-stdc++lib=$with_stdc__lib!" "$LINENO" 5 - fi + if test "x$with_stdc__lib" != xdynamic && test "x$with_stdc__lib" != xstatic \ + && test "x$with_stdc__lib" != xdefault; then + as_fn_error $? "Bad parameter value --with-stdc++lib=$with_stdc__lib!" "$LINENO" 5 + fi else with_stdc__lib=default @@ -32207,7 +35091,7 @@ else fi -if test "x$OPENJDK_TARGET_OS" = xlinux; then + if test "x$OPENJDK_TARGET_OS" = xlinux; then # Test if -lstdc++ works. { $as_echo "$as_me:${as_lineno-$LINENO}: checking if dynamic link of stdc++ is possible" >&5 $as_echo_n "checking if dynamic link of stdc++ is possible... " >&6; } @@ -32291,15 +35175,15 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu $as_echo "$has_static_libstdcxx" >&6; } if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then - as_fn_error $? "Cannot link to stdc++, neither dynamically nor statically!" "$LINENO" 5 + as_fn_error $? "Cannot link to stdc++, neither dynamically nor statically!" "$LINENO" 5 fi if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then - as_fn_error $? "Static linking of libstdc++ was not possible!" "$LINENO" 5 + as_fn_error $? "Static linking of libstdc++ was not possible!" "$LINENO" 5 fi if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then - as_fn_error $? "Dynamic linking of libstdc++ was not possible!" "$LINENO" 5 + as_fn_error $? "Dynamic linking of libstdc++ was not possible!" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libstdc++" >&5 @@ -32307,22 +35191,22 @@ $as_echo_n "checking how to link with libstdc++... " >&6; } # If dynamic was requested, it's available since it would fail above otherwise. # If dynamic wasn't requested, go with static unless it isn't available. if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then - LIBCXX="$LIBCXX -lstdc++" - LDCXX="$CXX" - STATIC_CXX_SETTING="STATIC_CXX=false" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: dynamic" >&5 + LIBCXX="$LIBCXX -lstdc++" + LDCXX="$CXX" + STATIC_CXX_SETTING="STATIC_CXX=false" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: dynamic" >&5 $as_echo "dynamic" >&6; } else - LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS" - LDCXX="$CC" - STATIC_CXX_SETTING="STATIC_CXX=true" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5 + LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS" + LDCXX="$CC" + STATIC_CXX_SETTING="STATIC_CXX=true" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5 $as_echo "static" >&6; } fi -fi + fi -if test "x$JVM_VARIANT_ZERO" = xtrue || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then + if test "x$JVM_VARIANT_ZERO" = xtrue || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then # Figure out LIBFFI_CFLAGS and LIBFFI_LIBS pkg_failed=no @@ -32411,9 +35295,9 @@ $as_echo "yes" >&6; } : fi -fi + fi -if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then + if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then # Extract the first word of "llvm-config", so it can be a program name with args. set dummy llvm-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -32453,7 +35337,7 @@ fi if test "x$LLVM_CONFIG" != xllvm-config; then - as_fn_error $? "llvm-config not found in $PATH." "$LINENO" 5 + as_fn_error $? "llvm-config not found in $PATH." "$LINENO" 5 fi llvm_components="jit mcjit engine nativecodegen native" @@ -32494,82 +35378,22 @@ fi -fi + fi -# libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) -if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then + # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) + if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1" -fi + fi -# TODO better (platform agnostic) test -if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then + # TODO better (platform agnostic) test + if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then LIBCXX="-lstdc++" -fi + fi -# After we have toolchain and the paths to all libraries (needed by msys), we can compile the fixpath helper - -# When using cygwin or msys, we need a wrapper binary that renames -# /cygdrive/c/ arguments into c:/ arguments and peeks into -# @files and rewrites these too! This wrapper binary is -# called fixpath. -FIXPATH= -if test "x$OPENJDK_BUILD_OS" = xwindows; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fixpath can be created" >&5 -$as_echo_n "checking if fixpath can be created... " >&6; } - FIXPATH_SRC="$SRC_ROOT/common/src/fixpath.c" - FIXPATH_BIN="$OUTPUT_ROOT/fixpath.exe" - if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin; then - FIXPATH_SRC=`$CYGPATH -m $FIXPATH_SRC` - FIXPATH_BIN=`$CYGPATH -m $FIXPATH_BIN` - # Important to keep the .exe suffix on Cygwin for Hotspot makefiles - FIXPATH="$OUTPUT_ROOT/fixpath.exe -c" - elif test "x$OPENJDK_BUILD_OS_ENV" = xwindows.msys; then - FIXPATH_SRC=`cmd //c echo $FIXPATH_SRC` - FIXPATH_BIN=`cmd //c echo $FIXPATH_BIN` - - # Take all collected prefixes and turn them into a -m/c/foo@/c/bar@... command line - # @ was chosen as separator to minimize risk of other tools messing around with it - all_unique_prefixes=`echo "${all_fixpath_prefixes[@]}" | tr ' ' '\n' | grep '^/./' | sort | uniq` - fixpath_argument_list=`echo $all_unique_prefixes | tr ' ' '@'` - - FIXPATH="$OUTPUT_ROOT/fixpath -m$fixpath_argument_list" - fi - rm -f $OUTPUT_ROOT/fixpath* - cd $OUTPUT_ROOT - $CC $FIXPATH_SRC -Fe$FIXPATH_BIN > $OUTPUT_ROOT/fixpath1.log 2>&1 - cd $CURDIR - - if test ! -x $OUTPUT_ROOT/fixpath.exe; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - cat $OUTPUT_ROOT/fixpath1.log - as_fn_error $? "Could not create $OUTPUT_ROOT/fixpath.exe" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fixpath.exe works" >&5 -$as_echo_n "checking if fixpath.exe works... " >&6; } - cd $OUTPUT_ROOT - $FIXPATH $CC $SRC_ROOT/common/src/fixpath.c -Fe$OUTPUT_ROOT/fixpath2.exe > $OUTPUT_ROOT/fixpath2.log 2>&1 - cd $CURDIR - if test ! -x $OUTPUT_ROOT/fixpath2.exe; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - cat $OUTPUT_ROOT/fixpath2.log - as_fn_error $? "fixpath did not work!" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - rm -f $OUTPUT_ROOT/fixpath?.??? $OUTPUT_ROOT/fixpath.obj -fi - - - - ############################################################################### # # We need to do some final tweaking, when everything else is done. @@ -32577,30 +35401,29 @@ fi ############################################################################### -HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET" + HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET" -# The name of the Service Agent jar. -SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}" -if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}" -fi + # The name of the Service Agent jar. + SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}" + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}" + fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if elliptic curve crypto implementation is present" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if elliptic curve crypto implementation is present" >&5 $as_echo_n "checking if elliptic curve crypto implementation is present... " >&6; } -if test -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then - ENABLE_INTREE_EC=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + if test -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then + ENABLE_INTREE_EC=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -else - ENABLE_INTREE_EC=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + else + ENABLE_INTREE_EC=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } -fi + fi @@ -32623,39 +35446,38 @@ fi if test "x$with_num_cores" = x; then # The number of cores were not specified, try to probe them. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for number of cores" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for number of cores" >&5 $as_echo_n "checking for number of cores... " >&6; } - NUM_CORES=1 - FOUND_CORES=no + NUM_CORES=1 + FOUND_CORES=no - if test -f /proc/cpuinfo; then - # Looks like a Linux (or cygwin) system - NUM_CORES=`cat /proc/cpuinfo | grep -c processor` - FOUND_CORES=yes - elif test -x /usr/sbin/psrinfo; then - # Looks like a Solaris system - NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line` - FOUND_CORES=yes - elif test -x /usr/sbin/system_profiler; then - # Looks like a MacOSX system - NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print $5}'` - FOUND_CORES=yes - elif test -n "$NUMBER_OF_PROCESSORS"; then - # On windows, look in the env - NUM_CORES=$NUMBER_OF_PROCESSORS - FOUND_CORES=yes - fi + if test -f /proc/cpuinfo; then + # Looks like a Linux (or cygwin) system + NUM_CORES=`cat /proc/cpuinfo | grep -c processor` + FOUND_CORES=yes + elif test -x /usr/sbin/psrinfo; then + # Looks like a Solaris system + NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line` + FOUND_CORES=yes + elif test -x /usr/sbin/system_profiler; then + # Looks like a MacOSX system + NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print $5}'` + FOUND_CORES=yes + elif test -n "$NUMBER_OF_PROCESSORS"; then + # On windows, look in the env + NUM_CORES=$NUMBER_OF_PROCESSORS + FOUND_CORES=yes + fi - if test "x$FOUND_CORES" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NUM_CORES" >&5 + if test "x$FOUND_CORES" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NUM_CORES" >&5 $as_echo "$NUM_CORES" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect number of cores, defaulting to 1" >&5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect number of cores, defaulting to 1" >&5 $as_echo "could not detect number of cores, defaulting to 1" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This will disable all parallelism from build!" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This will disable all parallelism from build!" >&5 $as_echo "$as_me: WARNING: This will disable all parallelism from build!" >&2;} - fi - + fi else NUM_CORES=$with_num_cores @@ -32673,42 +35495,42 @@ fi if test "x$with_memory_size" = x; then # The memory size was not specified, try to probe it. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for memory size" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for memory size" >&5 $as_echo_n "checking for memory size... " >&6; } - # Default to 1024 MB - MEMORY_SIZE=1024 - FOUND_MEM=no + # Default to 1024 MB + MEMORY_SIZE=1024 + FOUND_MEM=no - if test -f /proc/meminfo; then - # Looks like a Linux (or cygwin) system - MEMORY_SIZE=`cat /proc/meminfo | grep MemTotal | awk '{print $2}'` - MEMORY_SIZE=`expr $MEMORY_SIZE / 1024` - FOUND_MEM=yes - elif test -x /usr/sbin/prtconf; then - # Looks like a Solaris system - MEMORY_SIZE=`/usr/sbin/prtconf | grep "Memory size" | awk '{ print $3 }'` - FOUND_MEM=yes - elif test -x /usr/sbin/system_profiler; then - # Looks like a MacOSX system - MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print $2}'` - MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024` - FOUND_MEM=yes - elif test "x$OPENJDK_BUILD_OS" = xwindows; then - # Windows, but without cygwin - MEMORY_SIZE=`wmic computersystem get totalphysicalmemory -value | grep = | cut -d "=" -f 2-` - MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024` - FOUND_MEM=yes - fi + if test -f /proc/meminfo; then + # Looks like a Linux (or cygwin) system + MEMORY_SIZE=`cat /proc/meminfo | grep MemTotal | awk '{print $2}'` + MEMORY_SIZE=`expr $MEMORY_SIZE / 1024` + FOUND_MEM=yes + elif test -x /usr/sbin/prtconf; then + # Looks like a Solaris system + MEMORY_SIZE=`/usr/sbin/prtconf | grep "Memory size" | awk '{ print $3 }'` + FOUND_MEM=yes + elif test -x /usr/sbin/system_profiler; then + # Looks like a MacOSX system + MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print $2}'` + MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024` + FOUND_MEM=yes + elif test "x$OPENJDK_BUILD_OS" = xwindows; then + # Windows, but without cygwin + MEMORY_SIZE=`wmic computersystem get totalphysicalmemory -value | grep = | cut -d "=" -f 2-` + MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024` + FOUND_MEM=yes + fi - if test "x$FOUND_MEM" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MEMORY_SIZE MB" >&5 + if test "x$FOUND_MEM" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MEMORY_SIZE MB" >&5 $as_echo "$MEMORY_SIZE MB" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect memory size, defaulting to 1024 MB" >&5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect memory size, defaulting to 1024 MB" >&5 $as_echo "could not detect memory size, defaulting to 1024 MB" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This might seriously impact build performance!" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This might seriously impact build performance!" >&5 $as_echo "$as_me: WARNING: This might seriously impact build performance!" >&2;} - fi + fi else MEMORY_SIZE=$with_memory_size @@ -32764,224 +35586,223 @@ if test "${with_sjavac_server_java+set}" = set; then : fi -if test "x$with_sjavac_server_java" != x; then + if test "x$with_sjavac_server_java" != x; then SJAVAC_SERVER_JAVA="$with_sjavac_server_java" FOUND_VERSION=`$SJAVAC_SERVER_JAVA -version 2>&1 | grep " version \""` if test "x$FOUND_VERSION" = x; then - as_fn_error $? "Could not execute server java: $SJAVAC_SERVER_JAVA" "$LINENO" 5 + as_fn_error $? "Could not execute server java: $SJAVAC_SERVER_JAVA" "$LINENO" 5 fi -else + else SJAVAC_SERVER_JAVA="" # Hotspot specific options. - $ECHO "Check if jvm arg is ok: -verbosegc" >&5 - $ECHO "Command: $JAVA -verbosegc -version" >&5 - OUTPUT=`$JAVA -verbosegc -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -verbosegc" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -verbosegc" >&5 + $ECHO "Command: $JAVA -verbosegc -version" >&5 + OUTPUT=`$JAVA -verbosegc -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -verbosegc" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi # JRockit specific options. - $ECHO "Check if jvm arg is ok: -Xverbose:gc" >&5 - $ECHO "Command: $JAVA -Xverbose:gc -version" >&5 - OUTPUT=`$JAVA -Xverbose:gc -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xverbose:gc" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -Xverbose:gc" >&5 + $ECHO "Command: $JAVA -Xverbose:gc -version" >&5 + OUTPUT=`$JAVA -Xverbose:gc -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xverbose:gc" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi SJAVAC_SERVER_JAVA="$JAVA $SJAVAC_SERVER_JAVA" -fi + fi -if test "$MEMORY_SIZE" -gt "2500"; then + if test "$MEMORY_SIZE" -gt "2500"; then - $ECHO "Check if jvm arg is ok: -d64" >&5 - $ECHO "Command: $SJAVAC_SERVER_JAVA -d64 -version" >&5 - OUTPUT=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -d64" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -d64" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -d64 -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -d64" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi if test "$JVM_ARG_OK" = true; then - JVM_64BIT=true - JVM_ARG_OK=false - fi + JVM_64BIT=true + JVM_ARG_OK=false fi + fi -if test "$JVM_64BIT" = true; then + if test "$JVM_64BIT" = true; then if test "$MEMORY_SIZE" -gt "17000"; then - $ECHO "Check if jvm arg is ok: -Xms10G -Xmx10G" >&5 - $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms10G -Xmx10G -version" >&5 - OUTPUT=`$SJAVAC_SERVER_JAVA -Xms10G -Xmx10G -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms10G -Xmx10G" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -Xms10G -Xmx10G" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms10G -Xmx10G -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms10G -Xmx10G -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms10G -Xmx10G" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi fi if test "$MEMORY_SIZE" -gt "10000" && test "$JVM_ARG_OK" = false; then - $ECHO "Check if jvm arg is ok: -Xms6G -Xmx6G" >&5 - $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms6G -Xmx6G -version" >&5 - OUTPUT=`$SJAVAC_SERVER_JAVA -Xms6G -Xmx6G -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms6G -Xmx6G" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -Xms6G -Xmx6G" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms6G -Xmx6G -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms6G -Xmx6G -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms6G -Xmx6G" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi fi if test "$MEMORY_SIZE" -gt "5000" && test "$JVM_ARG_OK" = false; then - $ECHO "Check if jvm arg is ok: -Xms1G -Xmx3G" >&5 - $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms1G -Xmx3G -version" >&5 - OUTPUT=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx3G -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms1G -Xmx3G" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -Xms1G -Xmx3G" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms1G -Xmx3G -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx3G -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms1G -Xmx3G" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi fi if test "$MEMORY_SIZE" -gt "3800" && test "$JVM_ARG_OK" = false; then - $ECHO "Check if jvm arg is ok: -Xms1G -Xmx2500M" >&5 - $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M -version" >&5 - OUTPUT=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -Xms1G -Xmx2500M" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi fi -fi -if test "$MEMORY_SIZE" -gt "2500" && test "$JVM_ARG_OK" = false; then + fi + if test "$MEMORY_SIZE" -gt "2500" && test "$JVM_ARG_OK" = false; then - $ECHO "Check if jvm arg is ok: -Xms1000M -Xmx1500M" >&5 - $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms1000M -Xmx1500M -version" >&5 - OUTPUT=`$SJAVAC_SERVER_JAVA -Xms1000M -Xmx1500M -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms1000M -Xmx1500M" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -Xms1000M -Xmx1500M" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms1000M -Xmx1500M -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms1000M -Xmx1500M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms1000M -Xmx1500M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi -fi -if test "$MEMORY_SIZE" -gt "1000" && test "$JVM_ARG_OK" = false; then + fi + if test "$MEMORY_SIZE" -gt "1000" && test "$JVM_ARG_OK" = false; then - $ECHO "Check if jvm arg is ok: -Xms400M -Xmx1100M" >&5 - $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M -version" >&5 - OUTPUT=`$SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -Xms400M -Xmx1100M" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi -fi -if test "$JVM_ARG_OK" = false; then + fi + if test "$JVM_ARG_OK" = false; then - $ECHO "Check if jvm arg is ok: -Xms256M -Xmx512M" >&5 - $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms256M -Xmx512M -version" >&5 - OUTPUT=`$SJAVAC_SERVER_JAVA -Xms256M -Xmx512M -version 2>&1` - FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` - FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms256M -Xmx512M" - JVM_ARG_OK=true - else - $ECHO "Arg failed:" >&5 - $ECHO "$OUTPUT" >&5 - JVM_ARG_OK=false - fi + $ECHO "Check if jvm arg is ok: -Xms256M -Xmx512M" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms256M -Xmx512M -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms256M -Xmx512M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms256M -Xmx512M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi -fi + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use sjavac" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use sjavac" >&5 $as_echo_n "checking whether to use sjavac... " >&6; } -# Check whether --enable-sjavac was given. + # Check whether --enable-sjavac was given. if test "${enable_sjavac+set}" = set; then : enableval=$enable_sjavac; ENABLE_SJAVAC="${enableval}" else ENABLE_SJAVAC='no' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_SJAVAC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_SJAVAC" >&5 $as_echo "$ENABLE_SJAVAC" >&6; } -if test "x$ENABLE_SJAVAC" = xyes; then + if test "x$ENABLE_SJAVAC" = xyes; then SJAVAC_SERVER_DIR="$OUTPUT_ROOT/javacservers" -else + else SJAVAC_SERVER_DIR= -fi - + fi # Can the C/C++ compiler use precompiled headers? -############################################################################### -# -# Can the C/C++ compiler use precompiled headers? -# -# Check whether --enable-precompiled-headers was given. + ############################################################################### + # + # Can the C/C++ compiler use precompiled headers? + # + # Check whether --enable-precompiled-headers was given. if test "${enable_precompiled_headers+set}" = set; then : enableval=$enable_precompiled_headers; ENABLE_PRECOMPH=${enable_precompiled_headers} else @@ -32989,48 +35810,48 @@ else fi -USE_PRECOMPILED_HEADER=1 -if test "x$ENABLE_PRECOMPH" = xno; then + USE_PRECOMPILED_HEADER=1 + if test "x$ENABLE_PRECOMPH" = xno; then USE_PRECOMPILED_HEADER=0 -fi + fi -if test "x$ENABLE_PRECOMPH" = xyes; then + if test "x$ENABLE_PRECOMPH" = xyes; then # Check that the compiler actually supports precomp headers. if test "x$GCC" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking that precompiled headers work" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking that precompiled headers work" >&5 $as_echo_n "checking that precompiled headers work... " >&6; } - echo "int alfa();" > conftest.h - $CXX -x c++-header conftest.h -o conftest.hpp.gch 2>&5 >&5 - if test ! -f conftest.hpp.gch; then - USE_PRECOMPILED_HEADER=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + echo "int alfa();" > conftest.h + $CXX -x c++-header conftest.h -o conftest.hpp.gch 2>&5 >&5 + if test ! -f conftest.hpp.gch; then + USE_PRECOMPILED_HEADER=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - fi - rm -f conftest.h conftest.hpp.gch + fi + rm -f conftest.h conftest.hpp.gch fi -fi + fi # Setup use of ccache, if available - # Check whether --enable-ccache was given. + # Check whether --enable-ccache was given. if test "${enable_ccache+set}" = set; then : enableval=$enable_ccache; ENABLE_CCACHE=${enable_ccache} else ENABLE_CCACHE=yes fi - if test "x$ENABLE_CCACHE" = xyes; then - OLD_PATH="$PATH" - if test "x$TOOLS_DIR" != x; then - PATH=$TOOLS_DIR:$PATH - fi - # Extract the first word of "ccache", so it can be a program name with args. + if test "x$ENABLE_CCACHE" = xyes; then + OLD_PATH="$PATH" + if test "x$TOOLS_DIR" != x; then + PATH=$TOOLS_DIR:$PATH + fi + # Extract the first word of "ccache", so it can be a program name with args. 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; } @@ -33070,14 +35891,14 @@ $as_echo "no" >&6; } fi - PATH="$OLD_PATH" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ccache" >&5 + PATH="$OLD_PATH" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ccache" >&5 $as_echo_n "checking for ccache... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: explicitly disabled" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: explicitly disabled" >&5 $as_echo "explicitly disabled" >&6; } - CCACHE= - fi + CCACHE= + fi @@ -33087,33 +35908,33 @@ if test "${with_ccache_dir+set}" = set; then : fi - if test "x$with_ccache_dir" != x; then - # When using a non home ccache directory, assume the use is to share ccache files - # with other users. Thus change the umask. - SET_CCACHE_DIR="CCACHE_DIR=$with_ccache_dir CCACHE_UMASK=002" - fi - CCACHE_FOUND="" - if test "x$CCACHE" != x; then + if test "x$with_ccache_dir" != x; then + # When using a non home ccache directory, assume the use is to share ccache files + # with other users. Thus change the umask. + SET_CCACHE_DIR="CCACHE_DIR=$with_ccache_dir CCACHE_UMASK=002" + fi + CCACHE_FOUND="" + if test "x$CCACHE" != x; then - if test "x$CCACHE" != x; then - CCACHE_FOUND="true" - # Only use ccache if it is 3.1.4 or later, which supports - # precompiled headers. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ccache supports precompiled headers" >&5 + if test "x$CCACHE" != x; then + CCACHE_FOUND="true" + # Only use ccache if it is 3.1.4 or later, which supports + # precompiled headers. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ccache supports precompiled headers" >&5 $as_echo_n "checking if ccache supports precompiled headers... " >&6; } - HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.[456789]) 2> /dev/null` - if test "x$HAS_GOOD_CCACHE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabling ccache" >&5 + HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.[456789]) 2> /dev/null` + if test "x$HAS_GOOD_CCACHE" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabling ccache" >&5 $as_echo "no, disabling ccache" >&6; } - CCACHE= - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + CCACHE= + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C-compiler supports ccache precompiled headers" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C-compiler supports ccache precompiled headers" >&5 $as_echo_n "checking if C-compiler supports ccache precompiled headers... " >&6; } - PUSHED_FLAGS="$CXXFLAGS" - CXXFLAGS="-fpch-preprocess $CXXFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + PUSHED_FLAGS="$CXXFLAGS" + CXXFLAGS="-fpch-preprocess $CXXFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -33130,30 +35951,30 @@ else CC_KNOWS_CCACHE_TRICK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXXFLAGS="$PUSHED_FLAGS" - if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + CXXFLAGS="$PUSHED_FLAGS" + if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabling ccaching of precompiled headers" >&5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabling ccaching of precompiled headers" >&5 $as_echo "no, disabling ccaching of precompiled headers" >&6; } - CCACHE= - fi - fi + CCACHE= + fi fi + fi - if test "x$CCACHE" != x; then - CCACHE_SLOPPINESS=time_macros - CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS $CCACHE" - CCACHE_FLAGS=-fpch-preprocess + if test "x$CCACHE" != x; then + CCACHE_SLOPPINESS=time_macros + CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS $CCACHE" + CCACHE_FLAGS=-fpch-preprocess - if test "x$SET_CCACHE_DIR" != x; then - mkdir -p $CCACHE_DIR > /dev/null 2>&1 - chmod a+rwxs $CCACHE_DIR > /dev/null 2>&1 - fi + if test "x$SET_CCACHE_DIR" != x; then + mkdir -p $CCACHE_DIR > /dev/null 2>&1 + chmod a+rwxs $CCACHE_DIR > /dev/null 2>&1 fi + fi - fi + fi ############################################################################### @@ -33172,12 +35993,11 @@ $as_echo "no, disabling ccaching of precompiled headers" >&6; } fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if build directory is on local disk" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if build directory is on local disk" >&5 $as_echo_n "checking if build directory is on local disk... " >&6; } - # df -l lists only local disks; if the given directory is not found then - # a non-zero exit code is given + # df -l lists only local disks; if the given directory is not found then + # a non-zero exit code is given if test "x$DF" = x; then if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # msys does not have df; use Windows "net use" instead. @@ -33199,30 +36019,29 @@ $as_echo_n "checking if build directory is on local disk... " >&6; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OUTPUT_DIR_IS_LOCAL" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OUTPUT_DIR_IS_LOCAL" >&5 $as_echo "$OUTPUT_DIR_IS_LOCAL" >&6; } -# Check if the user has any old-style ALT_ variables set. -FOUND_ALT_VARIABLES=`env | grep ^ALT_` + # Check if the user has any old-style ALT_ variables set. + FOUND_ALT_VARIABLES=`env | grep ^ALT_` -# Before generating output files, test if they exist. If they do, this is a reconfigure. -# Since we can't properly handle the dependencies for this, warn the user about the situation -if test -e $OUTPUT_ROOT/spec.gmk; then - IS_RECONFIGURE=yes -else - IS_RECONFIGURE=no -fi - -if test -e $SRC_ROOT/build/.hide-configure-performance-hints; then - HIDE_PERFORMANCE_HINTS=yes -else - HIDE_PERFORMANCE_HINTS=no - # Hide it the next time around... - $TOUCH $SRC_ROOT/build/.hide-configure-performance-hints > /dev/null 2>&1 -fi + # Before generating output files, test if they exist. If they do, this is a reconfigure. + # Since we can't properly handle the dependencies for this, warn the user about the situation + if test -e $OUTPUT_ROOT/spec.gmk; then + IS_RECONFIGURE=yes + else + IS_RECONFIGURE=no + fi + if test -e $SRC_ROOT/build/.hide-configure-performance-hints; then + HIDE_PERFORMANCE_HINTS=yes + else + HIDE_PERFORMANCE_HINTS=no + # Hide it the next time around... + $TOUCH $SRC_ROOT/build/.hide-configure-performance-hints > /dev/null 2>&1 + fi # At the end, call the custom hook. (Dummy macro if no custom sources available) @@ -34523,115 +37342,122 @@ $CHMOD +x $OUTPUT_ROOT/compare.sh # Finally output some useful information to the user -# Finally output some useful information to the user + # Finally output some useful information to the user -if test "x$CCACHE_FOUND" != x; then - if test "x$HAS_GOOD_CCACHE" = x; then - CCACHE_STATUS="installed, but disabled (version older than 3.1.4)" - CCACHE_HELP_MSG="You have ccache installed, but it is a version prior to 3.1.4. Try upgrading." - else - CCACHE_STATUS="installed and in use" - fi -else - if test "x$GCC" = xyes; then - CCACHE_STATUS="not installed (consider installing)" - CCACHE_HELP_MSG="You do not have ccache installed. Try installing it." - else - CCACHE_STATUS="not available for your system" - fi -fi + if test "x$CCACHE_FOUND" != x; then + if test "x$HAS_GOOD_CCACHE" = x; then + CCACHE_STATUS="installed, but disabled (version older than 3.1.4)" + CCACHE_HELP_MSG="You have ccache installed, but it is a version prior to 3.1.4. Try upgrading." + else + CCACHE_STATUS="installed and in use" + fi + else + if test "x$GCC" = xyes; then + CCACHE_STATUS="not installed (consider installing)" + CCACHE_HELP_MSG="You do not have ccache installed. Try installing it." + else + CCACHE_STATUS="not available for your system" + fi + fi -printf "\n" -printf "====================================================\n" -printf "A new configuration has been successfully created in\n" -printf "$OUTPUT_ROOT\n" -if test "x$CONFIGURE_COMMAND_LINE" != x; then - printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n" -else - printf "using default settings.\n" -fi + printf "\n" + printf "====================================================\n" + printf "A new configuration has been successfully created in\n" + printf "$OUTPUT_ROOT\n" + if test "x$CONFIGURE_COMMAND_LINE" != x; then + printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n" + else + printf "using default settings.\n" + fi -printf "\n" -printf "Configuration summary:\n" -printf "* Debug level: $DEBUG_LEVEL\n" -printf "* JDK variant: $JDK_VARIANT\n" -printf "* JVM variants: $with_jvm_variants\n" -printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n" + printf "\n" + printf "Configuration summary:\n" + printf "* Debug level: $DEBUG_LEVEL\n" + printf "* JDK variant: $JDK_VARIANT\n" + printf "* JVM variants: $with_jvm_variants\n" + printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n" -printf "\n" -printf "Tools summary:\n" -if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" -fi -printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" -printf "* C Compiler: $CC_VENDOR version $CC_VERSION (at $CC)\n" -printf "* C++ Compiler: $CXX_VENDOR version $CXX_VERSION (at $CXX)\n" + printf "\n" + printf "Tools summary:\n" + if test "x$OPENJDK_BUILD_OS" = "xwindows"; then + printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" + fi + printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" + printf "* C Compiler: $CC_VENDOR version $CC_VERSION (at $CC)\n" + printf "* C++ Compiler: $CXX_VENDOR version $CXX_VERSION (at $CXX)\n" -printf "\n" -printf "Build performance summary:\n" -printf "* Cores to use: $JOBS\n" -printf "* Memory limit: $MEMORY_SIZE MB\n" -printf "* ccache status: $CCACHE_STATUS\n" -printf "\n" + printf "\n" + printf "Build performance summary:\n" + printf "* Cores to use: $JOBS\n" + printf "* Memory limit: $MEMORY_SIZE MB\n" + printf "* ccache status: $CCACHE_STATUS\n" + printf "\n" -if test "x$CCACHE_HELP_MSG" != x && test "x$HIDE_PERFORMANCE_HINTS" = "xno"; then - printf "Build performance tip: ccache gives a tremendous speedup for C++ recompilations.\n" - printf "$CCACHE_HELP_MSG\n" + if test "x$CCACHE_HELP_MSG" != x && test "x$HIDE_PERFORMANCE_HINTS" = "xno"; then + printf "Build performance tip: ccache gives a tremendous speedup for C++ recompilations.\n" + printf "$CCACHE_HELP_MSG\n" - # Print a helpful message on how to acquire the necessary build dependency. - # ccache is the help tag: freetyp2, cups, pulse, alsa etc - MISSING_DEPENDENCY=ccache + # Print a helpful message on how to acquire the necessary build dependency. + # ccache is the help tag: freetype, cups, pulse, alsa etc + MISSING_DEPENDENCY=ccache + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else PKGHANDLER_COMMAND= case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; esac if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." fi + fi - printf "$HELP_MSG\n" - printf "\n" -fi + printf "$HELP_MSG\n" + printf "\n" + fi -if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then - printf "NOTE: You have requested to build more than one version of the JVM, which\n" - printf "will result in longer build times.\n" - printf "\n" -fi + if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then + printf "NOTE: You have requested to build more than one version of the JVM, which\n" + printf "will result in longer build times.\n" + printf "\n" + fi -if test "x$FOUND_ALT_VARIABLES" != "x"; then - printf "WARNING: You have old-style ALT_ environment variables set.\n" - printf "These are not respected, and will be ignored. It is recommended\n" - printf "that you clean your environment. The following variables are set:\n" - printf "$FOUND_ALT_VARIABLES\n" - printf "\n" -fi + if test "x$FOUND_ALT_VARIABLES" != "x"; then + printf "WARNING: You have old-style ALT_ environment variables set.\n" + printf "These are not respected, and will be ignored. It is recommended\n" + printf "that you clean your environment. The following variables are set:\n" + printf "$FOUND_ALT_VARIABLES\n" + printf "\n" + fi -if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then - printf "WARNING: Your build output directory is not on a local disk.\n" - printf "This will severely degrade build performance!\n" - printf "It is recommended that you create an output directory on a local disk,\n" - printf "and run the configure script again from that directory.\n" - printf "\n" -fi + if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then + printf "WARNING: Your build output directory is not on a local disk.\n" + printf "This will severely degrade build performance!\n" + printf "It is recommended that you create an output directory on a local disk,\n" + printf "and run the configure script again from that directory.\n" + printf "\n" + fi -if test "x$IS_RECONFIGURE" = "xyes"; then - printf "WARNING: The result of this configuration has overridden an older\n" - printf "configuration. You *should* run 'make clean' to make sure you get a\n" - printf "proper build. Failure to do so might result in strange build problems.\n" - printf "\n" -fi + if test "x$IS_RECONFIGURE" = "xyes"; then + printf "WARNING: The result of this configuration has overridden an older\n" + printf "configuration. You *should* run 'make clean' to make sure you get a\n" + printf "proper build. Failure to do so might result in strange build problems.\n" + printf "\n" + fi diff --git a/common/autoconf/help.m4 b/common/autoconf/help.m4 index 15e8b955303..5cfcc6fcfc1 100644 --- a/common/autoconf/help.m4 +++ b/common/autoconf/help.m4 @@ -25,194 +25,227 @@ AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP], [ - AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd) + AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd) ]) AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY], [ - # Print a helpful message on how to acquire the necessary build dependency. - # $1 is the help tag: freetyp2, cups, pulse, alsa etc - MISSING_DEPENDENCY=$1 + # Print a helpful message on how to acquire the necessary build dependency. + # $1 is the help tag: freetype, cups, pulse, alsa etc + MISSING_DEPENDENCY=$1 + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else PKGHANDLER_COMMAND= case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; esac if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." fi + fi ]) cygwin_help() { - case $1 in + case $1 in unzip) - PKGHANDLER_COMMAND="cd && cmd /c setup -q -P unzip" ;; + PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P unzip )" + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + ;; zip) - PKGHANDLER_COMMAND="cd && cmd /c setup -q -P zip" ;; + PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P zip )" + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + ;; make) - PKGHANDLER_COMMAND="cd && cmd /c setup -q -P make" ;; + PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P make )" + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + ;; + freetype) + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + HELP_MSG="To install freetype, run: +wget \"http://gnuwin32.sourceforge.net/downlinks/freetype.php\" -O /tmp/freetype-setup.exe +chmod +x /tmp/freetype-setup.exe +/tmp/freetype-setup.exe +Follow GUI prompts, and install to default directory \"C:\Program Files (x86)\GnuWin32\". +After installation, locate lib/libfreetype.dll.a and make a copy with the name freetype.dll." + else + HELP_MSG="You need to build a 64-bit version of freetype. +This is not readily available. +You can find source code and build instructions on +http://www.freetype.org/ +If you put the resulting build in \"C:\Program Files\GnuWin32\", it will be found automatically." + fi + ;; * ) - break ;; - esac + break ;; + esac +} + +msys_help() { + PKGHANDLER_COMMAND="" } apt_help() { - case $1 in + case $1 in devkit) - PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;; + PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;; openjdk) - PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;; + PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;; alsa) - PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;; + PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;; cups) - PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;; - freetype2) - PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;; + PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;; + freetype) + PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;; pulse) - PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;; + PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;; x11) - PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;; + PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;; ccache) - PKGHANDLER_COMMAND="sudo apt-get install ccache" ;; + PKGHANDLER_COMMAND="sudo apt-get install ccache" ;; * ) - break ;; - esac + break ;; + esac } yum_help() { - case $1 in + case $1 in devkit) - PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;; + PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;; openjdk) - PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;; + PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;; alsa) - PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;; + PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;; cups) - PKGHANDLER_COMMAND="sudo yum install cups-devel" ;; - freetype2) - PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;; + PKGHANDLER_COMMAND="sudo yum install cups-devel" ;; + freetype) + PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;; pulse) - PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;; + PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;; x11) - PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel" ;; + PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel" ;; ccache) - PKGHANDLER_COMMAND="sudo yum install ccache" ;; + PKGHANDLER_COMMAND="sudo yum install ccache" ;; * ) - break ;; - esac + break ;; + esac } port_help() { - PKGHANDLER_COMMAND="" + PKGHANDLER_COMMAND="" } pkgutil_help() { - PKGHANDLER_COMMAND="" + PKGHANDLER_COMMAND="" } pkgadd_help() { - PKGHANDLER_COMMAND="" + PKGHANDLER_COMMAND="" } AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS], [ -# Finally output some useful information to the user + # Finally output some useful information to the user -if test "x$CCACHE_FOUND" != x; then - if test "x$HAS_GOOD_CCACHE" = x; then - CCACHE_STATUS="installed, but disabled (version older than 3.1.4)" - CCACHE_HELP_MSG="You have ccache installed, but it is a version prior to 3.1.4. Try upgrading." - else - CCACHE_STATUS="installed and in use" - fi -else - if test "x$GCC" = xyes; then - CCACHE_STATUS="not installed (consider installing)" - CCACHE_HELP_MSG="You do not have ccache installed. Try installing it." - else - CCACHE_STATUS="not available for your system" - fi -fi + if test "x$CCACHE_FOUND" != x; then + if test "x$HAS_GOOD_CCACHE" = x; then + CCACHE_STATUS="installed, but disabled (version older than 3.1.4)" + CCACHE_HELP_MSG="You have ccache installed, but it is a version prior to 3.1.4. Try upgrading." + else + CCACHE_STATUS="installed and in use" + fi + else + if test "x$GCC" = xyes; then + CCACHE_STATUS="not installed (consider installing)" + CCACHE_HELP_MSG="You do not have ccache installed. Try installing it." + else + CCACHE_STATUS="not available for your system" + fi + fi -printf "\n" -printf "====================================================\n" -printf "A new configuration has been successfully created in\n" -printf "$OUTPUT_ROOT\n" -if test "x$CONFIGURE_COMMAND_LINE" != x; then - printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n" -else - printf "using default settings.\n" -fi + printf "\n" + printf "====================================================\n" + printf "A new configuration has been successfully created in\n" + printf "$OUTPUT_ROOT\n" + if test "x$CONFIGURE_COMMAND_LINE" != x; then + printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n" + else + printf "using default settings.\n" + fi -printf "\n" -printf "Configuration summary:\n" -printf "* Debug level: $DEBUG_LEVEL\n" -printf "* JDK variant: $JDK_VARIANT\n" -printf "* JVM variants: $with_jvm_variants\n" -printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n" + printf "\n" + printf "Configuration summary:\n" + printf "* Debug level: $DEBUG_LEVEL\n" + printf "* JDK variant: $JDK_VARIANT\n" + printf "* JVM variants: $with_jvm_variants\n" + printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n" -printf "\n" -printf "Tools summary:\n" -if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" -fi -printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" -printf "* C Compiler: $CC_VENDOR version $CC_VERSION (at $CC)\n" -printf "* C++ Compiler: $CXX_VENDOR version $CXX_VERSION (at $CXX)\n" + printf "\n" + printf "Tools summary:\n" + if test "x$OPENJDK_BUILD_OS" = "xwindows"; then + printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" + fi + printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" + printf "* C Compiler: $CC_VENDOR version $CC_VERSION (at $CC)\n" + printf "* C++ Compiler: $CXX_VENDOR version $CXX_VERSION (at $CXX)\n" -printf "\n" -printf "Build performance summary:\n" -printf "* Cores to use: $JOBS\n" -printf "* Memory limit: $MEMORY_SIZE MB\n" -printf "* ccache status: $CCACHE_STATUS\n" -printf "\n" + printf "\n" + printf "Build performance summary:\n" + printf "* Cores to use: $JOBS\n" + printf "* Memory limit: $MEMORY_SIZE MB\n" + printf "* ccache status: $CCACHE_STATUS\n" + printf "\n" -if test "x$CCACHE_HELP_MSG" != x && test "x$HIDE_PERFORMANCE_HINTS" = "xno"; then - printf "Build performance tip: ccache gives a tremendous speedup for C++ recompilations.\n" - printf "$CCACHE_HELP_MSG\n" - HELP_MSG_MISSING_DEPENDENCY([ccache]) - printf "$HELP_MSG\n" - printf "\n" -fi + if test "x$CCACHE_HELP_MSG" != x && test "x$HIDE_PERFORMANCE_HINTS" = "xno"; then + printf "Build performance tip: ccache gives a tremendous speedup for C++ recompilations.\n" + printf "$CCACHE_HELP_MSG\n" + HELP_MSG_MISSING_DEPENDENCY([ccache]) + printf "$HELP_MSG\n" + printf "\n" + fi -if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then - printf "NOTE: You have requested to build more than one version of the JVM, which\n" - printf "will result in longer build times.\n" - printf "\n" -fi + if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then + printf "NOTE: You have requested to build more than one version of the JVM, which\n" + printf "will result in longer build times.\n" + printf "\n" + fi -if test "x$FOUND_ALT_VARIABLES" != "x"; then - printf "WARNING: You have old-style ALT_ environment variables set.\n" - printf "These are not respected, and will be ignored. It is recommended\n" - printf "that you clean your environment. The following variables are set:\n" - printf "$FOUND_ALT_VARIABLES\n" - printf "\n" -fi + if test "x$FOUND_ALT_VARIABLES" != "x"; then + printf "WARNING: You have old-style ALT_ environment variables set.\n" + printf "These are not respected, and will be ignored. It is recommended\n" + printf "that you clean your environment. The following variables are set:\n" + printf "$FOUND_ALT_VARIABLES\n" + printf "\n" + fi -if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then - printf "WARNING: Your build output directory is not on a local disk.\n" - printf "This will severely degrade build performance!\n" - printf "It is recommended that you create an output directory on a local disk,\n" - printf "and run the configure script again from that directory.\n" - printf "\n" -fi + if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then + printf "WARNING: Your build output directory is not on a local disk.\n" + printf "This will severely degrade build performance!\n" + printf "It is recommended that you create an output directory on a local disk,\n" + printf "and run the configure script again from that directory.\n" + printf "\n" + fi -if test "x$IS_RECONFIGURE" = "xyes"; then - printf "WARNING: The result of this configuration has overridden an older\n" - printf "configuration. You *should* run 'make clean' to make sure you get a\n" - printf "proper build. Failure to do so might result in strange build problems.\n" - printf "\n" -fi + if test "x$IS_RECONFIGURE" = "xyes"; then + printf "WARNING: The result of this configuration has overridden an older\n" + printf "configuration. You *should* run 'make clean' to make sure you get a\n" + printf "proper build. Failure to do so might result in strange build problems.\n" + printf "\n" + fi ]) diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in index 17b404a5902..b5a38d25c09 100644 --- a/common/autoconf/hotspot-spec.gmk.in +++ b/common/autoconf/hotspot-spec.gmk.in @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -111,20 +111,19 @@ EXTRA_LDFLAGS=@LEGACY_EXTRA_LDFLAGS@ USE_PRECOMPILED_HEADER=@USE_PRECOMPILED_HEADER@ # Hotspot expects the variable FULL_DEBUG_SYMBOLS=1/0 to control debug symbols -# creation. -ifeq ($(ENABLE_DEBUG_SYMBOLS), true) +# creation. +ifeq ($(ENABLE_DEBUG_SYMBOLS), true) FULL_DEBUG_SYMBOLS=1 - # Ensure hotspot uses the objcopy that configure located - ALT_OBJCOPY:=$(OBJCOPY) -else + # Ensure hotspot uses the objcopy that configure located + ALT_OBJCOPY:=$(OBJCOPY) +else FULL_DEBUG_SYMBOLS=0 endif # Hotspot expects the variable ZIP_DEBUGINFO_FILES=1/0 and not true/false. ifeq ($(ZIP_DEBUGINFO_FILES)$(ENABLE_DEBUG_SYMBOLS), truetrue) ZIP_DEBUGINFO_FILES:=1 -endif -ifeq ($(ZIP_DEBUGINFO_FILES), false) +else ZIP_DEBUGINFO_FILES:=0 endif diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4 index b1c99bbe7dc..4397fb81123 100644 --- a/common/autoconf/jdk-options.m4 +++ b/common/autoconf/jdk-options.m4 @@ -25,235 +25,234 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT], [ -############################################################################### -# -# Check which variant of the JDK that we want to build. -# Currently we have: -# normal: standard edition -# but the custom make system may add other variants -# -# Effectively the JDK variant gives a name to a specific set of -# modules to compile into the JDK. In the future, these modules -# might even be Jigsaw modules. -# -AC_MSG_CHECKING([which variant of the JDK to build]) -AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant], - [JDK variant to build (normal) @<:@normal@:>@])]) + ############################################################################### + # + # Check which variant of the JDK that we want to build. + # Currently we have: + # normal: standard edition + # but the custom make system may add other variants + # + # Effectively the JDK variant gives a name to a specific set of + # modules to compile into the JDK. In the future, these modules + # might even be Jigsaw modules. + # + AC_MSG_CHECKING([which variant of the JDK to build]) + AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant], + [JDK variant to build (normal) @<:@normal@:>@])]) -if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then + if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then JDK_VARIANT="normal" -else + else AC_MSG_ERROR([The available JDK variants are: normal]) -fi + fi -AC_SUBST(JDK_VARIANT) + AC_SUBST(JDK_VARIANT) -AC_MSG_RESULT([$JDK_VARIANT]) + AC_MSG_RESULT([$JDK_VARIANT]) ]) AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_VARIANTS], [ -############################################################################### -# -# Check which variants of the JVM that we want to build. -# 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, minimal1, kernel, zero, zeroshark) @<:@server@:>@])]) + ############################################################################### + # + # Check which variants of the JVM that we want to build. + # 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, minimal1, kernel, zero, zeroshark) @<:@server@:>@])]) -if test "x$with_jvm_variants" = x; then - with_jvm_variants="server" -fi + 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/minimal1,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'` + JVM_VARIANTS=",$with_jvm_variants," + 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, minimal1, kernel, zero, zeroshark]) -fi -AC_MSG_RESULT([$with_jvm_variants]) + if test "x$TEST_VARIANTS" != "x,"; then + 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'` + 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'` -if test "x$JVM_VARIANT_CLIENT" = xtrue; then + if test "x$JVM_VARIANT_CLIENT" = xtrue; then if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - AC_MSG_ERROR([You cannot build a client JVM for a 64-bit machine.]) + AC_MSG_ERROR([You cannot build a client JVM for a 64-bit machine.]) fi -fi -if test "x$JVM_VARIANT_KERNEL" = xtrue; then + fi + if test "x$JVM_VARIANT_KERNEL" = xtrue; then if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - AC_MSG_ERROR([You cannot build a kernel JVM for a 64-bit machine.]) + AC_MSG_ERROR([You cannot build a kernel JVM for a 64-bit machine.]) fi -fi -if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then + 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.]) + AC_MSG_ERROR([You cannot build a minimal JVM for a 64-bit machine.]) fi -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/minimal1,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/'` -if test "x$COUNT_VARIANTS" != "x,1"; then + # 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/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 + else BUILDING_MULTIPLE_JVM_VARIANTS=no -fi + fi -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) + 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) -INCLUDE_SA=true -if test "x$JVM_VARIANT_ZERO" = xtrue ; then + INCLUDE_SA=true + if test "x$JVM_VARIANT_ZERO" = xtrue ; then INCLUDE_SA=false -fi -if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then + fi + if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then INCLUDE_SA=false -fi -AC_SUBST(INCLUDE_SA) + fi + AC_SUBST(INCLUDE_SA) -if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - MACOSX_UNIVERSAL="true" -fi - -AC_SUBST(MACOSX_UNIVERSAL) + if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + MACOSX_UNIVERSAL="true" + fi + AC_SUBST(MACOSX_UNIVERSAL) ]) AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL], [ -############################################################################### -# -# Set the debug level -# release: no debug information, all optimizations, no asserts. -# fastdebug: debug information (-g), all optimizations, all asserts -# slowdebug: debug information (-g), no optimizations, all asserts -# -DEBUG_LEVEL="release" -AC_MSG_CHECKING([which debug level to use]) -AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], - [set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])], - [ + ############################################################################### + # + # Set the debug level + # release: no debug information, all optimizations, no asserts. + # fastdebug: debug information (-g), all optimizations, all asserts + # slowdebug: debug information (-g), no optimizations, all asserts + # + DEBUG_LEVEL="release" + AC_MSG_CHECKING([which debug level to use]) + AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], + [set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])], + [ ENABLE_DEBUG="${enableval}" DEBUG_LEVEL="fastdebug" - ], [ENABLE_DEBUG="no"]) + ], [ENABLE_DEBUG="no"]) -AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level], - [set the debug level (release, fastdebug, slowdebug) @<:@release@:>@])], - [ + AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level], + [set the debug level (release, fastdebug, slowdebug) @<:@release@:>@])], + [ DEBUG_LEVEL="${withval}" if test "x$ENABLE_DEBUG" = xyes; then - AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.]) + AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.]) fi - ]) -AC_MSG_RESULT([$DEBUG_LEVEL]) + ]) + AC_MSG_RESULT([$DEBUG_LEVEL]) -if test "x$DEBUG_LEVEL" != xrelease && \ - test "x$DEBUG_LEVEL" != xfastdebug && \ - test "x$DEBUG_LEVEL" != xslowdebug; then - AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug]) -fi + if test "x$DEBUG_LEVEL" != xrelease && \ + test "x$DEBUG_LEVEL" != xfastdebug && \ + test "x$DEBUG_LEVEL" != xslowdebug; then + AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug]) + fi -############################################################################### -# -# Setup legacy vars/targets and new vars to deal with different debug levels. -# + ############################################################################### + # + # Setup legacy vars/targets and new vars to deal with different debug levels. + # -case $DEBUG_LEVEL in - release ) - VARIANT="OPT" - FASTDEBUG="false" - DEBUG_CLASSFILES="false" - BUILD_VARIANT_RELEASE="" - HOTSPOT_DEBUG_LEVEL="product" - HOTSPOT_EXPORT="product" - ;; - fastdebug ) - VARIANT="DBG" - FASTDEBUG="true" - DEBUG_CLASSFILES="true" - BUILD_VARIANT_RELEASE="-fastdebug" - HOTSPOT_DEBUG_LEVEL="fastdebug" - HOTSPOT_EXPORT="fastdebug" - ;; - slowdebug ) - VARIANT="DBG" - FASTDEBUG="false" - DEBUG_CLASSFILES="true" - BUILD_VARIANT_RELEASE="-debug" - HOTSPOT_DEBUG_LEVEL="jvmg" - HOTSPOT_EXPORT="debug" - ;; -esac + case $DEBUG_LEVEL in + release ) + VARIANT="OPT" + FASTDEBUG="false" + DEBUG_CLASSFILES="false" + BUILD_VARIANT_RELEASE="" + HOTSPOT_DEBUG_LEVEL="product" + HOTSPOT_EXPORT="product" + ;; + fastdebug ) + VARIANT="DBG" + FASTDEBUG="true" + DEBUG_CLASSFILES="true" + BUILD_VARIANT_RELEASE="-fastdebug" + HOTSPOT_DEBUG_LEVEL="fastdebug" + HOTSPOT_EXPORT="fastdebug" + ;; + slowdebug ) + VARIANT="DBG" + FASTDEBUG="false" + DEBUG_CLASSFILES="true" + BUILD_VARIANT_RELEASE="-debug" + HOTSPOT_DEBUG_LEVEL="jvmg" + HOTSPOT_EXPORT="debug" + ;; + esac -##### -# 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="" + ##### + # 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 + if test "x$JVM_VARIANT_SERVER" = xtrue; then HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} " -fi + fi -if test "x$JVM_VARIANT_CLIENT" = xtrue; then + if test "x$JVM_VARIANT_CLIENT" = xtrue; then HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 " -fi + fi -if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then + if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 " -fi + fi -if test "x$JVM_VARIANT_KERNEL" = xtrue; then + if test "x$JVM_VARIANT_KERNEL" = xtrue; then HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel " -fi + fi -if test "x$JVM_VARIANT_ZERO" = xtrue; then + if test "x$JVM_VARIANT_ZERO" = xtrue; then HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero " -fi + fi -if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then + if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark " -fi + fi -HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT" + HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT" -# On Macosx universal binaries are produced, but they only contain -# 64 bit intel. This invalidates control of which jvms are built -# from configure, but only server is valid anyway. Fix this -# when hotspot makefiles are rewritten. -if test "x$MACOSX_UNIVERSAL" = xtrue; then + # On Macosx universal binaries are produced, but they only contain + # 64 bit intel. This invalidates control of which jvms are built + # from configure, but only server is valid anyway. Fix this + # when hotspot makefiles are rewritten. + if test "x$MACOSX_UNIVERSAL" = xtrue; then HOTSPOT_TARGET=universal_${HOTSPOT_EXPORT} -fi + fi -##### + ##### -AC_SUBST(DEBUG_LEVEL) -AC_SUBST(VARIANT) -AC_SUBST(FASTDEBUG) -AC_SUBST(DEBUG_CLASSFILES) -AC_SUBST(BUILD_VARIANT_RELEASE) + AC_SUBST(DEBUG_LEVEL) + AC_SUBST(VARIANT) + AC_SUBST(FASTDEBUG) + AC_SUBST(DEBUG_CLASSFILES) + AC_SUBST(BUILD_VARIANT_RELEASE) ]) @@ -264,7 +263,7 @@ AC_SUBST(BUILD_VARIANT_RELEASE) AC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM], [ AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only], - [suppress building custom source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"]) + [suppress building custom source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"]) AC_MSG_CHECKING([for presence of closed sources]) if test -d "$SRC_ROOT/jdk/src/closed"; then @@ -301,100 +300,100 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM], AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS], [ -############################################################################### -# -# Should we build a JDK/JVM with headful support (ie a graphical ui)? -# We always build headless support. -# -AC_MSG_CHECKING([headful support]) -AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful], - [disable building headful support (graphical UI support) @<:@enabled@:>@])], - [SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes]) + ############################################################################### + # + # Should we build a JDK/JVM with headful support (ie a graphical ui)? + # We always build headless support. + # + AC_MSG_CHECKING([headful support]) + AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful], + [disable building headful support (graphical UI support) @<:@enabled@:>@])], + [SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes]) -SUPPORT_HEADLESS=yes -BUILD_HEADLESS="BUILD_HEADLESS:=true" + SUPPORT_HEADLESS=yes + BUILD_HEADLESS="BUILD_HEADLESS:=true" -if test "x$SUPPORT_HEADFUL" = xyes; then + if test "x$SUPPORT_HEADFUL" = xyes; then # We are building both headful and headless. - headful_msg="inlude support for both headful and headless" -fi + headful_msg="include support for both headful and headless" + fi -if test "x$SUPPORT_HEADFUL" = xno; then + if test "x$SUPPORT_HEADFUL" = xno; then # Thus we are building headless only. BUILD_HEADLESS="BUILD_HEADLESS:=true" headful_msg="headless only" -fi + fi -AC_MSG_RESULT([$headful_msg]) + AC_MSG_RESULT([$headful_msg]) -AC_SUBST(SUPPORT_HEADLESS) -AC_SUBST(SUPPORT_HEADFUL) -AC_SUBST(BUILD_HEADLESS) + AC_SUBST(SUPPORT_HEADLESS) + AC_SUBST(SUPPORT_HEADFUL) + AC_SUBST(BUILD_HEADLESS) -# Control wether Hotspot runs Queens test after build. -AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build], - [run the Queens test after Hotspot build @<:@disabled@:>@])],, - [enable_hotspot_test_in_build=no]) -if test "x$enable_hotspot_test_in_build" = "xyes"; then + # Control wether Hotspot runs Queens test after build. + AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build], + [run the Queens test after Hotspot build @<:@disabled@:>@])],, + [enable_hotspot_test_in_build=no]) + if test "x$enable_hotspot_test_in_build" = "xyes"; then TEST_IN_BUILD=true -else + else TEST_IN_BUILD=false -fi -AC_SUBST(TEST_IN_BUILD) + fi + AC_SUBST(TEST_IN_BUILD) -############################################################################### -# -# Choose cacerts source file -# -AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file], - [specify alternative cacerts file])]) -if test "x$with_cacerts_file" != x; then + ############################################################################### + # + # Choose cacerts source file + # + AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file], + [specify alternative cacerts file])]) + if test "x$with_cacerts_file" != x; then CACERTS_FILE=$with_cacerts_file -else + else CACERTS_FILE=${SRC_ROOT}/jdk/src/share/lib/security/cacerts -fi -AC_SUBST(CACERTS_FILE) + fi + AC_SUBST(CACERTS_FILE) -############################################################################### -# -# Enable or disable unlimited crypto -# -AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--enable-unlimited-crypto], - [Enable unlimited crypto policy @<:@disabled@:>@])],, - [enable_unlimited_crypto=no]) -if test "x$enable_unlimited_crypto" = "xyes"; then + ############################################################################### + # + # Enable or disable unlimited crypto + # + AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--enable-unlimited-crypto], + [Enable unlimited crypto policy @<:@disabled@:>@])],, + [enable_unlimited_crypto=no]) + if test "x$enable_unlimited_crypto" = "xyes"; then UNLIMITED_CRYPTO=true -else + else UNLIMITED_CRYPTO=false -fi -AC_SUBST(UNLIMITED_CRYPTO) + fi + AC_SUBST(UNLIMITED_CRYPTO) -############################################################################### -# -# Enable or disable the elliptic curve crypto implementation -# -AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC], -[ -AC_MSG_CHECKING([if elliptic curve crypto implementation is present]) + ############################################################################### + # + # Enable or disable the elliptic curve crypto implementation + # + AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC], + [ + AC_MSG_CHECKING([if elliptic curve crypto implementation is present]) -if test -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then - ENABLE_INTREE_EC=yes - AC_MSG_RESULT([yes]) -else - ENABLE_INTREE_EC=no - AC_MSG_RESULT([no]) -fi + if test -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then + ENABLE_INTREE_EC=yes + AC_MSG_RESULT([yes]) + else + ENABLE_INTREE_EC=no + AC_MSG_RESULT([no]) + fi -AC_SUBST(ENABLE_INTREE_EC) -]) + AC_SUBST(ENABLE_INTREE_EC) + ]) -############################################################################### -# -# Compress jars -# -COMPRESS_JARS=false + ############################################################################### + # + # Compress jars + # + COMPRESS_JARS=false -AC_SUBST(COMPRESS_JARS) + AC_SUBST(COMPRESS_JARS) ]) ############################################################################### @@ -403,151 +402,152 @@ AC_SUBST(COMPRESS_JARS) # AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS], [ -# Source the version numbers -. $AUTOCONF_DIR/version-numbers + # Source the version numbers + . $AUTOCONF_DIR/version-numbers -# Get the settings from parameters -AC_ARG_WITH(milestone, [AS_HELP_STRING([--with-milestone], - [Set milestone value for build @<:@internal@:>@])]) -if test "x$with_milestone" = xyes; then - AC_MSG_ERROR([Milestone must have a value]) -elif test "x$with_milestone" != x; then + # Get the settings from parameters + AC_ARG_WITH(milestone, [AS_HELP_STRING([--with-milestone], + [Set milestone value for build @<:@internal@:>@])]) + if test "x$with_milestone" = xyes; then + AC_MSG_ERROR([Milestone must have a value]) + elif test "x$with_milestone" != x; then MILESTONE="$with_milestone" -fi -if test "x$MILESTONE" = x; then - MILESTONE=internal -fi + fi + if test "x$MILESTONE" = x; then + MILESTONE=internal + fi -AC_ARG_WITH(update-version, [AS_HELP_STRING([--with-update-version], - [Set update version value for build @<:@b00@:>@])]) -if test "x$with_update_version" = xyes; then - AC_MSG_ERROR([Update version must have a value]) -elif test "x$with_update_version" != x; then - JDK_UPDATE_VERSION="$with_update_version" -fi + AC_ARG_WITH(update-version, [AS_HELP_STRING([--with-update-version], + [Set update version value for build @<:@b00@:>@])]) + if test "x$with_update_version" = xyes; then + AC_MSG_ERROR([Update version must have a value]) + elif test "x$with_update_version" != x; then + JDK_UPDATE_VERSION="$with_update_version" + fi -AC_ARG_WITH(build-number, [AS_HELP_STRING([--with-build-number], - [Set build number value for build @<:@b00@:>@])]) -if test "x$with_build_number" = xyes; then - AC_MSG_ERROR([Build number must have a value]) -elif test "x$with_build_number" != x; then - JDK_BUILD_NUMBER="$with_build_number" -fi -if test "x$JDK_BUILD_NUMBER" = x; then - JDK_BUILD_NUMBER=b00 -fi + AC_ARG_WITH(user-release-suffix, [AS_HELP_STRING([--with-user-release-suffix], + [Add a custom string to the version string if build number isn't set.@<:@username_builddateb00@:>@])]) + if test "x$with_user_release_suffix" = xyes; then + AC_MSG_ERROR([Release suffix must have a value]) + elif test "x$with_user_release_suffix" != x; then + USER_RELEASE_SUFFIX="$with_user_release_suffix" + fi -AC_ARG_WITH(user-release-suffix, [AS_HELP_STRING([--with-user-release-suffix], - [Add a custom string to the version string if build number isn't set.@<:@username_builddateb00@:>@])]) -if test "x$with_user_release_suffix" = xyes; then - AC_MSG_ERROR([Release suffix must have a value]) -elif test "x$with_user_release_suffix" != x; then - USER_RELEASE_SUFFIX="$with_user_release_suffix" -else - BUILD_DATE=`date '+%Y_%m_%d_%H_%M'` - # Avoid [:alnum:] since it depends on the locale. - CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'` - USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` -fi -AC_SUBST(USER_RELEASE_SUFFIX) + AC_ARG_WITH(build-number, [AS_HELP_STRING([--with-build-number], + [Set build number value for build @<:@b00@:>@])]) + if test "x$with_build_number" = xyes; then + AC_MSG_ERROR([Build number must have a value]) + elif test "x$with_build_number" != x; then + JDK_BUILD_NUMBER="$with_build_number" + fi + # Define default USER_RELEASE_SUFFIX if BUILD_NUMBER and USER_RELEASE_SUFFIX are not set + if test "x$JDK_BUILD_NUMBER" = x; then + JDK_BUILD_NUMBER=b00 + if test "x$USER_RELEASE_SUFFIX" = x; then + BUILD_DATE=`date '+%Y_%m_%d_%H_%M'` + # Avoid [:alnum:] since it depends on the locale. + CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'` + USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + fi -# Now set the JDK version, milestone, build number etc. -AC_SUBST(JDK_MAJOR_VERSION) -AC_SUBST(JDK_MINOR_VERSION) -AC_SUBST(JDK_MICRO_VERSION) -AC_SUBST(JDK_UPDATE_VERSION) -AC_SUBST(JDK_BUILD_NUMBER) -AC_SUBST(MILESTONE) -AC_SUBST(LAUNCHER_NAME) -AC_SUBST(PRODUCT_NAME) -AC_SUBST(PRODUCT_SUFFIX) -AC_SUBST(JDK_RC_PLATFORM_NAME) -AC_SUBST(COMPANY_NAME) -AC_SUBST(MACOSX_BUNDLE_NAME_BASE) -AC_SUBST(MACOSX_BUNDLE_ID_BASE) + # Now set the JDK version, milestone, build number etc. + AC_SUBST(USER_RELEASE_SUFFIX) + AC_SUBST(JDK_MAJOR_VERSION) + AC_SUBST(JDK_MINOR_VERSION) + AC_SUBST(JDK_MICRO_VERSION) + AC_SUBST(JDK_UPDATE_VERSION) + AC_SUBST(JDK_BUILD_NUMBER) + AC_SUBST(MILESTONE) + AC_SUBST(LAUNCHER_NAME) + AC_SUBST(PRODUCT_NAME) + AC_SUBST(PRODUCT_SUFFIX) + AC_SUBST(JDK_RC_PLATFORM_NAME) + AC_SUBST(COMPANY_NAME) + AC_SUBST(MACOSX_BUNDLE_NAME_BASE) + AC_SUBST(MACOSX_BUNDLE_ID_BASE) -COPYRIGHT_YEAR=`date +'%Y'` -AC_SUBST(COPYRIGHT_YEAR) + COPYRIGHT_YEAR=`date +'%Y'` + AC_SUBST(COPYRIGHT_YEAR) -if test "x$JDK_UPDATE_VERSION" != x; then - JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}_${JDK_UPDATE_VERSION}" -else - JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}" -fi -AC_SUBST(JDK_VERSION) + if test "x$JDK_UPDATE_VERSION" != x; then + JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}_${JDK_UPDATE_VERSION}" + else + JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}" + fi + AC_SUBST(JDK_VERSION) -COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'` -AC_SUBST(COOKED_BUILD_NUMBER) + COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'` + AC_SUBST(COOKED_BUILD_NUMBER) ]) AC_DEFUN_ONCE([JDKOPT_SETUP_BUILD_TWEAKS], [ -HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET" -AC_SUBST(HOTSPOT_MAKE_ARGS) - -# The name of the Service Agent jar. -SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}" -if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}" -fi -AC_SUBST(SALIB_NAME) + HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET" + AC_SUBST(HOTSPOT_MAKE_ARGS) + # The name of the Service Agent jar. + SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}" + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}" + fi + AC_SUBST(SALIB_NAME) ]) AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], [ -# -# ENABLE_DEBUG_SYMBOLS -# This must be done after the toolchain is setup, since we're looking at objcopy. -# -AC_ARG_ENABLE([debug-symbols], - [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols @<:@enabled@:>@])]) + # + # ENABLE_DEBUG_SYMBOLS + # This must be done after the toolchain is setup, since we're looking at objcopy. + # + AC_ARG_ENABLE([debug-symbols], + [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols @<:@enabled@:>@])]) -AC_MSG_CHECKING([if we should generate debug symbols]) + AC_MSG_CHECKING([if we should generate debug symbols]) -if test "x$enable_debug_symbols" = "xyes" && test "x$OBJCOPY" = x; then - # explicit enabling of enable-debug-symbols and can't find objcopy - # this is an error - AC_MSG_ERROR([Unable to find objcopy, cannot enable debug-symbols]) -fi - -if test "x$enable_debug_symbols" = "xyes"; then - ENABLE_DEBUG_SYMBOLS=true -elif test "x$enable_debug_symbols" = "xno"; then - ENABLE_DEBUG_SYMBOLS=false -else - # default on macosx is false - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - ENABLE_DEBUG_SYMBOLS=false - # Default is on if objcopy is found, otherwise off - elif test "x$OBJCOPY" != x || test "x$OPENJDK_TARGET_OS" = xwindows; then - ENABLE_DEBUG_SYMBOLS=true - else - ENABLE_DEBUG_SYMBOLS=false + if test "x$enable_debug_symbols" = "xyes" && test "x$OBJCOPY" = x; then + # explicit enabling of enable-debug-symbols and can't find objcopy + # this is an error + AC_MSG_ERROR([Unable to find objcopy, cannot enable debug-symbols]) fi -fi -AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS]) + if test "x$enable_debug_symbols" = "xyes"; then + ENABLE_DEBUG_SYMBOLS=true + elif test "x$enable_debug_symbols" = "xno"; then + ENABLE_DEBUG_SYMBOLS=false + else + # Default is on if objcopy is found + if test "x$OBJCOPY" != x; then + ENABLE_DEBUG_SYMBOLS=true + # MacOS X and Windows don't use objcopy but default is on for those OSes + elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then + ENABLE_DEBUG_SYMBOLS=true + else + ENABLE_DEBUG_SYMBOLS=false + fi + fi -# -# ZIP_DEBUGINFO_FILES -# -AC_MSG_CHECKING([if we should zip debug-info files]) -AC_ARG_ENABLE([zip-debug-info], - [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])], - [enable_zip_debug_info="${enableval}"], [enable_zip_debug_info="yes"]) -AC_MSG_RESULT([${enable_zip_debug_info}]) + AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS]) -if test "x${enable_zip_debug_info}" = "xno"; then - ZIP_DEBUGINFO_FILES=false -else - ZIP_DEBUGINFO_FILES=true -fi + # + # ZIP_DEBUGINFO_FILES + # + AC_MSG_CHECKING([if we should zip debug-info files]) + AC_ARG_ENABLE([zip-debug-info], + [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])], + [enable_zip_debug_info="${enableval}"], [enable_zip_debug_info="yes"]) + AC_MSG_RESULT([${enable_zip_debug_info}]) -AC_SUBST(ENABLE_DEBUG_SYMBOLS) -AC_SUBST(ZIP_DEBUGINFO_FILES) -AC_SUBST(CFLAGS_DEBUG_SYMBOLS) -AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS) + if test "x${enable_zip_debug_info}" = "xno"; then + ZIP_DEBUGINFO_FILES=false + else + ZIP_DEBUGINFO_FILES=true + fi + + AC_SUBST(ENABLE_DEBUG_SYMBOLS) + AC_SUBST(ZIP_DEBUGINFO_FILES) + AC_SUBST(CFLAGS_DEBUG_SYMBOLS) + AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS) ]) # Support for customization of the build process. Some build files @@ -555,5 +555,5 @@ AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS) # for a degree of customization of the build targets and the rules/recipes # to create them AC_ARG_WITH([custom-make-dir], [AS_HELP_STRING([--with-custom-make-dir], - [use this directory for custom build/make files])], [CUSTOM_MAKE_DIR=$with_custom_make_dir]) +[use this directory for custom build/make files])], [CUSTOM_MAKE_DIR=$with_custom_make_dir]) AC_SUBST(CUSTOM_MAKE_DIR) diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4 index 1d53f04d203..c2cc3794429 100644 --- a/common/autoconf/libraries.m4 +++ b/common/autoconf/libraries.m4 @@ -25,638 +25,746 @@ AC_DEFUN_ONCE([LIB_SETUP_INIT], [ - -############################################################################### -# -# OS specific settings that we never will need to probe. -# -if test "x$OPENJDK_TARGET_OS" = xlinux; then + + ############################################################################### + # + # OS specific settings that we never will need to probe. + # + if test "x$OPENJDK_TARGET_OS" = xlinux; then AC_MSG_CHECKING([what is not needed on Linux?]) PULSE_NOT_NEEDED=yes AC_MSG_RESULT([pulse]) -fi + fi -if test "x$OPENJDK_TARGET_OS" = xsolaris; then + if test "x$OPENJDK_TARGET_OS" = xsolaris; then AC_MSG_CHECKING([what is not needed on Solaris?]) ALSA_NOT_NEEDED=yes PULSE_NOT_NEEDED=yes AC_MSG_RESULT([alsa pulse]) -fi + fi -if test "x$OPENJDK_TARGET_OS" = xwindows; then + if test "x$OPENJDK_TARGET_OS" = xwindows; then AC_MSG_CHECKING([what is not needed on Windows?]) - CUPS_NOT_NEEDED=yes + CUPS_NOT_NEEDED=yes ALSA_NOT_NEEDED=yes PULSE_NOT_NEEDED=yes X11_NOT_NEEDED=yes AC_MSG_RESULT([alsa cups pulse x11]) -fi + fi -if test "x$OPENJDK_TARGET_OS" = xmacosx; then + if test "x$OPENJDK_TARGET_OS" = xmacosx; then AC_MSG_CHECKING([what is not needed on MacOSX?]) ALSA_NOT_NEEDED=yes PULSE_NOT_NEEDED=yes X11_NOT_NEEDED=yes - FREETYPE2_NOT_NEEDED=yes # If the java runtime framework is disabled, then we need X11. # This will be adjusted below. AC_MSG_RESULT([alsa pulse x11]) -fi + fi -if test "x$OPENJDK_TARGET_OS" = xbsd; then + if test "x$OPENJDK_TARGET_OS" = xbsd; then AC_MSG_CHECKING([what is not needed on bsd?]) ALSA_NOT_NEEDED=yes - AC_MSG_RESULT([alsa]) -fi + AC_MSG_RESULT([alsa]) + fi -if test "x$OPENJDK" = "xfalse"; then - FREETYPE2_NOT_NEEDED=yes -fi + if test "x$OPENJDK" = "xfalse"; then + FREETYPE_NOT_NEEDED=yes + fi -if test "x$SUPPORT_HEADFUL" = xno; then + if test "x$SUPPORT_HEADFUL" = xno; then X11_NOT_NEEDED=yes -fi + fi -############################################################################### -# -# Check for MacOSX support for OpenJDK. If this exists, try to build a JVM -# that uses this API. -# -AC_ARG_ENABLE([macosx-runtime-support], [AS_HELP_STRING([--disable-macosx-runtime-support], - [disable the use of MacOSX Java runtime support framework @<:@enabled@:>@])], - [MACOSX_RUNTIME_SUPPORT="${enableval}"],[MACOSX_RUNTIME_SUPPORT="no"]) + ############################################################################### + # + # Check for MacOSX support for OpenJDK. + # -USE_MACOSX_RUNTIME_SUPPORT=no -AC_MSG_CHECKING([for explicit Java runtime support in the OS]) -if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then - if test "x$MACOSX_RUNTIME_SUPPORT" != xno; then - MACOSX_RUNTIME_SUPPORT=yes - USE_MACOSX_RUNTIME_SUPPORT=yes - AC_MSG_RESULT([yes, does not need alsa freetype2 pulse and X11]) - else - AC_MSG_RESULT([yes, but explicitly disabled.]) - fi -else + BASIC_DEPRECATED_ARG_ENABLE(macosx-runtime-support, macosx_runtime_support) + + AC_MSG_CHECKING([for Mac OS X Java Framework]) + if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then + AC_MSG_RESULT([/System/Library/Frameworks/JavaVM.framework]) + else AC_MSG_RESULT([no]) -fi - -if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$USE_MACOSX_RUNTIME_SUPPORT" = xno; then - AC_MSG_CHECKING([what is not needed on an X11 build on MacOSX?]) - X11_NOT_NEEDED= - FREETYPE2_NOT_NEEDED= - AC_MSG_RESULT([alsa pulse]) -fi + fi ]) AC_DEFUN_ONCE([LIB_SETUP_X11], [ -############################################################################### -# -# Check for X Windows -# + ############################################################################### + # + # Check for X Windows + # -# Check if the user has specified sysroot, but not --x-includes or --x-libraries. -# Make a simple check for the libraries at the sysroot, and setup --x-includes and -# --x-libraries for the sysroot, if that seems to be correct. -if test "x$SYS_ROOT" != "x/"; then - if test "x$x_includes" = xNONE; then - if test -f "$SYS_ROOT/usr/X11R6/include/X11/Xlib.h"; then - x_includes="$SYS_ROOT/usr/X11R6/include" - elif test -f "$SYS_ROOT/usr/include/X11/Xlib.h"; then - x_includes="$SYS_ROOT/usr/include" + # Check if the user has specified sysroot, but not --x-includes or --x-libraries. + # Make a simple check for the libraries at the sysroot, and setup --x-includes and + # --x-libraries for the sysroot, if that seems to be correct. + if test "x$SYS_ROOT" != "x/"; then + if test "x$x_includes" = xNONE; then + if test -f "$SYS_ROOT/usr/X11R6/include/X11/Xlib.h"; then + x_includes="$SYS_ROOT/usr/X11R6/include" + elif test -f "$SYS_ROOT/usr/include/X11/Xlib.h"; then + x_includes="$SYS_ROOT/usr/include" + fi + fi + if test "x$x_libraries" = xNONE; then + if test -f "$SYS_ROOT/usr/X11R6/lib/libX11.so"; then + x_libraries="$SYS_ROOT/usr/X11R6/lib" + elif test "$SYS_ROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + x_libraries="$SYS_ROOT/usr/lib64" + elif test -f "$SYS_ROOT/usr/lib/libX11.so"; then + x_libraries="$SYS_ROOT/usr/lib" + fi fi fi - if test "x$x_libraries" = xNONE; then - if test -f "$SYS_ROOT/usr/X11R6/lib/libX11.so"; then - x_libraries="$SYS_ROOT/usr/X11R6/lib" - elif test "$SYS_ROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - x_libraries="$SYS_ROOT/usr/lib64" - elif test -f "$SYS_ROOT/usr/lib/libX11.so"; then - x_libraries="$SYS_ROOT/usr/lib" - fi + + # Now let autoconf do it's magic + AC_PATH_X + AC_PATH_XTRA + + # AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling + # this doesn't make sense so we remove it. + if test "x$COMPILE_TYPE" = xcross; then + X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'` fi -fi -# Now let autoconf do it's magic -AC_PATH_X -AC_PATH_XTRA - -# AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling -# this doesn't make sense so we remove it. -if test "x$COMPILE_TYPE" = xcross; then - X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'` -fi - -if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then + if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then HELP_MSG_MISSING_DEPENDENCY([x11]) AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG]) -fi - -# Some of the old makefiles require a setting of OPENWIN_HOME -# Since the X11R6 directory has disappeared on later Linuxes, -# we need to probe for it. -if test "x$OPENJDK_TARGET_OS" = xlinux; then - if test -d "$SYS_ROOT/usr/X11R6"; then - OPENWIN_HOME="$SYS_ROOT/usr/X11R6" - elif test -d "$SYS_ROOT/usr/include/X11"; then - OPENWIN_HOME="$SYS_ROOT/usr" - fi -fi -if test "x$OPENJDK_TARGET_OS" = xsolaris; then - OPENWIN_HOME="/usr/openwin" -fi -AC_SUBST(OPENWIN_HOME) - - -# -# Weird Sol10 something check...TODO change to try compile -# -if test "x${OPENJDK_TARGET_OS}" = xsolaris; then - if test "`uname -r`" = "5.10"; then - if test "`${EGREP} -c XLinearGradient ${OPENWIN_HOME}/share/include/X11/extensions/Xrender.h`" = "0"; then - X_CFLAGS="${X_CFLAGS} -DSOLARIS10_NO_XRENDER_STRUCTS" - fi fi -fi -AC_LANG_PUSH(C) -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $X_CFLAGS" + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + OPENWIN_HOME="/usr/openwin" + fi + AC_SUBST(OPENWIN_HOME) -# Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10 -AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h], - [X11_A_OK=yes], - [X11_A_OK=no; break], - [ # include - # include - ]) -CFLAGS="$OLD_CFLAGS" -AC_LANG_POP(C) + # + # Weird Sol10 something check...TODO change to try compile + # + if test "x${OPENJDK_TARGET_OS}" = xsolaris; then + if test "`uname -r`" = "5.10"; then + if test "`${EGREP} -c XLinearGradient ${OPENWIN_HOME}/share/include/X11/extensions/Xrender.h`" = "0"; then + X_CFLAGS="${X_CFLAGS} -DSOLARIS10_NO_XRENDER_STRUCTS" + fi + fi + fi -if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then + AC_LANG_PUSH(C) + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $X_CFLAGS" + + # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10 + AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h], + [X11_A_OK=yes], + [X11_A_OK=no; break], + [ + # include + # include + ] + ) + + CFLAGS="$OLD_CFLAGS" + AC_LANG_POP(C) + + if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then HELP_MSG_MISSING_DEPENDENCY([x11]) AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG]) -fi + fi -AC_SUBST(X_CFLAGS) -AC_SUBST(X_LIBS) + AC_SUBST(X_CFLAGS) + AC_SUBST(X_LIBS) ]) AC_DEFUN_ONCE([LIB_SETUP_CUPS], [ -############################################################################### -# -# The common unix printing system cups is used to print from java. -# -AC_ARG_WITH(cups, [AS_HELP_STRING([--with-cups], - [specify prefix directory for the cups package - (expecting the headers under PATH/include)])]) -AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include], - [specify directory for the cups include files])]) + ############################################################################### + # + # The common unix printing system cups is used to print from java. + # + AC_ARG_WITH(cups, [AS_HELP_STRING([--with-cups], + [specify prefix directory for the cups package + (expecting the headers under PATH/include)])]) + AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include], + [specify directory for the cups include files])]) -if test "x$CUPS_NOT_NEEDED" = xyes; then - if test "x${with_cups}" != x || test "x${with_cups_include}" != x; then - AC_MSG_WARN([cups not used, so --with-cups is ignored]) - fi - CUPS_CFLAGS= -else - CUPS_FOUND=no + if test "x$CUPS_NOT_NEEDED" = xyes; then + if test "x${with_cups}" != x || test "x${with_cups_include}" != x; then + AC_MSG_WARN([cups not used, so --with-cups is ignored]) + fi + CUPS_CFLAGS= + else + CUPS_FOUND=no - if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then - AC_MSG_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.]) - fi + if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then + AC_MSG_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.]) + fi - if test "x${with_cups}" != x; then - CUPS_CFLAGS="-I${with_cups}/include" - CUPS_FOUND=yes - fi - if test "x${with_cups_include}" != x; then - CUPS_CFLAGS="-I${with_cups_include}" - CUPS_FOUND=yes - fi - if test "x$CUPS_FOUND" = xno; then - BDEPS_CHECK_MODULE(CUPS, cups, xxx, [CUPS_FOUND=yes]) - fi - if test "x$CUPS_FOUND" = xno; then - # Are the cups headers installed in the default /usr/include location? - AC_CHECK_HEADERS([cups/cups.h cups/ppd.h], - [CUPS_FOUND=yes - CUPS_CFLAGS= - DEFAULT_CUPS=yes]) - fi - if test "x$CUPS_FOUND" = xno; then - # Getting nervous now? Lets poke around for standard Solaris third-party - # package installation locations. - AC_MSG_CHECKING([for cups headers]) - if test -s /opt/sfw/cups/include/cups/cups.h; then - # An SFW package seems to be installed! - CUPS_FOUND=yes - CUPS_CFLAGS="-I/opt/sfw/cups/include" - elif test -s /opt/csw/include/cups/cups.h; then - # A CSW package seems to be installed! - CUPS_FOUND=yes - CUPS_CFLAGS="-I/opt/csw/include" - fi - AC_MSG_RESULT([$CUPS_FOUND]) - fi - if test "x$CUPS_FOUND" = xno; then - HELP_MSG_MISSING_DEPENDENCY([cups]) - AC_MSG_ERROR([Could not find cups! $HELP_MSG ]) - fi -fi + if test "x${with_cups}" != x; then + CUPS_CFLAGS="-I${with_cups}/include" + CUPS_FOUND=yes + fi + if test "x${with_cups_include}" != x; then + CUPS_CFLAGS="-I${with_cups_include}" + CUPS_FOUND=yes + fi + if test "x$CUPS_FOUND" = xno; then + BDEPS_CHECK_MODULE(CUPS, cups, xxx, [CUPS_FOUND=yes]) + fi + if test "x$CUPS_FOUND" = xno; then + # Are the cups headers installed in the default /usr/include location? + AC_CHECK_HEADERS([cups/cups.h cups/ppd.h], + [ + CUPS_FOUND=yes + CUPS_CFLAGS= + DEFAULT_CUPS=yes + ] + ) + fi + if test "x$CUPS_FOUND" = xno; then + # Getting nervous now? Lets poke around for standard Solaris third-party + # package installation locations. + AC_MSG_CHECKING([for cups headers]) + if test -s /opt/sfw/cups/include/cups/cups.h; then + # An SFW package seems to be installed! + CUPS_FOUND=yes + CUPS_CFLAGS="-I/opt/sfw/cups/include" + elif test -s /opt/csw/include/cups/cups.h; then + # A CSW package seems to be installed! + CUPS_FOUND=yes + CUPS_CFLAGS="-I/opt/csw/include" + fi + AC_MSG_RESULT([$CUPS_FOUND]) + fi + if test "x$CUPS_FOUND" = xno; then + HELP_MSG_MISSING_DEPENDENCY([cups]) + AC_MSG_ERROR([Could not find cups! $HELP_MSG ]) + fi + fi -AC_SUBST(CUPS_CFLAGS) + AC_SUBST(CUPS_CFLAGS) ]) +AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE], +[ + POTENTIAL_FREETYPE_INCLUDE_PATH="$1" + POTENTIAL_FREETYPE_LIB_PATH="$2" + METHOD="$3" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + AC_MSG_NOTICE([Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD]) + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location.]) + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location.]) + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then + BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_INCLUDE_PATH) + BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_LIB_PATH) + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + AC_MSG_CHECKING([for freetype includes]) + AC_MSG_RESULT([$FREETYPE_INCLUDE_PATH]) + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + AC_MSG_CHECKING([for freetype libraries]) + AC_MSG_RESULT([$FREETYPE_LIB_PATH]) + fi +]) + AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], [ -############################################################################### -# -# The ubiquitous freetype2 library is used to render fonts. -# -AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype], - [specify prefix directory for the freetype2 package - (expecting the libraries under PATH/lib and the headers under PATH/include)])]) + ############################################################################### + # + # The ubiquitous freetype library is used to render fonts. + # + AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype], + [specify prefix directory for the freetype package + (expecting the libraries under PATH/lib and the headers under PATH/include)])]) + AC_ARG_WITH(freetype-include, [AS_HELP_STRING([--with-freetype-include], + [specify directory for the freetype include files])]) + AC_ARG_WITH(freetype-lib, [AS_HELP_STRING([--with-freetype-lib], + [specify directory for the freetype library])]) + AC_ARG_ENABLE(freetype-bundling, [AS_HELP_STRING([--disable-freetype-bundling], + [disable bundling of the freetype library with the build result @<:@enabled on Windows or when using --with-freetype, disabled otherwise@:>@])]) -# If we are using the OS installed system lib for freetype, then we do not need to copy it to the build tree -USING_SYSTEM_FT_LIB=false + FREETYPE_CFLAGS= + FREETYPE_LIBS= + FREETYPE_BUNDLE_LIB_PATH= -if test "x$FREETYPE2_NOT_NEEDED" = xyes; then - if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then - AC_MSG_WARN([freetype not used, so --with-freetype is ignored]) - fi - FREETYPE2_CFLAGS= - FREETYPE2_LIBS= - FREETYPE2_LIB_PATH= -else - FREETYPE2_FOUND=no + if test "x$FREETYPE_NOT_NEEDED" = xyes; then + if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then + AC_MSG_WARN([freetype not used, so --with-freetype is ignored]) + fi + if test "x$enable_freetype_bundling" != x; then + AC_MSG_WARN([freetype not used, so --enable-freetype-bundling is ignored]) + fi + else + # freetype is needed to build; go get it! - if test "x$with_freetype" != x; then - BASIC_FIXUP_PATH(with_freetype) - FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype" - FREETYPE2_LIB_PATH="$with_freetype/lib" - if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -d "$with_freetype/lib/amd64"; then - FREETYPE2_LIBS="-L$with_freetype/lib/amd64 -lfreetype" - FREETYPE2_LIB_PATH="$with_freetype/lib/amd64" - fi - if test "x$OPENJDK_TARGET_OS" = xwindows; then - FREETYPE2_LIBS="$with_freetype/lib/freetype.lib" - fi - FREETYPE2_CFLAGS="-I$with_freetype/include" - if test -s $with_freetype/include/ft2build.h && test -d $with_freetype/include/freetype2/freetype; then - FREETYPE2_CFLAGS="-I$with_freetype/include/freetype2 -I$with_freetype/include" - fi - FREETYPE2_FOUND=yes - if test "x$FREETYPE2_FOUND" = xyes; then - # Verify that the directories exist - if ! test -d "$with_freetype/lib" || ! test -d "$with_freetype/include"; then - AC_MSG_ERROR([Could not find the expected directories $with_freetype/lib and $with_freetype/include]) - fi - # List the contents of the lib. - FREETYPELIB=`ls $with_freetype/lib/libfreetype.so $with_freetype/lib/freetype.dll 2> /dev/null` - if test "x$FREETYPELIB" = x; then - AC_MSG_ERROR([Could not find libfreetype.so nor freetype.dll in $with_freetype/lib]) - fi - # Check one h-file - if ! test -s "$with_freetype/include/ft2build.h"; then - AC_MSG_ERROR([Could not find $with_freetype/include/ft2build.h]) - fi - fi + BUNDLE_FREETYPE="$enable_freetype_bundling" + + if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then + # User has specified settings + + if test "x$BUNDLE_FREETYPE" = x; then + # If not specified, default is to bundle freetype + BUNDLE_FREETYPE=yes + fi + + if test "x$with_freetype" != x; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include" + POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib" + fi + + # Allow --with-freetype-lib and --with-freetype-include to override + if test "x$with_freetype_include" != x; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include" + fi + if test "x$with_freetype_lib" != x; then + POTENTIAL_FREETYPE_LIB_PATH="$with_freetype_lib" + fi + + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x && test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then + # Okay, we got it. Check that it works. + LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype]) + if test "x$FOUND_FREETYPE" != xyes; then + AC_MSG_ERROR([Can not find or use freetype at location given by --with-freetype]) fi - if test "x$FREETYPE2_FOUND" = xno; then - BDEPS_CHECK_MODULE(FREETYPE2, freetype2, xxx, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no]) - USING_SYSTEM_FT_LIB=true - fi - if test "x$FREETYPE2_FOUND" = xno && test "x$OPENJDK_TARGET_OS" = xwindows; then - FREETYPELOCATION="$PROGRAMFILES/GnuWin32" - BASIC_FIXUP_PATH(FREETYPELOCATION) - AC_MSG_CHECKING([for freetype in some standard windows locations]) - if test -s "$FREETYPELOCATION/include/ft2build.h" && test -d "$FREETYPELOCATION/include/freetype2/freetype"; then - FREETYPE2_CFLAGS="-I$FREETYPELOCATION/include/freetype2 -I$FREETYPELOCATION/include" - FREETYPE2_LIBS="$FREETYPELOCATION/lib/freetype.lib" - FREETYPE2_LIB_PATH="$FREETYPELOCATION/lib" - if ! test -s "$FREETYPE2_LIBS"; then - AC_MSG_ERROR([Could not find $FREETYPE2_LIBS]) - fi - if ! test -s "$FREETYPE2_LIB_PATH/freetype.dll"; then - AC_MSG_ERROR([Could not find $FREETYPE2_LIB_PATH/freetype.dll]) - fi - USING_SYSTEM_FT_LIB=true - FREETYPE2_FOUND=yes - fi - AC_MSG_RESULT([$FREETYPE2_FOUND]) + else + # User specified only one of lib or include. This is an error. + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" = x ; then + AC_MSG_NOTICE([User specified --with-freetype-lib but not --with-freetype-include]) + AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.]) + else + AC_MSG_NOTICE([User specified --with-freetype-include but not --with-freetype-lib]) + AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.]) fi - if test "x$FREETYPE2_FOUND" = xno; then - PKG_CHECK_MODULES(FREETYPE2, freetype2, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no]) + fi + else + # User did not specify settings, but we need freetype. Try to locate it. + + if test "x$BUNDLE_FREETYPE" = x; then + # If not specified, default is to bundle freetype only on windows + if test "x$OPENJDK_TARGET_OS" = xwindows; then + BUNDLE_FREETYPE=yes + else + BUNDLE_FREETYPE=no + fi + fi + + if test "x$FOUND_FREETYPE" != xyes; then + # Check builddeps + BDEPS_CHECK_MODULE(FREETYPE, freetype2, xxx, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no]) + # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. + if test "x$FOUND_FREETYPE" = xyes; then + if test "x$BUNDLE_FREETYPE" = xyes; then + AC_MSG_NOTICE([Found freetype using builddeps, but ignoring since we can not bundle that]) + FOUND_FREETYPE=no + else + AC_MSG_CHECKING([for freetype]) + AC_MSG_RESULT([yes (using builddeps)]) + fi + fi + fi + + if test "x$FOUND_FREETYPE" != xyes; then + # Check modules using pkg-config, but only if we have it (ugly output results otherwise) + if test "x$PKG_CONFIG" != x; then + PKG_CHECK_MODULES(FREETYPE, freetype2, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no]) + if test "x$FOUND_FREETYPE" = xyes; then # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. - FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's/-lz//g'` - USING_SYSTEM_FT_LIB=true + FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'` # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 - if test "x$FREETYPE2_FOUND" = xyes && test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's?/lib?/lib/amd64?g'` + if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then + FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'` fi - fi - if test "x$FREETYPE2_FOUND" = xno; then - AC_MSG_CHECKING([for freetype in some standard locations]) - - if test -s $SYS_ROOT/usr/X11/include/ft2build.h && test -d $SYS_ROOT/usr/X11/include/freetype2/freetype; then - DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/X11/include/freetype2 -I$SYS_ROOT/usr/X11/include" - DEFAULT_FREETYPE_LIBS="-L$SYS_ROOT/usr/X11/lib -lfreetype" - fi - if test -s $SYS_ROOT/usr/include/ft2build.h && test -d $SYS_ROOT/usr/include/freetype2/freetype; then - DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/include/freetype2" - DEFAULT_FREETYPE_LIBS="-lfreetype" - fi - - PREV_CXXCFLAGS="$CXXFLAGS" - PREV_LDFLAGS="$LDFLAGS" - CXXFLAGS="$CXXFLAGS $DEFAULT_FREETYPE_CFLAGS" - LDFLAGS="$LDFLAGS $DEFAULT_FREETYPE_LIBS" - AC_LINK_IFELSE([AC_LANG_SOURCE([[#include - #include FT_FREETYPE_H - int main() { return 0; } - ]])], - [ - # Yes, the default cflags and libs did the trick. - FREETYPE2_FOUND=yes - FREETYPE2_CFLAGS="$DEFAULT_FREETYPE_CFLAGS" - FREETYPE2_LIBS="$DEFAULT_FREETYPE_LIBS" - ], - [ - FREETYPE2_FOUND=no - ]) - CXXCFLAGS="$PREV_CXXFLAGS" - LDFLAGS="$PREV_LDFLAGS" - AC_MSG_RESULT([$FREETYPE2_FOUND]) - USING_SYSTEM_FT_LIB=true - fi - if test "x$FREETYPE2_FOUND" = xno; then - HELP_MSG_MISSING_DEPENDENCY([freetype2]) - AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ]) - fi - - if test "x$OPENJDK_TARGET_OS" != xwindows; then - # AC_CHECK_LIB does not support use of cl.exe - PREV_LDFLAGS="$LDFLAGS" - LDFLAGS="$FREETYPE2_LIBS" - AC_CHECK_LIB(freetype, FT_Init_FreeType, - FREETYPE2_FOUND=true, - AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ])) - LDFLAGS="$PREV_LDFLAGS" + # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. + if test "x$BUNDLE_FREETYPE" = xyes; then + AC_MSG_NOTICE([Found freetype using pkg-config, but ignoring since we can not bundle that]) + FOUND_FREETYPE=no + else + AC_MSG_CHECKING([for freetype]) + AC_MSG_RESULT([yes (using pkg-config)]) + fi + fi fi -fi + fi -AC_SUBST(USING_SYSTEM_FT_LIB) -AC_SUBST(FREETYPE2_LIB_PATH) -AC_SUBST(FREETYPE2_CFLAGS) -AC_SUBST(FREETYPE2_LIBS) + if test "x$FOUND_FREETYPE" != xyes; then + # Check in well-known locations + if test "x$OPENJDK_TARGET_OS" = xwindows; then + FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32" + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR) + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) + if test "x$FOUND_FREETYPE" != xyes; then + FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32" + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR) + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) + fi + else + if test "x$SYS_ROOT" = "x/"; then + FREETYPE_ROOT= + else + FREETYPE_ROOT="$SYS_ROOT" + fi + FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr" + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) + if test "x$FOUND_FREETYPE" != xyes; then + FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr/X11" + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) + fi + + if test "x$FOUND_FREETYPE" != xyes; then + FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr" + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/x86_64-linux-gnu], [well-known location]) + else + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/i386-linux-gnu], [well-known location]) + if test "x$FOUND_FREETYPE" != xyes; then + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib32], [well-known location]) + fi + fi + fi + fi + fi # end check in well-known locations + + if test "x$FOUND_FREETYPE" != xyes; then + HELP_MSG_MISSING_DEPENDENCY([freetype]) + AC_MSG_ERROR([Could not find freetype! $HELP_MSG ]) + fi + fi # end user specified settings + + # Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir. + if test "x$FREETYPE_CFLAGS" = x; then + BASIC_FIXUP_PATH(FREETYPE_INCLUDE_PATH) + if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then + FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH/freetype2 -I$FREETYPE_INCLUDE_PATH" + else + FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH" + fi + fi + + if test "x$FREETYPE_LIBS" = x; then + BASIC_FIXUP_PATH(FREETYPE_LIB_PATH) + if test "x$OPENJDK_TARGET_OS" = xwindows; then + FREETYPE_LIBS="$FREETYPE_LIB_PATH/freetype.lib" + else + FREETYPE_LIBS="-L$FREETYPE_LIB_PATH -lfreetype" + fi + fi + + # Try to compile it + AC_MSG_CHECKING([if we can compile and link with freetype]) + AC_LANG_PUSH(C++) + PREV_CXXCFLAGS="$CXXFLAGS" + PREV_LIBS="$LIBS" + PREV_CXX="$CXX" + CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + LIBS="$LIBS $FREETYPE_LIBS" + CXX="$FIXPATH $CXX" + AC_LINK_IFELSE([AC_LANG_SOURCE([[ + #include + #include FT_FREETYPE_H + int main () { + FT_Init_FreeType(NULL); + return 0; + } + ]])], + [ + AC_MSG_RESULT([yes]) + ], + [ + AC_MSG_RESULT([no]) + AC_MSG_NOTICE([Could not compile and link with freetype. This might be a 32/64-bit mismatch.]) + AC_MSG_NOTICE([Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS]) + + HELP_MSG_MISSING_DEPENDENCY([freetype]) + + AC_MSG_ERROR([Can not continue without freetype. $HELP_MSG]) + ] + ) + CXXCFLAGS="$PREV_CXXFLAGS" + LIBS="$PREV_LIBS" + CXX="$PREV_CXX" + AC_LANG_POP(C++) + + AC_MSG_CHECKING([if we should bundle freetype]) + if test "x$BUNDLE_FREETYPE" = xyes; then + FREETYPE_BUNDLE_LIB_PATH="$FREETYPE_LIB_PATH" + fi + AC_MSG_RESULT([$BUNDLE_FREETYPE]) + + fi # end freetype needed + + AC_SUBST(FREETYPE_BUNDLE_LIB_PATH) + AC_SUBST(FREETYPE_CFLAGS) + AC_SUBST(FREETYPE_LIBS) ]) AC_DEFUN_ONCE([LIB_SETUP_ALSA], [ -############################################################################### -# -# Check for alsa headers and libraries. Used on Linux/GNU systems. -# -AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa], - [specify prefix directory for the alsa package - (expecting the libraries under PATH/lib and the headers under PATH/include)])]) -AC_ARG_WITH(alsa-include, [AS_HELP_STRING([--with-alsa-include], - [specify directory for the alsa include files])]) -AC_ARG_WITH(alsa-lib, [AS_HELP_STRING([--with-alsa-lib], - [specify directory for the alsa library])]) + ############################################################################### + # + # Check for alsa headers and libraries. Used on Linux/GNU systems. + # + AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa], + [specify prefix directory for the alsa package + (expecting the libraries under PATH/lib and the headers under PATH/include)])]) + AC_ARG_WITH(alsa-include, [AS_HELP_STRING([--with-alsa-include], + [specify directory for the alsa include files])]) + AC_ARG_WITH(alsa-lib, [AS_HELP_STRING([--with-alsa-lib], + [specify directory for the alsa library])]) -if test "x$ALSA_NOT_NEEDED" = xyes; then - if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then - AC_MSG_WARN([alsa not used, so --with-alsa is ignored]) - fi - ALSA_CFLAGS= - ALSA_LIBS= -else - ALSA_FOUND=no + if test "x$ALSA_NOT_NEEDED" = xyes; then + if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then + AC_MSG_WARN([alsa not used, so --with-alsa is ignored]) + fi + ALSA_CFLAGS= + ALSA_LIBS= + else + ALSA_FOUND=no - if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then - AC_MSG_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.]) - fi + if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then + AC_MSG_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.]) + fi - if test "x${with_alsa}" != x; then - ALSA_LIBS="-L${with_alsa}/lib -lalsa" - ALSA_CFLAGS="-I${with_alsa}/include" - ALSA_FOUND=yes - fi - if test "x${with_alsa_include}" != x; then - ALSA_CFLAGS="-I${with_alsa_include}" - ALSA_FOUND=yes - fi - if test "x${with_alsa_lib}" != x; then - ALSA_LIBS="-L${with_alsa_lib} -lalsa" - ALSA_FOUND=yes - fi - if test "x$ALSA_FOUND" = xno; then - BDEPS_CHECK_MODULE(ALSA, alsa, xxx, [ALSA_FOUND=yes], [ALSA_FOUND=no]) - fi - if test "x$ALSA_FOUND" = xno; then - PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no]) - fi - if test "x$ALSA_FOUND" = xno; then - AC_CHECK_HEADERS([alsa/asoundlib.h], - [ALSA_FOUND=yes - ALSA_CFLAGS=-Iignoreme - ALSA_LIBS=-lasound - DEFAULT_ALSA=yes], - [ALSA_FOUND=no]) - fi - if test "x$ALSA_FOUND" = xno; then - HELP_MSG_MISSING_DEPENDENCY([alsa]) - AC_MSG_ERROR([Could not find alsa! $HELP_MSG ]) - fi -fi - -AC_SUBST(ALSA_CFLAGS) -AC_SUBST(ALSA_LIBS) + if test "x${with_alsa}" != x; then + ALSA_LIBS="-L${with_alsa}/lib -lalsa" + ALSA_CFLAGS="-I${with_alsa}/include" + ALSA_FOUND=yes + fi + if test "x${with_alsa_include}" != x; then + ALSA_CFLAGS="-I${with_alsa_include}" + ALSA_FOUND=yes + fi + if test "x${with_alsa_lib}" != x; then + ALSA_LIBS="-L${with_alsa_lib} -lalsa" + ALSA_FOUND=yes + fi + if test "x$ALSA_FOUND" = xno; then + BDEPS_CHECK_MODULE(ALSA, alsa, xxx, [ALSA_FOUND=yes], [ALSA_FOUND=no]) + fi + if test "x$ALSA_FOUND" = xno; then + PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no]) + fi + if test "x$ALSA_FOUND" = xno; then + AC_CHECK_HEADERS([alsa/asoundlib.h], + [ + ALSA_FOUND=yes + ALSA_CFLAGS=-Iignoreme + ALSA_LIBS=-lasound + DEFAULT_ALSA=yes + ], + [ALSA_FOUND=no]) + fi + if test "x$ALSA_FOUND" = xno; then + HELP_MSG_MISSING_DEPENDENCY([alsa]) + AC_MSG_ERROR([Could not find alsa! $HELP_MSG ]) + fi + fi + AC_SUBST(ALSA_CFLAGS) + AC_SUBST(ALSA_LIBS) ]) AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS], [ -############################################################################### -# -# Check for the jpeg library -# + ############################################################################### + # + # Check for the jpeg library + # -USE_EXTERNAL_LIBJPEG=true -AC_CHECK_LIB(jpeg, main, [], - [ USE_EXTERNAL_LIBJPEG=false - AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source]) - ]) -AC_SUBST(USE_EXTERNAL_LIBJPEG) - -############################################################################### -# -# Check for the gif library -# + USE_EXTERNAL_LIBJPEG=true + AC_CHECK_LIB(jpeg, main, [], + [ USE_EXTERNAL_LIBJPEG=false + AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source]) + ]) + AC_SUBST(USE_EXTERNAL_LIBJPEG) -AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib], - [use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) + ############################################################################### + # + # Check for the gif library + # + + AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib], + [use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) -AC_MSG_CHECKING([for which giflib to use]) + AC_MSG_CHECKING([for which giflib to use]) -# default is bundled -DEFAULT_GIFLIB=bundled + # default is bundled + DEFAULT_GIFLIB=bundled -# -# if user didn't specify, use DEFAULT_GIFLIB -# -if test "x${with_giflib}" = "x"; then + # + # if user didn't specify, use DEFAULT_GIFLIB + # + if test "x${with_giflib}" = "x"; then with_giflib=${DEFAULT_GIFLIB} -fi + fi -AC_MSG_RESULT(${with_giflib}) + AC_MSG_RESULT(${with_giflib}) -if test "x${with_giflib}" = "xbundled"; then + if test "x${with_giflib}" = "xbundled"; then USE_EXTERNAL_LIBGIF=false -elif test "x${with_giflib}" = "xsystem"; then + elif test "x${with_giflib}" = "xsystem"; then AC_CHECK_HEADER(gif_lib.h, [], - [ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])]) + [ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])]) AC_CHECK_LIB(gif, DGifGetCode, [], - [ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])]) + [ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])]) USE_EXTERNAL_LIBGIF=true -else + else AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled']) -fi -AC_SUBST(USE_EXTERNAL_LIBGIF) + fi + AC_SUBST(USE_EXTERNAL_LIBGIF) -############################################################################### -# -# Check for the zlib library -# + ############################################################################### + # + # Check for the zlib library + # -AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib], - [use zlib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) + AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib], + [use zlib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) -AC_CHECK_LIB(z, compress, - [ ZLIB_FOUND=yes ], - [ ZLIB_FOUND=no ]) + AC_CHECK_LIB(z, compress, + [ ZLIB_FOUND=yes ], + [ ZLIB_FOUND=no ]) -AC_MSG_CHECKING([for which zlib to use]) + AC_MSG_CHECKING([for which zlib to use]) -DEFAULT_ZLIB=bundled -if test "x$OPENJDK_TARGET_OS" = xmacosx; then -# -# On macosx default is system...on others default is -# + DEFAULT_ZLIB=bundled + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + # + # On macosx default is system...on others default is + # DEFAULT_ZLIB=system -fi + fi -if test "x${ZLIB_FOUND}" != "xyes"; then -# -# If we don't find any system...set default to bundled -# + if test "x${ZLIB_FOUND}" != "xyes"; then + # + # If we don't find any system...set default to bundled + # DEFAULT_ZLIB=bundled -fi + fi -# -# If user didn't specify, use DEFAULT_ZLIB -# -if test "x${with_zlib}" = "x"; then + # + # If user didn't specify, use DEFAULT_ZLIB + # + if test "x${with_zlib}" = "x"; then with_zlib=${DEFAULT_ZLIB} -fi + fi -if test "x${with_zlib}" = "xbundled"; then + if test "x${with_zlib}" = "xbundled"; then USE_EXTERNAL_LIBZ=false AC_MSG_RESULT([bundled]) -elif test "x${with_zlib}" = "xsystem"; then + elif test "x${with_zlib}" = "xsystem"; then if test "x${ZLIB_FOUND}" = "xyes"; then - USE_EXTERNAL_LIBZ=true - AC_MSG_RESULT([system]) + USE_EXTERNAL_LIBZ=true + AC_MSG_RESULT([system]) else - AC_MSG_RESULT([system not found]) - AC_MSG_ERROR([--with-zlib=system specified, but no zlib found!]) + AC_MSG_RESULT([system not found]) + AC_MSG_ERROR([--with-zlib=system specified, but no zlib found!]) fi -else - AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled']) -fi + else + AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled']) + fi -AC_SUBST(USE_EXTERNAL_LIBZ) + AC_SUBST(USE_EXTERNAL_LIBZ) -############################################################################### -LIBZIP_CAN_USE_MMAP=true + ############################################################################### + LIBZIP_CAN_USE_MMAP=true -AC_SUBST(LIBZIP_CAN_USE_MMAP) + AC_SUBST(LIBZIP_CAN_USE_MMAP) -############################################################################### -# -# Check if altzone exists in time.h -# + ############################################################################### + # + # Check if altzone exists in time.h + # -AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [return (int)altzone;])], - [has_altzone=yes], - [has_altzone=no]) -if test "x$has_altzone" = xyes; then + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [return (int)altzone;])], + [has_altzone=yes], + [has_altzone=no]) + if test "x$has_altzone" = xyes; then AC_DEFINE([HAVE_ALTZONE], 1, [Define if you have the external 'altzone' variable in time.h]) -fi + fi -############################################################################### -# -# Check the maths library -# + ############################################################################### + # + # Check the maths library + # -AC_CHECK_LIB(m, cos, [], - [ - AC_MSG_NOTICE([Maths library was not found]) - ]) -AC_SUBST(LIBM) + AC_CHECK_LIB(m, cos, [], + [ + AC_MSG_NOTICE([Maths library was not found]) + ] + ) + AC_SUBST(LIBM) -############################################################################### -# -# Check for libdl.so - -save_LIBS="$LIBS" -LIBS="" -AC_CHECK_LIB(dl,dlopen) -LIBDL="$LIBS" -AC_SUBST(LIBDL) -LIBS="$save_LIBS" + ############################################################################### + # + # Check for libdl.so + save_LIBS="$LIBS" + LIBS="" + AC_CHECK_LIB(dl,dlopen) + LIBDL="$LIBS" + AC_SUBST(LIBDL) + LIBS="$save_LIBS" ]) AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP], [ -############################################################################### -# -# statically link libstdc++ before C++ ABI is stablized on Linux unless -# dynamic build is configured on command line. -# -AC_ARG_WITH([stdc++lib], [AS_HELP_STRING([--with-stdc++lib=,,], - [force linking of the C++ runtime on Linux to either static or dynamic, default is static with dynamic as fallback])], - [ - if test "x$with_stdc__lib" != xdynamic && test "x$with_stdc__lib" != xstatic \ - && test "x$with_stdc__lib" != xdefault; then - AC_MSG_ERROR([Bad parameter value --with-stdc++lib=$with_stdc__lib!]) - fi - ], - [with_stdc__lib=default] -) + ############################################################################### + # + # statically link libstdc++ before C++ ABI is stablized on Linux unless + # dynamic build is configured on command line. + # + AC_ARG_WITH([stdc++lib], [AS_HELP_STRING([--with-stdc++lib=,,], + [force linking of the C++ runtime on Linux to either static or dynamic, default is static with dynamic as fallback])], + [ + if test "x$with_stdc__lib" != xdynamic && test "x$with_stdc__lib" != xstatic \ + && test "x$with_stdc__lib" != xdefault; then + AC_MSG_ERROR([Bad parameter value --with-stdc++lib=$with_stdc__lib!]) + fi + ], + [with_stdc__lib=default] + ) -if test "x$OPENJDK_TARGET_OS" = xlinux; then + if test "x$OPENJDK_TARGET_OS" = xlinux; then # Test if -lstdc++ works. AC_MSG_CHECKING([if dynamic link of stdc++ is possible]) AC_LANG_PUSH(C++) OLD_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -lstdc++" AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])], - [has_dynamic_libstdcxx=yes], - [has_dynamic_libstdcxx=no]) + [has_dynamic_libstdcxx=yes], + [has_dynamic_libstdcxx=no]) CXXFLAGS="$OLD_CXXFLAGS" AC_LANG_POP(C++) AC_MSG_RESULT([$has_dynamic_libstdcxx]) @@ -668,55 +776,55 @@ if test "x$OPENJDK_TARGET_OS" = xlinux; then OLD_LIBS="$LIBS" OLD_CXX="$CXX" LIBS="$STATIC_STDCXX_FLAGS" - CXX="$CC" + CXX="$CC" AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])], - [has_static_libstdcxx=yes], - [has_static_libstdcxx=no]) + [has_static_libstdcxx=yes], + [has_static_libstdcxx=no]) LIBS="$OLD_LIBS" CXX="$OLD_CXX" AC_LANG_POP(C++) AC_MSG_RESULT([$has_static_libstdcxx]) if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then - AC_MSG_ERROR([Cannot link to stdc++, neither dynamically nor statically!]) + AC_MSG_ERROR([Cannot link to stdc++, neither dynamically nor statically!]) fi if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then - AC_MSG_ERROR([Static linking of libstdc++ was not possible!]) + AC_MSG_ERROR([Static linking of libstdc++ was not possible!]) fi if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then - AC_MSG_ERROR([Dynamic linking of libstdc++ was not possible!]) + AC_MSG_ERROR([Dynamic linking of libstdc++ was not possible!]) fi AC_MSG_CHECKING([how to link with libstdc++]) # If dynamic was requested, it's available since it would fail above otherwise. # If dynamic wasn't requested, go with static unless it isn't available. if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then - LIBCXX="$LIBCXX -lstdc++" - LDCXX="$CXX" - STATIC_CXX_SETTING="STATIC_CXX=false" - AC_MSG_RESULT([dynamic]) + LIBCXX="$LIBCXX -lstdc++" + LDCXX="$CXX" + STATIC_CXX_SETTING="STATIC_CXX=false" + AC_MSG_RESULT([dynamic]) else - LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS" - LDCXX="$CC" - STATIC_CXX_SETTING="STATIC_CXX=true" - AC_MSG_RESULT([static]) + LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS" + LDCXX="$CC" + STATIC_CXX_SETTING="STATIC_CXX=true" + AC_MSG_RESULT([static]) fi -fi -AC_SUBST(STATIC_CXX_SETTING) + fi + AC_SUBST(STATIC_CXX_SETTING) -if test "x$JVM_VARIANT_ZERO" = xtrue || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then + if test "x$JVM_VARIANT_ZERO" = xtrue || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then # Figure out LIBFFI_CFLAGS and LIBFFI_LIBS PKG_CHECK_MODULES([LIBFFI], [libffi]) -fi + fi -if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then + if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then AC_CHECK_PROG([LLVM_CONFIG], [llvm-config], [llvm-config]) if test "x$LLVM_CONFIG" != xllvm-config; then - AC_MSG_ERROR([llvm-config not found in $PATH.]) + AC_MSG_ERROR([llvm-config not found in $PATH.]) fi llvm_components="jit mcjit engine nativecodegen native" @@ -757,18 +865,17 @@ if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then AC_SUBST(LLVM_CFLAGS) AC_SUBST(LLVM_LDFLAGS) AC_SUBST(LLVM_LIBS) -fi + fi -# libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) -if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then + # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) + if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1" -fi + fi -# TODO better (platform agnostic) test -if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then + # TODO better (platform agnostic) test + if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then LIBCXX="-lstdc++" -fi - -AC_SUBST(LIBCXX) + fi + AC_SUBST(LIBCXX) ]) diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 index 96c710d8a18..757bf227e78 100644 --- a/common/autoconf/platform.m4 +++ b/common/autoconf/platform.m4 @@ -53,37 +53,37 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU], VAR_CPU_ARCH=ppc VAR_CPU_BITS=32 VAR_CPU_ENDIAN=big - ;; + ;; powerpc64) VAR_CPU=ppc64 VAR_CPU_ARCH=ppc VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big - ;; + ;; s390) VAR_CPU=s390 VAR_CPU_ARCH=s390 VAR_CPU_BITS=32 VAR_CPU_ENDIAN=big - ;; + ;; s390x) VAR_CPU=s390x VAR_CPU_ARCH=s390 VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big - ;; + ;; sparc) VAR_CPU=sparc VAR_CPU_ARCH=sparc VAR_CPU_BITS=32 VAR_CPU_ENDIAN=big - ;; + ;; sparcv9) VAR_CPU=sparcv9 VAR_CPU_ARCH=sparc VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big - ;; + ;; *) AC_MSG_ERROR([unsupported cpu $1]) ;; @@ -140,56 +140,56 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS], # OPENJDK_BUILD_OS, etc. AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD], [ - # Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME - # (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME - # Note that we might later on rewrite e.g. OPENJDK_TARGET_CPU due to reduced build, - # but this will not change the value of OPENJDK_TARGET_AUTOCONF_NAME. - OPENJDK_TARGET_AUTOCONF_NAME="$host" - OPENJDK_BUILD_AUTOCONF_NAME="$build" - AC_SUBST(OPENJDK_TARGET_AUTOCONF_NAME) - AC_SUBST(OPENJDK_BUILD_AUTOCONF_NAME) + # Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME + # (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME + # Note that we might later on rewrite e.g. OPENJDK_TARGET_CPU due to reduced build, + # but this will not change the value of OPENJDK_TARGET_AUTOCONF_NAME. + OPENJDK_TARGET_AUTOCONF_NAME="$host" + OPENJDK_BUILD_AUTOCONF_NAME="$build" + AC_SUBST(OPENJDK_TARGET_AUTOCONF_NAME) + AC_SUBST(OPENJDK_BUILD_AUTOCONF_NAME) - # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. - PLATFORM_EXTRACT_VARS_FROM_OS($build_os) - PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu) - # ..and setup our own variables. (Do this explicitely to facilitate searching) - OPENJDK_BUILD_OS="$VAR_OS" - OPENJDK_BUILD_OS_API="$VAR_OS_API" - OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV" - OPENJDK_BUILD_CPU="$VAR_CPU" - OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" - OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" - OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" - AC_SUBST(OPENJDK_BUILD_OS) - AC_SUBST(OPENJDK_BUILD_OS_API) - AC_SUBST(OPENJDK_BUILD_CPU) - AC_SUBST(OPENJDK_BUILD_CPU_ARCH) - AC_SUBST(OPENJDK_BUILD_CPU_BITS) - AC_SUBST(OPENJDK_BUILD_CPU_ENDIAN) + # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. + PLATFORM_EXTRACT_VARS_FROM_OS($build_os) + PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu) + # ..and setup our own variables. (Do this explicitely to facilitate searching) + OPENJDK_BUILD_OS="$VAR_OS" + OPENJDK_BUILD_OS_API="$VAR_OS_API" + OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV" + OPENJDK_BUILD_CPU="$VAR_CPU" + OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" + OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" + OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" + AC_SUBST(OPENJDK_BUILD_OS) + AC_SUBST(OPENJDK_BUILD_OS_API) + AC_SUBST(OPENJDK_BUILD_CPU) + AC_SUBST(OPENJDK_BUILD_CPU_ARCH) + AC_SUBST(OPENJDK_BUILD_CPU_BITS) + AC_SUBST(OPENJDK_BUILD_CPU_ENDIAN) - AC_MSG_CHECKING([openjdk-build os-cpu]) - AC_MSG_RESULT([$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU]) + AC_MSG_CHECKING([openjdk-build os-cpu]) + AC_MSG_RESULT([$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU]) - # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. - PLATFORM_EXTRACT_VARS_FROM_OS($host_os) - PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu) - # ... and setup our own variables. (Do this explicitely to facilitate searching) - OPENJDK_TARGET_OS="$VAR_OS" - OPENJDK_TARGET_OS_API="$VAR_OS_API" - OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV" - OPENJDK_TARGET_CPU="$VAR_CPU" - OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" - OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" - OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN" - AC_SUBST(OPENJDK_TARGET_OS) - AC_SUBST(OPENJDK_TARGET_OS_API) - AC_SUBST(OPENJDK_TARGET_CPU) - AC_SUBST(OPENJDK_TARGET_CPU_ARCH) - AC_SUBST(OPENJDK_TARGET_CPU_BITS) - AC_SUBST(OPENJDK_TARGET_CPU_ENDIAN) + # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. + PLATFORM_EXTRACT_VARS_FROM_OS($host_os) + PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu) + # ... and setup our own variables. (Do this explicitely to facilitate searching) + OPENJDK_TARGET_OS="$VAR_OS" + OPENJDK_TARGET_OS_API="$VAR_OS_API" + OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV" + OPENJDK_TARGET_CPU="$VAR_CPU" + OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" + OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" + OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN" + AC_SUBST(OPENJDK_TARGET_OS) + AC_SUBST(OPENJDK_TARGET_OS_API) + AC_SUBST(OPENJDK_TARGET_CPU) + AC_SUBST(OPENJDK_TARGET_CPU_ARCH) + AC_SUBST(OPENJDK_TARGET_CPU_BITS) + AC_SUBST(OPENJDK_TARGET_CPU_ENDIAN) - AC_MSG_CHECKING([openjdk-target os-cpu]) - AC_MSG_RESULT([$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU]) + AC_MSG_CHECKING([openjdk-target os-cpu]) + AC_MSG_RESULT([$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU]) ]) # Check if a reduced build (32-bit on 64-bit platforms) is requested, and modify behaviour @@ -198,7 +198,7 @@ AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD], AC_DEFUN([PLATFORM_SETUP_TARGET_CPU_BITS], [ AC_ARG_WITH(target-bits, [AS_HELP_STRING([--with-target-bits], - [build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 @<:@guessed@:>@])]) + [build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 @<:@guessed@:>@])]) # We have three types of compiles: # native == normal compilation, target system == build system @@ -227,7 +227,7 @@ AC_DEFUN([PLATFORM_SETUP_TARGET_CPU_BITS], OPENJDK_TARGET_CPU=sparc else AC_MSG_ERROR([Reduced build (--with-target-bits=32) is only supported on x86_64 and sparcv9]) - fi + fi elif test "x$with_target_bits" = x64 && test "x$OPENJDK_TARGET_CPU_BITS" = x32; then AC_MSG_ERROR([It is not possible to use --with-target-bits=64 on a 32 bit system. Use proper cross-compilation instead.]) elif test "x$with_target_bits" = "x$OPENJDK_TARGET_CPU_BITS"; then @@ -238,184 +238,190 @@ AC_DEFUN([PLATFORM_SETUP_TARGET_CPU_BITS], fi AC_SUBST(COMPILE_TYPE) -AC_MSG_CHECKING([compilation type]) -AC_MSG_RESULT([$COMPILE_TYPE]) + AC_MSG_CHECKING([compilation type]) + AC_MSG_RESULT([$COMPILE_TYPE]) ]) - # Setup the legacy variables, for controlling the old makefiles. - # +# Setup the legacy variables, for controlling the old makefiles. +# AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], [ - # Also store the legacy naming of the cpu. - # Ie i586 and amd64 instead of x86 and x86_64 - OPENJDK_TARGET_CPU_LEGACY="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - OPENJDK_TARGET_CPU_LEGACY="i586" - elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - # On all platforms except MacOSX replace x86_64 with amd64. - OPENJDK_TARGET_CPU_LEGACY="amd64" - fi - AC_SUBST(OPENJDK_TARGET_CPU_LEGACY) + # Also store the legacy naming of the cpu. + # Ie i586 and amd64 instead of x86 and x86_64 + OPENJDK_TARGET_CPU_LEGACY="$OPENJDK_TARGET_CPU" + if test "x$OPENJDK_TARGET_CPU" = xx86; then + OPENJDK_TARGET_CPU_LEGACY="i586" + elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then + # On all platforms except MacOSX replace x86_64 with amd64. + OPENJDK_TARGET_CPU_LEGACY="amd64" + fi + AC_SUBST(OPENJDK_TARGET_CPU_LEGACY) - # And the second legacy naming of the cpu. - # Ie i386 and amd64 instead of x86 and x86_64. - OPENJDK_TARGET_CPU_LEGACY_LIB="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - OPENJDK_TARGET_CPU_LEGACY_LIB="i386" - elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then - OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" - fi - AC_SUBST(OPENJDK_TARGET_CPU_LEGACY_LIB) + # And the second legacy naming of the cpu. + # Ie i386 and amd64 instead of x86 and x86_64. + OPENJDK_TARGET_CPU_LEGACY_LIB="$OPENJDK_TARGET_CPU" + if test "x$OPENJDK_TARGET_CPU" = xx86; then + OPENJDK_TARGET_CPU_LEGACY_LIB="i386" + elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then + OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" + fi + AC_SUBST(OPENJDK_TARGET_CPU_LEGACY_LIB) - # This is the name of the cpu (but using i386 and amd64 instead of - # x86 and x86_64, respectively), preceeded by a /, to be used when - # locating libraries. On macosx, it's empty, though. - OPENJDK_TARGET_CPU_LIBDIR="/$OPENJDK_TARGET_CPU_LEGACY_LIB" - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - OPENJDK_TARGET_CPU_LIBDIR="" - fi - AC_SUBST(OPENJDK_TARGET_CPU_LIBDIR) + # This is the name of the cpu (but using i386 and amd64 instead of + # x86 and x86_64, respectively), preceeded by a /, to be used when + # locating libraries. On macosx, it's empty, though. + OPENJDK_TARGET_CPU_LIBDIR="/$OPENJDK_TARGET_CPU_LEGACY_LIB" + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + OPENJDK_TARGET_CPU_LIBDIR="" + fi + AC_SUBST(OPENJDK_TARGET_CPU_LIBDIR) - # OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to - # /amd64 or /sparcv9. This string is appended to some library paths, like this: - # /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so - OPENJDK_TARGET_CPU_ISADIR="" - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - if test "x$OPENJDK_TARGET_CPU" = xx86_64; then - OPENJDK_TARGET_CPU_ISADIR="/amd64" - elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then - OPENJDK_TARGET_CPU_ISADIR="/sparcv9" - fi + # OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to + # /amd64 or /sparcv9. This string is appended to some library paths, like this: + # /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so + OPENJDK_TARGET_CPU_ISADIR="" + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + if test "x$OPENJDK_TARGET_CPU" = xx86_64; then + OPENJDK_TARGET_CPU_ISADIR="/amd64" + elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then + OPENJDK_TARGET_CPU_ISADIR="/sparcv9" fi - AC_SUBST(OPENJDK_TARGET_CPU_ISADIR) + fi + AC_SUBST(OPENJDK_TARGET_CPU_ISADIR) - # Setup OPENJDK_TARGET_CPU_OSARCH, which is used to set the os.arch Java system property - OPENJDK_TARGET_CPU_OSARCH="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xx86; then - # On linux only, we replace x86 with i386. - OPENJDK_TARGET_CPU_OSARCH="i386" - elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - # On all platforms except macosx, we replace x86_64 with amd64. - OPENJDK_TARGET_CPU_OSARCH="amd64" - fi - AC_SUBST(OPENJDK_TARGET_CPU_OSARCH) + # Setup OPENJDK_TARGET_CPU_OSARCH, which is used to set the os.arch Java system property + OPENJDK_TARGET_CPU_OSARCH="$OPENJDK_TARGET_CPU" + if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xx86; then + # On linux only, we replace x86 with i386. + OPENJDK_TARGET_CPU_OSARCH="i386" + elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then + # On all platforms except macosx, we replace x86_64 with amd64. + OPENJDK_TARGET_CPU_OSARCH="amd64" + fi + AC_SUBST(OPENJDK_TARGET_CPU_OSARCH) - OPENJDK_TARGET_CPU_JLI="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - OPENJDK_TARGET_CPU_JLI="i386" - elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - # On all platforms except macosx, we replace x86_64 with amd64. - OPENJDK_TARGET_CPU_JLI="amd64" + OPENJDK_TARGET_CPU_JLI="$OPENJDK_TARGET_CPU" + if test "x$OPENJDK_TARGET_CPU" = xx86; then + OPENJDK_TARGET_CPU_JLI="i386" + elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then + # On all platforms except macosx, we replace x86_64 with amd64. + OPENJDK_TARGET_CPU_JLI="amd64" + fi + # Now setup the -D flags for building libjli. + OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + if test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc; then + OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'" + elif test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then + OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'" fi - # Now setup the -D flags for building libjli. - OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - if test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc; then - OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'" - elif test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then - OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'" - fi - fi - AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS) + fi + AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS) - # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. - if test "x$OPENJDK_TARGET_OS_API" = xposix; then - OPENJDK_TARGET_OS_API_DIR="solaris" - fi - if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then - OPENJDK_TARGET_OS_API_DIR="windows" - fi - AC_SUBST(OPENJDK_TARGET_OS_API_DIR) + # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. + if test "x$OPENJDK_TARGET_OS_API" = xposix; then + OPENJDK_TARGET_OS_API_DIR="solaris" + fi + if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then + OPENJDK_TARGET_OS_API_DIR="windows" + fi + AC_SUBST(OPENJDK_TARGET_OS_API_DIR) - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - A_LP64="LP64:=" - # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in - # unpack200.exe - if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xmacosx; then - ADD_LP64="-D_LP64=1" - fi + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + OPENJDK_TARGET_OS_EXPORT_DIR=macosx + else + OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_API_DIR} + fi + AC_SUBST(OPENJDK_TARGET_OS_EXPORT_DIR) + + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + A_LP64="LP64:=" + # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in + # unpack200.exe + if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xmacosx; then + ADD_LP64="-D_LP64=1" fi - AC_SUBST(LP64,$A_LP64) + fi + AC_SUBST(LP64,$A_LP64) - if test "x$COMPILE_TYPE" = "xcross"; then - # FIXME: ... or should this include reduced builds..? - DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_TARGET_CPU_LEGACY" - else - DEFINE_CROSS_COMPILE_ARCH="" - fi - AC_SUBST(DEFINE_CROSS_COMPILE_ARCH) - - # ZERO_ARCHDEF is used to enable architecture-specific code - case "${OPENJDK_TARGET_CPU}" in - ppc*) ZERO_ARCHDEF=PPC ;; - s390*) ZERO_ARCHDEF=S390 ;; - sparc*) ZERO_ARCHDEF=SPARC ;; - x86_64*) ZERO_ARCHDEF=AMD64 ;; - x86) ZERO_ARCHDEF=IA32 ;; - *) ZERO_ARCHDEF=$(echo "${OPENJDK_TARGET_CPU_LEGACY_LIB}" | tr a-z A-Z) - esac - AC_SUBST(ZERO_ARCHDEF) + if test "x$COMPILE_TYPE" = "xcross"; then + # FIXME: ... or should this include reduced builds..? + DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_TARGET_CPU_LEGACY" + else + DEFINE_CROSS_COMPILE_ARCH="" + fi + AC_SUBST(DEFINE_CROSS_COMPILE_ARCH) + # ZERO_ARCHDEF is used to enable architecture-specific code + case "${OPENJDK_TARGET_CPU}" in + ppc*) ZERO_ARCHDEF=PPC ;; + s390*) ZERO_ARCHDEF=S390 ;; + sparc*) ZERO_ARCHDEF=SPARC ;; + x86_64*) ZERO_ARCHDEF=AMD64 ;; + x86) ZERO_ARCHDEF=IA32 ;; + *) ZERO_ARCHDEF=$(echo "${OPENJDK_TARGET_CPU_LEGACY_LIB}" | tr a-z A-Z) + esac + AC_SUBST(ZERO_ARCHDEF) ]) AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES], [ - if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - REQUIRED_OS_NAME=SunOS - REQUIRED_OS_VERSION=5.10 - fi - if test "x$OPENJDK_TARGET_OS" = "xlinux"; then - REQUIRED_OS_NAME=Linux - REQUIRED_OS_VERSION=2.6 - fi - if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - REQUIRED_OS_NAME=Windows - if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then - REQUIRED_OS_VERSION=5.2 - else - REQUIRED_OS_VERSION=5.1 - fi - fi - if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - REQUIRED_OS_NAME=Darwin - REQUIRED_OS_VERSION=11.2 + if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then + REQUIRED_OS_NAME=SunOS + REQUIRED_OS_VERSION=5.10 + fi + if test "x$OPENJDK_TARGET_OS" = "xlinux"; then + REQUIRED_OS_NAME=Linux + REQUIRED_OS_VERSION=2.6 + fi + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + REQUIRED_OS_NAME=Windows + if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then + REQUIRED_OS_VERSION=5.2 + else + REQUIRED_OS_VERSION=5.1 fi + fi + if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + REQUIRED_OS_NAME=Darwin + REQUIRED_OS_VERSION=11.2 + fi - AC_SUBST(REQUIRED_OS_NAME) - AC_SUBST(REQUIRED_OS_VERSION) + AC_SUBST(REQUIRED_OS_NAME) + AC_SUBST(REQUIRED_OS_VERSION) ]) #%%% Build and target systems %%% AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET], [ -# Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target" -# is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the -# product you're building. The target of this build is called "host". Since this is confusing to most people, we -# have not adopted that system, but use "target" as the platform we are building for. In some places though we need -# to use the configure naming style. -AC_CANONICAL_BUILD -AC_CANONICAL_HOST -AC_CANONICAL_TARGET + # Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target" + # is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the + # product you're building. The target of this build is called "host". Since this is confusing to most people, we + # have not adopted that system, but use "target" as the platform we are building for. In some places though we need + # to use the configure naming style. + AC_CANONICAL_BUILD + AC_CANONICAL_HOST + AC_CANONICAL_TARGET -PLATFORM_EXTRACT_TARGET_AND_BUILD -PLATFORM_SETUP_TARGET_CPU_BITS -PLATFORM_SET_RELEASE_FILE_OS_VALUES -PLATFORM_SETUP_LEGACY_VARS + PLATFORM_EXTRACT_TARGET_AND_BUILD + PLATFORM_SETUP_TARGET_CPU_BITS + PLATFORM_SET_RELEASE_FILE_OS_VALUES + PLATFORM_SETUP_LEGACY_VARS ]) AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION], [ -############################################################################### + ############################################################################### -# Note that this is the build platform OS version! + # Note that this is the build platform OS version! -OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`" -OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`" -OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`" -OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`" -AC_SUBST(OS_VERSION_MAJOR) -AC_SUBST(OS_VERSION_MINOR) -AC_SUBST(OS_VERSION_MICRO) + OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`" + OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`" + OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`" + OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`" + AC_SUBST(OS_VERSION_MAJOR) + AC_SUBST(OS_VERSION_MINOR) + AC_SUBST(OS_VERSION_MICRO) ]) # Support macro for PLATFORM_SETUP_OPENJDK_TARGET_BITS. @@ -441,68 +447,68 @@ AC_DEFUN([PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS], AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS], [ -############################################################################### -# -# Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code. -# (The JVM can use 32 or 64 bit Java pointers but that decision -# is made at runtime.) -# + ############################################################################### + # + # Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code. + # (The JVM can use 32 or 64 bit Java pointers but that decision + # is made at runtime.) + # -if test "x$OPENJDK_TARGET_OS" = xsolaris; then - # Always specify -m flags on Solaris - PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS -elif test "x$COMPILE_TYPE" = xreduced; then - if test "x$OPENJDK_TARGET_OS" != xwindows; then - # Specify -m if running reduced on other Posix platforms + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + # Always specify -m flags on Solaris PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS + elif test "x$COMPILE_TYPE" = xreduced; then + if test "x$OPENJDK_TARGET_OS" != xwindows; then + # Specify -m if running reduced on other Posix platforms + PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS + fi fi -fi -# Make compilation sanity check -AC_CHECK_HEADERS([stdio.h], , [ - AC_MSG_NOTICE([Failed to compile stdio.h. This likely implies missing compile dependencies.]) - if test "x$COMPILE_TYPE" = xreduced; then - AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed.]) - elif test "x$COMPILE_TYPE" = xcross; then - AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.]) + # Make compilation sanity check + AC_CHECK_HEADERS([stdio.h], , [ + AC_MSG_NOTICE([Failed to compile stdio.h. This likely implies missing compile dependencies.]) + if test "x$COMPILE_TYPE" = xreduced; then + AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed.]) + elif test "x$COMPILE_TYPE" = xcross; then + AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.]) + fi + AC_MSG_ERROR([Cannot continue.]) + ]) + + AC_CHECK_SIZEOF([int *], [1111]) + + if test "x$SIZEOF_INT_P" != "x$ac_cv_sizeof_int_p"; then + # Workaround autoconf bug, see http://lists.gnu.org/archive/html/autoconf/2010-07/msg00004.html + SIZEOF_INT_P="$ac_cv_sizeof_int_p" fi - AC_MSG_ERROR([Cannot continue.]) -]) -AC_CHECK_SIZEOF([int *], [1111]) - -if test "x$SIZEOF_INT_P" != "x$ac_cv_sizeof_int_p"; then - # Workaround autoconf bug, see http://lists.gnu.org/archive/html/autoconf/2010-07/msg00004.html - SIZEOF_INT_P="$ac_cv_sizeof_int_p" -fi - -if test "x$SIZEOF_INT_P" = x; then + if test "x$SIZEOF_INT_P" = x; then # The test failed, lets stick to the assumed value. AC_MSG_WARN([The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS.]) -else + else TESTED_TARGET_CPU_BITS=`expr 8 \* $SIZEOF_INT_P` if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then - AC_MSG_ERROR([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)]) + AC_MSG_ERROR([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)]) fi -fi + fi -AC_MSG_CHECKING([for target address size]) -AC_MSG_RESULT([$OPENJDK_TARGET_CPU_BITS bits]) + AC_MSG_CHECKING([for target address size]) + AC_MSG_RESULT([$OPENJDK_TARGET_CPU_BITS bits]) ]) AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS], [ -############################################################################### -# -# Is the target little of big endian? -# -AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal_endianness"]) + ############################################################################### + # + # Is the target little of big endian? + # + AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal_endianness"]) -if test "x$ENDIAN" = xuniversal_endianness; then + if test "x$ENDIAN" = xuniversal_endianness; then AC_MSG_ERROR([Building with both big and little endianness is not supported]) -fi -if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then + fi + if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then AC_MSG_ERROR([The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)]) -fi + fi ]) diff --git a/common/autoconf/source-dirs.m4 b/common/autoconf/source-dirs.m4 index e040cc82f69..e5d1262d188 100644 --- a/common/autoconf/source-dirs.m4 +++ b/common/autoconf/source-dirs.m4 @@ -25,55 +25,54 @@ AC_DEFUN_ONCE([SRCDIRS_SETUP_TOPDIRS], [ - -# Where are the sources. Any of these can be overridden -# using --with-override-corba and the likes. -LANGTOOLS_TOPDIR="$SRC_ROOT/langtools" -CORBA_TOPDIR="$SRC_ROOT/corba" -JAXP_TOPDIR="$SRC_ROOT/jaxp" -JAXWS_TOPDIR="$SRC_ROOT/jaxws" -HOTSPOT_TOPDIR="$SRC_ROOT/hotspot" -NASHORN_TOPDIR="$SRC_ROOT/nashorn" -JDK_TOPDIR="$SRC_ROOT/jdk" -AC_SUBST(LANGTOOLS_TOPDIR) -AC_SUBST(CORBA_TOPDIR) -AC_SUBST(JAXP_TOPDIR) -AC_SUBST(JAXWS_TOPDIR) -AC_SUBST(HOTSPOT_TOPDIR) -AC_SUBST(NASHORN_TOPDIR) -AC_SUBST(JDK_TOPDIR) + # Where are the sources. Any of these can be overridden + # using --with-override-corba and the likes. + LANGTOOLS_TOPDIR="$SRC_ROOT/langtools" + CORBA_TOPDIR="$SRC_ROOT/corba" + JAXP_TOPDIR="$SRC_ROOT/jaxp" + JAXWS_TOPDIR="$SRC_ROOT/jaxws" + HOTSPOT_TOPDIR="$SRC_ROOT/hotspot" + NASHORN_TOPDIR="$SRC_ROOT/nashorn" + JDK_TOPDIR="$SRC_ROOT/jdk" + AC_SUBST(LANGTOOLS_TOPDIR) + AC_SUBST(CORBA_TOPDIR) + AC_SUBST(JAXP_TOPDIR) + AC_SUBST(JAXWS_TOPDIR) + AC_SUBST(HOTSPOT_TOPDIR) + AC_SUBST(NASHORN_TOPDIR) + AC_SUBST(JDK_TOPDIR) ]) AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS], [ -############################################################################### -# -# Pickup additional source for a component from outside of the source root -# or override source for a component. -# -AC_ARG_WITH(add-source-root, [AS_HELP_STRING([--with-add-source-root], - [for each and every source directory, look in this additional source root for - the same directory; if it exists and have files in it, include it in the build])]) - -AC_ARG_WITH(override-source-root, [AS_HELP_STRING([--with-override-source-root], - [for each and every source directory, look in this override source root for - the same directory; if it exists, use that directory instead and - ignore the directory in the original source root])]) + ############################################################################### + # + # Pickup additional source for a component from outside of the source root + # or override source for a component. + # + AC_ARG_WITH(add-source-root, [AS_HELP_STRING([--with-add-source-root], + [for each and every source directory, look in this additional source root for + the same directory; if it exists and have files in it, include it in the build])]) -AC_ARG_WITH(adds-and-overrides, [AS_HELP_STRING([--with-adds-and-overrides], - [use the subdirs 'adds' and 'overrides' in the specified directory as - add-source-root and override-source-root])]) + AC_ARG_WITH(override-source-root, [AS_HELP_STRING([--with-override-source-root], + [for each and every source directory, look in this override source root for + the same directory; if it exists, use that directory instead and + ignore the directory in the original source root])]) -if test "x$with_adds_and_overrides" != x; then + AC_ARG_WITH(adds-and-overrides, [AS_HELP_STRING([--with-adds-and-overrides], + [use the subdirs 'adds' and 'overrides' in the specified directory as + add-source-root and override-source-root])]) + + if test "x$with_adds_and_overrides" != x; then with_add_source_root="$with_adds_and_overrides/adds" with_override_source_root="$with_adds_and_overrides/overrides" -fi + fi -if test "x$with_add_source_root" != x; then + if test "x$with_add_source_root" != x; then if ! test -d $with_add_source_root; then - AC_MSG_ERROR([Trying to use a non-existant add-source-root $with_add_source_root]) + AC_MSG_ERROR([Trying to use a non-existant add-source-root $with_add_source_root]) fi CURDIR="$PWD" cd "$with_add_source_root" @@ -82,219 +81,218 @@ if test "x$with_add_source_root" != x; then # Verify that the addon source root does not have any root makefiles. # If it does, then it is usually an error, prevent this. if test -f $with_add_source_root/langtools/makefiles/Makefile || \ - test -f $with_add_source_root/langtools/make/Makefile; then - AC_MSG_ERROR([Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources.]) + test -f $with_add_source_root/langtools/make/Makefile; then + AC_MSG_ERROR([Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources.]) fi if test -f $with_add_source_root/corba/makefiles/Makefile || \ - test -f $with_add_source_root/corba/make/Makefile; then - AC_MSG_ERROR([Your add source root seems to contain a full corba repo! An add source root should only contain additional sources.]) + test -f $with_add_source_root/corba/make/Makefile; then + AC_MSG_ERROR([Your add source root seems to contain a full corba repo! An add source root should only contain additional sources.]) fi if test -f $with_add_source_root/jaxp/makefiles/Makefile || \ - test -f $with_add_source_root/jaxp/make/Makefile; then - AC_MSG_ERROR([Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources.]) + test -f $with_add_source_root/jaxp/make/Makefile; then + AC_MSG_ERROR([Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources.]) fi if test -f $with_add_source_root/jaxws/makefiles/Makefile || \ - test -f $with_add_source_root/jaxws/make/Makefile; then - AC_MSG_ERROR([Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources.]) + test -f $with_add_source_root/jaxws/make/Makefile; then + AC_MSG_ERROR([Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources.]) fi if test -f $with_add_source_root/hotspot/makefiles/Makefile || \ - test -f $with_add_source_root/hotspot/make/Makefile; then - AC_MSG_ERROR([Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources.]) + test -f $with_add_source_root/hotspot/make/Makefile; then + AC_MSG_ERROR([Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources.]) fi if test -f $with_add_source_root/nashorn/makefiles/Makefile || \ - test -f $with_add_source_root/nashorn/make/Makefile; then - AC_MSG_ERROR([Your add source root seems to contain a full nashorn repo! An add source root should only contain additional sources.]) + test -f $with_add_source_root/nashorn/make/Makefile; then + AC_MSG_ERROR([Your add source root seems to contain a full nashorn repo! An add source root should only contain additional sources.]) fi if test -f $with_add_source_root/jdk/makefiles/Makefile || \ - test -f $with_add_source_root/jdk/make/Makefile; then - AC_MSG_ERROR([Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources.]) + test -f $with_add_source_root/jdk/make/Makefile; then + AC_MSG_ERROR([Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources.]) fi -fi -AC_SUBST(ADD_SRC_ROOT) + fi + AC_SUBST(ADD_SRC_ROOT) -if test "x$with_override_source_root" != x; then + if test "x$with_override_source_root" != x; then if ! test -d $with_override_source_root; then - AC_MSG_ERROR([Trying to use a non-existant override-source-root $with_override_source_root]) + AC_MSG_ERROR([Trying to use a non-existant override-source-root $with_override_source_root]) fi CURDIR="$PWD" cd "$with_override_source_root" OVERRIDE_SRC_ROOT="`pwd`" cd "$CURDIR" if test -f $with_override_source_root/langtools/makefiles/Makefile || \ - test -f $with_override_source_root/langtools/make/Makefile; then - AC_MSG_ERROR([Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override.]) + test -f $with_override_source_root/langtools/make/Makefile; then + AC_MSG_ERROR([Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override.]) fi if test -f $with_override_source_root/corba/makefiles/Makefile || \ - test -f $with_override_source_root/corba/make/Makefile; then - AC_MSG_ERROR([Your override source root seems to contain a full corba repo! An override source root should only contain sources that override.]) + test -f $with_override_source_root/corba/make/Makefile; then + AC_MSG_ERROR([Your override source root seems to contain a full corba repo! An override source root should only contain sources that override.]) fi if test -f $with_override_source_root/jaxp/makefiles/Makefile || \ - test -f $with_override_source_root/jaxp/make/Makefile; then - AC_MSG_ERROR([Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override.]) + test -f $with_override_source_root/jaxp/make/Makefile; then + AC_MSG_ERROR([Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override.]) fi if test -f $with_override_source_root/jaxws/makefiles/Makefile || \ - test -f $with_override_source_root/jaxws/make/Makefile; then - AC_MSG_ERROR([Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override.]) + test -f $with_override_source_root/jaxws/make/Makefile; then + AC_MSG_ERROR([Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override.]) fi if test -f $with_override_source_root/hotspot/makefiles/Makefile || \ - test -f $with_override_source_root/hotspot/make/Makefile; then - AC_MSG_ERROR([Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override.]) + test -f $with_override_source_root/hotspot/make/Makefile; then + AC_MSG_ERROR([Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override.]) fi if test -f $with_override_source_root/nashorn/makefiles/Makefile || \ - test -f $with_override_source_root/nashorn/make/Makefile; then - AC_MSG_ERROR([Your override source root seems to contain a full nashorn repo! An override source root should only contain sources that override.]) + test -f $with_override_source_root/nashorn/make/Makefile; then + AC_MSG_ERROR([Your override source root seems to contain a full nashorn repo! An override source root should only contain sources that override.]) fi if test -f $with_override_source_root/jdk/makefiles/Makefile || \ - test -f $with_override_source_root/jdk/make/Makefile; then - AC_MSG_ERROR([Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override.]) + test -f $with_override_source_root/jdk/make/Makefile; then + AC_MSG_ERROR([Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override.]) fi -fi -AC_SUBST(OVERRIDE_SRC_ROOT) + fi + AC_SUBST(OVERRIDE_SRC_ROOT) -############################################################################### -# -# Override a repo completely, this is used for example when you have 3 small -# development sandboxes of the langtools sources and want to avoid having 3 full -# OpenJDK sources checked out on disk. -# -# Assuming that the 3 langtools sandboxes are located here: -# /home/fredrik/sandbox1/langtools -# /home/fredrik/sandbox2/langtools -# /home/fredrik/sandbox3/langtools -# -# From the source root you create build subdirs manually: -# mkdir -p build1 build2 build3 -# in each build directory run: -# (cd build1 && ../configure --with-override-langtools=/home/fredrik/sandbox1 && make) -# (cd build2 && ../configure --with-override-langtools=/home/fredrik/sandbox2 && make) -# (cd build3 && ../configure --with-override-langtools=/home/fredrik/sandbox3 && make) -# + ############################################################################### + # + # Override a repo completely, this is used for example when you have 3 small + # development sandboxes of the langtools sources and want to avoid having 3 full + # OpenJDK sources checked out on disk. + # + # Assuming that the 3 langtools sandboxes are located here: + # /home/fredrik/sandbox1/langtools + # /home/fredrik/sandbox2/langtools + # /home/fredrik/sandbox3/langtools + # + # From the source root you create build subdirs manually: + # mkdir -p build1 build2 build3 + # in each build directory run: + # (cd build1 && ../configure --with-override-langtools=/home/fredrik/sandbox1 && make) + # (cd build2 && ../configure --with-override-langtools=/home/fredrik/sandbox2 && make) + # (cd build3 && ../configure --with-override-langtools=/home/fredrik/sandbox3 && make) + # -AC_ARG_WITH(override-langtools, [AS_HELP_STRING([--with-override-langtools], - [use this langtools dir for the build])]) + AC_ARG_WITH(override-langtools, [AS_HELP_STRING([--with-override-langtools], + [use this langtools dir for the build])]) -AC_ARG_WITH(override-corba, [AS_HELP_STRING([--with-override-corba], - [use this corba dir for the build])]) + AC_ARG_WITH(override-corba, [AS_HELP_STRING([--with-override-corba], + [use this corba dir for the build])]) -AC_ARG_WITH(override-jaxp, [AS_HELP_STRING([--with-override-jaxp], - [use this jaxp dir for the build])]) + AC_ARG_WITH(override-jaxp, [AS_HELP_STRING([--with-override-jaxp], + [use this jaxp dir for the build])]) -AC_ARG_WITH(override-jaxws, [AS_HELP_STRING([--with-override-jaxws], - [use this jaxws dir for the build])]) + AC_ARG_WITH(override-jaxws, [AS_HELP_STRING([--with-override-jaxws], + [use this jaxws dir for the build])]) -AC_ARG_WITH(override-hotspot, [AS_HELP_STRING([--with-override-hotspot], - [use this hotspot dir for the build])]) + AC_ARG_WITH(override-hotspot, [AS_HELP_STRING([--with-override-hotspot], + [use this hotspot dir for the build])]) -AC_ARG_WITH(override-nashorn, [AS_HELP_STRING([--with-override-nashorn], - [use this nashorn dir for the build])]) + AC_ARG_WITH(override-nashorn, [AS_HELP_STRING([--with-override-nashorn], + [use this nashorn dir for the build])]) -AC_ARG_WITH(override-jdk, [AS_HELP_STRING([--with-override-jdk], - [use this jdk dir for the build])]) + AC_ARG_WITH(override-jdk, [AS_HELP_STRING([--with-override-jdk], + [use this jdk dir for the build])]) -if test "x$with_override_langtools" != x; then + if test "x$with_override_langtools" != x; then CURDIR="$PWD" cd "$with_override_langtools" LANGTOOLS_TOPDIR="`pwd`" cd "$CURDIR" if ! test -f $LANGTOOLS_TOPDIR/makefiles/Makefile; then - AC_MSG_ERROR([You have to override langtools with a full langtools repo!]) + AC_MSG_ERROR([You have to override langtools with a full langtools repo!]) fi AC_MSG_CHECKING([if langtools should be overridden]) AC_MSG_RESULT([yes with $LANGTOOLS_TOPDIR]) -fi -if test "x$with_override_corba" != x; then + fi + if test "x$with_override_corba" != x; then CURDIR="$PWD" cd "$with_override_corba" CORBA_TOPDIR="`pwd`" cd "$CURDIR" if ! test -f $CORBA_TOPDIR/makefiles/Makefile; then - AC_MSG_ERROR([You have to override corba with a full corba repo!]) + AC_MSG_ERROR([You have to override corba with a full corba repo!]) fi AC_MSG_CHECKING([if corba should be overridden]) AC_MSG_RESULT([yes with $CORBA_TOPDIR]) -fi -if test "x$with_override_jaxp" != x; then + fi + if test "x$with_override_jaxp" != x; then CURDIR="$PWD" cd "$with_override_jaxp" JAXP_TOPDIR="`pwd`" cd "$CURDIR" if ! test -f $JAXP_TOPDIR/makefiles/Makefile; then - AC_MSG_ERROR([You have to override jaxp with a full jaxp repo!]) + AC_MSG_ERROR([You have to override jaxp with a full jaxp repo!]) fi AC_MSG_CHECKING([if jaxp should be overridden]) AC_MSG_RESULT([yes with $JAXP_TOPDIR]) -fi -if test "x$with_override_jaxws" != x; then + fi + if test "x$with_override_jaxws" != x; then CURDIR="$PWD" cd "$with_override_jaxws" JAXWS_TOPDIR="`pwd`" cd "$CURDIR" if ! test -f $JAXWS_TOPDIR/makefiles/Makefile; then - AC_MSG_ERROR([You have to override jaxws with a full jaxws repo!]) + AC_MSG_ERROR([You have to override jaxws with a full jaxws repo!]) fi AC_MSG_CHECKING([if jaxws should be overridden]) AC_MSG_RESULT([yes with $JAXWS_TOPDIR]) -fi -if test "x$with_override_hotspot" != x; then + fi + if test "x$with_override_hotspot" != x; then CURDIR="$PWD" cd "$with_override_hotspot" HOTSPOT_TOPDIR="`pwd`" cd "$CURDIR" if ! test -f $HOTSPOT_TOPDIR/make/Makefile && \ - ! test -f $HOTSPOT_TOPDIR/makefiles/Makefile; then - AC_MSG_ERROR([You have to override hotspot with a full hotspot repo!]) + ! test -f $HOTSPOT_TOPDIR/makefiles/Makefile; then + AC_MSG_ERROR([You have to override hotspot with a full hotspot repo!]) fi AC_MSG_CHECKING([if hotspot should be overridden]) AC_MSG_RESULT([yes with $HOTSPOT_TOPDIR]) -fi -if test "x$with_override_nashorn" != x; then + fi + if test "x$with_override_nashorn" != x; then CURDIR="$PWD" cd "$with_override_nashorn" NASHORN_TOPDIR="`pwd`" cd "$CURDIR" if ! test -f $NASHORN_TOPDIR/makefiles/Makefile; then - AC_MSG_ERROR([You have to override nashorn with a full nashorn repo!]) + AC_MSG_ERROR([You have to override nashorn with a full nashorn repo!]) fi AC_MSG_CHECKING([if nashorn should be overridden]) AC_MSG_RESULT([yes with $NASHORN_TOPDIR]) -fi -if test "x$with_override_jdk" != x; then + fi + if test "x$with_override_jdk" != x; then CURDIR="$PWD" cd "$with_override_jdk" JDK_TOPDIR="`pwd`" cd "$CURDIR" if ! test -f $JDK_TOPDIR/makefiles/Makefile; then - AC_MSG_ERROR([You have to override JDK with a full JDK repo!]) + AC_MSG_ERROR([You have to override JDK with a full JDK repo!]) fi AC_MSG_CHECKING([if JDK should be overridden]) AC_MSG_RESULT([yes with $JDK_TOPDIR]) -fi - + fi ]) AC_DEFUN_ONCE([SRCDIRS_SETUP_OUTPUT_DIRS], [ -BUILD_OUTPUT="$OUTPUT_ROOT" -AC_SUBST(BUILD_OUTPUT) + BUILD_OUTPUT="$OUTPUT_ROOT" + AC_SUBST(BUILD_OUTPUT) -HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist" -BUILD_HOTSPOT=true -AC_SUBST(HOTSPOT_DIST) -AC_SUBST(BUILD_HOTSPOT) -AC_ARG_WITH(import-hotspot, [AS_HELP_STRING([--with-import-hotspot], - [import hotspot binaries from this jdk image or hotspot build dist dir instead of building from source])]) -if test "x$with_import_hotspot" != x; then + HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist" + BUILD_HOTSPOT=true + AC_SUBST(HOTSPOT_DIST) + AC_SUBST(BUILD_HOTSPOT) + AC_ARG_WITH(import-hotspot, [AS_HELP_STRING([--with-import-hotspot], + [import hotspot binaries from this jdk image or hotspot build dist dir instead of building from source])]) + if test "x$with_import_hotspot" != x; then CURDIR="$PWD" cd "$with_import_hotspot" HOTSPOT_DIST="`pwd`" cd "$CURDIR" if ! (test -d $HOTSPOT_DIST/lib && test -d $HOTSPOT_DIST/jre/lib); then - AC_MSG_ERROR([You have to import hotspot from a full jdk image or hotspot build dist dir!]) + AC_MSG_ERROR([You have to import hotspot from a full jdk image or hotspot build dist dir!]) fi AC_MSG_CHECKING([if hotspot should be imported]) AC_MSG_RESULT([yes from $HOTSPOT_DIST]) BUILD_HOTSPOT=false -fi + fi -JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk" + JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk" ]) diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index 7e186693700..3b08c6dc588 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -30,8 +30,8 @@ # (called @OPENJDK_BUILD_AUTOCONF_NAME@ by autoconf) # using 'configure @CONFIGURE_COMMAND_LINE@' -# When calling macros, the spaces between arguments are -# often semantically important! Sometimes we need to subst +# When calling macros, the spaces between arguments are +# often semantically important! Sometimes we need to subst # spaces and commas, therefore we need the following macros. X:= SPACE:=$(X) $(X) @@ -56,17 +56,17 @@ MAKE:=@MAKE@ # Pass along the verbosity and log level settings. ifeq (,$(findstring VERBOSE=,$(MAKE))) - MAKE:=$(MAKE) $(VERBOSE) VERBOSE="$(VERBOSE)" LOG_LEVEL="$(LOG_LEVEL)" + MAKE:=$(MAKE) $(VERBOSE) VERBOSE="$(VERBOSE)" LOG_LEVEL="$(LOG_LEVEL)" endif # No implicit variables or rules! ifeq (,$(findstring -R,$(MAKE))) - MAKE:=$(MAKE) -R + MAKE:=$(MAKE) -R endif # Specify where the common include directory for makefiles is. ifeq (,$(findstring -I @SRC_ROOT@/common/makefiles,$(MAKE))) - MAKE:=$(MAKE) -I @SRC_ROOT@/common/makefiles + MAKE:=$(MAKE) -I @SRC_ROOT@/common/makefiles endif # The "human readable" name of this configuration @@ -92,6 +92,7 @@ OPENJDK_TARGET_CPU_LEGACY_LIB:=@OPENJDK_TARGET_CPU_LEGACY_LIB@ OPENJDK_TARGET_CPU_OSARCH:=@OPENJDK_TARGET_CPU_OSARCH@ OPENJDK_TARGET_CPU_JLI_CFLAGS:=@OPENJDK_TARGET_CPU_JLI_CFLAGS@ OPENJDK_TARGET_OS_API_DIR:=@OPENJDK_TARGET_OS_API_DIR@ +OPENJDK_TARGET_OS_EXPORT_DIR:=@OPENJDK_TARGET_OS_EXPORT_DIR@ # We are building on this build system. # When not cross-compiling, it is the same as the target. @@ -161,6 +162,7 @@ JDK_RC_PLATFORM_NAME:=@JDK_RC_PLATFORM_NAME@ COMPANY_NAME:=@COMPANY_NAME@ MACOSX_BUNDLE_NAME_BASE=@MACOSX_BUNDLE_NAME_BASE@ MACOSX_BUNDLE_ID_BASE=@MACOSX_BUNDLE_ID_BASE@ +USER_RELEASE_SUFFIX=@USER_RELEASE_SUFFIX@ # Different version strings generated from the above information. JDK_VERSION:=@JDK_VERSION@ @@ -173,8 +175,8 @@ ifeq ($(MILESTONE),) else RELEASE=$(JDK_VERSION)-$(MILESTONE)$(BUILD_VARIANT_RELEASE) endif -ifeq ($(JDK_BUILD_NUMBER),b00) - USER_RELEASE_SUFFIX=@USER_RELEASE_SUFFIX@ + +ifneq ($(USER_RELEASE_SUFFIX), ) FULL_VERSION=$(RELEASE)-$(USER_RELEASE_SUFFIX)-$(JDK_BUILD_NUMBER) else FULL_VERSION=$(RELEASE)-$(JDK_BUILD_NUMBER) @@ -267,13 +269,9 @@ SJAVAC_SERVER_DIR:=@SJAVAC_SERVER_DIR@ # Number of parallel jobs to use for compilation JOBS?=@JOBS@ -# The OpenJDK makefiles should be changed to using the standard -# configure output ..._CFLAGS and ..._LIBS. In the meantime we -# extract the information here. -FREETYPE2_LIB_PATH:=@FREETYPE2_LIB_PATH@ -FREETYPE2_LIBS:=@FREETYPE2_LIBS@ -FREETYPE2_CFLAGS:=@FREETYPE2_CFLAGS@ -USING_SYSTEM_FT_LIB=@USING_SYSTEM_FT_LIB@ +FREETYPE_LIBS:=@FREETYPE_LIBS@ +FREETYPE_CFLAGS:=@FREETYPE_CFLAGS@ +FREETYPE_BUNDLE_LIB_PATH=@FREETYPE_BUNDLE_LIB_PATH@ CUPS_CFLAGS:=@CUPS_CFLAGS@ ALSA_LIBS:=@ALSA_LIBS@ ALSA_CFLAGS:=@ALSA_CFLAGS@ @@ -286,7 +284,7 @@ CACERTS_FILE=@CACERTS_FILE@ # Enable unlimited crypto policy UNLIMITED_CRYPTO=@UNLIMITED_CRYPTO@ -# Necessary additional compiler flags to compile X11 +# Necessary additional compiler flags to compile X11 X_CFLAGS:=@X_CFLAGS@ X_LIBS:=@X_LIBS@ OPENWIN_HOME:=@OPENWIN_HOME@ @@ -387,7 +385,7 @@ LIPO:=@LIPO@ # Command to create a shared library SHARED_LIBRARY_FLAGS:=@SHARED_LIBRARY_FLAGS@ -# Options to linker to specify a mapfile. +# Options to linker to specify a mapfile. # (Note absence of := assignment, because we do not want to evaluate the macro body here) SET_SHARED_LIBRARY_MAPFILE=@SET_SHARED_LIBRARY_MAPFILE@ @@ -460,7 +458,7 @@ NEW_JAVADOC = $(BOOTSTRAP_JAVAC_ARGS) com.sun.tools.javadoc.Main # Guarding this against resetting value. Legacy make files include spec multiple # times. ifndef RC_FLAGS -RC_FLAGS:=@RC_FLAGS@ + RC_FLAGS:=@RC_FLAGS@ endif # A specific java binary with specific options can be used to run @@ -484,6 +482,7 @@ CUT:=@CUT@ DATE:=@DATE@ DIFF:=@DIFF@ DIRNAME:=@DIRNAME@ +DSYMUTIL:=@DSYMUTIL@ FIND:=@FIND@ FIND_DELETE:=@FIND_DELETE@ ECHO:=@ECHO@ @@ -540,9 +539,9 @@ BUILD_LOG_PREVIOUS:=@BUILD_LOG_PREVIOUS@ # we have solved how to prevent the log wrapper to wait # for the background sjavac server process. ifeq (@ENABLE_SJAVAC@X@OPENJDK_BUILD_OS_API@,yesXwinapi) - BUILD_LOG_WRAPPER:= + BUILD_LOG_WRAPPER:= else - BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@ + BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@ endif # Build setup @@ -562,12 +561,12 @@ MSVCR_DLL:=@MSVCR_DLL@ # of the next macro to get rid of superfluous files. ADD_SRCS=$1 ifneq (,$(ADD_SRC_ROOT)) - # Append wildcard rule to pickup any matching source roots found below ADD_SRC_ROOT - ADD_SRCS+=$(wildcard $(subst $(SRC_ROOT),$(ADD_SRC_ROOT),$1)) + # Append wildcard rule to pickup any matching source roots found below ADD_SRC_ROOT + ADD_SRCS+=$(wildcard $(subst $(SRC_ROOT),$(ADD_SRC_ROOT),$1)) endif ifneq (,$(OVERRIDE_SRC_ROOT)) - # Append wildcard rule to pickup any matching source roots found below OVERRIDE_SRC_ROOT - ADD_SRCS+=$(wildcard $(subst $(SRC_ROOT),$(OVERRIDE_SRC_ROOT),$1)) + # Append wildcard rule to pickup any matching source roots found below OVERRIDE_SRC_ROOT + ADD_SRCS+=$(wildcard $(subst $(SRC_ROOT),$(OVERRIDE_SRC_ROOT),$1)) endif # OVR_SRCS creates a filter expression to filter out sources in @@ -577,9 +576,9 @@ endif # We cannot do the scan in configure, since that would force us to rerun configure when # we add overridden sources. ifneq (,$(OVERRIDE_SRC_ROOT)) - OVR_SRCS:=$(addsuffix %,$(subst $(OVERRIDE_SRC_ROOT),$(SRC_ROOT),$(sort $(dir $(shell $(FIND) $(OVERRIDE_SRC_ROOT) -type f))))) + OVR_SRCS:=$(addsuffix %,$(subst $(OVERRIDE_SRC_ROOT),$(SRC_ROOT),$(sort $(dir $(shell $(FIND) $(OVERRIDE_SRC_ROOT) -type f))))) else - OVR_SRCS:= + OVR_SRCS:= endif #################################################### @@ -588,7 +587,7 @@ endif # # Common prefix for all installed files. Defaults to /usr/local, -# but /opt/myjdk is another common version. +# but /opt/myjdk is another common version. INSTALL_PREFIX=@prefix@ # Directories containing architecture-dependent files should be relative to exec_prefix @@ -618,7 +617,7 @@ INSTALL_INCLUDEDIR=@libdir@ # Executables that other programs run. INSTALL_LIBEXECDIR=@libexecdir@ -# Locale-dependent but architecture-independent data, such as message catalogs. +# Locale-dependent but architecture-independent data, such as message catalogs. INSTALL_LOCALEDIR=@localedir@ # Modifiable single-machine data diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index 21733003023..c7cb93f2736 100644 --- a/common/autoconf/toolchain.m4 +++ b/common/autoconf/toolchain.m4 @@ -46,7 +46,7 @@ AC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION], fi elif test "x$OPENJDK_TARGET_OS" = xwindows; then # First line typically looks something like: - # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 + # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*Version \(@<:@1-9@:>@@<:@0-9.@:>@*\) .*/\1/p"` COMPILER_VENDOR="Microsoft CL.EXE" @@ -86,25 +86,25 @@ AC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION], AC_DEFUN_ONCE([TOOLCHAIN_SETUP_SYSROOT_AND_OUT_OPTIONS], [ -############################################################################### -# -# Configure the development tool paths and potential sysroot. -# -AC_LANG(C++) + ############################################################################### + # + # Configure the development tool paths and potential sysroot. + # + AC_LANG(C++) -# The option used to specify the target .o,.a or .so file. -# When compiling, how to specify the to be created object file. -CC_OUT_OPTION='-o$(SPACE)' -# When linking, how to specify the to be created executable. -EXE_OUT_OPTION='-o$(SPACE)' -# When linking, how to specify the to be created dynamically linkable library. -LD_OUT_OPTION='-o$(SPACE)' -# When archiving, how to specify the to be create static archive for object files. -AR_OUT_OPTION='rcs$(SPACE)' -AC_SUBST(CC_OUT_OPTION) -AC_SUBST(EXE_OUT_OPTION) -AC_SUBST(LD_OUT_OPTION) -AC_SUBST(AR_OUT_OPTION) + # The option used to specify the target .o,.a or .so file. + # When compiling, how to specify the to be created object file. + CC_OUT_OPTION='-o$(SPACE)' + # When linking, how to specify the to be created executable. + EXE_OUT_OPTION='-o$(SPACE)' + # When linking, how to specify the to be created dynamically linkable library. + LD_OUT_OPTION='-o$(SPACE)' + # When archiving, how to specify the to be create static archive for object files. + AR_OUT_OPTION='rcs$(SPACE)' + AC_SUBST(CC_OUT_OPTION) + AC_SUBST(EXE_OUT_OPTION) + AC_SUBST(LD_OUT_OPTION) + AC_SUBST(AR_OUT_OPTION) ]) # $1 = compiler to test (CC or CXX) @@ -133,8 +133,8 @@ AC_DEFUN([TOOLCHAIN_FIND_COMPILER], fi if test "x[$]$1" = x; then - HELP_MSG_MISSING_DEPENDENCY([devkit]) - AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG]) + HELP_MSG_MISSING_DEPENDENCY([devkit]) + AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG]) fi BASIC_FIXUP_EXECUTABLE($1) AC_MSG_CHECKING([resolved symbolic links for $1]) @@ -174,26 +174,27 @@ AC_DEFUN([TOOLCHAIN_FIND_COMPILER], AC_DEFUN([TOOLCHAIN_SETUP_PATHS], [ -if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV - BASIC_DEPRECATED_ARG_WITH([dxsdk]) - BASIC_DEPRECATED_ARG_WITH([dxsdk-lib]) - BASIC_DEPRECATED_ARG_WITH([dxsdk-include]) -fi + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV + TOOLCHAIN_SETUP_MSVCR_DLL + BASIC_DEPRECATED_ARG_WITH([dxsdk]) + BASIC_DEPRECATED_ARG_WITH([dxsdk-lib]) + BASIC_DEPRECATED_ARG_WITH([dxsdk-include]) + fi -AC_SUBST(MSVCR_DLL) + AC_SUBST(MSVCR_DLL) -# If --build AND --host is set, then the configure script will find any -# cross compilation tools in the PATH. Cross compilation tools -# follows the cross compilation standard where they are prefixed with ${host}. -# For example the binary i686-sun-solaris2.10-gcc -# will cross compile for i686-sun-solaris2.10 -# If neither of build and host is not set, then build=host and the -# default compiler found in the path will be used. -# Setting only --host, does not seem to be really supported. -# Please set both --build and --host if you want to cross compile. + # If --build AND --host is set, then the configure script will find any + # cross compilation tools in the PATH. Cross compilation tools + # follows the cross compilation standard where they are prefixed with ${host}. + # For example the binary i686-sun-solaris2.10-gcc + # will cross compile for i686-sun-solaris2.10 + # If neither of build and host is not set, then build=host and the + # default compiler found in the path will be used. + # Setting only --host, does not seem to be really supported. + # Please set both --build and --host if you want to cross compile. -if test "x$COMPILE_TYPE" = "xcross"; then + if test "x$COMPILE_TYPE" = "xcross"; then # Now we to find a C/C++ compiler that can build executables for the build # platform. We can't use the AC_PROG_CC macro, since it can only be used # once. Also, we need to do this before adding a tools dir to the path, @@ -206,123 +207,124 @@ if test "x$COMPILE_TYPE" = "xcross"; then BASIC_FIXUP_EXECUTABLE(BUILD_CXX) AC_PATH_PROG(BUILD_LD, ld) BASIC_FIXUP_EXECUTABLE(BUILD_LD) -fi -AC_SUBST(BUILD_CC) -AC_SUBST(BUILD_CXX) -AC_SUBST(BUILD_LD) + fi + AC_SUBST(BUILD_CC) + AC_SUBST(BUILD_CXX) + AC_SUBST(BUILD_LD) -# If a devkit is found on the builddeps server, then prepend its path to the -# PATH variable. If there are cross compilers available in the devkit, these -# will be found by AC_PROG_CC et al. -DEVKIT= -BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx, - [# Found devkit - PATH="$DEVKIT/bin:$PATH" - SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root" - if test "x$x_includes" = "xNONE"; then - x_includes="$SYS_ROOT/usr/include/X11" - fi - if test "x$x_libraries" = "xNONE"; then - x_libraries="$SYS_ROOT/usr/lib" - fi - ], - []) + # If a devkit is found on the builddeps server, then prepend its path to the + # PATH variable. If there are cross compilers available in the devkit, these + # will be found by AC_PROG_CC et al. + DEVKIT= + BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx, + [ + # Found devkit + PATH="$DEVKIT/bin:$PATH" + SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root" + if test "x$x_includes" = "xNONE"; then + x_includes="$SYS_ROOT/usr/include/X11" + fi + if test "x$x_libraries" = "xNONE"; then + x_libraries="$SYS_ROOT/usr/lib" + fi + ], + []) -# Store the CFLAGS etal passed to the configure script. -ORG_CFLAGS="$CFLAGS" -ORG_CXXFLAGS="$CXXFLAGS" -ORG_OBJCFLAGS="$OBJCFLAGS" + # Store the CFLAGS etal passed to the configure script. + ORG_CFLAGS="$CFLAGS" + ORG_CXXFLAGS="$CXXFLAGS" + ORG_OBJCFLAGS="$OBJCFLAGS" -# autoconf magic only relies on PATH, so update it if tools dir is specified -OLD_PATH="$PATH" -if test "x$TOOLS_DIR" != x; then - PATH=$TOOLS_DIR:$PATH -fi + # autoconf magic only relies on PATH, so update it if tools dir is specified + OLD_PATH="$PATH" + if test "x$TOOLS_DIR" != x; then + PATH=$TOOLS_DIR:$PATH + fi -### Locate C compiler (CC) + ### Locate C compiler (CC) -# On windows, only cl.exe is supported. -# On Solaris, cc is preferred to gcc. -# Elsewhere, gcc is preferred to cc. + # On windows, only cl.exe is supported. + # On Solaris, cc is preferred to gcc. + # Elsewhere, gcc is preferred to cc. -if test "x$CC" != x; then - COMPILER_CHECK_LIST="$CC" -elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then - COMPILER_CHECK_LIST="cl" -elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - COMPILER_CHECK_LIST="cc gcc" -else - COMPILER_CHECK_LIST="gcc cc" -fi + if test "x$CC" != x; then + COMPILER_CHECK_LIST="$CC" + elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then + COMPILER_CHECK_LIST="cl" + elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then + COMPILER_CHECK_LIST="cc gcc" + else + COMPILER_CHECK_LIST="gcc cc" + fi -TOOLCHAIN_FIND_COMPILER([CC],[C],[$COMPILER_CHECK_LIST]) -# Now that we have resolved CC ourself, let autoconf have its go at it -AC_PROG_CC([$CC]) + TOOLCHAIN_FIND_COMPILER([CC],[C],[$COMPILER_CHECK_LIST]) + # Now that we have resolved CC ourself, let autoconf have its go at it + AC_PROG_CC([$CC]) -### Locate C++ compiler (CXX) + ### Locate C++ compiler (CXX) -if test "x$CXX" != x; then - COMPILER_CHECK_LIST="$CXX" -elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then - COMPILER_CHECK_LIST="cl" -elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - COMPILER_CHECK_LIST="CC g++" -else - COMPILER_CHECK_LIST="g++ CC" -fi + if test "x$CXX" != x; then + COMPILER_CHECK_LIST="$CXX" + elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then + COMPILER_CHECK_LIST="cl" + elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then + COMPILER_CHECK_LIST="CC g++" + else + COMPILER_CHECK_LIST="g++ CC" + fi -TOOLCHAIN_FIND_COMPILER([CXX],[C++],[$COMPILER_CHECK_LIST]) -# Now that we have resolved CXX ourself, let autoconf have its go at it -AC_PROG_CXX([$CXX]) + TOOLCHAIN_FIND_COMPILER([CXX],[C++],[$COMPILER_CHECK_LIST]) + # Now that we have resolved CXX ourself, let autoconf have its go at it + AC_PROG_CXX([$CXX]) -### Locate other tools + ### Locate other tools -if test "x$OPENJDK_TARGET_OS" = xmacosx; then + if test "x$OPENJDK_TARGET_OS" = xmacosx; then AC_PROG_OBJC BASIC_FIXUP_EXECUTABLE(OBJC) -else + else OBJC= -fi + fi -# Restore the flags to the user specified values. -# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" -CFLAGS="$ORG_CFLAGS" -CXXFLAGS="$ORG_CXXFLAGS" -OBJCFLAGS="$ORG_OBJCFLAGS" + # Restore the flags to the user specified values. + # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" + CFLAGS="$ORG_CFLAGS" + CXXFLAGS="$ORG_CXXFLAGS" + OBJCFLAGS="$ORG_OBJCFLAGS" -LD="$CC" -LDEXE="$CC" -LDCXX="$CXX" -LDEXECXX="$CXX" -AC_SUBST(LD) -# LDEXE is the linker to use, when creating executables. -AC_SUBST(LDEXE) -# Linking C++ libraries. -AC_SUBST(LDCXX) -# Linking C++ executables. -AC_SUBST(LDEXECXX) + LD="$CC" + LDEXE="$CC" + LDCXX="$CXX" + LDEXECXX="$CXX" + AC_SUBST(LD) + # LDEXE is the linker to use, when creating executables. + AC_SUBST(LDEXE) + # Linking C++ libraries. + AC_SUBST(LDCXX) + # Linking C++ executables. + AC_SUBST(LDEXECXX) -if test "x$OPENJDK_TARGET_OS" != xwindows; then + if test "x$OPENJDK_TARGET_OS" != xwindows; then AC_CHECK_TOOL(AR, ar) BASIC_FIXUP_EXECUTABLE(AR) -fi -if test "x$OPENJDK_TARGET_OS" = xmacosx; then + fi + if test "x$OPENJDK_TARGET_OS" = xmacosx; then ARFLAGS="-r" -else + else ARFLAGS="" -fi -AC_SUBST(ARFLAGS) + fi + AC_SUBST(ARFLAGS) -# For hotspot, we need these in Windows mixed path; other platforms keep them the same -HOTSPOT_CXX="$CXX" -HOTSPOT_LD="$LD" -AC_SUBST(HOTSPOT_CXX) -AC_SUBST(HOTSPOT_LD) + # For hotspot, we need these in Windows mixed path; other platforms keep them the same + HOTSPOT_CXX="$CXX" + HOTSPOT_LD="$LD" + AC_SUBST(HOTSPOT_CXX) + AC_SUBST(HOTSPOT_LD) -COMPILER_NAME=gcc -COMPILER_TYPE=CC -AS_IF([test "x$OPENJDK_TARGET_OS" = xwindows], [ + COMPILER_NAME=gcc + COMPILER_TYPE=CC + AS_IF([test "x$OPENJDK_TARGET_OS" = xwindows], [ # For now, assume that we are always compiling using cl.exe. CC_OUT_OPTION=-Fo EXE_OUT_OPTION=-out: @@ -369,45 +371,45 @@ AS_IF([test "x$OPENJDK_TARGET_OS" = xwindows], [ RC_FLAGS="-nologo -l 0x409 -r" AS_IF([test "x$VARIANT" = xOPT], [ - RC_FLAGS="$RC_FLAGS -d NDEBUG" - ]) + RC_FLAGS="$RC_FLAGS -d NDEBUG" + ]) - # The version variables used to create RC_FLAGS may be overridden - # in a custom configure script, or possibly the command line. - # Let those variables be expanded at make time in spec.gmk. - # The \$ are escaped to the shell, and the $(...) variables - # are evaluated by make. - RC_FLAGS="$RC_FLAGS \ - -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \ - -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \ - -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \ - -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \ - -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \ - -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \ - -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\"" + # The version variables used to create RC_FLAGS may be overridden + # in a custom configure script, or possibly the command line. + # Let those variables be expanded at make time in spec.gmk. + # The \$ are escaped to the shell, and the $(...) variables + # are evaluated by make. + RC_FLAGS="$RC_FLAGS \ + -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \ + -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \ + -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \ + -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \ + -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \ + -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \ + -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\"" - # lib.exe is used to create static libraries. - AC_CHECK_PROG([WINAR], [lib],[lib],,,) - BASIC_FIXUP_EXECUTABLE(WINAR) - AR="$WINAR" - ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT" + # lib.exe is used to create static libraries. + AC_CHECK_PROG([WINAR], [lib],[lib],,,) + BASIC_FIXUP_EXECUTABLE(WINAR) + AR="$WINAR" + ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT" - AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,) - BASIC_FIXUP_EXECUTABLE(DUMPBIN) + AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,) + BASIC_FIXUP_EXECUTABLE(DUMPBIN) - COMPILER_TYPE=CL - CCXXFLAGS="$CCXXFLAGS -nologo" -]) -AC_SUBST(RC_FLAGS) -AC_SUBST(COMPILER_TYPE) + COMPILER_TYPE=CL + CCXXFLAGS="$CCXXFLAGS -nologo" + ]) + AC_SUBST(RC_FLAGS) + AC_SUBST(COMPILER_TYPE) -AC_PROG_CPP -BASIC_FIXUP_EXECUTABLE(CPP) + AC_PROG_CPP + BASIC_FIXUP_EXECUTABLE(CPP) -AC_PROG_CXXCPP -BASIC_FIXUP_EXECUTABLE(CXXCPP) + AC_PROG_CXXCPP + BASIC_FIXUP_EXECUTABLE(CXXCPP) -if test "x$COMPILE_TYPE" != "xcross"; then + if test "x$COMPILE_TYPE" != "xcross"; then # If we are not cross compiling, use the same compilers for # building the build platform executables. The cross-compilation # case needed to be done earlier, but this can only be done after @@ -415,28 +417,28 @@ if test "x$COMPILE_TYPE" != "xcross"; then BUILD_CC="$CC" BUILD_CXX="$CXX" BUILD_LD="$LD" -fi + fi -# for solaris we really need solaris tools, and not gnu equivalent -# these seems to normally reside in /usr/ccs/bin so add that to path before -# starting to probe -# -# NOTE: I add this /usr/ccs/bin after TOOLS but before OLD_PATH -# so that it can be overriden --with-tools-dir -if test "x$OPENJDK_BUILD_OS" = xsolaris; then + # for solaris we really need solaris tools, and not gnu equivalent + # these seems to normally reside in /usr/ccs/bin so add that to path before + # starting to probe + # + # NOTE: I add this /usr/ccs/bin after TOOLS but before OLD_PATH + # so that it can be overriden --with-tools-dir + if test "x$OPENJDK_BUILD_OS" = xsolaris; then PATH="${TOOLS_DIR}:/usr/ccs/bin:${OLD_PATH}" -fi + fi -# Find the right assembler. -if test "x$OPENJDK_TARGET_OS" = xsolaris; then + # Find the right assembler. + if test "x$OPENJDK_TARGET_OS" = xsolaris; then AC_PATH_PROG(AS, as) BASIC_FIXUP_EXECUTABLE(AS) -else + else AS="$CC -c" -fi -AC_SUBST(AS) + fi + AC_SUBST(AS) -if test "x$OPENJDK_TARGET_OS" = xsolaris; then + if test "x$OPENJDK_TARGET_OS" = xsolaris; then AC_PATH_PROG(NM, nm) BASIC_FIXUP_EXECUTABLE(NM) AC_PATH_PROG(GNM, gnm) @@ -445,52 +447,52 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris; then BASIC_FIXUP_EXECUTABLE(STRIP) AC_PATH_PROG(MCS, mcs) BASIC_FIXUP_EXECUTABLE(MCS) -elif test "x$OPENJDK_TARGET_OS" != xwindows; then + elif test "x$OPENJDK_TARGET_OS" != xwindows; then AC_CHECK_TOOL(NM, nm) BASIC_FIXUP_EXECUTABLE(NM) GNM="$NM" AC_SUBST(GNM) AC_CHECK_TOOL(STRIP, strip) BASIC_FIXUP_EXECUTABLE(STRIP) -fi + fi -# objcopy is used for moving debug symbols to separate files when -# full debug symbols are enabled. -if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then + # objcopy is used for moving debug symbols to separate files when + # full debug symbols are enabled. + if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then AC_CHECK_TOOLS(OBJCOPY, [gobjcopy objcopy]) # Only call fixup if objcopy was found. if test -n "$OBJCOPY"; then - BASIC_FIXUP_EXECUTABLE(OBJCOPY) + BASIC_FIXUP_EXECUTABLE(OBJCOPY) fi -fi + fi -AC_CHECK_TOOLS(OBJDUMP, [gobjdump objdump]) -if test "x$OBJDUMP" != x; then - # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE bails if argument is missing. - BASIC_FIXUP_EXECUTABLE(OBJDUMP) -fi + AC_CHECK_TOOLS(OBJDUMP, [gobjdump objdump]) + if test "x$OBJDUMP" != x; then + # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE bails if argument is missing. + BASIC_FIXUP_EXECUTABLE(OBJDUMP) + fi -if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - AC_PATH_PROG(LIPO, lipo) - BASIC_FIXUP_EXECUTABLE(LIPO) -fi + if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + AC_PATH_PROG(LIPO, lipo) + BASIC_FIXUP_EXECUTABLE(LIPO) + fi -TOOLCHAIN_SETUP_JTREG + TOOLCHAIN_SETUP_JTREG -# Restore old path without tools dir -PATH="$OLD_PATH" + # Restore old path without tools dir + PATH="$OLD_PATH" ]) AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_LIBS], [ -############################################################################### -# -# How to compile shared libraries. -# + ############################################################################### + # + # How to compile shared libraries. + # -if test "x$GCC" = xyes; then + if test "x$GCC" = xyes; then COMPILER_NAME=gcc PICFLAG="-fPIC" LIBRARY_PREFIX=lib @@ -515,398 +517,399 @@ if test "x$GCC" = xyes; then # Linking is different on MacOSX if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # Might change in the future to clang. - COMPILER_NAME=gcc - SHARED_LIBRARY='lib[$]1.dylib' - SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" - SHARED_LIBRARY_SUFFIX='.dylib' - EXE_SUFFIX='' - SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1' - SET_SHARED_LIBRARY_MAPFILE='' - SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.' - SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" - POST_STRIP_CMD="$STRIP -S" + # Might change in the future to clang. + COMPILER_NAME=gcc + SHARED_LIBRARY='lib[$]1.dylib' + SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" + SHARED_LIBRARY_SUFFIX='.dylib' + EXE_SUFFIX='' + SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1' + SET_SHARED_LIBRARY_MAPFILE='' + SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.' + SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" + POST_STRIP_CMD="$STRIP -S" fi -else + else if test "x$OPENJDK_TARGET_OS" = xsolaris; then - # If it is not gcc, then assume it is the Oracle Solaris Studio Compiler - COMPILER_NAME=ossc - PICFLAG="-KPIC" - LIBRARY_PREFIX=lib - SHARED_LIBRARY='lib[$]1.so' - STATIC_LIBRARY='lib[$]1.a' - SHARED_LIBRARY_FLAGS="-G" - SHARED_LIBRARY_SUFFIX='.so' - STATIC_LIBRARY_SUFFIX='.a' - OBJ_SUFFIX='.o' - EXE_SUFFIX='' - SET_SHARED_LIBRARY_NAME='' - SET_SHARED_LIBRARY_MAPFILE='-M[$]1' - C_FLAG_REORDER='-xF' - CXX_FLAG_REORDER='-xF' - SET_SHARED_LIBRARY_ORIGIN='-R\$$$$ORIGIN[$]1' - SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" - CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__" - CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__" - CFLAGS_JDKLIB_EXTRA='-xstrconst' - POST_STRIP_CMD="$STRIP -x" - POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\"" + # If it is not gcc, then assume it is the Oracle Solaris Studio Compiler + COMPILER_NAME=ossc + PICFLAG="-KPIC" + LIBRARY_PREFIX=lib + SHARED_LIBRARY='lib[$]1.so' + STATIC_LIBRARY='lib[$]1.a' + SHARED_LIBRARY_FLAGS="-G" + SHARED_LIBRARY_SUFFIX='.so' + STATIC_LIBRARY_SUFFIX='.a' + OBJ_SUFFIX='.o' + EXE_SUFFIX='' + SET_SHARED_LIBRARY_NAME='' + SET_SHARED_LIBRARY_MAPFILE='-M[$]1' + C_FLAG_REORDER='-xF' + CXX_FLAG_REORDER='-xF' + SET_SHARED_LIBRARY_ORIGIN='-R\$$$$ORIGIN[$]1' + SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" + CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__" + CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__" + CFLAGS_JDKLIB_EXTRA='-xstrconst' + POST_STRIP_CMD="$STRIP -x" + POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\"" fi if test "x$OPENJDK_TARGET_OS" = xwindows; then - # If it is not gcc, then assume it is the MS Visual Studio compiler - COMPILER_NAME=cl - PICFLAG="" - LIBRARY_PREFIX= - SHARED_LIBRARY='[$]1.dll' - STATIC_LIBRARY='[$]1.lib' - SHARED_LIBRARY_FLAGS="-LD" - SHARED_LIBRARY_SUFFIX='.dll' - STATIC_LIBRARY_SUFFIX='.lib' - OBJ_SUFFIX='.obj' - EXE_SUFFIX='.exe' - SET_SHARED_LIBRARY_NAME='' - SET_SHARED_LIBRARY_MAPFILE='' - SET_SHARED_LIBRARY_ORIGIN='' - SET_EXECUTABLE_ORIGIN='' + # If it is not gcc, then assume it is the MS Visual Studio compiler + COMPILER_NAME=cl + PICFLAG="" + LIBRARY_PREFIX= + SHARED_LIBRARY='[$]1.dll' + STATIC_LIBRARY='[$]1.lib' + SHARED_LIBRARY_FLAGS="-LD" + SHARED_LIBRARY_SUFFIX='.dll' + STATIC_LIBRARY_SUFFIX='.lib' + OBJ_SUFFIX='.obj' + EXE_SUFFIX='.exe' + SET_SHARED_LIBRARY_NAME='' + SET_SHARED_LIBRARY_MAPFILE='' + SET_SHARED_LIBRARY_ORIGIN='' + SET_EXECUTABLE_ORIGIN='' fi -fi + fi -AC_SUBST(COMPILER_NAME) -AC_SUBST(OBJ_SUFFIX) -AC_SUBST(SHARED_LIBRARY) -AC_SUBST(STATIC_LIBRARY) -AC_SUBST(LIBRARY_PREFIX) -AC_SUBST(SHARED_LIBRARY_SUFFIX) -AC_SUBST(STATIC_LIBRARY_SUFFIX) -AC_SUBST(EXE_SUFFIX) -AC_SUBST(SHARED_LIBRARY_FLAGS) -AC_SUBST(SET_SHARED_LIBRARY_NAME) -AC_SUBST(SET_SHARED_LIBRARY_MAPFILE) -AC_SUBST(C_FLAG_REORDER) -AC_SUBST(CXX_FLAG_REORDER) -AC_SUBST(SET_SHARED_LIBRARY_ORIGIN) -AC_SUBST(SET_EXECUTABLE_ORIGIN) -AC_SUBST(POST_STRIP_CMD) -AC_SUBST(POST_MCS_CMD) + AC_SUBST(COMPILER_NAME) + AC_SUBST(OBJ_SUFFIX) + AC_SUBST(SHARED_LIBRARY) + AC_SUBST(STATIC_LIBRARY) + AC_SUBST(LIBRARY_PREFIX) + AC_SUBST(SHARED_LIBRARY_SUFFIX) + AC_SUBST(STATIC_LIBRARY_SUFFIX) + AC_SUBST(EXE_SUFFIX) + AC_SUBST(SHARED_LIBRARY_FLAGS) + AC_SUBST(SET_SHARED_LIBRARY_NAME) + AC_SUBST(SET_SHARED_LIBRARY_MAPFILE) + AC_SUBST(C_FLAG_REORDER) + AC_SUBST(CXX_FLAG_REORDER) + AC_SUBST(SET_SHARED_LIBRARY_ORIGIN) + AC_SUBST(SET_EXECUTABLE_ORIGIN) + AC_SUBST(POST_STRIP_CMD) + AC_SUBST(POST_MCS_CMD) -# The (cross) compiler is now configured, we can now test capabilities -# of the target platform. + # The (cross) compiler is now configured, we can now test capabilities + # of the target platform. ]) AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], [ -############################################################################### -# -# Setup the opt flags for different compilers -# and different operating systems. -# + ############################################################################### + # + # Setup the opt flags for different compilers + # and different operating systems. + # -# -# NOTE: check for -mstackrealign needs to be below potential addition of -m32 -# -if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then + # + # NOTE: check for -mstackrealign needs to be below potential addition of -m32 + # + if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then # On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned. # While waiting for a better solution, the current workaround is to use -mstackrealign. CFLAGS="$CFLAGS -mstackrealign" AC_MSG_CHECKING([if 32-bit compiler supports -mstackrealign]) AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])], - [ - AC_MSG_RESULT([yes]) - ], - [ - AC_MSG_RESULT([no]) - AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.]) - ]) -fi + [ + AC_MSG_RESULT([yes]) + ], + [ + AC_MSG_RESULT([no]) + AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.]) + ] + ) + fi -C_FLAG_DEPS="-MMD -MF" -CXX_FLAG_DEPS="-MMD -MF" + C_FLAG_DEPS="-MMD -MF" + CXX_FLAG_DEPS="-MMD -MF" -case $COMPILER_TYPE in - CC ) - case $COMPILER_NAME in - gcc ) - case $OPENJDK_TARGET_OS in - macosx ) - # On MacOSX we optimize for size, something - # we should do for all platforms? - C_O_FLAG_HI="-Os" - C_O_FLAG_NORM="-Os" - C_O_FLAG_NONE="" - ;; - *) - C_O_FLAG_HI="-O3" - C_O_FLAG_NORM="-O2" - C_O_FLAG_NONE="-O0" - ;; - esac - CXX_O_FLAG_HI="$C_O_FLAG_HI" - CXX_O_FLAG_NORM="$C_O_FLAG_NORM" - CXX_O_FLAG_NONE="$C_O_FLAG_NONE" - CFLAGS_DEBUG_SYMBOLS="-g" - CXXFLAGS_DEBUG_SYMBOLS="-g" - if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then + case $COMPILER_TYPE in + CC ) + case $COMPILER_NAME in + gcc ) + case $OPENJDK_TARGET_OS in + macosx ) + # On MacOSX we optimize for size, something + # we should do for all platforms? + C_O_FLAG_HI="-Os" + C_O_FLAG_NORM="-Os" + C_O_FLAG_NONE="" + ;; + *) + C_O_FLAG_HI="-O3" + C_O_FLAG_NORM="-O2" + C_O_FLAG_NONE="-O0" + ;; + esac + CXX_O_FLAG_HI="$C_O_FLAG_HI" + CXX_O_FLAG_NORM="$C_O_FLAG_NORM" + CXX_O_FLAG_NONE="$C_O_FLAG_NONE" + CFLAGS_DEBUG_SYMBOLS="-g" + CXXFLAGS_DEBUG_SYMBOLS="-g" + if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then CFLAGS_DEBUG_SYMBOLS="-g1" CXXFLAGS_DEBUG_SYMBOLS="-g1" - fi - ;; - ossc ) - # - # Forte has different names for this with their C++ compiler... - # - C_FLAG_DEPS="-xMMD -xMF" - CXX_FLAG_DEPS="-xMMD -xMF" + fi + ;; + ossc ) + # + # Forte has different names for this with their C++ compiler... + # + C_FLAG_DEPS="-xMMD -xMF" + CXX_FLAG_DEPS="-xMMD -xMF" - # Extra options used with HIGHEST - # - # WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be - # done with care, there are some assumptions below that need to - # be understood about the use of pointers, and IEEE behavior. - # - # Use non-standard floating point mode (not IEEE 754) - CC_HIGHEST="$CC_HIGHEST -fns" - # Do some simplification of floating point arithmetic (not IEEE 754) - CC_HIGHEST="$CC_HIGHEST -fsimple" - # Use single precision floating point with 'float' - CC_HIGHEST="$CC_HIGHEST -fsingle" - # Assume memory references via basic pointer types do not alias - # (Source with excessing pointer casting and data access with mixed - # pointer types are not recommended) - CC_HIGHEST="$CC_HIGHEST -xalias_level=basic" - # Use intrinsic or inline versions for math/std functions - # (If you expect perfect errno behavior, do not use this) - CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all" - # Loop data dependency optimizations (need -xO3 or higher) - CC_HIGHEST="$CC_HIGHEST -xdepend" - # Pointer parameters to functions do not overlap - # (Similar to -xalias_level=basic usage, but less obvious sometimes. - # If you pass in multiple pointers to the same data, do not use this) - CC_HIGHEST="$CC_HIGHEST -xrestrict" - # Inline some library routines - # (If you expect perfect errno behavior, do not use this) - CC_HIGHEST="$CC_HIGHEST -xlibmil" - # Use optimized math routines - # (If you expect perfect errno behavior, do not use this) - # Can cause undefined external on Solaris 8 X86 on __sincos, removing for now - #CC_HIGHEST="$CC_HIGHEST -xlibmopt" + # Extra options used with HIGHEST + # + # WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be + # done with care, there are some assumptions below that need to + # be understood about the use of pointers, and IEEE behavior. + # + # Use non-standard floating point mode (not IEEE 754) + CC_HIGHEST="$CC_HIGHEST -fns" + # Do some simplification of floating point arithmetic (not IEEE 754) + CC_HIGHEST="$CC_HIGHEST -fsimple" + # Use single precision floating point with 'float' + CC_HIGHEST="$CC_HIGHEST -fsingle" + # Assume memory references via basic pointer types do not alias + # (Source with excessing pointer casting and data access with mixed + # pointer types are not recommended) + CC_HIGHEST="$CC_HIGHEST -xalias_level=basic" + # Use intrinsic or inline versions for math/std functions + # (If you expect perfect errno behavior, do not use this) + CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all" + # Loop data dependency optimizations (need -xO3 or higher) + CC_HIGHEST="$CC_HIGHEST -xdepend" + # Pointer parameters to functions do not overlap + # (Similar to -xalias_level=basic usage, but less obvious sometimes. + # If you pass in multiple pointers to the same data, do not use this) + CC_HIGHEST="$CC_HIGHEST -xrestrict" + # Inline some library routines + # (If you expect perfect errno behavior, do not use this) + CC_HIGHEST="$CC_HIGHEST -xlibmil" + # Use optimized math routines + # (If you expect perfect errno behavior, do not use this) + # Can cause undefined external on Solaris 8 X86 on __sincos, removing for now + #CC_HIGHEST="$CC_HIGHEST -xlibmopt" - if test "x$OPENJDK_TARGET_CPU" = xsparc; then - CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" - CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s" - fi + if test "x$OPENJDK_TARGET_CPU" = xsparc; then + CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" + CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s" + fi - case $OPENJDK_TARGET_CPU_ARCH in - x86) - C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr" - C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr" - C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr" - C_O_FLAG_NONE="-xregs=no%frameptr" - CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr" - CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr" - CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr" - CXX_O_FLAG_NONE="-xregs=no%frameptr" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium" - CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium" - fi - ;; - sparc) - CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" - CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" - C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" - C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0" - C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0" - C_O_FLAG_NONE="" - CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" - CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" - CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" - CXX_O_FLAG_NONE="" - ;; - esac + case $OPENJDK_TARGET_CPU_ARCH in + x86) + C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr" + C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr" + C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr" + C_O_FLAG_NONE="-xregs=no%frameptr" + CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr" + CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr" + CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr" + CXX_O_FLAG_NONE="-xregs=no%frameptr" + if test "x$OPENJDK_TARGET_CPU" = xx86; then + C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium" + CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium" + fi + ;; + sparc) + CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" + CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" + C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" + C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0" + C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0" + C_O_FLAG_NONE="" + CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" + CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" + CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" + CXX_O_FLAG_NONE="" + ;; + esac - CFLAGS_DEBUG_SYMBOLS="-g -xs" - CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" - esac - ;; - CL ) - C_O_FLAG_HIGHEST="-O2" - C_O_FLAG_HI="-O1" - C_O_FLAG_NORM="-O1" - C_O_FLAG_NONE="-Od" - CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST" - CXX_O_FLAG_HI="$C_O_FLAG_HI" - CXX_O_FLAG_NORM="$C_O_FLAG_NORM" - CXX_O_FLAG_NONE="$C_O_FLAG_NONE" - ;; -esac + CFLAGS_DEBUG_SYMBOLS="-g -xs" + CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" + esac + ;; + CL ) + C_O_FLAG_HIGHEST="-O2" + C_O_FLAG_HI="-O1" + C_O_FLAG_NORM="-O1" + C_O_FLAG_NONE="-Od" + CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST" + CXX_O_FLAG_HI="$C_O_FLAG_HI" + CXX_O_FLAG_NORM="$C_O_FLAG_NORM" + CXX_O_FLAG_NONE="$C_O_FLAG_NONE" + ;; + esac -if test -z "$C_O_FLAG_HIGHEST"; then - C_O_FLAG_HIGHEST="$C_O_FLAG_HI" -fi + if test -z "$C_O_FLAG_HIGHEST"; then + C_O_FLAG_HIGHEST="$C_O_FLAG_HI" + fi -if test -z "$CXX_O_FLAG_HIGHEST"; then - CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HI" -fi + if test -z "$CXX_O_FLAG_HIGHEST"; then + CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HI" + fi -AC_SUBST(C_O_FLAG_HIGHEST) -AC_SUBST(C_O_FLAG_HI) -AC_SUBST(C_O_FLAG_NORM) -AC_SUBST(C_O_FLAG_NONE) -AC_SUBST(CXX_O_FLAG_HIGHEST) -AC_SUBST(CXX_O_FLAG_HI) -AC_SUBST(CXX_O_FLAG_NORM) -AC_SUBST(CXX_O_FLAG_NONE) -AC_SUBST(C_FLAG_DEPS) -AC_SUBST(CXX_FLAG_DEPS) + AC_SUBST(C_O_FLAG_HIGHEST) + AC_SUBST(C_O_FLAG_HI) + AC_SUBST(C_O_FLAG_NORM) + AC_SUBST(C_O_FLAG_NONE) + AC_SUBST(CXX_O_FLAG_HIGHEST) + AC_SUBST(CXX_O_FLAG_HI) + AC_SUBST(CXX_O_FLAG_NORM) + AC_SUBST(CXX_O_FLAG_NONE) + AC_SUBST(C_FLAG_DEPS) + AC_SUBST(CXX_FLAG_DEPS) ]) AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_JDK], [ -if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then - AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags]) -fi + if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then + AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags]) + fi -if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then - AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags]) -fi + if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then + AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags]) + fi -if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then - AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags]) -fi + if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then + AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags]) + fi -AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags], - [extra flags to be used when compiling jdk c-files])]) + AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags], + [extra flags to be used when compiling jdk c-files])]) -AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags], - [extra flags to be used when compiling jdk c++-files])]) + AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags], + [extra flags to be used when compiling jdk c++-files])]) -AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags], - [extra flags to be used when linking jdk])]) + AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags], + [extra flags to be used when linking jdk])]) -CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags" -CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags" -LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags" + CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags" + CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags" + LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags" -# Hotspot needs these set in their legacy form -LEGACY_EXTRA_CFLAGS=$with_extra_cflags -LEGACY_EXTRA_CXXFLAGS=$with_extra_cxxflags -LEGACY_EXTRA_LDFLAGS=$with_extra_ldflags + # Hotspot needs these set in their legacy form + LEGACY_EXTRA_CFLAGS=$with_extra_cflags + LEGACY_EXTRA_CXXFLAGS=$with_extra_cxxflags + LEGACY_EXTRA_LDFLAGS=$with_extra_ldflags -AC_SUBST(LEGACY_EXTRA_CFLAGS) -AC_SUBST(LEGACY_EXTRA_CXXFLAGS) -AC_SUBST(LEGACY_EXTRA_LDFLAGS) + AC_SUBST(LEGACY_EXTRA_CFLAGS) + AC_SUBST(LEGACY_EXTRA_CXXFLAGS) + AC_SUBST(LEGACY_EXTRA_LDFLAGS) -############################################################################### -# -# Now setup the CFLAGS and LDFLAGS for the JDK build. -# Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build. -# -case $COMPILER_NAME in - gcc ) - CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \ - -pipe \ - -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" - case $OPENJDK_TARGET_CPU_ARCH in - arm ) - # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - ppc ) - # on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing - ;; - * ) - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer" - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ############################################################################### + # + # Now setup the CFLAGS and LDFLAGS for the JDK build. + # Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build. + # + case $COMPILER_NAME in + gcc ) + CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \ + -pipe \ + -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" + case $OPENJDK_TARGET_CPU_ARCH in + arm ) + # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" ;; - esac + ppc ) + # on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing ;; - ossc ) - CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" - case $OPENJDK_TARGET_CPU_ARCH in - x86 ) - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB" - CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE" + * ) + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer" + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" ;; - esac - - CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" - CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib" - - LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext" - LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib" + esac + ;; + ossc ) + CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" + case $OPENJDK_TARGET_CPU_ARCH in + x86 ) + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB" + CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE" ;; - cl ) - CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ - -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \ - -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ - -DWIN32 -DIAL" - case $OPENJDK_TARGET_CPU in - x86 ) - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86" - ;; - x86_64 ) - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64" - ;; - esac + esac + + CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" + CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib" + + LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext" + LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib" + ;; + cl ) + CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ + -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \ + -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ + -DWIN32 -DIAL" + case $OPENJDK_TARGET_CPU in + x86 ) + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86" ;; -esac + x86_64 ) + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64" + ;; + esac + ;; + esac -############################################################################### + ############################################################################### -# Adjust flags according to debug level. -case $DEBUG_LEVEL in - fastdebug ) - CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS" - CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS" - C_O_FLAG_HI="$C_O_FLAG_NORM" - C_O_FLAG_NORM="$C_O_FLAG_NORM" - CXX_O_FLAG_HI="$CXX_O_FLAG_NORM" - CXX_O_FLAG_NORM="$CXX_O_FLAG_NORM" - JAVAC_FLAGS="$JAVAC_FLAGS -g" - ;; - slowdebug ) - CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS" - CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS" - C_O_FLAG_HI="$C_O_FLAG_NONE" - C_O_FLAG_NORM="$C_O_FLAG_NONE" - CXX_O_FLAG_HI="$CXX_O_FLAG_NONE" - CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE" - JAVAC_FLAGS="$JAVAC_FLAGS -g" - ;; -esac + # Adjust flags according to debug level. + case $DEBUG_LEVEL in + fastdebug ) + CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS" + CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS" + C_O_FLAG_HI="$C_O_FLAG_NORM" + C_O_FLAG_NORM="$C_O_FLAG_NORM" + CXX_O_FLAG_HI="$CXX_O_FLAG_NORM" + CXX_O_FLAG_NORM="$CXX_O_FLAG_NORM" + JAVAC_FLAGS="$JAVAC_FLAGS -g" + ;; + slowdebug ) + CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS" + CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS" + C_O_FLAG_HI="$C_O_FLAG_NONE" + C_O_FLAG_NORM="$C_O_FLAG_NONE" + CXX_O_FLAG_HI="$CXX_O_FLAG_NONE" + CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE" + JAVAC_FLAGS="$JAVAC_FLAGS -g" + ;; + esac -CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64" -# The package path is used only on macosx? -PACKAGE_PATH=/opt/local -AC_SUBST(PACKAGE_PATH) + # The package path is used only on macosx? + PACKAGE_PATH=/opt/local + AC_SUBST(PACKAGE_PATH) -if test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then + if test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the # Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN # (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h). # Note: -Dmacro is the same as #define macro 1 - # -Dmacro= is the same as #define macro + # -Dmacro= is the same as #define macro if test "x$OPENJDK_TARGET_OS" = xsolaris; then - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN=" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN=" else - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN" fi -else + else CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN" -fi -if test "x$OPENJDK_TARGET_OS" = xlinux; then + fi + if test "x$OPENJDK_TARGET_OS" = xlinux; then CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DLINUX" -fi -if test "x$OPENJDK_TARGET_OS" = xwindows; then + fi + if test "x$OPENJDK_TARGET_OS" = xwindows; then CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DWINDOWS" -fi -if test "x$OPENJDK_TARGET_OS" = xsolaris; then + fi + if test "x$OPENJDK_TARGET_OS" = xsolaris; then CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DSOLARIS" -fi -if test "x$OPENJDK_TARGET_OS" = xmacosx; then + fi + if test "x$OPENJDK_TARGET_OS" = xmacosx; then CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT" # Setting these parameters makes it an error to link to macosx APIs that are # newer than the given OS version and makes the linked binaries compatible even @@ -919,118 +922,118 @@ if test "x$OPENJDK_TARGET_OS" = xmacosx; then # command line. CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" -fi -if test "x$OPENJDK_TARGET_OS" = xbsd; then + fi + if test "x$OPENJDK_TARGET_OS" = xbsd; then CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DBSD -D_ALLBSD_SOURCE" -fi -if test "x$DEBUG_LEVEL" = xrelease; then + fi + if test "x$DEBUG_LEVEL" = xrelease; then CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG" - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED" - fi -else + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED" + fi + else CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG" -fi + fi -CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY" -CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'" -CCXXFLAGS_JDK="$CCXXFLAGS_JDK \ - -I${JDK_OUTPUTDIR}/include \ - -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \ - -I${JDK_TOPDIR}/src/share/javavm/export \ - -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/javavm/export \ - -I${JDK_TOPDIR}/src/share/native/common \ - -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK \ + -I${JDK_OUTPUTDIR}/include \ + -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \ + -I${JDK_TOPDIR}/src/share/javavm/export \ + -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_EXPORT_DIR/javavm/export \ + -I${JDK_TOPDIR}/src/share/native/common \ + -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common" -# The shared libraries are compiled using the picflag. -CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" -CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA " + # The shared libraries are compiled using the picflag. + CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" + CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA " -# Executable flags -CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK" -CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK" + # Executable flags + CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK" + CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK" -# Now this is odd. The JDK native libraries have to link against libjvm.so -# On 32-bit machines there is normally two distinct libjvm.so:s, client and server. -# Which should we link to? Are we lucky enough that the binary api to the libjvm.so library -# is identical for client and server? Yes. Which is picked at runtime (client or server)? -# Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following -# libraries will link to whatever is in memory. Yuck. -# -# Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh. -if test "x$COMPILER_NAME" = xcl; then + # Now this is odd. The JDK native libraries have to link against libjvm.so + # On 32-bit machines there is normally two distinct libjvm.so:s, client and server. + # Which should we link to? Are we lucky enough that the binary api to the libjvm.so library + # is identical for client and server? Yes. Which is picked at runtime (client or server)? + # Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following + # libraries will link to whatever is in memory. Yuck. + # + # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh. + if test "x$COMPILER_NAME" = xcl; then LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no" if test "x$OPENJDK_TARGET_CPU" = xx86; then - LDFLAGS_JDK="$LDFLAGS_JDK -safeseh" + LDFLAGS_JDK="$LDFLAGS_JDK -safeseh" fi # TODO: make -debug optional "--disable-full-debug-symbols" LDFLAGS_JDK="$LDFLAGS_JDK -debug" LDFLAGS_JDKLIB="${LDFLAGS_JDK} -dll -libpath:${JDK_OUTPUTDIR}/lib" LDFLAGS_JDKLIB_SUFFIX="" if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then - LDFLAGS_STACK_SIZE=1048576 + LDFLAGS_STACK_SIZE=1048576 else - LDFLAGS_STACK_SIZE=327680 + LDFLAGS_STACK_SIZE=327680 fi LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE" -else + else if test "x$COMPILER_NAME" = xgcc; then - # If this is a --hash-style=gnu system, use --hash-style=both, why? - HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` - if test -n "$HAS_GNU_HASH"; then - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both " - fi - if test "x$OPENJDK_TARGET_OS" = xlinux; then - # And since we now know that the linker is gnu, then add -z defs, to forbid - # undefined symbols in object files. - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs" - if test "x$DEBUG_LEVEL" = "xrelease"; then - # When building release libraries, tell the linker optimize them. - # Should this be supplied to the OSS linker as well? - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1" - fi + # If this is a --hash-style=gnu system, use --hash-style=both, why? + HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` + if test -n "$HAS_GNU_HASH"; then + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both " + fi + if test "x$OPENJDK_TARGET_OS" = xlinux; then + # And since we now know that the linker is gnu, then add -z defs, to forbid + # undefined symbols in object files. + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs" + if test "x$DEBUG_LEVEL" = "xrelease"; then + # When building release libraries, tell the linker optimize them. + # Should this be supplied to the OSS linker as well? + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1" fi + fi fi LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \ - -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}" + -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}" # 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. 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" + 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" + 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" + 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" + LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server" fi LDFLAGS_JDKLIB_SUFFIX="-ljava -ljvm" if test "x$COMPILER_NAME" = xossc; then - LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc" + LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc" fi LDFLAGS_JDKEXE="${LDFLAGS_JDK}" if test "x$OPENJDK_TARGET_OS" = xlinux; then - LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined" + LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined" fi -fi + fi -AC_SUBST(CFLAGS_JDKLIB) -AC_SUBST(CFLAGS_JDKEXE) + AC_SUBST(CFLAGS_JDKLIB) + AC_SUBST(CFLAGS_JDKEXE) -AC_SUBST(CXXFLAGS_JDKLIB) -AC_SUBST(CXXFLAGS_JDKEXE) + AC_SUBST(CXXFLAGS_JDKLIB) + AC_SUBST(CXXFLAGS_JDKEXE) -AC_SUBST(LDFLAGS_JDKLIB) -AC_SUBST(LDFLAGS_JDKEXE) -AC_SUBST(LDFLAGS_JDKLIB_SUFFIX) -AC_SUBST(LDFLAGS_JDKEXE_SUFFIX) -AC_SUBST(LDFLAGS_CXX_JDK) + AC_SUBST(LDFLAGS_JDKLIB) + AC_SUBST(LDFLAGS_JDKEXE) + AC_SUBST(LDFLAGS_JDKLIB_SUFFIX) + AC_SUBST(LDFLAGS_JDKEXE_SUFFIX) + AC_SUBST(LDFLAGS_CXX_JDK) ]) @@ -1046,18 +1049,16 @@ AC_DEFUN([TOOLCHAIN_COMPILER_CHECK_ARGUMENTS], saved_cflags="$CFLAGS" CFLAGS="$CFLAGS $1" AC_LANG_PUSH([C]) - AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([[int i;]]) - ], [], [supports=no]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], + [supports=no]) AC_LANG_POP([C]) CFLAGS="$saved_cflags" saved_cxxflags="$CXXFLAGS" CXXFLAGS="$CXXFLAG $1" AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([[int i;]]) - ], [], [supports=no]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], + [supports=no]) AC_LANG_POP([C++]) CXXFLAGS="$saved_cxxflags" @@ -1086,8 +1087,8 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_MISC], # Check that the compiler supports -mX flags # Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([-m${OPENJDK_TARGET_CPU_BITS}], - [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true], - [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false]) + [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true], + [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false]) AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG) ]) @@ -1095,9 +1096,9 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_MISC], AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], [ AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg], - [Regression Test Harness @<:@probed@:>@])], - [], - [with_jtreg=no]) + [Regression Test Harness @<:@probed@:>@])], + [], + [with_jtreg=no]) if test "x$with_jtreg" = xno; then # jtreg disabled diff --git a/common/autoconf/toolchain_windows.m4 b/common/autoconf/toolchain_windows.m4 index f97713f952f..37da5554066 100644 --- a/common/autoconf/toolchain_windows.m4 +++ b/common/autoconf/toolchain_windows.m4 @@ -75,7 +75,7 @@ AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE], VCVARSFILE="vc/bin/vcvars32.bat" else VCVARSFILE="vc/bin/amd64/vcvars64.bat" - fi + fi VS_ENV_CMD="" VS_ENV_ARGS="" @@ -89,7 +89,7 @@ AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE], AC_MSG_NOTICE([The path given by --with-tools-dir does not contain a valid Visual Studio installation]) AC_MSG_NOTICE([Please point to the VC/bin directory within the Visual Studio installation]) AC_MSG_ERROR([Cannot locate a valid Visual Studio installation]) - fi + fi if test "x$VS100COMNTOOLS" != x; then TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$VS100COMNTOOLS/../..], [VS100COMNTOOLS variable]) @@ -118,7 +118,7 @@ AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE], # the set env variables into the spec file. AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], [ - # Store path to cygwin link.exe to help excluding it when searching for + # Store path to cygwin link.exe to help excluding it when searching for # VS linker. This must be done before changing the PATH when looking for VS. AC_PATH_PROG(CYGWIN_LINK, link) if test "x$CYGWIN_LINK" != x; then @@ -187,7 +187,7 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], AC_MSG_ERROR([Cannot continue]) fi - # Now set all paths and other env variables. This will allow the rest of + # Now set all paths and other env variables. This will allow the rest of # the configure script to find and run the compiler in the proper way. AC_MSG_NOTICE([Setting extracted environment variables]) . $OUTPUT_ROOT/localdevenv.sh @@ -198,7 +198,7 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], # At this point, we should have corrent variables in the environment, or we can't continue. AC_MSG_CHECKING([for Visual Studio variables]) - + if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x || test "x$WINDOWSSDKDIR" != x; then if test "x$INCLUDE" = x || test "x$LIB" = x; then AC_MSG_RESULT([present but broken]) @@ -228,52 +228,113 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.]) AC_MSG_ERROR([Cannot continue]) fi - - AC_MSG_CHECKING([for msvcr100.dll]) +]) + +AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL], +[ + POSSIBLE_MSVCR_DLL="$1" + METHOD="$2" + if test -e "$POSSIBLE_MSVCR_DLL"; then + AC_MSG_NOTICE([Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD]) + + # Need to check if the found msvcr is correct architecture + AC_MSG_CHECKING([found msvcr100.dll architecture]) + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + AC_MSG_RESULT([ok]) + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + AC_MSG_CHECKING([for msvcr100.dll]) + AC_MSG_RESULT([$MSVCR_DLL]) + else + AC_MSG_RESULT([incorrect, ignoring]) + AC_MSG_NOTICE([The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE]) + fi + fi +]) + +AC_DEFUN([TOOLCHAIN_SETUP_MSVCR_DLL], +[ AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll], [copy this msvcr100.dll into the built JDK (Windows only) @<:@probed@:>@])]) + if test "x$with_msvcr_dll" != x; then - MSVCR_DLL="$with_msvcr_dll" - else - if test "x$VCINSTALLDIR" != x; then - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x64 | head --lines 1` - else - MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x86 | grep -v ia64 | grep -v x64 | head --lines 1` - if test "x$MSVCR_DLL" = x; then - MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | head --lines 1` - fi - fi - if test "x$MSVCR_DLL" != x; then - AC_MSG_NOTICE([msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR]) - else - AC_MSG_NOTICE([Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR]) - fi - fi - # Try some fallback alternatives + # If given explicitely by user, do not probe. If not present, fail directly. + TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$with_msvcr_dll], [--with-msvcr-dll]) if test "x$MSVCR_DLL" = x; then - # If visual studio express is installed, there is usually one with the debugger - if test "x$VS100COMNTOOLS" != x; then - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - MSVCR_DLL=`find "$VS100COMNTOOLS/.." -name msvcr100.dll | grep -i x64 | head --lines 1` - AC_MSG_NOTICE([msvcr100.dll found in $VS100COMNTOOLS..: $VS100COMNTOOLS..]) - fi - fi - fi - if test "x$MSVCR_DLL" = x; then - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - # Fallback for 32bit builds, look in the windows directory. - if test -f "$SYSTEMROOT/system32/msvcr100.dll"; then - AC_MSG_NOTICE([msvcr100.dll found in $SYSTEMROOT/system32]) - MSVCR_DLL="$SYSTEMROOT/system32/msvcr100.dll" - fi - fi + AC_MSG_ERROR([Could not find a proper msvcr100.dll as specified by --with-msvcr-dll]) fi fi + if test "x$MSVCR_DLL" = x; then - AC_MSG_RESULT([no]) - AC_MSG_ERROR([Could not find msvcr100.dll !]) + # Probe: Using well-known location from Visual Studio 10.0 + if test "x$VCINSTALLDIR" != x; then + CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR" + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VC_INSTALL_DIR) + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC100.CRT/msvcr100.dll" + else + POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC100.CRT/msvcr100.dll" + fi + TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in VCINSTALLDIR]) + fi fi - AC_MSG_RESULT([$MSVCR_DLL]) + + if test "x$MSVCR_DLL" = x; then + # Probe: Check in the Boot JDK directory. + POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll" + TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in Boot JDK]) + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: Look in the Windows system32 directory + CYGWIN_SYSTEMROOT="$SYSTEMROOT" + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_SYSTEMROOT) + POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll" + TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in SYSTEMROOT]) + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: If Visual Studio Express is installed, there is usually one with the debugger + if test "x$VS100COMNTOOLS" != x; then + CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.." + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VS_TOOLS_DIR) + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x64/ | $HEAD --lines 1` + else + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x86/ | $HEAD --lines 1` + fi + TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VS100COMNTOOLS]) + fi + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now. + # (This was the original behaviour; kept since it might turn up something) + if test "x$CYGWIN_VC_INSTALL_DIR" != x; then + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x64 | $HEAD --lines 1` + else + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1` + if test "x$POSSIBLE_MSVCR_DLL" = x; then + # We're grasping at straws now... + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1` + fi + fi + + TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VCINSTALLDIR]) + fi + fi + + if test "x$MSVCR_DLL" = x; then + AC_MSG_CHECKING([for msvcr100.dll]) + AC_MSG_RESULT([no]) + AC_MSG_ERROR([Could not find msvcr100.dll. Please specify using --with-msvcr-dll.]) + fi + BASIC_FIXUP_PATH(MSVCR_DLL) ]) diff --git a/common/bin/compare.sh b/common/bin/compare.sh index aacdc718b6f..732c6757fc7 100644 --- a/common/bin/compare.sh +++ b/common/bin/compare.sh @@ -76,13 +76,13 @@ diff_text() { TMP=1 if [[ "$THIS_FILE" = *"META-INF/MANIFEST.MF" ]]; then - TMP=$(LANG=C $DIFF $OTHER_FILE $THIS_FILE | \ + TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \ $GREP '^[<>]' | \ $SED -e '/[<>] Ant-Version: Apache Ant .*/d' \ -e '/[<>] Created-By: .* (Oracle Corporation).*/d') fi if test "x$SUFFIX" = "xjava"; then - TMP=$(LANG=C $DIFF $OTHER_FILE $THIS_FILE | \ + TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \ $GREP '^[<>]' | \ $SED -e '/[<>] \* from.*\.idl/d' \ -e '/[<>] \*.*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \ @@ -121,8 +121,8 @@ diff_text() { # | $SED -e '/^#/d' -e '/^$/d' \ # -e :a -e '/\\$/N; s/\\\n//; ta' \ # -e 's/^[ \t]*//;s/[ \t]*$//' \ -# -e 's/\\=/=/' | LANG=C $SORT > $OTHER_FILE.cleaned - TMP=$(LANG=C $DIFF $OTHER_FILE.cleaned $THIS_FILE) +# -e 's/\\=/=/' | LC_ALL=C $SORT > $OTHER_FILE.cleaned + TMP=$(LC_ALL=C $DIFF $OTHER_FILE.cleaned $THIS_FILE) fi if test -n "$TMP"; then echo Files $OTHER_FILE and $THIS_FILE differ @@ -410,11 +410,11 @@ compare_zip_file() { CONTENTS_DIFF_FILE=$WORK_DIR/$ZIP_FILE.diff # On solaris, there is no -q option. if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then - LANG=C $DIFF -r $OTHER_UNZIPDIR $THIS_UNZIPDIR \ + LC_ALL=C $DIFF -r $OTHER_UNZIPDIR $THIS_UNZIPDIR \ | $GREP -v -e "^<" -e "^>" -e "^Common subdirectories:" \ > $CONTENTS_DIFF_FILE else - LANG=C $DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE + LC_ALL=C $DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE fi ONLY_OTHER=$($GREP "^Only in $OTHER_UNZIPDIR" $CONTENTS_DIFF_FILE) @@ -459,11 +459,11 @@ compare_zip_file() { if [ -n "$SHOW_DIFFS" ]; then for i in $(cat $WORK_DIR/$ZIP_FILE.difflist) ; do if [ -f "${OTHER_UNZIPDIR}/$i.javap" ]; then - LANG=C $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap + LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap elif [ -f "${OTHER_UNZIPDIR}/$i.cleaned" ]; then - LANG=C $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i + LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i else - LANG=C $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i + LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i fi done fi @@ -703,7 +703,7 @@ compare_bin_file() { $NM -a $ORIG_THIS_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this fi - LANG=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff + LC_ALL=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff if [ -s $WORK_FILE_BASE.symbols.diff ]; then SYM_MSG=" diff " if [[ "$ACCEPTED_SYM_DIFF" != *"$BIN_FILE"* ]]; then @@ -732,8 +732,8 @@ compare_bin_file() { (cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME 2 $WORK_FILE_BASE.deps.this.uniq) (cd $FILE_WORK_DIR && $RM -f $NAME) - LANG=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this > $WORK_FILE_BASE.deps.diff - LANG=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq > $WORK_FILE_BASE.deps.diff.uniq + LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this > $WORK_FILE_BASE.deps.diff + LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq > $WORK_FILE_BASE.deps.diff.uniq if [ -s $WORK_FILE_BASE.deps.diff ]; then if [ -s $WORK_FILE_BASE.deps.diff.uniq ]; then @@ -768,7 +768,7 @@ compare_bin_file() { if [ -n "$FULLDUMP_CMD" ] && [ -z "$SKIP_FULLDUMP_DIFF" ]; then $FULLDUMP_CMD $OTHER_FILE > $WORK_FILE_BASE.fulldump.other 2>&1 $FULLDUMP_CMD $THIS_FILE > $WORK_FILE_BASE.fulldump.this 2>&1 - LANG=C $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this > $WORK_FILE_BASE.fulldump.diff + LC_ALL=C $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this > $WORK_FILE_BASE.fulldump.diff if [ -s $WORK_FILE_BASE.fulldump.diff ]; then ELF_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.fulldump.diff | awk '{print $5}') @@ -802,7 +802,7 @@ compare_bin_file() { $DIS_CMD $OTHER_FILE | $GREP -v $NAME | $DIS_DIFF_FILTER > $WORK_FILE_BASE.dis.other 2>&1 $DIS_CMD $THIS_FILE | $GREP -v $NAME | $DIS_DIFF_FILTER > $WORK_FILE_BASE.dis.this 2>&1 - LANG=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff + LC_ALL=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff if [ -s $WORK_FILE_BASE.dis.diff ]; then DIS_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.dis.diff | awk '{print $5}') diff --git a/common/bin/hgforest.sh b/common/bin/hgforest.sh index 1dc50390b42..2282c3239ca 100644 --- a/common/bin/hgforest.sh +++ b/common/bin/hgforest.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,37 +27,11 @@ 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 2> /dev/null | grep -v '^no hg in'`" - -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- | sed -e 's/^[ \t]*//;s/[ \t]*$//'`" - bpython="`basename "$python"`" -fi - -if [ -x "$python" -a ! -d "$python" -a "`${python} -V 2>&1 | cut -f 1 -d ' '`" = "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} @@ -171,7 +145,7 @@ for i in ${repos} ${repos_extra} ; do ( if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`" - echo ${hg} clone ${pull_newrepo} ${i} + echo hg clone ${pull_newrepo} ${i} path="`dirname ${i}`" if [ "${path}" != "." ] ; then times=0 @@ -184,10 +158,10 @@ for i in ${repos} ${repos_extra} ; do sleep 5 done fi - (${hg} clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc )& + (PYTHONUNBUFFERED=true hg clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc )& else - echo "cd ${i} && ${hg} $*" - cd ${i} && (${hg} "$@"; echo "$?" > ${tmp}/${repopidfile}.pid.rc )& + echo "cd ${i} && hg $*" + cd ${i} && (PYTHONUNBUFFERED=true hg "$@"; echo "$?" > ${tmp}/${repopidfile}.pid.rc )& fi echo $! > ${tmp}/${repopidfile}.pid ) 2>&1 | sed -e "s@^@${reponame}: @") & diff --git a/common/makefiles/HotspotWrapper.gmk b/common/makefiles/HotspotWrapper.gmk index 8a1ae6447e6..51437dfb17b 100644 --- a/common/makefiles/HotspotWrapper.gmk +++ b/common/makefiles/HotspotWrapper.gmk @@ -36,7 +36,7 @@ include MakeBase.gmk default: all # Get all files except .hg in the hotspot directory. -HOTSPOT_FILES := $(shell $(FIND) -L $(HOTSPOT_TOPDIR) -name ".hg" -prune -o -print) +HOTSPOT_FILES := $(shell $(FIND) -L $(HOTSPOT_TOPDIR) -name ".hg" -prune -o -print) # The old build creates hotspot output dir before calling hotspot and # not doing it breaks builds on msys. diff --git a/common/makefiles/IdlCompilation.gmk b/common/makefiles/IdlCompilation.gmk index 94cc15476ad..d816f23e613 100644 --- a/common/makefiles/IdlCompilation.gmk +++ b/common/makefiles/IdlCompilation.gmk @@ -23,52 +23,52 @@ # questions. # -PREFIXES=-pkgPrefix CORBA org.omg \ - -pkgPrefix CosNaming org.omg \ - -pkgPrefix CosTransactions org.omg \ - -pkgPrefix CosTSInteroperation org.omg \ - -pkgPrefix DynamicAny org.omg \ - -pkgPrefix Dynamic org.omg \ - -pkgPrefix IOP org.omg \ - -pkgPrefix Messaging org.omg \ - -pkgPrefix PortableInterceptor org.omg \ - -pkgPrefix PortableServer org.omg \ - -pkgPrefix activation com.sun.corba.se.spi \ - -pkgPrefix GIOP com.sun.corba.se \ - -pkgPrefix PortableActivationIDL com.sun.corba.se \ - -pkgPrefix messages com.sun.corba.se +PREFIXES=-pkgPrefix CORBA org.omg \ + -pkgPrefix CosNaming org.omg \ + -pkgPrefix CosTransactions org.omg \ + -pkgPrefix CosTSInteroperation org.omg \ + -pkgPrefix DynamicAny org.omg \ + -pkgPrefix Dynamic org.omg \ + -pkgPrefix IOP org.omg \ + -pkgPrefix Messaging org.omg \ + -pkgPrefix PortableInterceptor org.omg \ + -pkgPrefix PortableServer org.omg \ + -pkgPrefix activation com.sun.corba.se.spi \ + -pkgPrefix GIOP com.sun.corba.se \ + -pkgPrefix PortableActivationIDL com.sun.corba.se \ + -pkgPrefix messages com.sun.corba.se define add_idl_package - # param 1 = MYPACKAGE - # param 2 = src root - # param 3 = gensrc root - # param 4 = source idl to compile - # param 5 = target idl package - # param 6 = delete these files that were output from the idlj - # param 7 = idls that match these patterns should be compiled with -oldImplBase - # param 8 = the idlj command - # Save the generated java files to a temporary directory so - # that we can find them and create proper dependencies. - # After that, we move them to the real gensrc target dir. - $4_TMPDIR:=tmp___$(subst /,_,$(patsubst $2/%,%,$4))___ - ifneq ($$(filter $7,$4),) - $4_OLDIMPLBASE:=-oldImplBase - $4_OLDIMPLBASE_MSG:=with -oldImplBase - endif - $5 : $4 + # param 1 = MYPACKAGE + # param 2 = src root + # param 3 = gensrc root + # param 4 = source idl to compile + # param 5 = target idl package + # param 6 = delete these files that were output from the idlj + # param 7 = idls that match these patterns should be compiled with -oldImplBase + # param 8 = the idlj command + # Save the generated java files to a temporary directory so + # that we can find them and create proper dependencies. + # After that, we move them to the real gensrc target dir. + $4_TMPDIR:=tmp___$(subst /,_,$(patsubst $2/%,%,$4))___ + ifneq ($$(filter $7,$4),) + $4_OLDIMPLBASE:=-oldImplBase + $4_OLDIMPLBASE_MSG:=with -oldImplBase + endif + $5 : $4 $(MKDIR) -p $3/$$($4_TMPDIR) $(RM) -rf $3/$$($4_TMPDIR) $(MKDIR) -p $(dir $5) - $(ECHO) $(LOG_INFO) Compiling IDL $(patsubst $2/%,%,$4) + $(ECHO) $(LOG_INFO) Compiling IDL $(patsubst $2/%,%,$4) $8 -td $3/$$($4_TMPDIR) \ - -i $2/org/omg/CORBA \ - -i $2/org/omg/PortableInterceptor \ - -i $2/org/omg/PortableServer \ - -D CORBA3 -corba 3.0 \ - -fall \ - $$($4_OLDIMPLBASE) \ - $(PREFIXES) \ - $4 + -i $2/org/omg/CORBA \ + -i $2/org/omg/PortableInterceptor \ + -i $2/org/omg/PortableServer \ + -D CORBA3 -corba 3.0 \ + -fall \ + $$($4_OLDIMPLBASE) \ + $(PREFIXES) \ + $4 $(RM) -f $$(addprefix $3/$$($4_TMPDIR)/,$6) $(CP) -r $3/$$($4_TMPDIR)/* $3 ($(CD) $3/$$($4_TMPDIR) && $(FIND) . -type f | $(SED) 's!\./!$3/!g' | $(NAWK) '{ print $$$$1 ": $4" }' > $5) @@ -76,31 +76,31 @@ define add_idl_package endef define SetupIdlCompilation -# param 1 is for example BUILD_IDLS -# param 2,3,4,5,6,7,8 are named args. -# IDLJ,SRC,BIN,INCLUDES,EXCLUDES,OLDIMPLBASES,DELETES -$(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) -$(call LogSetupMacroEntry,SetupIdlCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) -$(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk)) + # param 1 is for example BUILD_IDLS + # param 2,3,4,5,6,7,8 are named args. + # IDLJ,SRC,BIN,INCLUDES,EXCLUDES,OLDIMPLBASES,DELETES + $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) + $(call LogSetupMacroEntry,SetupIdlCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) + $(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk)) -# Find all existing java files and existing class files. -$$(eval $$(call MakeDir,$$($1_BIN))) -$1_SRCS := $$(shell find $$($1_SRC) -name "*.idl") -$1_BINS := $$(shell find $$($1_BIN) -name "*.java") -# Prepend the source/bin path to the filter expressions. -$1_SRC_INCLUDES := $$(addprefix $$($1_SRC)/,$$($1_INCLUDES)) -$1_SRC_EXCLUDES := $$(addprefix $$($1_SRC)/,$$($1_EXCLUDES)) -$1_BIN_INCLUDES := $$(addprefix $$($1_BIN)/,$$($1_INCLUDES)) -$1_BIN_EXCLUDES := $$(addprefix $$($1_BIN)/,$$($1_EXCLUDES)) -$1_OLDIMPLBASES := $$(addprefix $$($1_SRC)/,$$($1_OLDIMPLBASES)) -# Now remove unwanted java/class files. -$1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS)) -$1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) -$1_BINS := $$(filter $$($1_BIN_INCLUDES),$$($1_BINS)) -$1_BINS := $$(filter-out $$($1_BIN_EXCLUDES),$$($1_BINS)) -$1 := $$(sort $$(patsubst $$($1_SRC)/%.idl,$$($1_BIN)/%.idl.d,$$($1_SRCS))) -# Now create the dependencies for each idl target. -$$(foreach p,$$($1),$$(eval $$(call add_idl_package,$1,$$($1_SRC),$$($1_BIN),$$(patsubst $$($1_BIN)/%.idl.d,$$($1_SRC)/%.idl,$$p),$$p,$$($1_DELETES),$$($1_OLDIMPLBASES),$$($1_IDLJ)))) + # Find all existing java files and existing class files. + $$(eval $$(call MakeDir,$$($1_BIN))) + $1_SRCS := $$(shell find $$($1_SRC) -name "*.idl") + $1_BINS := $$(shell find $$($1_BIN) -name "*.java") + # Prepend the source/bin path to the filter expressions. + $1_SRC_INCLUDES := $$(addprefix $$($1_SRC)/,$$($1_INCLUDES)) + $1_SRC_EXCLUDES := $$(addprefix $$($1_SRC)/,$$($1_EXCLUDES)) + $1_BIN_INCLUDES := $$(addprefix $$($1_BIN)/,$$($1_INCLUDES)) + $1_BIN_EXCLUDES := $$(addprefix $$($1_BIN)/,$$($1_EXCLUDES)) + $1_OLDIMPLBASES := $$(addprefix $$($1_SRC)/,$$($1_OLDIMPLBASES)) + # Now remove unwanted java/class files. + $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS)) + $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) + $1_BINS := $$(filter $$($1_BIN_INCLUDES),$$($1_BINS)) + $1_BINS := $$(filter-out $$($1_BIN_EXCLUDES),$$($1_BINS)) + $1 := $$(sort $$(patsubst $$($1_SRC)/%.idl,$$($1_BIN)/%.idl.d,$$($1_SRCS))) + # Now create the dependencies for each idl target. + $$(foreach p,$$($1),$$(eval $$(call add_idl_package,$1,$$($1_SRC),$$($1_BIN),$$(patsubst $$($1_BIN)/%.idl.d,$$($1_SRC)/%.idl,$$p),$$p,$$($1_DELETES),$$($1_OLDIMPLBASES),$$($1_IDLJ)))) endef .SUFFIXES: .java .class .package diff --git a/common/makefiles/JavaCompilation.gmk b/common/makefiles/JavaCompilation.gmk index 50b05865f00..065bbbc34b0 100644 --- a/common/makefiles/JavaCompilation.gmk +++ b/common/makefiles/JavaCompilation.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -35,288 +35,292 @@ # of removing duplicates. It is actually this side effect that is # desired whenever sort is used below! -ifeq (,$(_MAKEBASE_GMK)) - $(error You must include MakeBase.gmk prior to including JavaCompilation.gmk) +ifeq (,$(_MAKEBASE_GMK)) + $(error You must include MakeBase.gmk prior to including JavaCompilation.gmk) endif FALSE_FIND_PATTERN:=-name FILE_NAME_THAT_DOESNT_EXIST define SetupJavaCompiler - # param 1 is for example GENERATE_OLD_BYTECODE or GENERATE_NEW_JDKBYTECODE - # This is the name of the compiler setup. - # param 2-9 are named args. - # JVM:=The jvm used to run the javac/javah command - # JAVAC:=The javac jar and bootstrap classpath changes, or just bin/javac if JVM is left out - # FLAGS:=Flags to be supplied to javac - # SERVER_DIR:=Use a javac server (-XDserver) and store the server related files here - # SERVER_JVM:=Use this JVM for the server. Defaults to the JVM above. - $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) - $(call LogSetupMacroEntry,SetupJavaCompiler($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) - $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk)) + # param 1 is for example GENERATE_OLD_BYTECODE or GENERATE_NEW_JDKBYTECODE + # This is the name of the compiler setup. + # param 2-9 are named args. + # JVM:=The jvm used to run the javac/javah command + # JAVAC:=The javac jar and bootstrap classpath changes, or just bin/javac if JVM is left out + # FLAGS:=Flags to be supplied to javac + # SERVER_DIR:=Use a javac server (-XDserver) and store the server related files here + # SERVER_JVM:=Use this JVM for the server. Defaults to the JVM above. + $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) + $(call LogSetupMacroEntry,SetupJavaCompiler($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) + $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk)) - # The port file contains the tcp/ip on which the server listens - # and the cookie necessary to talk to the server. - $1_SJAVAC_PORTFILE:=$$($1_SERVER_DIR)/server.port - # You can use a different JVM to run the background javac server. - ifeq ($$($1_SERVER_JVM),) - # It defaults to the same JVM that is used to start the javac command. - $1_SERVER_JVM:=$$($1_JVM) - endif + # The port file contains the tcp/ip on which the server listens + # and the cookie necessary to talk to the server. + $1_SJAVAC_PORTFILE:=$$($1_SERVER_DIR)/server.port + # You can use a different JVM to run the background javac server. + ifeq ($$($1_SERVER_JVM),) + # It defaults to the same JVM that is used to start the javac command. + $1_SERVER_JVM:=$$($1_JVM) + endif endef define SetupArchive - # param 1 is for example ARCHIVE_MYPACKAGE - # param 2 are the dependecies - # param 3,4,5,6,7,8,9 are named args. - # SRCS:=List of directories in where to find files to add to archive - # SUFFIXES:=File suffixes to include in jar - # INCLUDES:=List of directories/packages in SRCS that should be included - # EXCLUDES:=List of directories/packages in SRCS that should be excluded - # EXCLUDE_FILES:=List of files in SRCS that should be excluded - # EXTRA_FILES:=List of files in SRCS that should be included regardless of suffix match. - # JAR:=Jar file to create - # MANIFEST:=Optional manifest file template. - # JARMAIN:=Optional main class to add to manifest - # JARINDEX:=true means generate the index in the jar file. - # SKIP_METAINF:=Set to prevent contents of an META-INF directory to be automatically - # added to the archive. - # EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest. - # CHECK_COMPRESS_JAR Check the COMPRESS_JAR variable + # param 1 is for example ARCHIVE_MYPACKAGE + # param 2 are the dependecies + # param 3,4,5,6,7,8,9 are named args. + # SRCS:=List of directories in where to find files to add to archive + # SUFFIXES:=File suffixes to include in jar + # INCLUDES:=List of directories/packages in SRCS that should be included + # EXCLUDES:=List of directories/packages in SRCS that should be excluded + # EXCLUDE_FILES:=List of files in SRCS that should be excluded + # EXTRA_FILES:=List of files in SRCS that should be included regardless of suffix match. + # JAR:=Jar file to create + # MANIFEST:=Optional manifest file template. + # JARMAIN:=Optional main class to add to manifest + # JARINDEX:=true means generate the index in the jar file. + # SKIP_METAINF:=Set to prevent contents of an META-INF directory to be automatically + # added to the archive. + # EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest. + # CHECK_COMPRESS_JAR Check the COMPRESS_JAR variable - # NOTE: $2 is dependencies, not a named argument! - $(foreach i,3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) - $(call LogSetupMacroEntry,SetupArchive($1),,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) - $(if $(findstring $(LOG_LEVEL),debug trace), $(info *[2] = $(strip $2))) - $(if $(16),$(error Internal makefile error: Too many arguments to SetupArchive, please update JavaCompilation.gmk)) + # NOTE: $2 is dependencies, not a named argument! + $(foreach i,3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) + $(call LogSetupMacroEntry,SetupArchive($1),,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) + $(if $(findstring $(LOG_LEVEL),trace), $(info *[2] = $(strip $2))) + $(if $(16),$(error Internal makefile error: Too many arguments to SetupArchive, please update JavaCompilation.gmk)) - $1_JARMAIN:=$(strip $$($1_JARMAIN)) - $1_JARNAME:=$$(notdir $$($1_JAR)) - $1_MANIFEST_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_manifest - $1_DELETESS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletess - $1_DELETES_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletes - $1_BIN:=$$(dir $$($1_JAR)) + $1_JARMAIN:=$(strip $$($1_JARMAIN)) + $1_JARNAME:=$$(notdir $$($1_JAR)) + $1_MANIFEST_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_manifest + $1_DELETESS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletess + $1_DELETES_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletes + $1_BIN:=$$(dir $$($1_JAR)) - ifeq (,$$($1_SUFFIXES)) - # No suffix was set, default to classes. - $1_SUFFIXES:=.class - endif - # Convert suffixes to a find expression - $1_FIND_PATTERNS:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_SUFFIXES)) - # On windows, a lot of includes/excludes risk making the command line too long, so - # writing the grep patterns to files. - ifneq (,$$($1_INCLUDES)) - $1_GREP_INCLUDE_PATTERNS:=$$(foreach src,$$($1_SRCS),\ - $$(addprefix $$(src)/,$$($1_INCLUDES))) - # If there are a lot of include patterns, output to file to shorten command lines - ifeq ($$(word 20,$$($1_GREP_INCLUDE_PATTERNS)),) - $1_GREP_INCLUDES:=| $(GREP) $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_INCLUDE_PATTERNS)) - else - $1_GREP_INCLUDE_OUTPUT:=$(RM) $$($1_BIN)/_the.$$($1_JARNAME)_include && \ - $$(strip $$(call ListPathsSafely,$1_GREP_INCLUDE_PATTERNS,\n, \ - >> $$($1_BIN)/_the.$$($1_JARNAME)_include)) - $1_GREP_INCLUDES:=| $(GREP) -f $$($1_BIN)/_the.$$($1_JARNAME)_include - endif - endif - ifneq (,$$($1_EXCLUDES)$$($1_EXCLUDE_FILES)) - $1_GREP_EXCLUDE_PATTERNS:=$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/,\ - $$($1_EXCLUDES) $$($1_EXCLUDE_FILES))) - # If there are a lot of include patterns, output to file to shorten command lines - ifeq ($$(word 20,$$($1_GREP_EXCLUDE_PATTERNS)),) - $1_GREP_EXCLUDES:=| $(GREP) -v $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_EXCLUDE_PATTERNS)) - else - $1_GREP_EXCLUDE_OUTPUT=$(RM) $$($1_BIN)/_the.$$($1_JARNAME)_exclude && \ - $$(strip $$(call ListPathsSafely,$1_GREP_EXCLUDE_PATTERNS,\n, \ - >> $$($1_BIN)/_the.$$($1_JARNAME)_exclude)) - $1_GREP_EXCLUDES:=| $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude - endif - endif - - # Check if this jar needs to have its index generated. - ifneq (,$$($1_JARINDEX)) - $1_JARINDEX = (cd $$(dir $$@) && $(JAR) -i $$(notdir $$@)) + ifeq (,$$($1_SUFFIXES)) + # No suffix was set, default to classes. + $1_SUFFIXES:=.class + endif + # Convert suffixes to a find expression + $1_FIND_PATTERNS:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_SUFFIXES)) + # On windows, a lot of includes/excludes risk making the command line too long, so + # writing the grep patterns to files. + ifneq (,$$($1_INCLUDES)) + $1_GREP_INCLUDE_PATTERNS:=$$(foreach src,$$($1_SRCS), \ + $$(addprefix $$(src)/,$$($1_INCLUDES))) + # If there are a lot of include patterns, output to file to shorten command lines + ifeq ($$(word 20,$$($1_GREP_INCLUDE_PATTERNS)),) + $1_GREP_INCLUDES:=| $(GREP) $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_INCLUDE_PATTERNS)) else - $1_JARINDEX = true + $1_GREP_INCLUDE_OUTPUT:=$(RM) $$($1_BIN)/_the.$$($1_JARNAME)_include $$(NEWLINE) \ + $$(call ListPathsSafely,$1_GREP_INCLUDE_PATTERNS,\n, \ + >> $$($1_BIN)/_the.$$($1_JARNAME)_include) + $1_GREP_INCLUDES:=| $(GREP) -f $$($1_BIN)/_the.$$($1_JARNAME)_include endif - # When this macro is run in the same makefile as the java compilation, dependencies are - # transfered in make variables. When the macro is run in a different makefile than the - # java compilation, the dependencies need to be found in the filesystem. - ifneq (,$2) - $1_DEPS:=$2 + endif + ifneq (,$$($1_EXCLUDES)$$($1_EXCLUDE_FILES)) + $1_GREP_EXCLUDE_PATTERNS:=$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/, \ + $$($1_EXCLUDES) $$($1_EXCLUDE_FILES))) + # If there are a lot of include patterns, output to file to shorten command lines + ifeq ($$(word 20,$$($1_GREP_EXCLUDE_PATTERNS)),) + $1_GREP_EXCLUDES:=| $(GREP) -v $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_EXCLUDE_PATTERNS)) else - $1_DEPS:=$$(filter $$(addprefix %,$$($1_SUFFIXES)),\ - $$(call CacheFind,$$($1_SRCS))) - ifneq (,$$($1_GREP_INCLUDE_PATTERNS)) - $1_DEPS:=$$(filter $$(addsuffix %,$$($1_GREP_INCLUDE_PATTERNS)),$$($1_DEPS)) - endif - ifneq (,$$($1_GREP_EXCLUDE_PATTERNS)) - $1_DEPS:=$$(filter-out $$(addsuffix %,$$($1_GREP_EXCLUDE_PATTERNS)),$$($1_DEPS)) - endif - # The subst of \ is needed because $ has to be escaped with \ in EXTRA_FILES for the command - # lines, but not here for use in make dependencies. - $1_DEPS+=$$(subst \,,$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/,$$($1_EXTRA_FILES)))) - ifeq (,$$($1_SKIP_METAINF)) - $1_DEPS+=$$(call CacheFind,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS)))) - endif + $1_GREP_EXCLUDE_OUTPUT=$(RM) $$($1_BIN)/_the.$$($1_JARNAME)_exclude $$(NEWLINE) \ + $$(call ListPathsSafely,$1_GREP_EXCLUDE_PATTERNS,\n, \ + >> $$($1_BIN)/_the.$$($1_JARNAME)_exclude) + $1_GREP_EXCLUDES:=| $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude endif + endif - # Utility macros, to make the shell script receipt somewhat easier to dechipher. - - # The capture contents macro finds all files (matching the patterns, typically - # .class and .prp) that are newer than the jar-file, ie the new content to be put into the jar. - $1_CAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS),\ - (($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) -a -newer $$@ $$($1_GREP_INCLUDES) \ - $$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/||g' &&\ - $(ECHO) $$(subst $$(src)/,,$$($1_EXTRA_FILES))) > \ - $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) - # The capture metainf macro finds all files below the META-INF directory that are newer than the jar-file. + # Check if this jar needs to have its index generated. + ifneq (,$$($1_JARINDEX)) + $1_JARINDEX = (cd $$(dir $$@) && $(JAR) -i $$(notdir $$@)) + else + $1_JARINDEX = true + endif + # When this macro is run in the same makefile as the java compilation, dependencies are + # transfered in make variables. When the macro is run in a different makefile than the + # java compilation, the dependencies need to be found in the filesystem. + ifneq (,$2) + $1_DEPS:=$2 + else + $1_DEPS:=$$(filter $$(addprefix %,$$($1_SUFFIXES)), \ + $$(call CacheFind,$$($1_SRCS))) + ifneq (,$$($1_GREP_INCLUDE_PATTERNS)) + $1_DEPS:=$$(filter $$(addsuffix %,$$($1_GREP_INCLUDE_PATTERNS)),$$($1_DEPS)) + endif + ifneq (,$$($1_GREP_EXCLUDE_PATTERNS)) + $1_DEPS:=$$(filter-out $$(addsuffix %,$$($1_GREP_EXCLUDE_PATTERNS)),$$($1_DEPS)) + endif + # The subst of \ is needed because $ has to be escaped with \ in EXTRA_FILES for the command + # lines, but not here for use in make dependencies. + $1_DEPS+=$$(subst \,,$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/,$$($1_EXTRA_FILES)))) ifeq (,$$($1_SKIP_METAINF)) - $1_CAPTURE_METAINF =$$(foreach src,$$($1_SRCS),($(FIND) $$(src)/META-INF -type f -a -newer $$@ 2> /dev/null | $(SED) 's|$$(src)/||g' >> $$(src)/_the.$$($1_JARNAME)_contents ) $$(NEWLINE)) + $1_DEPS+=$$(call CacheFind,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS)))) endif - # The capture deletes macro finds all deleted files and concatenates them. The resulting file - # tells us what to remove from the jar-file. - $1_CAPTURE_DELETES=$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.deleted -newer $$@ -exec $(SED) 's|$$(src)||g' \{\} >> $$($1_DELETES_FILE) \;) $$(NEWLINE)) - # The update contents macro updates the jar file with the previously capture contents. - # xargs is used to trim the whitespace from the contents file, to see if it is empty. - $1_UPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\ - (cd $$(src) && \ - if [ -n "`$(CAT) _the.$$($1_JARNAME)_contents | $(XARGS)`" ]; then \ - $(ECHO) " updating" `$(WC) -l _the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \ - $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @_the.$$($1_JARNAME)_contents; \ - fi) $$(NEWLINE)) - # The s-variants of the above macros are used when the jar is created from scratch. - $1_SCAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS),\ - (($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \ - $$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/||g' &&\ - $$(subst $$(src)/,,$(ECHO) $$($1_EXTRA_FILES))) > \ - $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) + endif - ifeq (,$$($1_SKIP_METAINF)) - $1_SCAPTURE_METAINF=$$(foreach src,$$($1_SRCS),\ - ($(FIND) $$(src)/META-INF -type f 2> /dev/null | $(SED) 's|$$(src)/||g' >> \ - $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) + # Utility macros, to make the shell script receipt somewhat easier to decipher. + + # The capture contents macro finds all files (matching the patterns, typically + # .class and .prp) that are newer than the jar-file, ie the new content to be put into the jar. + $1_CAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS), \ + (($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) -a -newer $$@ $$($1_GREP_INCLUDES) \ + $$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/||g' && \ + $(ECHO) $$(subst $$(src)/,,$$($1_EXTRA_FILES))) > \ + $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) + # The capture metainf macro finds all files below the META-INF directory that are newer than the jar-file. + ifeq (,$$($1_SKIP_METAINF)) + $1_CAPTURE_METAINF =$$(foreach src,$$($1_SRCS),($(FIND) $$(src)/META-INF -type f -a -newer $$@ 2> /dev/null | $(SED) 's|$$(src)/||g' >> $$(src)/_the.$$($1_JARNAME)_contents ) $$(NEWLINE)) + endif + # The capture deletes macro finds all deleted files and concatenates them. The resulting file + # tells us what to remove from the jar-file. + $1_CAPTURE_DELETES=$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.deleted -newer $$@ -exec $(SED) 's|$$(src)||g' \{\} >> $$($1_DELETES_FILE) \;) $$(NEWLINE)) + # The update contents macro updates the jar file with the previously capture contents. + # xargs is used to trim the whitespace from the contents file, to see if it is empty. + $1_UPDATE_CONTENTS=$$(foreach src,$$($1_SRCS), \ + (cd $$(src) && \ + if [ -n "`$(CAT) _the.$$($1_JARNAME)_contents | $(XARGS)`" ]; then \ + $(ECHO) " updating" `$(WC) -l _the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \ + $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @_the.$$($1_JARNAME)_contents; \ + fi) $$(NEWLINE)) + # The s-variants of the above macros are used when the jar is created from scratch. + $1_SCAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS), \ + (($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \ + $$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/||g' && \ + $$(subst $$(src)/,,$(ECHO) $$($1_EXTRA_FILES))) > \ + $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) + + ifeq (,$$($1_SKIP_METAINF)) + $1_SCAPTURE_METAINF=$$(foreach src,$$($1_SRCS), \ + ($(FIND) $$(src)/META-INF -type f 2> /dev/null | $(SED) 's|$$(src)/||g' >> \ + $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) + endif + $1_SUPDATE_CONTENTS=$$(foreach src,$$($1_SRCS), \ + (cd $$(src) && $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) + + # Use a slightly shorter name for logging, but with enough path to identify this jar. + $1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_JAR)) + + ifneq (,$$($1_CHECK_COMPRESS_JAR)) + $1_JAR_CREATE_OPTIONS := c0fm + $1_JAR_UPDATE_OPTIONS := u0f + ifeq ($(COMPRESS_JARS), true) + $1_JAR_CREATE_OPTIONS := cfm + $1_JAR_UPDATE_OPTIONS := uf endif - $1_SUPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\ - (cd $$(src) && $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) + else + $1_JAR_CREATE_OPTIONS := cfm + $1_JAR_UPDATE_OPTIONS := uf + endif - # Use a slightly shorter name for logging, but with enough path to identify this jar. - $1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_JAR)) - - ifneq (,$$($1_CHECK_COMPRESS_JAR)) - $1_JAR_CREATE_OPTIONS := c0fm - $1_JAR_UPDATE_OPTIONS := u0f - ifeq ($(COMPRESS_JARS), true) - $1_JAR_CREATE_OPTIONS := cfm - $1_JAR_UPDATE_OPTIONS := uf - endif - else - $1_JAR_CREATE_OPTIONS := cfm - $1_JAR_UPDATE_OPTIONS := uf - endif - - # Here is the rule that creates/updates the jar file. - $$($1_JAR) : $$($1_DEPS) + # Here is the rule that creates/updates the jar file. + $$($1_JAR) : $$($1_DEPS) $(MKDIR) -p $$($1_BIN) $$($1_GREP_INCLUDE_OUTPUT) $$($1_GREP_EXCLUDE_OUTPUT) - $$(if $$($1_MANIFEST),\ - $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \ - -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $$($1_MANIFEST) > $$($1_MANIFEST_FILE) \ - ,\ - $(RM) $$($1_MANIFEST_FILE) && $(TOUCH) $$($1_MANIFEST_FILE)) + $$(if $$($1_MANIFEST), \ + $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \ + -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $$($1_MANIFEST) > $$($1_MANIFEST_FILE) \ + , \ + $(RM) $$($1_MANIFEST_FILE) && $(TOUCH) $$($1_MANIFEST_FILE)) $$(if $$($1_JARMAIN),$(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE)) $$(if $$($1_EXTRA_MANIFEST_ATTR),$(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE)) - $$(if $$(wildcard $$@),\ - $(ECHO) Modifying $$($1_NAME) $$(NEWLINE)\ - $$($1_CAPTURE_CONTENTS) \ - $$($1_CAPTURE_METAINF) \ - $(RM) $$($1_DELETES_FILE) $$(NEWLINE)\ - $$($1_CAPTURE_DELETES) \ - $(CAT) $$($1_DELETES_FILE) > $$($1_DELETESS_FILE) $$(NEWLINE)\ - if [ -s $$($1_DELETESS_FILE) ]; then \ - $(ECHO) " deleting" `$(WC) -l $$($1_DELETESS_FILE) | $(AWK) '{ print $$$$1 }'` files && \ - $(ZIP) -q -d $$@ `$(CAT) $$($1_DELETESS_FILE)` ; \ - fi $$(NEWLINE) \ - $$($1_UPDATE_CONTENTS) true $$(NEWLINE) \ - $$($1_JARINDEX) && true \ - ,\ - $(ECHO) Creating $$($1_NAME) && $(JAR) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) $$(NEWLINE) \ - $$($1_SCAPTURE_CONTENTS) \ - $$($1_SCAPTURE_METAINF) \ - $$($1_SUPDATE_CONTENTS) \ - $$($1_JARINDEX) && true ) + $$(if $$(wildcard $$@), \ + $(ECHO) Modifying $$($1_NAME) $$(NEWLINE) \ + $$($1_CAPTURE_CONTENTS) \ + $$($1_CAPTURE_METAINF) \ + $(RM) $$($1_DELETES_FILE) $$(NEWLINE) \ + $$($1_CAPTURE_DELETES) \ + $(CAT) $$($1_DELETES_FILE) > $$($1_DELETESS_FILE) $$(NEWLINE) \ + if [ -s $$($1_DELETESS_FILE) ]; then \ + $(ECHO) " deleting" `$(WC) -l $$($1_DELETESS_FILE) | $(AWK) '{ print $$$$1 }'` files && \ + $(ZIP) -q -d $$@ `$(CAT) $$($1_DELETESS_FILE)` ; \ + fi $$(NEWLINE) \ + $$($1_UPDATE_CONTENTS) true $$(NEWLINE) \ + $$($1_JARINDEX) && true \ + , \ + $(ECHO) Creating $$($1_NAME) && $(JAR) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) $$(NEWLINE) \ + $$($1_SCAPTURE_CONTENTS) \ + $$($1_SCAPTURE_METAINF) \ + $$($1_SUPDATE_CONTENTS) \ + $$($1_JARINDEX) && true ) endef define SetupZipArchive - # param 1 is for example ZIP_MYSOURCE - # param 2,3,4,5,6,7,8,9 are named args. - # SRC,ZIP,INCLUDES,INCLUDE_FILES,EXCLUDES,EXCLUDE_FILES,SUFFIXES,EXTRA_DEPS - $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) - $(call LogSetupMacroEntry,SetupZipArchive($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) - $(if $(16),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update JavaCompilation.gmk)) + # param 1 is for example ZIP_MYSOURCE + # param 2,3,4,5,6,7,8,9 are named args. + # SRC,ZIP,INCLUDES,INCLUDE_FILES,EXCLUDES,EXCLUDE_FILES,SUFFIXES,EXTRA_DEPS + $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) + $(call LogSetupMacroEntry,SetupZipArchive($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) + $(if $(16),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update JavaCompilation.gmk)) - # To avoid running find over too large sets of files, which causes make to crash - # on some configurations (cygwin), use INCLUDES and INCLUDE_FILES to build a set - # of directories to run find in, if available. - ifneq ($$($1_INCLUDES)$$($1_INCLUDE_FILES),) - $1_FIND_LIST := $$(wildcard $$(foreach i,$$($1_SRC),\ - $$(addprefix $$i/,$$($1_INCLUDES) $$($1_INCLUDE_FILES)))) + # To avoid running find over too large sets of files, which causes make to crash + # on some configurations (cygwin), use INCLUDES and INCLUDE_FILES to build a set + # of directories to run find in, if available. + ifneq ($$($1_INCLUDES)$$($1_INCLUDE_FILES),) + $1_FIND_LIST := $$(wildcard $$(foreach i,$$($1_SRC), \ + $$(addprefix $$i/,$$($1_INCLUDES) $$($1_INCLUDE_FILES)))) + else + $1_FIND_LIST := $$($1_SRC) + endif + + # Find all files in the source tree. + $1_ALL_SRCS := $$(call not-containing,_the.,$$(call CacheFind,$$($1_FIND_LIST))) + + # Filter on suffixes if set + ifneq ($$($1_SUFFIXES),) + $1_ALL_SRCS := $$(filter $$(addprefix %, $$($1_SUFFIXES)), $$($1_ALL_SRCS)) + endif + + ifneq ($$($1_INCLUDES),) + ifneq ($$($1_SUFFIXES),) + $1_ZIP_INCLUDES := $$(foreach s,$$($1_SUFFIXES), \ + $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$$s$(DQUOTE),$$($1_INCLUDES)))) else - $1_FIND_LIST := $$($1_SRC) + $1_ZIP_INCLUDES := $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_INCLUDES))) endif + endif + ifneq ($$($1_INCLUDE_FILES),) + $1_ZIP_INCLUDES += $$(addprefix -i$(SPACE),$$($1_INCLUDE_FILES)) + endif + ifneq ($$($1_EXCLUDES),) + $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES)))) + $1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES))) + $1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_SRCS)) + endif - # Find all files in the source tree. - $1_ALL_SRCS := $$(call not-containing,_the.,\ - $$(filter $$(addprefix %,$$($1_SUFFIXES)),$$(call CacheFind,$$($1_FIND_LIST)))) + # Use a slightly shorter name for logging, but with enough path to identify this zip. + $1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_ZIP)) - ifneq ($$($1_INCLUDES),) - ifneq ($$($1_SUFFIXES),) - $1_ZIP_INCLUDES := $$(foreach s,$$($1_SUFFIXES),\ - $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$$s$(DQUOTE),$$($1_INCLUDES)))) - else - $1_ZIP_INCLUDES := $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_INCLUDES))) - endif - endif - ifneq ($$($1_INCLUDE_FILES),) - $1_ZIP_INCLUDES += $$(addprefix -i$(SPACE),$$($1_INCLUDE_FILES)) - endif - ifneq ($$($1_EXCLUDES),) - $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES)))) - $1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES))) - $1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_SRCS)) - endif - - # Use a slightly shorter name for logging, but with enough path to identify this zip. - $1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_ZIP)) - - # Now $1_ALL_SRCS should contain all sources that are going to be put into the zip. - # I.e. the zip -i and -x options should match the filtering done in the makefile. - # Explicitly excluded files can be given with absolute path. The patsubst solution - # isn't perfect but the likelyhood of an absolute path to match something in a src - # dir is very small. - # If zip has nothing to do, it returns 12 and would fail the build. Check for 12 - # and only fail if it's not. - $$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS) - $(MKDIR) -p $$(@D) - $(ECHO) Updating $$($1_NAME) - $$(foreach i,$$($1_SRC),(cd $$i && $(ZIP) -qru $$@ . $$($1_ZIP_INCLUDES) $$($1_ZIP_EXCLUDES) -x \*_the.\* $$(addprefix -x$(SPACE),$$(patsubst $$i/%,%,$$($1_EXCLUDE_FILES))) || test "$$$$?" = "12" )$$(NEWLINE)) true - $(TOUCH) $$@ + # Now $1_ALL_SRCS should contain all sources that are going to be put into the zip. + # I.e. the zip -i and -x options should match the filtering done in the makefile. + # Explicitly excluded files can be given with absolute path. The patsubst solution + # isn't perfect but the likelyhood of an absolute path to match something in a src + # dir is very small. + # If zip has nothing to do, it returns 12 and would fail the build. Check for 12 + # and only fail if it's not. + $$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS) + $(MKDIR) -p $$(@D) + $(ECHO) Updating $$($1_NAME) + $$(foreach i,$$($1_SRC),(cd $$i && $(ZIP) -qru $$@ . $$($1_ZIP_INCLUDES) $$($1_ZIP_EXCLUDES) -x \*_the.\* $$(addprefix -x$(SPACE),$$(patsubst $$i/%,%,$$($1_EXCLUDE_FILES))) || test "$$$$?" = "12" )$$(NEWLINE)) true + $(TOUCH) $$@ endef define add_file_to_copy - # param 1 = BUILD_MYPACKAGE - # parma 2 = The source file to copy. - $2_TARGET:=$2 - # Remove the source prefix. - $$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET))) - # Now we can setup the depency that will trigger the copying. - $$($1_BIN)$$($2_TARGET) : $2 + # param 1 = BUILD_MYPACKAGE + # parma 2 = The source file to copy. + $2_TARGET:=$2 + # Remove the source prefix. + $$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET))) + # Now we can setup the depency that will trigger the copying. + $$($1_BIN)$$($2_TARGET) : $2 $(MKDIR) -p $$(@D) $(CP) $$< $$@ $(CHMOD) -f ug+w $$@ - # And do not forget this target - $1_ALL_COPY_TARGETS += $$($1_BIN)$$($2_TARGET) + # And do not forget this target + $1_ALL_COPY_TARGETS += $$($1_BIN)$$($2_TARGET) endef @@ -326,206 +330,206 @@ endef # This is the new clean standard. Though it is to be superseded by # a standard annotation processor from with sjavac. define add_file_to_copy_and_clean - # param 1 = BUILD_MYPACKAGE - # parma 2 = The source file to copy and clean. - $2_TARGET:=$2 - # Remove the source prefix. - $$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET))) - # Now we can setup the depency that will trigger the copying. - $$($1_BIN)$$($2_TARGET) : $2 + # param 1 = BUILD_MYPACKAGE + # parma 2 = The source file to copy and clean. + $2_TARGET:=$2 + # Remove the source prefix. + $$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET))) + # Now we can setup the depency that will trigger the copying. + $$($1_BIN)$$($2_TARGET) : $2 $(MKDIR) -p $$(@D) - $(CAT) $$< | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \ - | $(SED) -f "$(SRC_ROOT)/common/makefiles/support/unicode2x.sed" \ - | $(SED) -e '/^#/d' -e '/^$$$$/d' \ - -e :a -e '/\\$$$$/N; s/\\\n//; ta' \ - -e 's/^[ \t]*//;s/[ \t]*$$$$//' \ - -e 's/\\=/=/' | LANG=C $(SORT) > $$@ + $(CAT) $$< | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \ + | $(SED) -f "$(SRC_ROOT)/common/makefiles/support/unicode2x.sed" \ + | $(SED) -e '/^#/d' -e '/^$$$$/d' \ + -e :a -e '/\\$$$$/N; s/\\\n//; ta' \ + -e 's/^[ \t]*//;s/[ \t]*$$$$//' \ + -e 's/\\=/=/' | LANG=C $(SORT) > $$@ $(CHMOD) -f ug+w $$@ - # And do not forget this target - $1_ALL_COPY_CLEAN_TARGETS += $$($1_BIN)$$($2_TARGET) + # And do not forget this target + $1_ALL_COPY_CLEAN_TARGETS += $$($1_BIN)$$($2_TARGET) endef define remove_string - $2 := $$(subst $1,,$$($2)) + $2 := $$(subst $1,,$$($2)) endef define replace_space_with_pathsep - $1:=$(subst $(SPACE),$(PATH_SEP),$(strip $(patsubst %,%,$2))) + $1:=$(subst $(SPACE),$(PATH_SEP),$(strip $(patsubst %,%,$2))) endef define SetupJavaCompilation - # param 1 is for example BUILD_MYPACKAGE - # param 2,3,4,5,6,7,8 are named args. - # SETUP:=must point to a previously setup java compiler, for example: SETUP:=BOOTJAVAC - # JVM:=path to ..bin/java - # ADD_JAVAC_FLAGS:=javac flags to append to the default ones. - # SRC:=one or more directories to search for sources - # BIN:=store classes here - # INCLUDES:=myapp.foo means will only compile java files in myapp.foo or any of its sub-packages. - # EXCLUDES:=myapp.foo means will do not compile java files in myapp.foo or any of its sub-packages. - # COPY:=.prp means copy all prp files to the corresponding package in BIN. - # CLEAN:=.properties means copy and clean all properties file to the corresponding package in BIN. - # COPY_FILES:=myapp/foo/setting.txt means copy this file over to the package myapp/foo - # SRCZIP:=Create a src.zip based on the found sources and copied files. - # INCLUDE_FILES:="com/sun/SolarisFoobar.java" means only compile this file! - # EXCLUDE_FILES:="com/sun/SolarisFoobar.java" means do not compile this particular file! - # "SolarisFoobar.java" means do not compile SolarisFoobar, wherever it is found. - # JAVAC_SOURCE_PATH_UGLY_OVERRIDE:=Don't use this. This forces an explicit -sourcepath to javac. - # Its only here until we cleanup some nasty source code pasta in the jdk. - # HEADERS:=path to directory where all generated c-headers are written. - # DEPENDS:=Extra dependecy - $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) - $(call LogSetupMacroEntry,SetupJavaCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) - $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk)) + # param 1 is for example BUILD_MYPACKAGE + # param 2,3,4,5,6,7,8 are named args. + # SETUP:=must point to a previously setup java compiler, for example: SETUP:=BOOTJAVAC + # JVM:=path to ..bin/java + # ADD_JAVAC_FLAGS:=javac flags to append to the default ones. + # SRC:=one or more directories to search for sources + # BIN:=store classes here + # INCLUDES:=myapp.foo means will only compile java files in myapp.foo or any of its sub-packages. + # EXCLUDES:=myapp.foo means will do not compile java files in myapp.foo or any of its sub-packages. + # COPY:=.prp means copy all prp files to the corresponding package in BIN. + # CLEAN:=.properties means copy and clean all properties file to the corresponding package in BIN. + # COPY_FILES:=myapp/foo/setting.txt means copy this file over to the package myapp/foo + # SRCZIP:=Create a src.zip based on the found sources and copied files. + # INCLUDE_FILES:="com/sun/SolarisFoobar.java" means only compile this file! + # EXCLUDE_FILES:="com/sun/SolarisFoobar.java" means do not compile this particular file! + # "SolarisFoobar.java" means do not compile SolarisFoobar, wherever it is found. + # JAVAC_SOURCE_PATH_OVERRIDE:=This forces an explicit -sourcepath to javac instead of the complete + # source roots from SRC. This is sometimes needed when compiling specific subsets of the source. + # HEADERS:=path to directory where all generated c-headers are written. + # DEPENDS:=Extra dependecy + $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) + $(call LogSetupMacroEntry,SetupJavaCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) + $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk)) - # Extract the info from the java compiler setup. - $1_JVM := $$($$($1_SETUP)_JVM) - $1_JAVAC := $$($$($1_SETUP)_JAVAC) - $1_FLAGS := $$($$($1_SETUP)_FLAGS) $(JAVAC_FLAGS) $$($1_ADD_JAVAC_FLAGS) - ifeq ($$($1_JAVAC),) - $$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP)) - endif - $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE) - $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM) + # Extract the info from the java compiler setup. + $1_JVM := $$($$($1_SETUP)_JVM) + $1_JAVAC := $$($$($1_SETUP)_JAVAC) + $1_FLAGS := $$($$($1_SETUP)_FLAGS) $(JAVAC_FLAGS) $$($1_ADD_JAVAC_FLAGS) + ifeq ($$($1_JAVAC),) + $$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP)) + endif + $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE) + $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM) - # Handle addons and overrides. - $1_SRC:=$$(call ADD_SRCS,$$($1_SRC)) - # Make sure the dirs exist. - $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupJavaCompilation $1 contains missing directory $$d))) - $$(eval $$(call MakeDir,$$($1_BIN))) - # Find all files in the source trees. - $1_ALL_SRCS += $$(filter-out $(OVR_SRCS),$$(call CacheFind,$$($1_SRC))) - # Extract the java files. - ifneq ($$($1_EXCLUDE_FILES),) - $1_EXCLUDE_FILES_PATTERN:=$$(addprefix %,$$($1_EXCLUDE_FILES)) + # Handle addons and overrides. + $1_SRC:=$$(call ADD_SRCS,$$($1_SRC)) + # Make sure the dirs exist. + $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupJavaCompilation $1 contains missing directory $$d))) + $$(eval $$(call MakeDir,$$($1_BIN))) + # Find all files in the source trees. + $1_ALL_SRCS += $$(filter-out $(OVR_SRCS),$$(call CacheFind,$$($1_SRC))) + # Extract the java files. + ifneq ($$($1_EXCLUDE_FILES),) + $1_EXCLUDE_FILES_PATTERN:=$$(addprefix %,$$($1_EXCLUDE_FILES)) + endif + $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$(filter %.java,$$($1_ALL_SRCS))) + ifneq ($$($1_INCLUDE_FILES),) + $1_INCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES))) + $1_SRCS := $$(filter $$($1_INCLUDE_FILES), $$($1_SRCS)) + endif + + # Now we have a list of all java files to compile: $$($1_SRCS) + + # Create the corresponding smart javac wrapper command line. + $1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix .*,$$(subst /,.,$$($1_EXCLUDES)))) \ + $$(addprefix -i ,$$(addsuffix .*,$$(subst /,.,$$($1_INCLUDES)))) \ + $$(addprefix -xf *,$$(strip $$($1_EXCLUDE_FILES))) \ + $$(addprefix -if *,$$(strip $$($1_INCLUDE_FILES))) \ + -src "$$(subst $$(SPACE),$$(PATH_SEP),$$(strip $$($1_SRC)))" + + # Prepend the source/bin path to the filter expressions. + ifneq ($$($1_INCLUDES),) + $1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES)))) + $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS)) + endif + ifneq ($$($1_EXCLUDES),) + $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES)))) + $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) + endif + + # Find all files to be copied from source to bin. + ifneq (,$$($1_COPY)) + # Search for all files to be copied. + $1_ALL_COPIES := $$(filter $$(addprefix %,$$($1_COPY)),$$($1_ALL_SRCS)) + # Copy these explicitly + $1_ALL_COPIES += $$($1_COPY_FILES) + # Copy must also respect filters. + ifneq (,$$($1_INCLUDES)) + $1_ALL_COPIES := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_COPIES)) endif - $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$(filter %.java,$$($1_ALL_SRCS))) - ifneq ($$($1_INCLUDE_FILES),) - $1_INCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES))) - $1_SRCS := $$(filter $$($1_INCLUDE_FILES), $$($1_SRCS)) + ifneq (,$$($1_EXCLUDES)) + $1_ALL_COPIES := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_COPIES)) + endif + ifneq (,$$($1_EXCLUDE_FILES)) + $1_ALL_COPIES := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_COPIES)) + endif + # All files below META-INF are always copied. + $1_ALL_COPIES += $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS)) + ifneq (,$$($1_ALL_COPIES)) + # Yep, there are files to be copied! + $1_ALL_COPY_TARGETS:= + $$(foreach i,$$($1_ALL_COPIES),$$(eval $$(call add_file_to_copy,$1,$$i))) + # Now we can depend on $$($1_ALL_COPY_TARGETS) to copy all files! + endif + endif + + # Find all property files to be copied and cleaned from source to bin. + ifneq (,$$($1_CLEAN)) + # Search for all files to be copied. + $1_ALL_CLEANS := $$(filter $$(addprefix %,$$($1_CLEAN)),$$($1_ALL_SRCS)) + # Copy and clean must also respect filters. + ifneq (,$$($1_INCLUDES)) + $1_ALL_CLEANS := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_CLEANS)) + endif + ifneq (,$$($1_EXCLUDES)) + $1_ALL_CLEANS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_CLEANS)) + endif + ifneq (,$$($1_EXCLUDE_FILES)) + $1_ALL_CLEANS := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_CLEANS)) + endif + ifneq (,$$($1_ALL_CLEANS)) + # Yep, there are files to be copied and cleaned! + $1_ALL_COPY_CLEAN_TARGETS:= + $$(foreach i,$$($1_ALL_CLEANS),$$(eval $$(call add_file_to_copy_and_clean,$1,$$i))) + # Now we can depend on $$($1_ALL_COPY_CLEAN_TARGETS) to copy all files! + endif + endif + + # Prep the source paths. + ifneq ($$($1_JAVAC_SOURCE_PATH_OVERRIDE),) + $$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_JAVAC_SOURCE_PATH_OVERRIDE))) + else + $$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_SRC))) + endif + + # Create a sed expression to remove the source roots and to replace / with . + # and remove .java at the end. + $1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g' + + ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes) + ifneq (,$$($1_HEADERS)) + $1_HEADERS_ARG := -h $$($1_HEADERS) endif - # Now we have a list of all java files to compile: $$($1_SRCS) + # Using sjavac to compile. + $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/javac_state - # Create the corresponding smart javac wrapper command line. - $1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix .*,$$(subst /,.,$$($1_EXCLUDES)))) \ - $$(addprefix -i ,$$(addsuffix .*,$$(subst /,.,$$($1_INCLUDES)))) \ - $$(addprefix -xf *,$$(strip $$($1_EXCLUDE_FILES))) \ - $$(addprefix -if *,$$(strip $$($1_INCLUDE_FILES))) \ - -src "$$(subst $$(SPACE),$$(PATH_SEP),$$(strip $$($1_SRC)))" + # Create SJAVAC variable form JAVAC variable. Expects $1_JAVAC to be + # "bootclasspathprepend -cp .../javac.jar com.sun.tools.javac.Main" + # and javac is simply replaced with sjavac. + $1_SJAVAC:=$$(subst com.sun.tools.javac.Main,com.sun.tools.sjavac.Main,$$($1_JAVAC)) - # Prepend the source/bin path to the filter expressions. - ifneq ($$($1_INCLUDES),) - $1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES)))) - $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS)) - endif - ifneq ($$($1_EXCLUDES),) - $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES)))) - $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) - endif + # Set the $1_REMOTE to spawn a background javac server. + $1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),id=$1,sjavac=$$(subst $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC)))) - # Find all files to be copied from source to bin. - ifneq (,$$($1_COPY)) - # Search for all files to be copied. - $1_ALL_COPIES := $$(filter $$(addprefix %,$$($1_COPY)),$$($1_ALL_SRCS)) - # Copy these explicitly - $1_ALL_COPIES += $$($1_COPY_FILES) - # Copy must also respect filters. - ifneq (,$$($1_INCLUDES)) - $1_ALL_COPIES := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_COPIES)) - endif - ifneq (,$$($1_EXCLUDES)) - $1_ALL_COPIES := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_COPIES)) - endif - ifneq (,$$($1_EXCLUDE_FILES)) - $1_ALL_COPIES := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_COPIES)) - endif - # All files below META-INF are always copied. - $1_ALL_COPIES += $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS)) - ifneq (,$$($1_ALL_COPIES)) - # Yep, there are files to be copied! - $1_ALL_COPY_TARGETS:= - $$(foreach i,$$($1_ALL_COPIES),$$(eval $$(call add_file_to_copy,$1,$$i))) - # Now we can depend on $$($1_ALL_COPY_TARGETS) to copy all files! - endif - endif + $$($1_BIN)/javac_state: $$($1_SRCS) $$($1_DEPENDS) + $(MKDIR) -p $$(@D) + $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.$1_batch.tmp) + $(ECHO) Compiling $1 + ($$($1_JVM) $$($1_SJAVAC) \ + $$($1_REMOTE) \ + -j $(JOBS) \ + --permit-unidentified-artifacts \ + --permit-sources-without-package \ + --compare-found-sources $$($1_BIN)/_the.$1_batch.tmp \ + --log=$(LOG_LEVEL) \ + $$($1_SJAVAC_ARGS) \ + $$($1_FLAGS) \ + $$($1_HEADERS_ARG) \ + -d $$($1_BIN) && \ + $(MV) $$($1_BIN)/_the.$1_batch.tmp $$($1_BIN)/_the.$1_batch) + else + # Using plain javac to batch compile everything. + $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/_the.$1_batch - # Find all property files to be copied and cleaned from source to bin. - ifneq (,$$($1_CLEAN)) - # Search for all files to be copied. - $1_ALL_CLEANS := $$(filter $$(addprefix %,$$($1_CLEAN)),$$($1_ALL_SRCS)) - # Copy and clean must also respect filters. - ifneq (,$$($1_INCLUDES)) - $1_ALL_CLEANS := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_CLEANS)) - endif - ifneq (,$$($1_EXCLUDES)) - $1_ALL_CLEANS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_CLEANS)) - endif - ifneq (,$$($1_EXCLUDE_FILES)) - $1_ALL_CLEANS := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_CLEANS)) - endif - ifneq (,$$($1_ALL_CLEANS)) - # Yep, there are files to be copied and cleaned! - $1_ALL_COPY_CLEAN_TARGETS:= - $$(foreach i,$$($1_ALL_CLEANS),$$(eval $$(call add_file_to_copy_and_clean,$1,$$i))) - # Now we can depend on $$($1_ALL_COPY_CLEAN_TARGETS) to copy all files! - endif - endif + # When building in batch, put headers in a temp dir to filter out those that actually + # changed before copying them to the real header dir. + ifneq (,$$($1_HEADERS)) + $1_HEADERS_ARG := -h $$($1_HEADERS).tmp - # Prep the source paths. - ifneq ($$($1_JAVAC_SOURCE_PATH_UGLY_OVERRIDE),) - $$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_JAVAC_SOURCE_PATH_UGLY_OVERRIDE))) - else - $$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_SRC))) - endif - - # Create a sed expression to remove the source roots and to replace / with . - # and remove .java at the end. - $1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g' - - ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes) - ifneq (,$$($1_HEADERS)) - $1_HEADERS_ARG := -h $$($1_HEADERS) - endif - - # Using sjavac to compile. - $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/javac_state - - # Create SJAVAC variable form JAVAC variable. Expects $1_JAVAC to be - # "bootclasspathprepend -cp .../javac.jar com.sun.tools.javac.Main" - # and javac is simply replaced with sjavac. - $1_SJAVAC:=$$(subst com.sun.tools.javac.Main,com.sun.tools.sjavac.Main,$$($1_JAVAC)) - - # Set the $1_REMOTE to spawn a background javac server. - $1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),id=$1,sjavac=$$(subst $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC)))) - - $$($1_BIN)/javac_state: $$($1_SRCS) $$($1_DEPENDS) - $(MKDIR) -p $$(@D) - $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp) - $(ECHO) Compiling $1 - ($$($1_JVM) $$($1_SJAVAC) \ - $$($1_REMOTE) \ - -j $(JOBS) \ - --permit-unidentified-artifacts \ - --permit-sources-without-package \ - --compare-found-sources $$($1_BIN)/_the.batch.tmp \ - --log=$(LOG_LEVEL) \ - $$($1_SJAVAC_ARGS) \ - $$($1_FLAGS) \ - $$($1_HEADERS_ARG) \ - -d $$($1_BIN) && \ - $(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch) - else - # Using plain javac to batch compile everything. - $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/_the.batch - - # When buliding in batch, put headers in a temp dir to filter out those that actually - # changed before copying them to the real header dir. - ifneq (,$$($1_HEADERS)) - $1_HEADERS_ARG := -h $$($1_HEADERS).tmp - - $$($1_HEADERS)/_the.headers: $$($1_BIN)/_the.batch + $$($1_HEADERS)/_the.$1_headers: $$($1_BIN)/_the.$1_batch $(MKDIR) -p $$(@D) for f in `ls $$($1_HEADERS).tmp`; do \ if [ ! -f "$$($1_HEADERS)/$$$$f" ] || [ "`$(DIFF) $$($1_HEADERS)/$$$$f $$($1_HEADERS).tmp/$$$$f`" != "" ]; then \ @@ -535,54 +539,54 @@ define SetupJavaCompilation $(RM) -r $$($1_HEADERS).tmp $(TOUCH) $$@ - $1 += $$($1_HEADERS)/_the.headers - endif - - # When not using sjavac, pass along all sources to javac using an @file. - $$($1_BIN)/_the.batch: $$($1_SRCS) $$($1_DEPENDS) - $(MKDIR) -p $$(@D) - $(RM) $$($1_BIN)/_the.batch $$($1_BIN)/_the.batch.tmp - $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp) - $(ECHO) Compiling `$(WC) $$($1_BIN)/_the.batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1 - ($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) \ - -implicit:none -sourcepath "$$($1_SRCROOTSC)" \ - -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.batch.tmp && \ - $(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch) - + $1 += $$($1_HEADERS)/_the.$1_headers endif - # Check if a jar file was specified, then setup the rules for the jar. - ifneq (,$$($1_JAR)) - # If no suffixes was explicitly set for this jar file. - # Use class and the cleaned/copied properties file suffixes as the default - # for the types of files to be put into the jar. - ifeq (,$$($1_SUFFIXES)) - $1_SUFFIXES:=.class $$($1_CLEAN) $$($1_COPY) - endif + # When not using sjavac, pass along all sources to javac using an @file. + $$($1_BIN)/_the.$1_batch: $$($1_SRCS) $$($1_DEPENDS) + $(MKDIR) -p $$(@D) + $(RM) $$($1_BIN)/_the.$1_batch $$($1_BIN)/_the.$1_batch.tmp + $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.$1_batch.tmp) + $(ECHO) Compiling `$(WC) $$($1_BIN)/_the.$1_batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1 + ($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) \ + -implicit:none -sourcepath "$$($1_SRCROOTSC)" \ + -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.$1_batch.tmp && \ + $(MV) $$($1_BIN)/_the.$1_batch.tmp $$($1_BIN)/_the.$1_batch) - $$(eval $$(call SetupArchive,ARCHIVE_$1,$$($1),\ - SRCS:=$$($1_BIN),\ - SUFFIXES:=$$($1_SUFFIXES),\ - EXCLUDE:=$$($1_EXCLUDES),\ - INCLUDES:=$$($1_INCLUDES),\ - EXTRA_FILES:=$$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS),\ - JAR:=$$($1_JAR),\ - JARMAIN:=$$($1_JARMAIN),\ - MANIFEST:=$$($1_MANIFEST),\ - EXTRA_MANIFEST_ATTR:=$$($1_EXTRA_MANIFEST_ATTR),\ - JARINDEX:=$$($1_JARINDEX),\ - HEADERS:=$$($1_HEADERS),\ - SETUP:=$$($1_SETUP))) + endif + + # Check if a jar file was specified, then setup the rules for the jar. + ifneq (,$$($1_JAR)) + # If no suffixes was explicitly set for this jar file. + # Use class and the cleaned/copied properties file suffixes as the default + # for the types of files to be put into the jar. + ifeq (,$$($1_SUFFIXES)) + $1_SUFFIXES:=.class $$($1_CLEAN) $$($1_COPY) endif - # Check if a srczip was specified, then setup the rules for the srczip. - ifneq (,$$($1_SRCZIP)) - $$(eval $$(call SetupZipArchive,ARCHIVE_$1,\ - SRC:=$$($1_SRC),\ - ZIP:=$$($1_SRCZIP),\ - INCLUDES:=$$($1_INCLUDES),\ - EXCLUDES:=$$($1_EXCLUDES),\ - EXCLUDE_FILES:=$$($1_EXCLUDE_FILES))) - endif + $$(eval $$(call SetupArchive,ARCHIVE_$1,$$($1), \ + SRCS:=$$($1_BIN), \ + SUFFIXES:=$$($1_SUFFIXES), \ + EXCLUDE:=$$($1_EXCLUDES), \ + INCLUDES:=$$($1_INCLUDES), \ + EXTRA_FILES:=$$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS), \ + JAR:=$$($1_JAR), \ + JARMAIN:=$$($1_JARMAIN), \ + MANIFEST:=$$($1_MANIFEST), \ + EXTRA_MANIFEST_ATTR:=$$($1_EXTRA_MANIFEST_ATTR), \ + JARINDEX:=$$($1_JARINDEX), \ + HEADERS:=$$($1_HEADERS), \ + SETUP:=$$($1_SETUP))) + endif + + # Check if a srczip was specified, then setup the rules for the srczip. + ifneq (,$$($1_SRCZIP)) + $$(eval $$(call SetupZipArchive,ARCHIVE_$1, \ + SRC:=$$($1_SRC), \ + ZIP:=$$($1_SRCZIP), \ + INCLUDES:=$$($1_INCLUDES), \ + EXCLUDES:=$$($1_EXCLUDES), \ + EXCLUDE_FILES:=$$($1_EXCLUDE_FILES))) + endif endef diff --git a/common/makefiles/Jprt.gmk b/common/makefiles/Jprt.gmk index 4b19dc45e38..e80aea90d49 100644 --- a/common/makefiles/Jprt.gmk +++ b/common/makefiles/Jprt.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ # questions. # -# This file is included by the root NewerMakefile and contains targets +# This file is included by the root NewerMakefile and contains targets # and utilities needed by JPRT. # Utilities used in this Makefile. Most of this makefile executes without @@ -36,7 +36,7 @@ MKDIR=mkdir PRINTF=printf PWD=pwd # Insure we have a path that looks like it came from pwd -# (This is mostly for Windows sake and drive letters) +# (This is mostly for Windows sake and drive letters) define UnixPath # path $(shell (cd "$1" && $(PWD))) endef @@ -47,19 +47,19 @@ ifdef OPENJDK OPEN_BUILD=true else OPEN_BUILD := $(if $(or $(wildcard $(root_dir)/jdk/src/closed), \ - $(wildcard $(root_dir)/jdk/make/closed), \ - $(wildcard $(root_dir)/jdk/test/closed), \ - $(wildcard $(root_dir)/hotspot/src/closed), \ - $(wildcard $(root_dir)/hotspot/make/closed), \ - $(wildcard $(root_dir)/hotspot/test/closed)), \ - false,true) + $(wildcard $(root_dir)/jdk/make/closed), \ + $(wildcard $(root_dir)/jdk/test/closed), \ + $(wildcard $(root_dir)/hotspot/src/closed), \ + $(wildcard $(root_dir)/hotspot/make/closed), \ + $(wildcard $(root_dir)/hotspot/test/closed)), \ + false,true) endif HOTSPOT_AVAILABLE := $(if $(wildcard $(root_dir)/hotspot),true,false) ########################################################################### # To help in adoption of the new configure&&make build process, a bridge -# build will use the old settings to run configure and do the build. +# build will use the old settings to run configure and do the build. # Build with the configure bridge. After running configure, restart make # to parse the new spec file. @@ -85,80 +85,80 @@ $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest: FRC $(RM) $@.tmp $(MKDIR) -p $(BUILD_DIR_ROOT) @$(ECHO) " --with-debug-level=$(if $(DEBUG_LEVEL),$(DEBUG_LEVEL),release) " >> $@.tmp -ifdef ARCH_DATA_MODEL - @$(ECHO) " --with-target-bits=$(ARCH_DATA_MODEL) " >> $@.tmp -endif -ifeq ($(ARCH_DATA_MODEL),32) - @$(ECHO) " --with-jvm-variants=client,server " >> $@.tmp -endif -ifdef ALT_PARALLEL_COMPILE_JOBS - @$(ECHO) " --with-num-cores=$(ALT_PARALLEL_COMPILE_JOBS) " >> $@.tmp -endif -ifdef ALT_BOOTDIR - @$(ECHO) " --with-boot-jdk=$(call UnixPath,$(ALT_BOOTDIR)) " >> $@.tmp -endif -ifdef ALT_CUPS_HEADERS_PATH - @$(ECHO) " --with-cups-include=$(call UnixPath,$(ALT_CUPS_HEADERS_PATH)) " >> $@.tmp -endif -ifdef ALT_FREETYPE_HEADERS_PATH - @$(ECHO) " --with-freetype=$(call UnixPath,$(ALT_FREETYPE_HEADERS_PATH)/..) " >> $@.tmp -endif -ifdef ENABLE_SJAVAC - @$(ECHO) " --enable-sjavac" >> $@.tmp -endif -ifeq ($(HOTSPOT_AVAILABLE),false) - ifdef ALT_JDK_IMPORT_PATH - @$(ECHO) " --with-import-hotspot=$(call UnixPath,$(ALT_JDK_IMPORT_PATH)) " >> $@.tmp - endif -endif -ifeq ($(OPEN_BUILD),true) - @$(ECHO) " --enable-openjdk-only " >> $@.tmp -else - # Todo: move to closed? - ifdef ALT_MOZILLA_HEADERS_PATH - @$(ECHO) " --with-mozilla-headers=$(call UnixPath,$(ALT_MOZILLA_HEADERS_PATH)) " >> $@.tmp - endif - ifdef ALT_JUNIT_DIR - @$(ECHO) " --with-junit-dir=$(call UnixPath,$(ALT_JUNIT_DIR)) " >> $@.tmp - endif - ifdef ANT_HOME - @$(ECHO) " --with-ant-home=$(call UnixPath,$(ANT_HOME)) " >> $@.tmp - endif - ifdef ALT_JAVAFX_ZIP_DIR - @$(ECHO) " --with-javafx-zip-dir=$(call UnixPath,$(ALT_JAVAFX_ZIP_DIR)) " >> $@.tmp - endif - ifdef ALT_JMC_ZIP_DIR - @$(ECHO) " --with-jmc-zip-dir=$(call UnixPath,$(ALT_JMC_ZIP_DIR)) " >> $@.tmp - endif - ifdef ALT_WIXDIR - @$(ECHO) " --with-wix=$(call UnixPath,$(ALT_WIXDIR)) " >> $@.tmp - endif - ifdef ALT_INSTALL_LZMA_PATH - @$(ECHO) " --with-lzma-path=$(call UnixPath,$(ALT_INSTALL_LZMA_PATH)) " >> $@.tmp - endif - ifdef ALT_INSTALL_UPX_PATH - @$(ECHO) " --with-upx-path=$(call UnixPath,$(ALT_INSTALL_UPX_PATH)) " >> $@.tmp - endif - ifdef ALT_INSTALL_UPX_FILENAME - @$(ECHO) " --with-upx-filename=$(call UnixPath,$(ALT_INSTALL_UPX_FILENAME)) " >> $@.tmp - endif - ifdef ALT_CCSS_SIGNING_DIR - @$(ECHO) " --with-ccss-signing=$(call UnixPath,$(ALT_CCSS_SIGNING_DIR)) " >> $@.tmp - endif - ifdef ALT_SLASH_JAVA - @$(ECHO) " --with-java-devtools=$(call UnixPath,$(ALT_SLASH_JAVA)/devtools) " >> $@.tmp - endif - ifdef ALT_SPARKLE_FRAMEWORK_DIR - @$(ECHO) " --with-sparkle-framework=$(call UnixPath,$(ALT_SPARKLE_FRAMEWORK_DIR)) " >> $@.tmp - endif -endif + ifdef ARCH_DATA_MODEL + @$(ECHO) " --with-target-bits=$(ARCH_DATA_MODEL) " >> $@.tmp + endif + ifeq ($(ARCH_DATA_MODEL),32) + @$(ECHO) " --with-jvm-variants=client,server " >> $@.tmp + endif + ifdef ALT_PARALLEL_COMPILE_JOBS + @$(ECHO) " --with-num-cores=$(ALT_PARALLEL_COMPILE_JOBS) " >> $@.tmp + endif + ifdef ALT_BOOTDIR + @$(ECHO) " --with-boot-jdk=$(call UnixPath,$(ALT_BOOTDIR)) " >> $@.tmp + endif + ifdef ALT_CUPS_HEADERS_PATH + @$(ECHO) " --with-cups-include=$(call UnixPath,$(ALT_CUPS_HEADERS_PATH)) " >> $@.tmp + endif + ifdef ALT_FREETYPE_HEADERS_PATH + @$(ECHO) " --with-freetype=$(call UnixPath,$(ALT_FREETYPE_HEADERS_PATH)/..) " >> $@.tmp + endif + ifdef ENABLE_SJAVAC + @$(ECHO) " --enable-sjavac" >> $@.tmp + endif + ifeq ($(HOTSPOT_AVAILABLE),false) + ifdef ALT_JDK_IMPORT_PATH + @$(ECHO) " --with-import-hotspot=$(call UnixPath,$(ALT_JDK_IMPORT_PATH)) " >> $@.tmp + endif + endif + ifeq ($(OPEN_BUILD),true) + @$(ECHO) " --enable-openjdk-only " >> $@.tmp + else +# Todo: move to closed? + ifdef ALT_MOZILLA_HEADERS_PATH + @$(ECHO) " --with-mozilla-headers=$(call UnixPath,$(ALT_MOZILLA_HEADERS_PATH)) " >> $@.tmp + endif + ifdef ALT_JUNIT_DIR + @$(ECHO) " --with-junit-dir=$(call UnixPath,$(ALT_JUNIT_DIR)) " >> $@.tmp + endif + ifdef ANT_HOME + @$(ECHO) " --with-ant-home=$(call UnixPath,$(ANT_HOME)) " >> $@.tmp + endif + ifdef ALT_JAVAFX_ZIP_DIR + @$(ECHO) " --with-javafx-zip-dir=$(call UnixPath,$(ALT_JAVAFX_ZIP_DIR)) " >> $@.tmp + endif + ifdef ALT_JMC_ZIP_DIR + @$(ECHO) " --with-jmc-zip-dir=$(call UnixPath,$(ALT_JMC_ZIP_DIR)) " >> $@.tmp + endif + ifdef ALT_WIXDIR + @$(ECHO) " --with-wix=$(call UnixPath,$(ALT_WIXDIR)) " >> $@.tmp + endif + ifdef ALT_INSTALL_LZMA_PATH + @$(ECHO) " --with-lzma-path=$(call UnixPath,$(ALT_INSTALL_LZMA_PATH)) " >> $@.tmp + endif + ifdef ALT_INSTALL_UPX_PATH + @$(ECHO) " --with-upx-path=$(call UnixPath,$(ALT_INSTALL_UPX_PATH)) " >> $@.tmp + endif + ifdef ALT_INSTALL_UPX_FILENAME + @$(ECHO) " --with-upx-filename=$(call UnixPath,$(ALT_INSTALL_UPX_FILENAME)) " >> $@.tmp + endif + ifdef ALT_CCSS_SIGNING_DIR + @$(ECHO) " --with-ccss-signing=$(call UnixPath,$(ALT_CCSS_SIGNING_DIR)) " >> $@.tmp + endif + ifdef ALT_SLASH_JAVA + @$(ECHO) " --with-java-devtools=$(call UnixPath,$(ALT_SLASH_JAVA)/devtools) " >> $@.tmp + endif + ifdef ALT_SPARKLE_FRAMEWORK_DIR + @$(ECHO) " --with-sparkle-framework=$(call UnixPath,$(ALT_SPARKLE_FRAMEWORK_DIR)) " >> $@.tmp + endif + endif @if [ -f $@ ] ; then \ - if ! $(CMP) $@ $@.tmp > /dev/null ; then \ - $(CP) $@.tmp $@ ; \ - fi ; \ - else \ - $(CP) $@.tmp $@ ; \ - fi + if ! $(CMP) $@ $@.tmp > /dev/null ; then \ + $(CP) $@.tmp $@ ; \ + fi ; \ + else \ + $(CP) $@.tmp $@ ; \ + fi $(RM) $@.tmp PHONY_LIST += bridge2configure bridgeBuild @@ -170,7 +170,7 @@ ifndef JPRT_ARCHIVE_BUNDLE JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/j2sdk-image.zip endif ifndef JPRT_ARCHIVE_INSTALL_BUNDLE - JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip + JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip endif # These targets execute in a SPEC free context, before calling bridgeBuild @@ -200,13 +200,8 @@ $(JPRT_ARCHIVE_BUNDLE): bundles $(RM) $@ $(CP) $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip $@ -ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_BITS),solaris-64) - SRC_JDK_IMAGE_DIR := $(JDK_OVERLAY_IMAGE_DIR) - SRC_JRE_IMAGE_DIR := $(JRE_OVERLAY_IMAGE_DIR) -else - SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR) - SRC_JRE_IMAGE_DIR := $(JRE_IMAGE_DIR) -endif +SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR) +SRC_JRE_IMAGE_DIR := $(JRE_IMAGE_DIR) SRC_JDK_BUNDLE_DIR := $(JDK_BUNDLE_DIR) SRC_JRE_BUNDLE_DIR := $(JRE_BUNDLE_DIR) @@ -215,11 +210,11 @@ bundles: all bundles-only bundles-only: start-make @$(call TargetEnter) $(MKDIR) -p $(BUILD_OUTPUT)/bundles - $(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip . - $(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip . - if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \ - $(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -q -r $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \ - fi + $(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip . + $(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip . + if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \ + $(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -y -q -r $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \ + fi @$(call TargetExit) # Copy images to one unified location regardless of platform etc. @@ -231,19 +226,19 @@ final-images-only: start-make $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR) $(CP) -R -P $(SRC_JDK_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)/ $(CP) -R -P $(SRC_JRE_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)/ -ifeq ($(OPENJDK_TARGET_OS),macosx) - $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR) - $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR) - $(CP) -R -P $(SRC_JDK_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR)/ - $(CP) -R -P $(SRC_JRE_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR)/ -endif + ifeq ($(OPENJDK_TARGET_OS),macosx) + $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR) + $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR) + $(CP) -R -P $(SRC_JDK_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR)/ + $(CP) -R -P $(SRC_JRE_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR)/ + endif @$(call TargetExit) # Keep track of phony targets PHONY_LIST += jprt_build_product jprt_build_fastdebug jprt_build_debug \ - jprt_build_generic bundles jprt_bundle \ - final-images final-images-only + jprt_build_generic bundles jprt_bundle \ + final-images final-images-only ########################################################################### # Phony targets diff --git a/common/makefiles/Main.gmk b/common/makefiles/Main.gmk index f5f01fce1ba..fa02febe6a7 100644 --- a/common/makefiles/Main.gmk +++ b/common/makefiles/Main.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ # Now load the spec include $(SPEC) -# Load the vital tools for all the makefiles. +# Load the vital tools for all the makefiles. include $(SRC_ROOT)/common/makefiles/MakeBase.gmk # Include the corresponding custom file, if present. @@ -38,19 +38,19 @@ include $(SRC_ROOT)/common/makefiles/MakeBase.gmk # Remove any build.log from a previous run, if they exist ifneq (,$(BUILD_LOG)) - ifneq (,$(BUILD_LOG_PREVIOUS)) - # Rotate old log - $(shell $(RM) $(BUILD_LOG_PREVIOUS) 2> /dev/null) - $(shell $(MV) $(BUILD_LOG) $(BUILD_LOG_PREVIOUS) 2> /dev/null) - else - $(shell $(RM) $(BUILD_LOG) 2> /dev/null) - endif - $(shell $(RM) $(OUTPUT_ROOT)/build-trace-time.log 2> /dev/null) + ifneq (,$(BUILD_LOG_PREVIOUS)) + # Rotate old log + $(shell $(RM) $(BUILD_LOG_PREVIOUS) 2> /dev/null) + $(shell $(MV) $(BUILD_LOG) $(BUILD_LOG_PREVIOUS) 2> /dev/null) + else + $(shell $(RM) $(BUILD_LOG) 2> /dev/null) + endif + $(shell $(RM) $(OUTPUT_ROOT)/build-trace-time.log 2> /dev/null) endif # Remove any javac server logs and port files. This # prevents a new make run to reuse the previous servers. ifneq (,$(SJAVAC_SERVER_DIR)) - $(shell $(MKDIR) -p $(SJAVAC_SERVER_DIR) && $(RM) -rf $(SJAVAC_SERVER_DIR)/*) + $(shell $(MKDIR) -p $(SJAVAC_SERVER_DIR) && $(RM) -rf $(SJAVAC_SERVER_DIR)/*) endif # Reset the build timers. @@ -68,10 +68,6 @@ default: jdk all: images docs @$(call CheckIfMakeAtEnd) -ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_BITS),solaris-64) - all: overlay-images -endif - # Setup a rule for SPEC file that fails if executed. This check makes sure the configuration # is up to date after changes to configure $(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*) @@ -107,8 +103,8 @@ jaxws-only: start-make @$(call TargetExit) ifeq ($(BUILD_HOTSPOT),true) -hotspot: hotspot-only -hotspot-only: start-make + hotspot: hotspot-only + hotspot-only: start-make @$(call TargetEnter) @($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk) @$(call TargetExit) @@ -153,9 +149,9 @@ profiles-only: start-make @$(call TargetExit) profiles-oscheck: -ifneq ($(OPENJDK_TARGET_OS), linux) - @echo "Error: The Java SE 8 Compact Profiles are only implemented for Linux at this time" && exit 1 -endif + ifneq ($(OPENJDK_TARGET_OS), linux) + @echo "Error: The Java SE 8 Compact Profiles are only implemented for Linux at this time" && exit 1 + endif install: images install-only install-only: start-make @@ -206,12 +202,12 @@ clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jd dist-clean: clean @($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments Makefile compare.sh spec.sh tmp javacservers) @$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \ - if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \ - $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ;\ - else \ - ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" && $(RM) -r $(OUTPUT_ROOT)) \ - fi \ - ) + if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \ + $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \ + else \ + ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" && $(RM) -r $(OUTPUT_ROOT)) \ + fi \ + ) @$(ECHO) Cleaned everything, you will have to re-run configure. clean-langtools: diff --git a/common/makefiles/MakeBase.gmk b/common/makefiles/MakeBase.gmk index d2bf4aaabee..519abac7201 100644 --- a/common/makefiles/MakeBase.gmk +++ b/common/makefiles/MakeBase.gmk @@ -48,314 +48,316 @@ $(subst $(SPACE),\n,$(strip $1)))))\ $(compress_post) decompress_paths=$(SED) -f $(SRC_ROOT)/common/makefiles/support/ListPathsSafely-uncompress.sed -e 's|X99|\\n|g' \ - -e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(SRC_ROOT)|g' \ - -e 's|X00|X|g' | tr '\n' '$2' + -e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(SRC_ROOT)|g' \ + -e 's|X00|X|g' | tr '\n' '$2' define ListPathsSafely_If - $(if $(word $3,$($1)),$(eval $1_LPS$3:=$(call compress_paths,$(wordlist $3,$4,$($1))))) + $(if $(word $3,$($1)),$(eval $1_LPS$3:=$(call compress_paths,$(wordlist $3,$4,$($1))))) endef define ListPathsSafely_Printf - $(if $(strip $($1_LPS$4)),printf -- "$(strip $($1_LPS$4))\n" | $(decompress_paths) $3) + $(if $(strip $($1_LPS$4)),$(if $(findstring $(LOG_LEVEL),trace),,@)printf \ + -- "$(strip $($1_LPS$4))\n" | $(decompress_paths) $3) endef # Receipt example: -# rm -f thepaths -# $(call ListPathsSafely,THEPATHS,\n, >> thepaths) -# The \n argument means translate spaces into \n -# if instead , , (a space) is supplied, then spaces remain spaces. +# rm -f thepaths +# $(call ListPathsSafely,THEPATHS,\n, >> thepaths) +# The \n argument means translate spaces into \n +# if instead , , (a space) is supplied, then spaces remain spaces. define ListPathsSafely - $(if $(word 16001,$($1)),$(error Cannot list safely more than 16000 paths. $1 has $(words $($1)) paths!)) - $(call ListPathsSafely_If,$1,$2,1,250) - $(call ListPathsSafely_If,$1,$2,251,500) - $(call ListPathsSafely_If,$1,$2,501,750) - $(call ListPathsSafely_If,$1,$2,751,1000) + $(if $(word 16001,$($1)),$(error Cannot list safely more than 16000 paths. $1 has $(words $($1)) paths!)) + $(ECHO) $(LOG_DEBUG) Writing $(words $($1)) paths to '$3' + $(call ListPathsSafely_If,$1,$2,1,250) + $(call ListPathsSafely_If,$1,$2,251,500) + $(call ListPathsSafely_If,$1,$2,501,750) + $(call ListPathsSafely_If,$1,$2,751,1000) - $(call ListPathsSafely_If,$1,$2,1001,1250) - $(call ListPathsSafely_If,$1,$2,1251,1500) - $(call ListPathsSafely_If,$1,$2,1501,1750) - $(call ListPathsSafely_If,$1,$2,1751,2000) + $(call ListPathsSafely_If,$1,$2,1001,1250) + $(call ListPathsSafely_If,$1,$2,1251,1500) + $(call ListPathsSafely_If,$1,$2,1501,1750) + $(call ListPathsSafely_If,$1,$2,1751,2000) - $(call ListPathsSafely_If,$1,$2,2001,2250) - $(call ListPathsSafely_If,$1,$2,2251,2500) - $(call ListPathsSafely_If,$1,$2,2501,2750) - $(call ListPathsSafely_If,$1,$2,2751,3000) + $(call ListPathsSafely_If,$1,$2,2001,2250) + $(call ListPathsSafely_If,$1,$2,2251,2500) + $(call ListPathsSafely_If,$1,$2,2501,2750) + $(call ListPathsSafely_If,$1,$2,2751,3000) - $(call ListPathsSafely_If,$1,$2,3001,3250) - $(call ListPathsSafely_If,$1,$2,3251,3500) - $(call ListPathsSafely_If,$1,$2,3501,3750) - $(call ListPathsSafely_If,$1,$2,3751,4000) + $(call ListPathsSafely_If,$1,$2,3001,3250) + $(call ListPathsSafely_If,$1,$2,3251,3500) + $(call ListPathsSafely_If,$1,$2,3501,3750) + $(call ListPathsSafely_If,$1,$2,3751,4000) - $(call ListPathsSafely_If,$1,$2,4001,4250) - $(call ListPathsSafely_If,$1,$2,4251,4500) - $(call ListPathsSafely_If,$1,$2,4501,4750) - $(call ListPathsSafely_If,$1,$2,4751,5000) + $(call ListPathsSafely_If,$1,$2,4001,4250) + $(call ListPathsSafely_If,$1,$2,4251,4500) + $(call ListPathsSafely_If,$1,$2,4501,4750) + $(call ListPathsSafely_If,$1,$2,4751,5000) - $(call ListPathsSafely_If,$1,$2,5001,5250) - $(call ListPathsSafely_If,$1,$2,5251,5500) - $(call ListPathsSafely_If,$1,$2,5501,5750) - $(call ListPathsSafely_If,$1,$2,5751,6000) + $(call ListPathsSafely_If,$1,$2,5001,5250) + $(call ListPathsSafely_If,$1,$2,5251,5500) + $(call ListPathsSafely_If,$1,$2,5501,5750) + $(call ListPathsSafely_If,$1,$2,5751,6000) - $(call ListPathsSafely_If,$1,$2,6001,6250) - $(call ListPathsSafely_If,$1,$2,6251,6500) - $(call ListPathsSafely_If,$1,$2,6501,6750) - $(call ListPathsSafely_If,$1,$2,6751,7000) + $(call ListPathsSafely_If,$1,$2,6001,6250) + $(call ListPathsSafely_If,$1,$2,6251,6500) + $(call ListPathsSafely_If,$1,$2,6501,6750) + $(call ListPathsSafely_If,$1,$2,6751,7000) - $(call ListPathsSafely_If,$1,$2,7001,7250) - $(call ListPathsSafely_If,$1,$2,7251,7500) - $(call ListPathsSafely_If,$1,$2,7501,7750) - $(call ListPathsSafely_If,$1,$2,7751,8000) + $(call ListPathsSafely_If,$1,$2,7001,7250) + $(call ListPathsSafely_If,$1,$2,7251,7500) + $(call ListPathsSafely_If,$1,$2,7501,7750) + $(call ListPathsSafely_If,$1,$2,7751,8000) - $(call ListPathsSafely_If,$1,$2,8001,8250) - $(call ListPathsSafely_If,$1,$2,8251,8500) - $(call ListPathsSafely_If,$1,$2,8501,8750) - $(call ListPathsSafely_If,$1,$2,8751,9000) + $(call ListPathsSafely_If,$1,$2,8001,8250) + $(call ListPathsSafely_If,$1,$2,8251,8500) + $(call ListPathsSafely_If,$1,$2,8501,8750) + $(call ListPathsSafely_If,$1,$2,8751,9000) - $(call ListPathsSafely_If,$1,$2,9001,9250) - $(call ListPathsSafely_If,$1,$2,9251,9500) - $(call ListPathsSafely_If,$1,$2,9501,9750) - $(call ListPathsSafely_If,$1,$2,9751,10000) + $(call ListPathsSafely_If,$1,$2,9001,9250) + $(call ListPathsSafely_If,$1,$2,9251,9500) + $(call ListPathsSafely_If,$1,$2,9501,9750) + $(call ListPathsSafely_If,$1,$2,9751,10000) - $(call ListPathsSafely_If,$1,$2,10001,10250) - $(call ListPathsSafely_If,$1,$2,10251,10500) - $(call ListPathsSafely_If,$1,$2,10501,10750) - $(call ListPathsSafely_If,$1,$2,10751,11000) + $(call ListPathsSafely_If,$1,$2,10001,10250) + $(call ListPathsSafely_If,$1,$2,10251,10500) + $(call ListPathsSafely_If,$1,$2,10501,10750) + $(call ListPathsSafely_If,$1,$2,10751,11000) - $(call ListPathsSafely_If,$1,$2,11001,11250) - $(call ListPathsSafely_If,$1,$2,11251,11500) - $(call ListPathsSafely_If,$1,$2,11501,11750) - $(call ListPathsSafely_If,$1,$2,11751,12000) + $(call ListPathsSafely_If,$1,$2,11001,11250) + $(call ListPathsSafely_If,$1,$2,11251,11500) + $(call ListPathsSafely_If,$1,$2,11501,11750) + $(call ListPathsSafely_If,$1,$2,11751,12000) - $(call ListPathsSafely_If,$1,$2,12001,12250) - $(call ListPathsSafely_If,$1,$2,12251,12500) - $(call ListPathsSafely_If,$1,$2,12501,12750) - $(call ListPathsSafely_If,$1,$2,12751,13000) + $(call ListPathsSafely_If,$1,$2,12001,12250) + $(call ListPathsSafely_If,$1,$2,12251,12500) + $(call ListPathsSafely_If,$1,$2,12501,12750) + $(call ListPathsSafely_If,$1,$2,12751,13000) - $(call ListPathsSafely_If,$1,$2,13001,13250) - $(call ListPathsSafely_If,$1,$2,13251,13500) - $(call ListPathsSafely_If,$1,$2,13501,13750) - $(call ListPathsSafely_If,$1,$2,13751,14000) + $(call ListPathsSafely_If,$1,$2,13001,13250) + $(call ListPathsSafely_If,$1,$2,13251,13500) + $(call ListPathsSafely_If,$1,$2,13501,13750) + $(call ListPathsSafely_If,$1,$2,13751,14000) - $(call ListPathsSafely_If,$1,$2,14001,14250) - $(call ListPathsSafely_If,$1,$2,14251,14500) - $(call ListPathsSafely_If,$1,$2,14501,14750) - $(call ListPathsSafely_If,$1,$2,14751,15000) + $(call ListPathsSafely_If,$1,$2,14001,14250) + $(call ListPathsSafely_If,$1,$2,14251,14500) + $(call ListPathsSafely_If,$1,$2,14501,14750) + $(call ListPathsSafely_If,$1,$2,14751,15000) - $(call ListPathsSafely_If,$1,$2,15001,15250) - $(call ListPathsSafely_If,$1,$2,15251,15500) - $(call ListPathsSafely_If,$1,$2,15501,15750) - $(call ListPathsSafely_If,$1,$2,15751,16000) + $(call ListPathsSafely_If,$1,$2,15001,15250) + $(call ListPathsSafely_If,$1,$2,15251,15500) + $(call ListPathsSafely_If,$1,$2,15501,15750) + $(call ListPathsSafely_If,$1,$2,15751,16000) - $(call ListPathsSafely_Printf,$1,$2,$3,1) - $(call ListPathsSafely_Printf,$1,$2,$3,251) - $(call ListPathsSafely_Printf,$1,$2,$3,501) - $(call ListPathsSafely_Printf,$1,$2,$3,751) + $(call ListPathsSafely_Printf,$1,$2,$3,1) + $(call ListPathsSafely_Printf,$1,$2,$3,251) + $(call ListPathsSafely_Printf,$1,$2,$3,501) + $(call ListPathsSafely_Printf,$1,$2,$3,751) - $(call ListPathsSafely_Printf,$1,$2,$3,1001) - $(call ListPathsSafely_Printf,$1,$2,$3,1251) - $(call ListPathsSafely_Printf,$1,$2,$3,1501) - $(call ListPathsSafely_Printf,$1,$2,$3,1751) + $(call ListPathsSafely_Printf,$1,$2,$3,1001) + $(call ListPathsSafely_Printf,$1,$2,$3,1251) + $(call ListPathsSafely_Printf,$1,$2,$3,1501) + $(call ListPathsSafely_Printf,$1,$2,$3,1751) - $(call ListPathsSafely_Printf,$1,$2,$3,2001) - $(call ListPathsSafely_Printf,$1,$2,$3,2251) - $(call ListPathsSafely_Printf,$1,$2,$3,2501) - $(call ListPathsSafely_Printf,$1,$2,$3,2751) + $(call ListPathsSafely_Printf,$1,$2,$3,2001) + $(call ListPathsSafely_Printf,$1,$2,$3,2251) + $(call ListPathsSafely_Printf,$1,$2,$3,2501) + $(call ListPathsSafely_Printf,$1,$2,$3,2751) - $(call ListPathsSafely_Printf,$1,$2,$3,3001) - $(call ListPathsSafely_Printf,$1,$2,$3,3251) - $(call ListPathsSafely_Printf,$1,$2,$3,3501) - $(call ListPathsSafely_Printf,$1,$2,$3,3751) + $(call ListPathsSafely_Printf,$1,$2,$3,3001) + $(call ListPathsSafely_Printf,$1,$2,$3,3251) + $(call ListPathsSafely_Printf,$1,$2,$3,3501) + $(call ListPathsSafely_Printf,$1,$2,$3,3751) - $(call ListPathsSafely_Printf,$1,$2,$3,4001) - $(call ListPathsSafely_Printf,$1,$2,$3,4251) - $(call ListPathsSafely_Printf,$1,$2,$3,4501) - $(call ListPathsSafely_Printf,$1,$2,$3,4751) + $(call ListPathsSafely_Printf,$1,$2,$3,4001) + $(call ListPathsSafely_Printf,$1,$2,$3,4251) + $(call ListPathsSafely_Printf,$1,$2,$3,4501) + $(call ListPathsSafely_Printf,$1,$2,$3,4751) - $(call ListPathsSafely_Printf,$1,$2,$3,5001) - $(call ListPathsSafely_Printf,$1,$2,$3,5251) - $(call ListPathsSafely_Printf,$1,$2,$3,5501) - $(call ListPathsSafely_Printf,$1,$2,$3,5751) + $(call ListPathsSafely_Printf,$1,$2,$3,5001) + $(call ListPathsSafely_Printf,$1,$2,$3,5251) + $(call ListPathsSafely_Printf,$1,$2,$3,5501) + $(call ListPathsSafely_Printf,$1,$2,$3,5751) - $(call ListPathsSafely_Printf,$1,$2,$3,6001) - $(call ListPathsSafely_Printf,$1,$2,$3,6251) - $(call ListPathsSafely_Printf,$1,$2,$3,6501) - $(call ListPathsSafely_Printf,$1,$2,$3,6751) + $(call ListPathsSafely_Printf,$1,$2,$3,6001) + $(call ListPathsSafely_Printf,$1,$2,$3,6251) + $(call ListPathsSafely_Printf,$1,$2,$3,6501) + $(call ListPathsSafely_Printf,$1,$2,$3,6751) - $(call ListPathsSafely_Printf,$1,$2,$3,7001) - $(call ListPathsSafely_Printf,$1,$2,$3,7251) - $(call ListPathsSafely_Printf,$1,$2,$3,7501) - $(call ListPathsSafely_Printf,$1,$2,$3,7751) + $(call ListPathsSafely_Printf,$1,$2,$3,7001) + $(call ListPathsSafely_Printf,$1,$2,$3,7251) + $(call ListPathsSafely_Printf,$1,$2,$3,7501) + $(call ListPathsSafely_Printf,$1,$2,$3,7751) - $(call ListPathsSafely_Printf,$1,$2,$3,8001) - $(call ListPathsSafely_Printf,$1,$2,$3,8251) - $(call ListPathsSafely_Printf,$1,$2,$3,8501) - $(call ListPathsSafely_Printf,$1,$2,$3,8751) + $(call ListPathsSafely_Printf,$1,$2,$3,8001) + $(call ListPathsSafely_Printf,$1,$2,$3,8251) + $(call ListPathsSafely_Printf,$1,$2,$3,8501) + $(call ListPathsSafely_Printf,$1,$2,$3,8751) - $(call ListPathsSafely_Printf,$1,$2,$3,9001) - $(call ListPathsSafely_Printf,$1,$2,$3,9251) - $(call ListPathsSafely_Printf,$1,$2,$3,9501) - $(call ListPathsSafely_Printf,$1,$2,$3,9751) + $(call ListPathsSafely_Printf,$1,$2,$3,9001) + $(call ListPathsSafely_Printf,$1,$2,$3,9251) + $(call ListPathsSafely_Printf,$1,$2,$3,9501) + $(call ListPathsSafely_Printf,$1,$2,$3,9751) - $(call ListPathsSafely_Printf,$1,$2,$3,10001) - $(call ListPathsSafely_Printf,$1,$2,$3,10251) - $(call ListPathsSafely_Printf,$1,$2,$3,10501) - $(call ListPathsSafely_Printf,$1,$2,$3,10751) + $(call ListPathsSafely_Printf,$1,$2,$3,10001) + $(call ListPathsSafely_Printf,$1,$2,$3,10251) + $(call ListPathsSafely_Printf,$1,$2,$3,10501) + $(call ListPathsSafely_Printf,$1,$2,$3,10751) - $(call ListPathsSafely_Printf,$1,$2,$3,11001) - $(call ListPathsSafely_Printf,$1,$2,$3,11251) - $(call ListPathsSafely_Printf,$1,$2,$3,11501) - $(call ListPathsSafely_Printf,$1,$2,$3,11751) + $(call ListPathsSafely_Printf,$1,$2,$3,11001) + $(call ListPathsSafely_Printf,$1,$2,$3,11251) + $(call ListPathsSafely_Printf,$1,$2,$3,11501) + $(call ListPathsSafely_Printf,$1,$2,$3,11751) - $(call ListPathsSafely_Printf,$1,$2,$3,12001) - $(call ListPathsSafely_Printf,$1,$2,$3,12251) - $(call ListPathsSafely_Printf,$1,$2,$3,12501) - $(call ListPathsSafely_Printf,$1,$2,$3,12751) + $(call ListPathsSafely_Printf,$1,$2,$3,12001) + $(call ListPathsSafely_Printf,$1,$2,$3,12251) + $(call ListPathsSafely_Printf,$1,$2,$3,12501) + $(call ListPathsSafely_Printf,$1,$2,$3,12751) - $(call ListPathsSafely_Printf,$1,$2,$3,13001) - $(call ListPathsSafely_Printf,$1,$2,$3,13251) - $(call ListPathsSafely_Printf,$1,$2,$3,13501) - $(call ListPathsSafely_Printf,$1,$2,$3,13751) + $(call ListPathsSafely_Printf,$1,$2,$3,13001) + $(call ListPathsSafely_Printf,$1,$2,$3,13251) + $(call ListPathsSafely_Printf,$1,$2,$3,13501) + $(call ListPathsSafely_Printf,$1,$2,$3,13751) - $(call ListPathsSafely_Printf,$1,$2,$3,14001) - $(call ListPathsSafely_Printf,$1,$2,$3,14251) - $(call ListPathsSafely_Printf,$1,$2,$3,14501) - $(call ListPathsSafely_Printf,$1,$2,$3,14751) + $(call ListPathsSafely_Printf,$1,$2,$3,14001) + $(call ListPathsSafely_Printf,$1,$2,$3,14251) + $(call ListPathsSafely_Printf,$1,$2,$3,14501) + $(call ListPathsSafely_Printf,$1,$2,$3,14751) - $(call ListPathsSafely_Printf,$1,$2,$3,15001) - $(call ListPathsSafely_Printf,$1,$2,$3,15251) - $(call ListPathsSafely_Printf,$1,$2,$3,15501) - $(call ListPathsSafely_Printf,$1,$2,$3,15751) + $(call ListPathsSafely_Printf,$1,$2,$3,15001) + $(call ListPathsSafely_Printf,$1,$2,$3,15251) + $(call ListPathsSafely_Printf,$1,$2,$3,15501) + $(call ListPathsSafely_Printf,$1,$2,$3,15751) endef define ListPathsSafelyNow_IfPrintf - ifneq (,$$(word $4,$$($1))) - $$(eval $1_LPS$4:=$$(call compress_paths,$$(wordlist $4,$5,$$($1)))) - $$(shell printf -- "$$(strip $$($1_LPS$4))\n" | $(decompress_paths) $3) - endif + ifneq (,$$(word $4,$$($1))) + $$(eval $1_LPS$4:=$$(call compress_paths,$$(wordlist $4,$5,$$($1)))) + $$(shell printf -- "$$(strip $$($1_LPS$4))\n" | $(decompress_paths) $3) + endif endef # And an non-receipt version: define ListPathsSafelyNow - ifneq (,$$(word 10001,$$($1))) - $$(error Cannot list safely more than 10000 paths. $1 has $$(words $$($1)) paths!) - endif - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1,250) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,251,500) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,501,750) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,751,1000) + ifneq (,$$(word 10001,$$($1))) + $$(error Cannot list safely more than 10000 paths. $1 has $$(words $$($1)) paths!) + endif + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1,250) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,251,500) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,501,750) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,751,1000) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1001,1250) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1251,1500) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1501,1750) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1751,2000) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1001,1250) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1251,1500) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1501,1750) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1751,2000) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2001,2250) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2251,2500) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2501,2750) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2751,3000) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2001,2250) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2251,2500) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2501,2750) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2751,3000) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3001,3250) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3251,3500) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3501,3750) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3751,4000) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3001,3250) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3251,3500) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3501,3750) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3751,4000) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4001,4250) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4251,4500) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4501,4750) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4751,5000) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4001,4250) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4251,4500) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4501,4750) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4751,5000) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5001,5250) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5251,5500) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5501,5750) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5751,6000) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5001,5250) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5251,5500) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5501,5750) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5751,6000) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6001,6250) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6251,6500) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6501,6750) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6751,7000) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6001,6250) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6251,6500) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6501,6750) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6751,7000) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7001,7250) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7251,7500) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7501,7750) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7751,8000) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7001,7250) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7251,7500) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7501,7750) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7751,8000) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8001,8250) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8251,8500) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8501,8750) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8751,9000) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8001,8250) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8251,8500) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8501,8750) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8751,9000) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9001,9250) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9251,9500) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9501,9750) - $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9751,10000) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9001,9250) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9251,9500) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9501,9750) + $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9751,10000) endef # The source tips can come from the Mercurial repository, or in the files -# $(HGTIP_FILENAME) which contains the tip but is also positioned in the same -# directory as the original $(HGDIR) directory. -# These should not be := assignments, only used from the root Makefile. +# $(HGTIP_FILENAME) which contains the tip but is also positioned in the same +# directory as the original $(HGDIR) directory. +# These should not be := assignments, only used from the root Makefile. HG_VERSION = $(shell $(HG) version 2> /dev/null) HG_DIRECTORY=.hg HGTIP_FILENAME=.hgtip HG_SEARCH = ./REPO ./*/REPO ./*/*/REPO ./*/*/*/REPO REPO_LIST = $(patsubst ./%,%,$(patsubst %/,%,$(sort $(dir \ $(shell $(CD) $(SRC_ROOT) ; ( $(LS) -d $(HG_SEARCH:%/REPO=%/$(HG_DIRECTORY)) ; \ - $(LS) $(HG_SEARCH:%/REPO=%/$(HGTIP_FILENAME)) ) \ - 2> /dev/null))))) + $(LS) $(HG_SEARCH:%/REPO=%/$(HGTIP_FILENAME)) ) \ + 2> /dev/null))))) # Emit the repo:tip pairs to $@ define GetSourceTips -$(CD) $(SRC_ROOT) ; \ -for i in $(REPO_LIST) IGNORE ; do \ - if [ "$${i}" = "IGNORE" ] ; then \ - continue; \ - elif [ -d $${i}/$(HG_DIRECTORY) -a "$(HG_VERSION)" != "" ] ; then \ - $(PRINTF) " %s:%s" \ - "$${i}" `$(HG) tip --repository $${i} --template '{node|short}\n'` ; \ - elif [ -f $${i}/$(HGTIP_FILENAME) ] ; then \ - $(PRINTF) " %s:%s" \ - "$${i}" `$(CAT) $${i}/$(HGTIP_FILENAME)` ; \ - fi; \ -done >> $@ -$(PRINTF) "\n" >> $@ + $(CD) $(SRC_ROOT) ; \ + for i in $(REPO_LIST) IGNORE ; do \ + if [ "$${i}" = "IGNORE" ] ; then \ + continue; \ + elif [ -d $${i}/$(HG_DIRECTORY) -a "$(HG_VERSION)" != "" ] ; then \ + $(PRINTF) " %s:%s" \ + "$${i}" `$(HG) tip --repository $${i} --template '{node|short}\n'` ; \ + elif [ -f $${i}/$(HGTIP_FILENAME) ] ; then \ + $(PRINTF) " %s:%s" \ + "$${i}" `$(CAT) $${i}/$(HGTIP_FILENAME)` ; \ + fi; \ + done >> $@ + $(PRINTF) "\n" >> $@ endef # Create the HGTIP_FILENAME file. Called from jdk/make/closed/bundles.gmk define CreateHgTip -$(HG) tip --repository $1 --template '{node|short}\n' > $1/$(HGTIP_FILENAME);\ -$(ECHO) $1/$(HGTIP_FILENAME) + $(HG) tip --repository $1 --template '{node|short}\n' > $1/$(HGTIP_FILENAME); \ + $(ECHO) $1/$(HGTIP_FILENAME) endef define SetupLogging - ifeq ($$(LOG_LEVEL),trace) - # Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make - # For each target executed, will print - # Building (from ) ( newer) - # but with a limit of 20 on , to avoid cluttering logs too much - # (and causing a crash on Cygwin). - # Default shell seems to always be /bin/sh. Must override with bash to get this to work on Solaris. - # Only use time if it's GNU time which supports format and output file. - WRAPPER_SHELL:=/bin/bash $$(SRC_ROOT)/common/bin/shell-tracer.sh $$(if $$(findstring yes,$$(IS_GNU_TIME)),$$(TIME),-) $$(OUTPUT_ROOT)/build-trace-time.log /bin/bash - SHELL=$$(warning $$(if $$@,Building $$@,Running shell command) $$(if $$<, (from $$<))$$(if $$?, ($$(wordlist 1, 20, $$?) $$(if $$(wordlist 21, 22, $$?), ... [in total $$(words $$?) files]) newer)))$$(WRAPPER_SHELL) - endif - # Never remove warning messages; this is just for completeness - LOG_WARN= - ifneq ($$(findstring $$(LOG_LEVEL),info debug trace),) - LOG_INFO= - else - LOG_INFO=> /dev/null - endif - ifneq ($$(findstring $$(LOG_LEVEL),debug trace),) - LOG_DEBUG= - else - LOG_DEBUG=> /dev/null - endif - ifneq ($$(findstring $$(LOG_LEVEL),trace),) - LOG_TRACE= - else - LOG_TRACE=> /dev/null - endif + ifeq ($$(LOG_LEVEL),trace) + # Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make + # For each target executed, will print + # Building (from ) ( newer) + # but with a limit of 20 on , to avoid cluttering logs too much + # (and causing a crash on Cygwin). + # Default shell seems to always be /bin/sh. Must override with bash to get this to work on Solaris. + # Only use time if it's GNU time which supports format and output file. + WRAPPER_SHELL:=/bin/bash $$(SRC_ROOT)/common/bin/shell-tracer.sh $$(if $$(findstring yes,$$(IS_GNU_TIME)),$$(TIME),-) $$(OUTPUT_ROOT)/build-trace-time.log /bin/bash + SHELL=$$(warning $$(if $$@,Building $$@,Running shell command) $$(if $$<, (from $$<))$$(if $$?, ($$(wordlist 1, 20, $$?) $$(if $$(wordlist 21, 22, $$?), ... [in total $$(words $$?) files]) newer)))$$(WRAPPER_SHELL) + endif + # Never remove warning messages; this is just for completeness + LOG_WARN= + ifneq ($$(findstring $$(LOG_LEVEL),info debug trace),) + LOG_INFO= + else + LOG_INFO=> /dev/null + endif + ifneq ($$(findstring $$(LOG_LEVEL),debug trace),) + LOG_DEBUG= + else + LOG_DEBUG=> /dev/null + endif + ifneq ($$(findstring $$(LOG_LEVEL),trace),) + LOG_TRACE= + else + LOG_TRACE=> /dev/null + endif endef # Make sure logging is setup for everyone that includes MakeBase.gmk. @@ -363,43 +365,43 @@ $(eval $(call SetupLogging)) # This is to be called by all SetupFoo macros define LogSetupMacroEntry - $(if $(27),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk)) - $(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26,$(if $($i),$(NEWLINE) $(strip [$i] $($i)))))) + $(if $(27),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk)) + $(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26,$(if $($i),$(NEWLINE) $(strip [$i] $($i)))))) endef # Make directory without forking mkdir if not needed define MakeDir - ifneq ($$(wildcard $1 $2 $3 $4 $5 $6 $7 $8 $9),$$(strip $1 $2 $3 $4 $5 $6 $7 $8 $9)) - $$(shell $(MKDIR) -p $1 $2 $3 $4 $5 $6 $7 $8 $9) - endif + ifneq ($$(wildcard $1 $2 $3 $4 $5 $6 $7 $8 $9),$$(strip $1 $2 $3 $4 $5 $6 $7 $8 $9)) + $$(shell $(MKDIR) -p $1 $2 $3 $4 $5 $6 $7 $8 $9) + endif endef ifeq ($(OPENJDK_TARGET_OS),solaris) -# On Solaris, if the target is a symlink and exists, cp won't overwrite. -# Cp has to operate in recursive mode to allow for -P flag, to preserve soft links. If the -# name of the target file differs from the source file, rename after copy. -define install-file + # On Solaris, if the target is a symlink and exists, cp won't overwrite. + # Cp has to operate in recursive mode to allow for -P flag, to preserve soft links. If the + # name of the target file differs from the source file, rename after copy. + define install-file $(MKDIR) -p $(@D) $(RM) '$@' $(CP) -f -r -P '$<' '$(@D)' if [ "$(@F)" != "$( $(BUILDTIMESDIR)/build_time_start_$1 - $(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$1_human_readable + $(MKDIR) -p $(BUILDTIMESDIR) + $(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$1 + $(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$1_human_readable endef # Record ending time and calculate the difference and store it in a # easy to read format. Handles builds that cross midnight. Expects -# that a build will never take 24 hours or more. +# that a build will never take 24 hours or more. define RecordEndTime - $(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$1 - $(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$1_human_readable - $(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$1` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$1` $1 | \ - $(NAWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \ - M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \ - > $(BUILDTIMESDIR)/build_time_diff_$1 + $(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$1 + $(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$1_human_readable + $(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$1` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$1` $1 | \ + $(NAWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \ + M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \ + > $(BUILDTIMESDIR)/build_time_diff_$1 endef # Find all build_time_* files and print their contents in a list sorted # on the name of the sub repository. define ReportBuildTimes - $(BUILD_LOG_WRAPPER) $(PRINTF) -- "----- Build times -------\nStart %s\nEnd %s\n%s\n%s\n-------------------------\n" \ - "`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \ - "`$(CAT) $(BUILDTIMESDIR)/build_time_end_TOTAL_human_readable`" \ - "`$(LS) $(BUILDTIMESDIR)/build_time_diff_* | $(GREP) -v _TOTAL | $(XARGS) $(CAT) | $(SORT) -k 2`" \ - "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`" + $(BUILD_LOG_WRAPPER) $(PRINTF) -- "----- Build times -------\nStart %s\nEnd %s\n%s\n%s\n-------------------------\n" \ + "`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \ + "`$(CAT) $(BUILDTIMESDIR)/build_time_end_TOTAL_human_readable`" \ + "`$(LS) $(BUILDTIMESDIR)/build_time_diff_* | $(GREP) -v _TOTAL | $(XARGS) $(CAT) | $(SORT) -k 2`" \ + "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`" endef define ResetAllTimers - $$(shell $(MKDIR) -p $(BUILDTIMESDIR) && $(RM) $(BUILDTIMESDIR)/build_time_*) + $$(shell $(MKDIR) -p $(BUILDTIMESDIR) && $(RM) $(BUILDTIMESDIR)/build_time_*) endef define StartGlobalTimer - $(call RecordStartTime,TOTAL) + $(call RecordStartTime,TOTAL) endef define StopGlobalTimer - $(call RecordEndTime,TOTAL) + $(call RecordEndTime,TOTAL) endef ### Functions for managing makefile structure (start/end of makefile and individual targets) @@ -123,184 +123,184 @@ endef # Check if the current target is the final target, as specified by # the user on the command line. If so, call AtRootMakeEnd. define CheckIfMakeAtEnd - # Check if the current target is the last goal - $(if $(filter $@,$(call LastGoal)),$(call AtMakeEnd)) - # If the target is 'foo-only', check if our goal was stated as 'foo' - $(if $(filter $@,$(call LastGoal)-only),$(call AtMakeEnd)) + # Check if the current target is the last goal + $(if $(filter $@,$(call LastGoal)),$(call AtMakeEnd)) + # If the target is 'foo-only', check if our goal was stated as 'foo' + $(if $(filter $@,$(call LastGoal)-only),$(call AtMakeEnd)) endef # Hook to be called when starting to execute a top-level target define TargetEnter - $(BUILD_LOG_WRAPPER) $(PRINTF) "## Starting $(patsubst %-only,%,$@)\n" - $(call RecordStartTime,$(patsubst %-only,%,$@)) + $(BUILD_LOG_WRAPPER) $(PRINTF) "## Starting $(patsubst %-only,%,$@)\n" + $(call RecordStartTime,$(patsubst %-only,%,$@)) endef # Hook to be called when finish executing a top-level target define TargetExit - $(call RecordEndTime,$(patsubst %-only,%,$@)) - $(BUILD_LOG_WRAPPER) $(PRINTF) "## Finished $(patsubst %-only,%,$@) (build time %s)\n\n" \ - "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_$(patsubst %-only,%,$@) | $(CUT) -f 1 -d ' '`" - $(call CheckIfMakeAtEnd) + $(call RecordEndTime,$(patsubst %-only,%,$@)) + $(BUILD_LOG_WRAPPER) $(PRINTF) "## Finished $(patsubst %-only,%,$@) (build time %s)\n\n" \ + "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_$(patsubst %-only,%,$@) | $(CUT) -f 1 -d ' '`" + $(call CheckIfMakeAtEnd) endef # Hook to be called as the very first thing when running a normal build define AtMakeStart - $(if $(findstring --jobserver,$(MAKEFLAGS)),$(error make -j is not supported, use make JOBS=n)) - $(call CheckEnvironment) - @$(PRINTF) $(LOG_INFO) "Running make as '$(MAKE) $(MFLAGS) $(MAKE_ARGS)'\n" - @$(PRINTF) "Building $(PRODUCT_NAME) for target '$(call GetRealTarget)' in configuration '$(CONF_NAME)'\n\n" - $(call StartGlobalTimer) + $(if $(findstring --jobserver,$(MAKEFLAGS)),$(error make -j is not supported, use make JOBS=n)) + $(call CheckEnvironment) + @$(PRINTF) $(LOG_INFO) "Running make as '$(MAKE) $(MFLAGS) $(MAKE_ARGS)'\n" + @$(PRINTF) "Building $(PRODUCT_NAME) for target '$(call GetRealTarget)' in configuration '$(CONF_NAME)'\n\n" + $(call StartGlobalTimer) endef # Hook to be called as the very last thing for targets that are "top level" targets define AtMakeEnd - [ -f $(SJAVAC_SERVER_DIR)/server.port ] && echo Stopping sjavac server && $(TOUCH) $(SJAVAC_SERVER_DIR)/server.port.stop; true - $(call StopGlobalTimer) - $(call ReportBuildTimes) - @$(PRINTF) "Finished building $(PRODUCT_NAME) for target '$(call GetRealTarget)'\n" - $(call CheckEnvironment) + [ -f $(SJAVAC_SERVER_DIR)/server.port ] && echo Stopping sjavac server && $(TOUCH) $(SJAVAC_SERVER_DIR)/server.port.stop; true + $(call StopGlobalTimer) + $(call ReportBuildTimes) + @$(PRINTF) "Finished building $(PRODUCT_NAME) for target '$(call GetRealTarget)'\n" + $(call CheckEnvironment) endef ### Functions for parsing and setting up make options from command-line define FatalError - # If the user specificed a "global" target (e.g. 'help'), do not exit but continue running - $$(if $$(filter-out $(global_targets),$$(call GetRealTarget)),$$(error Cannot continue)) + # If the user specificed a "global" target (e.g. 'help'), do not exit but continue running + $$(if $$(filter-out $(global_targets),$$(call GetRealTarget)),$$(error Cannot continue)) endef define ParseLogLevel - ifeq ($$(origin VERBOSE),undefined) - # Setup logging according to LOG (but only if VERBOSE is not given) + ifeq ($$(origin VERBOSE),undefined) + # Setup logging according to LOG (but only if VERBOSE is not given) - # If the "nofile" argument is given, act on it and strip it away - ifneq ($$(findstring nofile,$$(LOG)),) - # Reset the build log wrapper, regardless of other values - override BUILD_LOG_WRAPPER= - # COMMA is defined in spec.gmk, but that is not included yet - COMMA=, - # First try to remove ",nofile" if it exists - LOG_STRIPPED1=$$(subst $$(COMMA)nofile,,$$(LOG)) - # Otherwise just remove "nofile" - LOG_STRIPPED2=$$(subst nofile,,$$(LOG_STRIPPED1)) - # We might have ended up with a leading comma. Remove it - LOG_STRIPPED3=$$(strip $$(patsubst $$(COMMA)%,%,$$(LOG_STRIPPED2))) - LOG_LEVEL:=$$(LOG_STRIPPED3) - else - LOG_LEVEL:=$$(LOG) - endif - - ifeq ($$(LOG_LEVEL),) - # Set LOG to "warn" as default if not set (and no VERBOSE given) - override LOG_LEVEL=warn - endif - ifeq ($$(LOG_LEVEL),warn) - VERBOSE=-s - else ifeq ($$(LOG_LEVEL),info) - VERBOSE=-s - else ifeq ($$(LOG_LEVEL),debug) - VERBOSE= - else ifeq ($$(LOG_LEVEL),trace) - VERBOSE= - else - $$(info Error: LOG must be one of: warn, info, debug or trace.) - $$(eval $$(call FatalError)) - endif + # If the "nofile" argument is given, act on it and strip it away + ifneq ($$(findstring nofile,$$(LOG)),) + # Reset the build log wrapper, regardless of other values + override BUILD_LOG_WRAPPER= + # COMMA is defined in spec.gmk, but that is not included yet + COMMA=, + # First try to remove ",nofile" if it exists + LOG_STRIPPED1=$$(subst $$(COMMA)nofile,,$$(LOG)) + # Otherwise just remove "nofile" + LOG_STRIPPED2=$$(subst nofile,,$$(LOG_STRIPPED1)) + # We might have ended up with a leading comma. Remove it + LOG_STRIPPED3=$$(strip $$(patsubst $$(COMMA)%,%,$$(LOG_STRIPPED2))) + LOG_LEVEL:=$$(LOG_STRIPPED3) else - # Provide resonable interpretations of LOG_LEVEL if VERBOSE is given. - ifeq ($(VERBOSE),) - LOG_LEVEL:=debug - else - LOG_LEVEL:=warn - endif - ifneq ($$(LOG),) - # We have both a VERBOSE and a LOG argument. This is OK only if this is a repeated call by ourselves, - # but complain if this is the top-level make call. - ifeq ($$(MAKELEVEL),0) - $$(info Cannot use LOG=$$(LOG) and VERBOSE=$$(VERBOSE) at the same time. Choose one.) - $$(eval $$(call FatalError)) - endif - endif + LOG_LEVEL:=$$(LOG) endif + + ifeq ($$(LOG_LEVEL),) + # Set LOG to "warn" as default if not set (and no VERBOSE given) + override LOG_LEVEL=warn + endif + ifeq ($$(LOG_LEVEL),warn) + VERBOSE=-s + else ifeq ($$(LOG_LEVEL),info) + VERBOSE=-s + else ifeq ($$(LOG_LEVEL),debug) + VERBOSE= + else ifeq ($$(LOG_LEVEL),trace) + VERBOSE= + else + $$(info Error: LOG must be one of: warn, info, debug or trace.) + $$(eval $$(call FatalError)) + endif + else + # Provide resonable interpretations of LOG_LEVEL if VERBOSE is given. + ifeq ($(VERBOSE),) + LOG_LEVEL:=debug + else + LOG_LEVEL:=warn + endif + ifneq ($$(LOG),) + # We have both a VERBOSE and a LOG argument. This is OK only if this is a repeated call by ourselves, + # but complain if this is the top-level make call. + ifeq ($$(MAKELEVEL),0) + $$(info Cannot use LOG=$$(LOG) and VERBOSE=$$(VERBOSE) at the same time. Choose one.) + $$(eval $$(call FatalError)) + endif + endif + endif endef define ParseConfAndSpec - ifneq ($$(filter-out $(global_targets),$$(call GetRealTarget)),) - # If we only have global targets, no need to bother with SPEC or CONF - ifneq ($$(origin SPEC),undefined) - # We have been given a SPEC, check that it works out properly - ifeq ($$(wildcard $$(SPEC)),) - $$(info Cannot locate spec.gmk, given by SPEC=$$(SPEC)) - $$(eval $$(call FatalError)) - endif - ifneq ($$(origin CONF),undefined) - # We also have a CONF argument. This is OK only if this is a repeated call by ourselves, - # but complain if this is the top-level make call. - ifeq ($$(MAKELEVEL),0) - $$(info Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.) - $$(eval $$(call FatalError)) - endif - endif - # ... OK, we're satisfied, we'll use this SPEC later on - else - # Find all spec.gmk files in the build output directory - output_dir=$$(root_dir)/build - all_spec_files=$$(wildcard $$(output_dir)/*/spec.gmk) - ifeq ($$(all_spec_files),) - $$(info No configurations found for $$(root_dir)! Please run configure to create a configuration.) - $$(eval $$(call FatalError)) - endif - # Extract the configuration names from the path - all_confs=$$(patsubst %/spec.gmk,%,$$(patsubst $$(output_dir)/%,%,$$(all_spec_files))) - - ifneq ($$(origin CONF),undefined) - # User have given a CONF= argument. - ifeq ($$(CONF),) - # If given CONF=, match all configurations - matching_confs=$$(strip $$(all_confs)) - else - # Otherwise select those that contain the given CONF string - matching_confs=$$(strip $$(foreach var,$$(all_confs),$$(if $$(findstring $$(CONF),$$(var)),$$(var)))) - endif - ifeq ($$(matching_confs),) - $$(info No configurations found matching CONF=$$(CONF)) - $$(info Available configurations:) - $$(foreach var,$$(all_confs),$$(info * $$(var))) - $$(eval $$(call FatalError)) - else - ifeq ($$(words $$(matching_confs)),1) - $$(info Building '$$(matching_confs)' (matching CONF=$$(CONF))) - else - $$(info Building target '$(call GetRealTarget)' in the following configurations (matching CONF=$$(CONF)):) - $$(foreach var,$$(matching_confs),$$(info * $$(var))) - endif - endif - - # Create a SPEC definition. This will contain the path to one or more spec.gmk files. - SPEC=$$(addsuffix /spec.gmk,$$(addprefix $$(output_dir)/,$$(matching_confs))) - else - # No CONF or SPEC given, check the available configurations - ifneq ($$(words $$(all_spec_files)),1) - $$(info No CONF given, but more than one configuration found in $$(output_dir).) - $$(info Available configurations:) - $$(foreach var,$$(all_confs),$$(info * $$(var))) - $$(info Please retry building with CONF= (or SPEC=)) - $$(eval $$(call FatalError)) - endif - - # We found exactly one configuration, use it - SPEC=$$(strip $$(all_spec_files)) - endif + ifneq ($$(filter-out $(global_targets),$$(call GetRealTarget)),) + # If we only have global targets, no need to bother with SPEC or CONF + ifneq ($$(origin SPEC),undefined) + # We have been given a SPEC, check that it works out properly + ifeq ($$(wildcard $$(SPEC)),) + $$(info Cannot locate spec.gmk, given by SPEC=$$(SPEC)) + $$(eval $$(call FatalError)) + endif + ifneq ($$(origin CONF),undefined) + # We also have a CONF argument. This is OK only if this is a repeated call by ourselves, + # but complain if this is the top-level make call. + ifeq ($$(MAKELEVEL),0) + $$(info Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.) + $$(eval $$(call FatalError)) endif + endif + # ... OK, we're satisfied, we'll use this SPEC later on + else + # Find all spec.gmk files in the build output directory + output_dir=$$(root_dir)/build + all_spec_files=$$(wildcard $$(output_dir)/*/spec.gmk) + ifeq ($$(all_spec_files),) + $$(info No configurations found for $$(root_dir)! Please run configure to create a configuration.) + $$(eval $$(call FatalError)) + endif + # Extract the configuration names from the path + all_confs=$$(patsubst %/spec.gmk,%,$$(patsubst $$(output_dir)/%,%,$$(all_spec_files))) + + ifneq ($$(origin CONF),undefined) + # User have given a CONF= argument. + ifeq ($$(CONF),) + # If given CONF=, match all configurations + matching_confs=$$(strip $$(all_confs)) + else + # Otherwise select those that contain the given CONF string + matching_confs=$$(strip $$(foreach var,$$(all_confs),$$(if $$(findstring $$(CONF),$$(var)),$$(var)))) + endif + ifeq ($$(matching_confs),) + $$(info No configurations found matching CONF=$$(CONF)) + $$(info Available configurations:) + $$(foreach var,$$(all_confs),$$(info * $$(var))) + $$(eval $$(call FatalError)) + else + ifeq ($$(words $$(matching_confs)),1) + $$(info Building '$$(matching_confs)' (matching CONF=$$(CONF))) + else + $$(info Building target '$(call GetRealTarget)' in the following configurations (matching CONF=$$(CONF)):) + $$(foreach var,$$(matching_confs),$$(info * $$(var))) + endif + endif + + # Create a SPEC definition. This will contain the path to one or more spec.gmk files. + SPEC=$$(addsuffix /spec.gmk,$$(addprefix $$(output_dir)/,$$(matching_confs))) + else + # No CONF or SPEC given, check the available configurations + ifneq ($$(words $$(all_spec_files)),1) + $$(info No CONF given, but more than one configuration found in $$(output_dir).) + $$(info Available configurations:) + $$(foreach var,$$(all_confs),$$(info * $$(var))) + $$(info Please retry building with CONF= (or SPEC=)) + $$(eval $$(call FatalError)) + endif + + # We found exactly one configuration, use it + SPEC=$$(strip $$(all_spec_files)) + endif endif + endif endef ### Convenience functions from Main.gmk # Cleans the component given as $1 define CleanComponent - @$(PRINTF) "Cleaning $1 build artifacts ..." - @($(CD) $(OUTPUT_ROOT) && $(RM) -r $1) - @$(PRINTF) " done\n" + @$(PRINTF) "Cleaning $1 build artifacts ..." + @($(CD) $(OUTPUT_ROOT) && $(RM) -r $1) + @$(PRINTF) " done\n" endef endif # _MAKEHELPERS_GMK diff --git a/common/makefiles/NativeCompilation.gmk b/common/makefiles/NativeCompilation.gmk index 24448e86ebc..6ee497f5262 100644 --- a/common/makefiles/NativeCompilation.gmk +++ b/common/makefiles/NativeCompilation.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,556 +27,568 @@ # of removing duplicates. It is actually this side effect that is # desired whenever sort is used below! -ifeq (,$(_MAKEBASE_GMK)) - $(error You must include MakeBase.gmk prior to including NativeCompilation.gmk) +ifeq (,$(_MAKEBASE_GMK)) + $(error You must include MakeBase.gmk prior to including NativeCompilation.gmk) endif ifeq ($(COMPILER_TYPE),CC) - COMPILING_MSG=echo $(LOG_INFO) "Compiling $(notdir $1) (for $(notdir $2))" - LINKING_MSG=echo $(LOG_INFO) "Linking $1" - LINKING_EXE_MSG=echo $(LOG_INFO) "Linking executable $1" - ARCHIVING_MSG=echo $(LOG_INFO) "Archiving $1" + COMPILING_MSG=echo $(LOG_INFO) "Compiling $(notdir $1) (for $(notdir $2))" + LINKING_MSG=echo $(LOG_INFO) "Linking $1" + LINKING_EXE_MSG=echo $(LOG_INFO) "Linking executable $1" + ARCHIVING_MSG=echo $(LOG_INFO) "Archiving $1" else - COMPILING_MSG= - LINKING_MSG= - LINKING_EXE_MSG= - ARCHIVING_MSG= + COMPILING_MSG= + LINKING_MSG= + LINKING_EXE_MSG= + ARCHIVING_MSG= endif define add_native_source - # param 1 = BUILD_MYPACKAGE - # parma 2 = the source file name (..../alfa.c or .../beta.cpp) - # param 3 = the bin dir that stores all .o (.obj) and .d files. - # param 4 = the c flags to the compiler - # param 5 = the c compiler - # param 6 = the c++ flags to the compiler - # param 7 = the c++ compiler - # param 8 = the flags to the assembler + # param 1 = BUILD_MYPACKAGE + # parma 2 = the source file name (..../alfa.c or .../beta.cpp) + # param 3 = the bin dir that stores all .o (.obj) and .d files. + # param 4 = the c flags to the compiler + # param 5 = the c compiler + # param 6 = the c++ flags to the compiler + # param 7 = the c++ compiler + # param 8 = the flags to the assembler - ifneq (,$$(filter %.c,$2)) - # Compile as a C file - $1_$2_FLAGS=$4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$( $$($1_$2_DEP) + $$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP).tmp $(CC_OUT_OPTION)$$($1_$2_OBJ) $2 + $(SED) 's|^$$(@F):|$$@:|' $$($1_$2_DEP).tmp > $$($1_$2_DEP) else - $$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2 - endif + $$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2 + endif endif # The Visual Studio compiler lacks a feature for generating make dependencies, but by - # setting -showIncludes, all included files are printed. These are filtered out and + # setting -showIncludes, all included files are printed. These are filtered out and # parsed into make dependences. ifeq ($(COMPILER_TYPE),CL) - ($$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) \ - $(CC_OUT_OPTION)$$($1_$2_OBJ) $2 ; echo $$$$? > $$($1_$2_DEP).exitvalue) \ - | $(TEE) $$($1_$2_DEP).raw | $(GREP) -v "^Note: including file:" \ - && exit `cat $$($1_$2_DEP).exitvalue` - $(RM) $$($1_$2_DEP).exitvalue - ($(ECHO) $$@: \\ \ - && $(SED) -e '/^Note: including file:/!d' \ - -e 's|Note: including file: *||' \ - -e 's|\\|/|g' \ - -e 's|^\([a-zA-Z]\):|/cygdrive/\1|g' \ - -e '/$(subst /,\/,$(TOPDIR))/!d' \ - -e 's|$$$$| \\|g' \ - $$($1_$2_DEP).raw) > $$($1_$2_DEP) + ($$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) \ + $(CC_OUT_OPTION)$$($1_$2_OBJ) $2 ; echo $$$$? > $$($1_$2_DEP).exitvalue) \ + | $(TEE) $$($1_$2_DEP).raw | $(GREP) -v "^Note: including file:" \ + && exit `cat $$($1_$2_DEP).exitvalue` + $(RM) $$($1_$2_DEP).exitvalue + ($(ECHO) $$@: \\ \ + && $(SED) -e '/^Note: including file:/!d' \ + -e 's|Note: including file: *||' \ + -e 's|\\|/|g' \ + -e 's|^\([a-zA-Z]\):|/cygdrive/\1|g' \ + -e '/$(subst /,\/,$(TOPDIR))/!d' \ + -e 's|$$$$| \\|g' \ + $$($1_$2_DEP).raw) > $$($1_$2_DEP) endif - endif + endif endef define SetupNativeCompilation - # param 1 is for example BUILD_MYPACKAGE - # param 2,3,4,5,6,7,8 are named args. - # SRC one or more directory roots to scan for C/C++ files. - # LANG C or C++ - # CFLAGS the compiler flags to be used, used both for C and C++. - # CXXFLAGS the compiler flags to be used for c++, if set overrides CFLAGS. - # LDFLAGS the linker flags to be used, used both for C and C++. - # LDFLAGS_SUFFIX the linker flags to be added last on the commandline - # typically the libraries linked to. - # ARFLAGS the archiver flags to be used - # OBJECT_DIR the directory where we store the object files - # LIBRARY the resulting library file - # PROGRAM the resulting exec file - # INCLUDES only pick source from these directories - # EXCLUDES do not pick source from these directories - # INCLUDE_FILES only compile exactly these files! - # EXCLUDE_FILES with these names - # VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run - # RC_FLAGS flags for RC. - # MAPFILE mapfile - # REORDER reorder file - # DEBUG_SYMBOLS add debug symbols (if configured on) - # CC the compiler to use, default is $(CC) - # LDEXE the linker to use for linking executables, default is $(LDEXE) - # OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST - $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) - $(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26)) - $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk)) + # param 1 is for example BUILD_MYPACKAGE + # param 2,3,4,5,6,7,8 are named args. + # SRC one or more directory roots to scan for C/C++ files. + # LANG C or C++ + # CFLAGS the compiler flags to be used, used both for C and C++. + # CXXFLAGS the compiler flags to be used for c++, if set overrides CFLAGS. + # LDFLAGS the linker flags to be used, used both for C and C++. + # LDFLAGS_SUFFIX the linker flags to be added last on the commandline + # typically the libraries linked to. + # ARFLAGS the archiver flags to be used + # OBJECT_DIR the directory where we store the object files + # LIBRARY the resulting library file + # PROGRAM the resulting exec file + # INCLUDES only pick source from these directories + # EXCLUDES do not pick source from these directories + # INCLUDE_FILES only compile exactly these files! + # EXCLUDE_FILES with these names + # VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run + # RC_FLAGS flags for RC. + # MAPFILE mapfile + # REORDER reorder file + # DEBUG_SYMBOLS add debug symbols (if configured on) + # CC the compiler to use, default is $(CC) + # LDEXE the linker to use for linking executables, default is $(LDEXE) + # OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST + $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) + $(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26)) + $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk)) - ifneq (,$$($1_BIN)) - $$(error BIN has been replaced with OBJECT_DIR) + ifneq (,$$($1_BIN)) + $$(error BIN has been replaced with OBJECT_DIR) + endif + + ifneq (,$$($1_LIB)) + $$(error LIB has been replaced with LIBRARY) + endif + + ifneq (,$$($1_EXE)) + $$(error EXE has been replaced with PROGRAM) + endif + + ifneq (,$$($1_LIBRARY)) + ifeq (,$$($1_OUTPUT_DIR)) + $$(error LIBRARY requires OUTPUT_DIR) endif - ifneq (,$$($1_LIB)) - $$(error LIB has been replaced with LIBRARY) + ifneq ($$($1_LIBRARY),$(basename $$($1_LIBRARY))) + $$(error directory of LIBRARY should be specified using OUTPUT_DIR) endif - ifneq (,$$($1_EXE)) - $$(error EXE has been replaced with PROGRAM) + ifneq (,$(findstring $(SHARED_LIBRARY_SUFFIX),$$($1_LIBRARY))) + $$(error LIBRARY should be specified without SHARED_LIBRARY_SUFFIX: $(SHARED_LIBRARY_SUFFIX)) endif - ifneq (,$$($1_LIBRARY)) - ifeq (,$$($1_OUTPUT_DIR)) - $$(error LIBRARY requires OUTPUT_DIR) - endif - - ifneq ($$($1_LIBRARY),$(basename $$($1_LIBRARY))) - $$(error directory of LIBRARY should be specified using OUTPUT_DIR) - endif - - ifneq (,$(findstring $(SHARED_LIBRARY_SUFFIX),$$($1_LIBRARY))) - $$(error LIBRARY should be specified without SHARED_LIBRARY_SUFFIX: $(SHARED_LIBRARY_SUFFIX)) - endif - - ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_LIBRARY))) - $$(error LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX)) - endif - - $1_BASENAME:=$(LIBRARY_PREFIX)$$($1_LIBRARY)$(SHARED_LIBRARY_SUFFIX) - $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME) - + ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_LIBRARY))) + $$(error LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX)) endif - ifneq (,$$($1_STATIC_LIBRARY)) - ifeq (,$$($1_OUTPUT_DIR)) - $$(error STATIC_LIBRARY requires OUTPUT_DIR) - endif + $1_BASENAME:=$(LIBRARY_PREFIX)$$($1_LIBRARY)$(SHARED_LIBRARY_SUFFIX) + $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME) - ifneq ($$($1_STATIC_LIBRARY),$(basename $$($1_STATIC_LIBRARY))) - $$(error directory of STATIC_LIBRARY should be specified using OUTPUT_DIR) - endif + endif - ifneq (,$(findstring $(STATIC_LIBRARY_SUFFIX),$$($1_STATIC_LIBRARY))) - $$(error STATIC_LIBRARY should be specified without STATIC_LIBRARY_SUFFIX: $(STATIC_LIBRARY_SUFFIX)) - endif - - ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_STATIC_LIBRARY))) - $$(error STATIC_LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX)) - endif - - $1_BASENAME:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY)$(STATIC_LIBRARY_SUFFIX) - $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME) + ifneq (,$$($1_STATIC_LIBRARY)) + ifeq (,$$($1_OUTPUT_DIR)) + $$(error STATIC_LIBRARY requires OUTPUT_DIR) endif - ifneq (,$$($1_PROGRAM)) - ifeq (,$$($1_OUTPUT_DIR)) - $$(error PROGRAM requires OUTPUT_DIR) - endif - - ifneq ($$($1_PROGRAM),$(basename $$($1_PROGRAM))) - $$(error directory of PROGRAM should be specified using OUTPUT_DIR) - endif - - ifneq (,$(findstring $(EXE_SUFFIX),$$($1_PROGRAM))) - $$(error PROGRAM should be specified without EXE_SUFFIX: $(EXE_SUFFIX)) - endif - - $1_BASENAME:=$$($1_PROGRAM)$(EXE_SUFFIX) - $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME) - + ifneq ($$($1_STATIC_LIBRARY),$(basename $$($1_STATIC_LIBRARY))) + $$(error directory of STATIC_LIBRARY should be specified using OUTPUT_DIR) endif - ifeq (,$$($1_TARGET)) - $$(error Neither PROGRAM, LIBRARY nor STATIC_LIBRARY has been specified for SetupNativeCompilation) + ifneq (,$(findstring $(STATIC_LIBRARY_SUFFIX),$$($1_STATIC_LIBRARY))) + $$(error STATIC_LIBRARY should be specified without STATIC_LIBRARY_SUFFIX: $(STATIC_LIBRARY_SUFFIX)) endif - ifeq (,$$($1_LANG)) - $$(error You have to specify LANG for native compilation $1) + ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_STATIC_LIBRARY))) + $$(error STATIC_LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX)) endif - ifeq (C,$$($1_LANG)) - ifeq ($$($1_LDEXE),) - $1_LDEXE:=$(LDEXE) - endif - $1_LD:=$(LD) + + $1_BASENAME:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY)$(STATIC_LIBRARY_SUFFIX) + $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME) + endif + + ifneq (,$$($1_PROGRAM)) + ifeq (,$$($1_OUTPUT_DIR)) + $$(error PROGRAM requires OUTPUT_DIR) + endif + + ifneq ($$($1_PROGRAM),$(basename $$($1_PROGRAM))) + $$(error directory of PROGRAM should be specified using OUTPUT_DIR) + endif + + ifneq (,$(findstring $(EXE_SUFFIX),$$($1_PROGRAM))) + $$(error PROGRAM should be specified without EXE_SUFFIX: $(EXE_SUFFIX)) + endif + + $1_BASENAME:=$$($1_PROGRAM)$(EXE_SUFFIX) + $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME) + + endif + + ifeq (,$$($1_TARGET)) + $$(error Neither PROGRAM, LIBRARY nor STATIC_LIBRARY has been specified for SetupNativeCompilation) + endif + + ifeq (,$$($1_LANG)) + $$(error You have to specify LANG for native compilation $1) + endif + ifeq (C,$$($1_LANG)) + ifeq ($$($1_LDEXE),) + $1_LDEXE:=$(LDEXE) + endif + $1_LD:=$(LD) + else + ifeq (C++,$$($1_LANG)) + $1_LD:=$(LDCXX) + $1_LDEXE:=$(LDEXECXX) else - ifeq (C++,$$($1_LANG)) - $1_LD:=$(LDCXX) - $1_LDEXE:=$(LDEXECXX) - else - $$(error Unknown native language $$($1_LANG) for $1) - endif + $$(error Unknown native language $$($1_LANG) for $1) endif + endif - ifeq ($$($1_CC),) - $1_CC:=$(CC) - endif + ifeq ($$($1_CC),) + $1_CC:=$(CC) + endif - # Make sure the dirs exist. - $$(eval $$(call MakeDir,$$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))) - $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d))) + # Make sure the dirs exist. + $$(eval $$(call MakeDir,$$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))) + $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d))) - # Find all files in the source trees. Sort to remove duplicates. - $1_ALL_SRCS := $$(sort $$(call CacheFind,$$($1_SRC))) - # Extract the C/C++ files. - $1_EXCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_EXCLUDE_FILES))) - $1_INCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES))) - ifneq ($$($1_EXCLUDE_FILES),) - $1_EXCLUDE_FILES:=$$(addprefix %,$$($1_EXCLUDE_FILES)) - endif - $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter %.s %.c %.cpp %.m,$$($1_ALL_SRCS))) - ifneq (,$$(strip $$($1_INCLUDE_FILES))) - $1_SRCS := $$(filter $$($1_INCLUDE_FILES),$$($1_SRCS)) - endif - ifeq (,$$($1_SRCS)) - $$(error No sources found for $1 when looking inside the dirs $$($1_SRC)) - endif - # There can be only a single bin dir root, no need to foreach over the roots. - $1_BINS := $$(wildcard $$($1_OBJECT_DIR)/*$(OBJ_SUFFIX)) - # Now we have a list of all c/c++ files to compile: $$($1_SRCS) - # and we have a list of all existing object files: $$($1_BINS) + # Find all files in the source trees. Sort to remove duplicates. + $1_ALL_SRCS := $$(sort $$(call CacheFind,$$($1_SRC))) + # Extract the C/C++ files. + $1_EXCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_EXCLUDE_FILES))) + $1_INCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES))) + ifneq ($$($1_EXCLUDE_FILES),) + $1_EXCLUDE_FILES:=$$(addprefix %,$$($1_EXCLUDE_FILES)) + endif + $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter %.s %.c %.cpp %.m,$$($1_ALL_SRCS))) + ifneq (,$$(strip $$($1_INCLUDE_FILES))) + $1_SRCS := $$(filter $$($1_INCLUDE_FILES),$$($1_SRCS)) + endif + ifeq (,$$($1_SRCS)) + $$(error No sources found for $1 when looking inside the dirs $$($1_SRC)) + endif + # There can be only a single bin dir root, no need to foreach over the roots. + $1_BINS := $$(wildcard $$($1_OBJECT_DIR)/*$(OBJ_SUFFIX)) + # Now we have a list of all c/c++ files to compile: $$($1_SRCS) + # and we have a list of all existing object files: $$($1_BINS) - # Prepend the source/bin path to the filter expressions. Then do the filtering. - ifneq ($$($1_INCLUDES),) - $1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES)))) - $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS)) - endif - ifneq ($$($1_EXCLUDES),) - $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES)))) - $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) - endif + # Prepend the source/bin path to the filter expressions. Then do the filtering. + ifneq ($$($1_INCLUDES),) + $1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES)))) + $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS)) + endif + ifneq ($$($1_EXCLUDES),) + $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES)))) + $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) + endif - # Calculate the expected output from compiling the sources (sort to remove duplicates. Also provides - # a reproducable order on the input files to the linker). - $1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_OBJECT_DIR)/,$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(patsubst %.s,%$(OBJ_SUFFIX),$$(notdir $$($1_SRCS)))))))) - # Are there too many object files on disk? Perhaps because some source file was removed? - $1_SUPERFLOUS_OBJS:=$$(sort $$(filter-out $$($1_EXPECTED_OBJS),$$($1_BINS))) - # Clean out the superfluous object files. - ifneq ($$($1_SUPERFLUOUS_OBJS),) - $$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS)) - endif + # Calculate the expected output from compiling the sources (sort to remove duplicates. Also provides + # a reproducable order on the input files to the linker). + $1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_OBJECT_DIR)/,$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(patsubst %.s,%$(OBJ_SUFFIX),$$(notdir $$($1_SRCS)))))))) + # Are there too many object files on disk? Perhaps because some source file was removed? + $1_SUPERFLOUS_OBJS:=$$(sort $$(filter-out $$($1_EXPECTED_OBJS),$$($1_BINS))) + # Clean out the superfluous object files. + ifneq ($$($1_SUPERFLUOUS_OBJS),) + $$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS)) + endif - # Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables for CFLAGS. - $1_EXTRA_CFLAGS:=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS)) - ifneq ($(DEBUG_LEVEL),release) - # Pickup extra debug dependent variables for CFLAGS - $1_EXTRA_CFLAGS+=$$($1_CFLAGS_debug) - $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)_debug) - $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug) - else - $1_EXTRA_CFLAGS+=$$($1_CFLAGS_release) - $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)_release) - $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release) - endif + # Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables for CFLAGS. + $1_EXTRA_CFLAGS:=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS)) + ifneq ($(DEBUG_LEVEL),release) + # Pickup extra debug dependent variables for CFLAGS + $1_EXTRA_CFLAGS+=$$($1_CFLAGS_debug) + $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)_debug) + $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug) + else + $1_EXTRA_CFLAGS+=$$($1_CFLAGS_release) + $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)_release) + $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release) + endif - # Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables for CXXFLAGS. - $1_EXTRA_CXXFLAGS:=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)) - ifneq ($(DEBUG_LEVEL),release) - # Pickup extra debug dependent variables for CXXFLAGS - $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_debug) - $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)_debug) - $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug) - else - $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_release) - $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)_release) - $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release) - endif + # Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables for CXXFLAGS. + $1_EXTRA_CXXFLAGS:=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)) + ifneq ($(DEBUG_LEVEL),release) + # Pickup extra debug dependent variables for CXXFLAGS + $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_debug) + $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)_debug) + $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug) + else + $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_release) + $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)_release) + $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release) + endif - ifneq (,$$($1_DEBUG_SYMBOLS)) - ifeq ($(ENABLE_DEBUG_SYMBOLS), true) - ifdef OPENJDK - # Always add debug symbols - $1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS) - $1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS) - else - # Programs don't get the debug symbols added in the old build. It's not clear if - # this is intentional. - ifeq ($$($1_PROGRAM),) - $1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS) - $1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS) - endif - endif + ifneq (,$$($1_DEBUG_SYMBOLS)) + ifeq ($(ENABLE_DEBUG_SYMBOLS), true) + ifdef OPENJDK + # Always add debug symbols + $1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS) + $1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS) + else + # Programs don't get the debug symbols added in the old build. It's not clear if + # this is intentional. + ifeq ($$($1_PROGRAM),) + $1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS) + $1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS) endif + endif endif + endif - ifeq ($$($1_CXXFLAGS),) - $1_CXXFLAGS:=$$($1_CFLAGS) - endif - ifeq ($$(strip $$($1_EXTRA_CXXFLAGS)),) - $1_EXTRA_CXXFLAGS:=$$($1_EXTRA_CFLAGS) - endif + ifeq ($$($1_CXXFLAGS),) + $1_CXXFLAGS:=$$($1_CFLAGS) + endif + ifeq ($$(strip $$($1_EXTRA_CXXFLAGS)),) + $1_EXTRA_CXXFLAGS:=$$($1_EXTRA_CFLAGS) + endif - ifneq (,$$($1_REORDER)) - $1_EXTRA_CFLAGS += $$(C_FLAG_REORDER) - $1_EXTRA_CXXFLAGS += $$(CXX_FLAG_REORDER) - endif + ifneq (,$$($1_REORDER)) + $1_EXTRA_CFLAGS += $$(C_FLAG_REORDER) + $1_EXTRA_CXXFLAGS += $$(CXX_FLAG_REORDER) + endif - ifeq (NONE, $$($1_OPTIMIZATION)) - $1_EXTRA_CFLAGS += $(C_O_FLAG_NONE) - $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_NONE) - else ifeq (LOW, $$($1_OPTIMIZATION)) - $1_EXTRA_CFLAGS += $(C_O_FLAG_NORM) - $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_NORM) - else ifeq (HIGH, $$($1_OPTIMIZATION)) - $1_EXTRA_CFLAGS += $(C_O_FLAG_HI) - $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_HI) - else ifeq (HIGHEST, $$($1_OPTIMIZATION)) - $1_EXTRA_CFLAGS += $(C_O_FLAG_HIGHEST) - $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_HIGHEST) - else ifneq (, $$($1_OPTIMIZATION)) - $$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION)) - endif + ifeq (NONE, $$($1_OPTIMIZATION)) + $1_EXTRA_CFLAGS += $(C_O_FLAG_NONE) + $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_NONE) + else ifeq (LOW, $$($1_OPTIMIZATION)) + $1_EXTRA_CFLAGS += $(C_O_FLAG_NORM) + $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_NORM) + else ifeq (HIGH, $$($1_OPTIMIZATION)) + $1_EXTRA_CFLAGS += $(C_O_FLAG_HI) + $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_HI) + else ifeq (HIGHEST, $$($1_OPTIMIZATION)) + $1_EXTRA_CFLAGS += $(C_O_FLAG_HIGHEST) + $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_HIGHEST) + else ifneq (, $$($1_OPTIMIZATION)) + $$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION)) + endif - # Now call add_native_source for each source file we are going to compile. - $$(foreach p,$$($1_SRCS),\ - $$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR),\ - $$($1_CFLAGS) $$($1_EXTRA_CFLAGS),$$($1_CC),\ - $$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS),$(CXX),$$($1_ASFLAGS)))) + # Now call add_native_source for each source file we are going to compile. + $$(foreach p,$$($1_SRCS), \ + $$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR), \ + $$($1_CFLAGS) $$($1_EXTRA_CFLAGS),$$($1_CC), \ + $$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS),$(CXX),$$($1_ASFLAGS)))) - # On windows we need to create a resource file - ifeq ($(OPENJDK_TARGET_OS), windows) - ifneq (,$$($1_VERSIONINFO_RESOURCE)) - $1_RES:=$$($1_OBJECT_DIR)/$$($1_BASENAME).res - $$($1_RES): $$($1_VERSIONINFO_RESOURCE) + # On windows we need to create a resource file + ifeq ($(OPENJDK_TARGET_OS), windows) + ifneq (,$$($1_VERSIONINFO_RESOURCE)) + $1_RES:=$$($1_OBJECT_DIR)/$$($1_BASENAME).res + $$($1_RES): $$($1_VERSIONINFO_RESOURCE) $(RC) $$($1_RC_FLAGS) $(CC_OUT_OPTION)$$@ $$($1_VERSIONINFO_RESOURCE) - endif - ifneq (,$$($1_MANIFEST)) - $1_GEN_MANIFEST:=$$($1_OBJECT_DIR)/$$($1_PROGRAM).manifest - IMVERSIONVALUE:=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VERSION).$(COOKED_BUILD_NUMBER) - $$($1_GEN_MANIFEST): $$($1_MANIFEST) - $(SED) 's%IMVERSION%$$(IMVERSIONVALUE)%g;s%PROGRAM%$$($1_PROGRAM)%g' $$< > $$@ - endif endif + ifneq (,$$($1_MANIFEST)) + $1_GEN_MANIFEST:=$$($1_OBJECT_DIR)/$$($1_PROGRAM).manifest + IMVERSIONVALUE:=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VERSION).$(COOKED_BUILD_NUMBER) + $$($1_GEN_MANIFEST): $$($1_MANIFEST) + $(SED) 's%IMVERSION%$$(IMVERSIONVALUE)%g;s%PROGRAM%$$($1_PROGRAM)%g' $$< > $$@ + endif + endif - # mapfile doesnt seem to be implemented on macosx (yet??) - ifneq ($(OPENJDK_TARGET_OS),macosx) + # mapfile doesnt seem to be implemented on macosx (yet??) + ifneq ($(OPENJDK_TARGET_OS),macosx) ifneq ($(OPENJDK_TARGET_OS),windows) - $1_REAL_MAPFILE:=$$($1_MAPFILE) - ifneq (,$$($1_REORDER)) - $1_REAL_MAPFILE:=$$($1_OBJECT_DIR)/mapfile + $1_REAL_MAPFILE:=$$($1_MAPFILE) + ifneq (,$$($1_REORDER)) + $1_REAL_MAPFILE:=$$($1_OBJECT_DIR)/mapfile - $$($1_REAL_MAPFILE) : $$($1_MAPFILE) $$($1_REORDER) + $$($1_REAL_MAPFILE) : $$($1_MAPFILE) $$($1_REORDER) $$(MKDIR) -p $$(@D) $$(CP) $$($1_MAPFILE) $$@.tmp $$(SED) -e 's=OUTPUTDIR=$$($1_OBJECT_DIR)=' $$($1_REORDER) >> $$@.tmp $$(MV) $$@.tmp $$@ - endif + endif endif + endif + + # Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables + # for LDFLAGS and LDFLAGS_SUFFIX + $1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS)) + $1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS)) + ifneq (,$$($1_REAL_MAPFILE)) + $1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE)) + endif + + $1 := $$($1_TARGET) + ifneq (,$$($1_LIBRARY)) + # Generating a dynamic library. + $1_EXTRA_LDFLAGS+=$$(call SET_SHARED_LIBRARY_NAME,$$($1_BASENAME)) + ifeq ($(OPENJDK_TARGET_OS), windows) + $1_EXTRA_LDFLAGS+="-implib:$$($1_OBJECT_DIR)/$$($1_LIBRARY).lib" endif - # Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables - # for LDFLAGS and LDFLAGS_SUFFIX - $1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS)) - $1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS)) - ifneq (,$$($1_REAL_MAPFILE)) - $1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE)) - endif + $1_EXTRA_LDFLAGS_SUFFIX += $(GLOBAL_LDFLAGS_SUFFIX) - $1 := $$($1_TARGET) - ifneq (,$$($1_LIBRARY)) - # Generating a dynamic library. - $1_EXTRA_LDFLAGS+=$$(call SET_SHARED_LIBRARY_NAME,$$($1_BASENAME)) + ifneq (,$$($1_DEBUG_SYMBOLS)) + ifeq ($(ENABLE_DEBUG_SYMBOLS), true) ifeq ($(OPENJDK_TARGET_OS), windows) - $1_EXTRA_LDFLAGS+="-implib:$$($1_OBJECT_DIR)/$$($1_LIBRARY).lib" + $1_EXTRA_LDFLAGS+="-pdb:$$($1_OBJECT_DIR)/$$($1_LIBRARY).pdb" \ + "-map:$$($1_OBJECT_DIR)/$$($1_LIBRARY).map" endif - $1_EXTRA_LDFLAGS_SUFFIX += $(GLOBAL_LDFLAGS_SUFFIX) - - ifneq (,$$($1_DEBUG_SYMBOLS)) - ifeq ($(ENABLE_DEBUG_SYMBOLS), true) - ifeq ($(OPENJDK_TARGET_OS), windows) - $1_EXTRA_LDFLAGS+="-pdb:$$($1_OBJECT_DIR)/$$($1_LIBRARY).pdb" \ - "-map:$$($1_OBJECT_DIR)/$$($1_LIBRARY).map" - endif - - ifneq ($$($1_OUTPUT_DIR),$$($1_OBJECT_DIR)) - $$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% - $(CP) $$< $$@ - endif - - ifeq ($(OPENJDK_TARGET_OS), solaris) - # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. - # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from - # empty section headers until a fixed $(OBJCOPY) is available. - # An empty section header has sh_addr == 0 and sh_size == 0. - # This problem has only been seen on Solaris X64, but we call this tool - # on all Solaris builds just in case. - # - # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. - # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. - $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \ - $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) - $(RM) $$@ - $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< - $(OBJCOPY) --only-keep-debug $$< $$@ - $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< - else # not solaris - $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) - $(RM) $$@ - $(OBJCOPY) --only-keep-debug $$< $$@ - $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< - endif # Touch to not retrigger rule on rebuild - $(TOUCH) $$@ - - ifeq ($(ZIP_DEBUGINFO_FILES), true) - $1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz - - ifeq ($(OPENJDK_TARGET_OS), windows) - $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz : $$($1_TARGET) - $(CD) $$($1_OBJECT_DIR) \ - && $(ZIP) -q $$@ $$($1_LIBRARY).map $$($1_LIBRARY).pdb - else - $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz : $$($1_TARGET) \ - $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo - $(CD) $$($1_OBJECT_DIR) \ - && $(ZIP) -q $$@ $$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo - endif - else - ifeq ($(OPENJDK_TARGET_OS), windows) - $1 += $$($1_OUTPUT_DIR)/$$($1_LIBRARY).map \ - $$($1_OUTPUT_DIR)/$$($1_LIBRARY).pdb - else - $1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo - endif - endif - endif + ifneq ($$($1_OUTPUT_DIR),$$($1_OBJECT_DIR)) + $$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% + $(CP) $$< $$@ endif - $$($1_TARGET) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE) - $$(call LINKING_MSG,$$($1_BASENAME)) - $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(LD_OUT_OPTION)$$@ \ - $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \ - $$($1_EXTRA_LDFLAGS_SUFFIX) + ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X + ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows + ifeq ($(OPENJDK_TARGET_OS), solaris) + # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. + # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from + # empty section headers until a fixed $(OBJCOPY) is available. + # An empty section header has sh_addr == 0 and sh_size == 0. + # This problem has only been seen on Solaris X64, but we call this tool + # on all Solaris builds just in case. + # + # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. + # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. + $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \ + $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) + $(RM) $$@ + $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< + $(OBJCOPY) --only-keep-debug $$< $$@ + $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< + else # not solaris + $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) + $(RM) $$@ + $(OBJCOPY) --only-keep-debug $$< $$@ + $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< + endif # Touch to not retrigger rule on rebuild + $(TOUCH) $$@ + endif # !windows + endif # !macosx + ifeq ($(ZIP_DEBUGINFO_FILES), true) +ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet + $1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz + + ifeq ($(OPENJDK_TARGET_OS), windows) + $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz : $$($1_TARGET) + $(CD) $$($1_OBJECT_DIR) \ + && $(ZIP) -q $$@ $$($1_LIBRARY).map $$($1_LIBRARY).pdb + else + $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz : $$($1_TARGET) \ + $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo + $(CD) $$($1_OBJECT_DIR) \ + && $(ZIP) -q $$@ $$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo + endif +endif # no MacOS X support yet + else + ifeq ($(OPENJDK_TARGET_OS), windows) + $1 += $$($1_OUTPUT_DIR)/$$($1_LIBRARY).map \ + $$($1_OUTPUT_DIR)/$$($1_LIBRARY).pdb + else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files + $1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo + endif + endif + endif endif - ifneq (,$$($1_STATIC_LIBRARY)) - # Generating a static library, ie object file archive. - $$($1_TARGET) : $$($1_EXPECTED_OBJS) $$($1_RES) - $$(call ARCHIVING_MSG,$$($1_LIBRARY)) - $(AR) $$($1_AR_FLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_EXPECTED_OBJS) \ - $$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX) - endif + $$($1_TARGET) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE) + $$(call LINKING_MSG,$$($1_BASENAME)) + $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(LD_OUT_OPTION)$$@ \ + $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \ + $$($1_EXTRA_LDFLAGS_SUFFIX) - ifneq (,$$($1_PROGRAM)) - # A executable binary has been specified, setup the target for it. - ifneq (,$$($1_DEBUG_SYMBOLS)) - ifeq ($(ENABLE_DEBUG_SYMBOLS), true) - ifeq ($(OPENJDK_TARGET_OS), windows) - $1_EXTRA_LDFLAGS+="-pdb:$$($1_OBJECT_DIR)/$$($1_PROGRAM).pdb" \ - "-map:$$($1_OBJECT_DIR)/$$($1_PROGRAM).map" - endif + endif - ifneq ($$($1_OUTPUT_DIR),$$($1_OBJECT_DIR)) - $$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% - $(CP) $$< $$@ - endif + ifneq (,$$($1_STATIC_LIBRARY)) + # Generating a static library, ie object file archive. + $$($1_TARGET) : $$($1_EXPECTED_OBJS) $$($1_RES) + $$(call ARCHIVING_MSG,$$($1_LIBRARY)) + $(AR) $$($1_AR_FLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_EXPECTED_OBJS) \ + $$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX) + endif - ifeq ($(OPENJDK_TARGET_OS), solaris) - # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. - # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from - # empty section headers until a fixed $(OBJCOPY) is available. - # An empty section header has sh_addr == 0 and sh_size == 0. - # This problem has only been seen on Solaris X64, but we call this tool - # on all Solaris builds just in case. - # - # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. - # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. - $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \ - $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) - $(RM) $$@ - $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< - $(OBJCOPY) --only-keep-debug $$< $$@ - $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< - else # not solaris - $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) - $(RM) $$@ - $(OBJCOPY) --only-keep-debug $$< $$@ - $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< - endif - $(TOUCH) $$@ - - ifeq ($(ZIP_DEBUGINFO_FILES), true) - $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).diz - - ifeq ($(OPENJDK_TARGET_OS), windows) - $$($1_OBJECT_DIR)/$$($1_PROGRAM).diz : $$($1_TARGET) - $(CD) $$($1_OBJECT_DIR) \ - && $(ZIP) -q $$@ $$($1_PROGRAM).map $$($1_PROGRAM).pdb - else - $$($1_OBJECT_DIR)/$$(PROGRAM_PREFIX)$$($1_PROGRAM).diz : $$($1_TARGET) \ - $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo - $(CD) $$($1_OBJECT_DIR) \ - && $(ZIP) -q $$@ $$($1_PROGRAM).debuginfo - endif - else - ifeq ($(OPENJDK_TARGET_OS), windows) - $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).map \ - $$($1_OUTPUT_DIR)/$$($1_PROGRAM).pdb - else - $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).debuginfo - endif - endif - endif + ifneq (,$$($1_PROGRAM)) + # A executable binary has been specified, setup the target for it. + ifneq (,$$($1_DEBUG_SYMBOLS)) + ifeq ($(ENABLE_DEBUG_SYMBOLS), true) + ifeq ($(OPENJDK_TARGET_OS), windows) + $1_EXTRA_LDFLAGS+="-pdb:$$($1_OBJECT_DIR)/$$($1_PROGRAM).pdb" \ + "-map:$$($1_OBJECT_DIR)/$$($1_PROGRAM).map" endif - $1_EXTRA_LDFLAGS_SUFFIX += $(GLOBAL_LDFLAGS_SUFFIX) + ifneq ($$($1_OUTPUT_DIR),$$($1_OBJECT_DIR)) + $$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% + $(CP) $$< $$@ + endif - $$($1_TARGET) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_GEN_MANIFEST) - $$(call LINKING_EXE_MSG,$$($1_BASENAME)) - $$($1_LDEXE) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(EXE_OUT_OPTION)$$($1_TARGET) \ - $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \ - $$($1_EXTRA_LDFLAGS_SUFFIX) + ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X + ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows + ifeq ($(OPENJDK_TARGET_OS), solaris) + # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. + # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from + # empty section headers until a fixed $(OBJCOPY) is available. + # An empty section header has sh_addr == 0 and sh_size == 0. + # This problem has only been seen on Solaris X64, but we call this tool + # on all Solaris builds just in case. + # + # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. + # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. + $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \ + $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) + $(RM) $$@ + $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< + $(OBJCOPY) --only-keep-debug $$< $$@ + $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< + else # not solaris + $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) + $(RM) $$@ + $(OBJCOPY) --only-keep-debug $$< $$@ + $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< + endif + $(TOUCH) $$@ + endif # !windows + endif # !macosx + + ifeq ($(ZIP_DEBUGINFO_FILES), true) +ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet + $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).diz + + ifeq ($(OPENJDK_TARGET_OS), windows) + $$($1_OBJECT_DIR)/$$($1_PROGRAM).diz : $$($1_TARGET) + $(CD) $$($1_OBJECT_DIR) \ + && $(ZIP) -q $$@ $$($1_PROGRAM).map $$($1_PROGRAM).pdb + else + $$($1_OBJECT_DIR)/$$(PROGRAM_PREFIX)$$($1_PROGRAM).diz : $$($1_TARGET) \ + $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo + $(CD) $$($1_OBJECT_DIR) \ + && $(ZIP) -q $$@ $$($1_PROGRAM).debuginfo + endif +endif # no MacOS X support yet + else + ifeq ($(OPENJDK_TARGET_OS), windows) + $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).map \ + $$($1_OUTPUT_DIR)/$$($1_PROGRAM).pdb + else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files + $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).debuginfo + endif + endif + endif + endif + + $1_EXTRA_LDFLAGS_SUFFIX += $(GLOBAL_LDFLAGS_SUFFIX) + + $$($1_TARGET) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_GEN_MANIFEST) + $$(call LINKING_EXE_MSG,$$($1_BASENAME)) + $$($1_LDEXE) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(EXE_OUT_OPTION)$$($1_TARGET) \ + $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \ + $$($1_EXTRA_LDFLAGS_SUFFIX) ifneq (,$$($1_GEN_MANIFEST)) - $(MT) -nologo -manifest $$($1_GEN_MANIFEST) -outputresource:$$@;#1 + $(MT) -nologo -manifest $$($1_GEN_MANIFEST) -outputresource:$$@;#1 endif # This only works if the openjdk_codesign identity is present on the system. Let # silently fail otherwise. ifneq (,$(CODESIGN)) - ifneq (,$$($1_CODESIGN)) - $(CODESIGN) -s openjdk_codesign $$@ - endif + ifneq (,$$($1_CODESIGN)) + $(CODESIGN) -s openjdk_codesign $$@ + endif endif - endif + endif endef diff --git a/common/makefiles/RMICompilation.gmk b/common/makefiles/RMICompilation.gmk index 4727412e958..2c87b70441b 100644 --- a/common/makefiles/RMICompilation.gmk +++ b/common/makefiles/RMICompilation.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -24,74 +24,73 @@ # define SetupRMICompilation - # param 1 is a name for a variable to depend on. - # param 2 and up are named args. - # CLASSES:=List of classes to generate stubs for - # CLASSES_DIR:=Directory where to look for classes - # STUB_CLASSES_DIR:=Directory in where to put stub classes - # RUN_V11:=Set to run rmic with -v1.1 - # RUN_V12:=Set to run rmic with -v1.2 - # RUN_IIOP:=Set to run rmic with -iiop - # RUN_IIOP_STDPKG:=Set to run rmic with -iiop -standardPackage - # KEEP_GENERATED:=Set to keep generated sources around - $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) - $(call LogSetupMacroEntry,SetupRMICompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) - $(if $(16),$(error Internal makefile error: Too many arguments to SetupRMICompilation, please update RMICompilation.gmk)) + # param 1 is a name for a variable to depend on. + # param 2 and up are named args. + # CLASSES:=List of classes to generate stubs for + # CLASSES_DIR:=Directory where to look for classes + # STUB_CLASSES_DIR:=Directory in where to put stub classes + # RUN_V11:=Set to run rmic with -v1.1 + # RUN_V12:=Set to run rmic with -v1.2 + # RUN_IIOP:=Set to run rmic with -iiop + # RUN_IIOP_STDPKG:=Set to run rmic with -iiop -standardPackage + # KEEP_GENERATED:=Set to keep generated sources around + $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) + $(call LogSetupMacroEntry,SetupRMICompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) + $(if $(16),$(error Internal makefile error: Too many arguments to SetupRMICompilation, please update RMICompilation.gmk)) - $1_DEP_FILE := $$($1_STUB_CLASSES_DIR)/$1_rmic + $1_DEP_FILE := $$($1_STUB_CLASSES_DIR)/_the.$1_rmic.generated - $1_CLASSES_SLASH := $$(subst .,/,$$($1_CLASSES)) - $1_CLASS_FILES := $$(addprefix $$($1_CLASSES_DIR)/,$$(addsuffix .class,$$($1_CLASSES_SLASH))) - $1_STUB_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Stub.class,$$($1_CLASSES_SLASH))) - $1_TARGETS := $$($1_STUB_FILES) - $1_ARGS := - ifneq (,$$($1_RUN_V11)) - $1_SKEL_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Skel.class,$$($1_CLASSES_SLASH))) - $1_TARGETS += $$($1_SKEL_FILES) - $1_ARGS += -v1.1 - endif - ifneq (,$$($1_RUN_V12)) - $1_ARGS += -v1.2 - endif + $1_CLASSES_SLASH := $$(subst .,/,$$($1_CLASSES)) + $1_CLASS_FILES := $$(addprefix $$($1_CLASSES_DIR)/,$$(addsuffix .class,$$($1_CLASSES_SLASH))) + $1_STUB_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Stub.class,$$($1_CLASSES_SLASH))) + $1_TARGETS := $$($1_STUB_FILES) + $1_ARGS := + ifneq (,$$($1_RUN_V11)) + $1_SKEL_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Skel.class,$$($1_CLASSES_SLASH))) + $1_TARGETS += $$($1_SKEL_FILES) + $1_ARGS += -v1.1 + endif + ifneq (,$$($1_RUN_V12)) + $1_ARGS += -v1.2 + endif - $1_TIE_BASE_FILES := $$(foreach f,$$($1_CLASSES_SLASH),$$(dir $$f)_$$(notdir $$f)) - $1_TIE_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/org/omg/stub/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES))) - $1_TIE_STDPKG_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES))) + $1_TIE_BASE_FILES := $$(foreach f,$$($1_CLASSES_SLASH),$$(dir $$f)_$$(notdir $$f)) + $1_TIE_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/org/omg/stub/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES))) + $1_TIE_STDPKG_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES))) - ifneq (,$$($1_RUN_IIOP)) - $1_TARGETS += $$($1_TIE_FILES) - $1_ARGS += -iiop - endif - ifneq (,$$($1_RUN_IIOP_STDPKG)) - $1_TARGETS += $$($1_TIE_STDPKG_FILES) - $1_ARGS2 := -iiop -standardPackage - endif + ifneq (,$$($1_RUN_IIOP)) + $1_TARGETS += $$($1_TIE_FILES) + $1_ARGS += -iiop -emitPermissionCheck + endif + ifneq (,$$($1_RUN_IIOP_STDPKG)) + $1_TARGETS += $$($1_TIE_STDPKG_FILES) + $1_ARGS2 := -iiop -emitPermissionCheck -standardPackage + endif - ifneq (,$$($1_KEEP_GENERATED)) - $1_ARGS += -keepgenerated - $1_TARGETS += $$(subst .class,.java,$$($1_TARGETS)) - endif + ifneq (,$$($1_KEEP_GENERATED)) + $1_ARGS += -keepgenerated + $1_TARGETS += $$(subst .class,.java,$$($1_TARGETS)) + endif - $1_DOLLAR_SAFE_CLASSES := $$(subst $$$$,\$$$$,$$($1_CLASSES)) + $1_DOLLAR_SAFE_CLASSES := $$(subst $$$$,\$$$$,$$($1_CLASSES)) - $$($1_TARGETS): $$($1_DEP_FILE) $$($1_CLASS_FILES) + $$($1_TARGETS): $$($1_DEP_FILE) $$($1_CLASS_FILES) - $$($1_DEP_FILE): $$($1_CLASS_FILES) + $$($1_DEP_FILE): $$($1_CLASS_FILES) $(MKDIR) -p $$($1_STUB_CLASSES_DIR) if [ "x$$($1_ARGS)" != "x" ]; then \ - $(ECHO) $(LOG_INFO) Running rmic $$($1_ARGS) for $$($1_DOLLAR_SAFE_CLASSES) &&\ - $(RMIC) $$($1_ARGS) -classpath "$$($1_CLASSES_DIR)" \ - -d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES);\ + $(ECHO) $(LOG_INFO) Running rmic $$($1_ARGS) for $$($1_DOLLAR_SAFE_CLASSES) && \ + $(RMIC) $$($1_ARGS) -classpath "$$($1_CLASSES_DIR)" \ + -d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES); \ fi; if [ "x$$($1_ARGS2)" != "x" ]; then \ - $(ECHO) $(LOG_INFO) Running rmic $$($1_ARGS2) for $$($1_DOLLAR_SAFE_CLASSES) &&\ - $(RMIC) $$($1_ARGS2) -classpath "$$($1_CLASSES_DIR)" \ - -d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES);\ + $(ECHO) $(LOG_INFO) Running rmic $$($1_ARGS2) for $$($1_DOLLAR_SAFE_CLASSES) && \ + $(RMIC) $$($1_ARGS2) -classpath "$$($1_CLASSES_DIR)" \ + -d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES); \ fi; + $(TOUCH) $$@ - $1 := $$($1_TARGETS) + $1 := $$($1_TARGETS) $$($1_DEP_FILE) - # By marking as secondary, this "touch" file doesn't need to be touched and will never exist. - .SECONDARY: $$($1_DEP_FILE) endef diff --git a/common/makefiles/devkit/Makefile b/common/makefiles/devkit/Makefile index 000527e7350..a6a5ca9e9ae 100644 --- a/common/makefiles/devkit/Makefile +++ b/common/makefiles/devkit/Makefile @@ -25,12 +25,12 @@ ########################################################################################## # -# This Makefile, together with Tools.gmk, can be used to compile a set of -# gcc based cross compilation, portable, self contained packages, capable +# This Makefile, together with Tools.gmk, can be used to compile a set of +# gcc based cross compilation, portable, self contained packages, capable # of building OpenJDK. -# -# In addition to the makefiles, access to Oracle Linux installation -# media is required. This has been tested against Oracle Enterprise Linux +# +# In addition to the makefiles, access to Oracle Linux installation +# media is required. This has been tested against Oracle Enterprise Linux # 5.5. Set variables RPM_DIR_x86_64 and RPM_DIR_i686 respectively to point # to directory containing the RPMs. # @@ -43,9 +43,9 @@ # # To build the full set of crosstools, use a command line looking like this: # -# make tars RPM_DIR_x86_64=/tmp/oel55-x86_64/Server/ RPM_DIR_i686=/tmp/oel55-i686/Server/ +# make tars RPM_DIR_x86_64=/tmp/oel55-x86_64/Server/ RPM_DIR_i686=/tmp/oel55-i686/Server/ # -# To create a x86_64 package without the redundant i686 cross compiler, do +# To create a x86_64 package without the redundant i686 cross compiler, do # like this: # # make tars platforms=x86_64-unknown-linux-gnu RPM_DIR_x86_64=/tmp/oel55-x86_64/Server/ RPM_DIR_i686=/tmp/oel55-i686/Server/ @@ -54,70 +54,68 @@ # Main makefile which iterates over all host and target platforms. # -os := $(shell uname -o) -cpu := x86_64 +os := $(shell uname -o) +cpu := x86_64 #$(shell uname -p) # # This wrapper script can handle exactly these platforms # -platforms := $(foreach p,x86_64 i686,$(p)-unknown-linux-gnu) -#platforms := $(foreach p,x86_64,$(p)-unknown-linux-gnu) +platforms := $(foreach p,x86_64 i686,$(p)-unknown-linux-gnu) +#platforms := $(foreach p,x86_64,$(p)-unknown-linux-gnu) # Figure out what platform this is building on. -me := $(cpu)-$(if $(findstring Linux,$(os)),unknown-linux-gnu) +me := $(cpu)-$(if $(findstring Linux,$(os)),unknown-linux-gnu) $(info Building on platform $(me)) -all compile : $(platforms) +all compile : $(platforms) ifeq (,$(SKIP_ME)) -$(foreach p,$(filter-out $(me),$(platforms)),$(eval $(p) : $$(me))) + $(foreach p,$(filter-out $(me),$(platforms)),$(eval $(p) : $$(me))) endif -OUTPUT_ROOT = $(abspath ../../../build/devkit) -RESULT = $(OUTPUT_ROOT)/result +OUTPUT_ROOT = $(abspath ../../../build/devkit) +RESULT = $(OUTPUT_ROOT)/result -submakevars = HOST=$@ BUILD=$(me) \ - RESULT=$(RESULT) PREFIX=$(RESULT)/$@ \ - OUTPUT_ROOT=$(OUTPUT_ROOT) -$(platforms) : - @echo 'Building compilers for $@' - @echo 'Targets: $(platforms)' - for p in $@ $(filter-out $@,$(platforms)); do \ - $(MAKE) -f Tools.gmk all $(submakevars) \ - TARGET=$$p || exit 1 ; \ - done - @echo 'Building ccache program for $@' - $(MAKE) -f Tools.gmk ccache $(submakevars) TARGET=$@ - @echo 'All done"' +submakevars = HOST=$@ BUILD=$(me) \ + RESULT=$(RESULT) PREFIX=$(RESULT)/$@ \ + OUTPUT_ROOT=$(OUTPUT_ROOT) +$(platforms) : + @echo 'Building compilers for $@' + @echo 'Targets: $(platforms)' + for p in $@ $(filter-out $@,$(platforms)); do \ + $(MAKE) -f Tools.gmk all $(submakevars) \ + TARGET=$$p || exit 1 ; \ + done + @echo 'Building ccache program for $@' + $(MAKE) -f Tools.gmk ccache $(submakevars) TARGET=$@ + @echo 'All done"' $(foreach a,i686 x86_64,$(eval $(a) : $(filter $(a)%,$(platforms)))) -ia32 : i686 -today := $(shell date +%Y%m%d) +ia32 : i686 +today := $(shell date +%Y%m%d) define Mktar -$(1)_tar = $$(RESULT)/sdk-$(1)-$$(today).tar.gz -$$($(1)_tar) : PLATFORM = $(1) -TARFILES += $$($(1)_tar) -$$($(1)_tar) : $(1) $$(shell find $$(RESULT)/$(1)) + $(1)_tar = $$(RESULT)/sdk-$(1)-$$(today).tar.gz + $$($(1)_tar) : PLATFORM = $(1) + TARFILES += $$($(1)_tar) + $$($(1)_tar) : $(1) $$(shell find $$(RESULT)/$(1)) endef $(foreach p,$(platforms),$(eval $(call Mktar,$(p)))) -tars : all $(TARFILES) -onlytars : $(TARFILES) -%.tar.gz : - @echo 'Creating compiler package $@' - cd $(RESULT)/$(PLATFORM) && tar -czf $@ * - touch $@ +tars : all $(TARFILES) +onlytars : $(TARFILES) +%.tar.gz : + @echo 'Creating compiler package $@' + cd $(RESULT)/$(PLATFORM) && tar -czf $@ * + touch $@ -clean : +clean : rm -rf build result -FORCE : -.PHONY : $(configs) $(platforms) - - +FORCE : +.PHONY : $(configs) $(platforms) diff --git a/common/makefiles/devkit/Tools.gmk b/common/makefiles/devkit/Tools.gmk index 57d331f22a2..457dacb8e9d 100644 --- a/common/makefiles/devkit/Tools.gmk +++ b/common/makefiles/devkit/Tools.gmk @@ -26,15 +26,15 @@ ########################################################################################## # # Workhorse makefile for creating ONE cross compiler -# Needs either to be from BUILD -> BUILD OR have +# Needs either to be from BUILD -> BUILD OR have # BUILD -> HOST prebuilt # -# NOTE: There is a bug here. We don't limit the -# PATH when building BUILD -> BUILD, which means that +# NOTE: There is a bug here. We don't limit the +# PATH when building BUILD -> BUILD, which means that # if you configure after you've once build the BUILD->BUILD # compiler THAT one will be picked up as the compiler for itself. # This is not so great, especially if you did a partial delete -# of the target tree. +# of the target tree. # # Fix this... # @@ -43,45 +43,45 @@ $(info TARGET=$(TARGET)) $(info HOST=$(HOST)) $(info BUILD=$(BUILD)) -ARCH := $(word 1,$(subst -, ,$(TARGET))) +ARCH := $(word 1,$(subst -, ,$(TARGET))) ########################################################################################## # Define external dependencies # Latest that could be made to work. -gcc_ver := gcc-4.7.3 -binutils_ver := binutils-2.22 -ccache_ver := ccache-3.1.9 -mpfr_ver := mpfr-3.0.1 -gmp_ver := gmp-4.3.2 -mpc_ver := mpc-1.0.1 +gcc_ver := gcc-4.7.3 +binutils_ver := binutils-2.22 +ccache_ver := ccache-3.1.9 +mpfr_ver := mpfr-3.0.1 +gmp_ver := gmp-4.3.2 +mpc_ver := mpc-1.0.1 -GCC := http://ftp.gnu.org/pub/gnu/gcc/$(gcc_ver)/$(gcc_ver).tar.bz2 -BINUTILS := http://ftp.gnu.org/pub/gnu/binutils/$(binutils_ver).tar.bz2 -CCACHE := http://samba.org/ftp/ccache/$(ccache_ver).tar.gz -MPFR := http://www.mpfr.org/${mpfr_ver}/${mpfr_ver}.tar.bz2 -GMP := http://ftp.gnu.org/pub/gnu/gmp/${gmp_ver}.tar.bz2 -MPC := http://www.multiprecision.org/mpc/download/${mpc_ver}.tar.gz +GCC := http://ftp.gnu.org/pub/gnu/gcc/$(gcc_ver)/$(gcc_ver).tar.bz2 +BINUTILS := http://ftp.gnu.org/pub/gnu/binutils/$(binutils_ver).tar.bz2 +CCACHE := http://samba.org/ftp/ccache/$(ccache_ver).tar.gz +MPFR := http://www.mpfr.org/${mpfr_ver}/${mpfr_ver}.tar.bz2 +GMP := http://ftp.gnu.org/pub/gnu/gmp/${gmp_ver}.tar.bz2 +MPC := http://www.multiprecision.org/mpc/download/${mpc_ver}.tar.gz # RPMs in OEL5.5 -RPM_LIST := \ - kernel-headers \ - glibc-2 glibc-headers glibc-devel \ - cups-libs cups-devel \ - libX11 libX11-devel \ - xorg-x11-proto-devel \ - alsa-lib alsa-lib-devel \ - libXext libXext-devel \ - libXtst libXtst-devel \ - libXrender libXrender-devel \ - freetype freetype-devel \ - libXt libXt-devel \ - libSM libSM-devel \ - libICE libICE-devel \ - libXi libXi-devel \ - libXdmcp libXdmcp-devel \ - libXau libXau-devel \ - libgcc +RPM_LIST := \ + kernel-headers \ + glibc-2 glibc-headers glibc-devel \ + cups-libs cups-devel \ + libX11 libX11-devel \ + xorg-x11-proto-devel \ + alsa-lib alsa-lib-devel \ + libXext libXext-devel \ + libXtst libXtst-devel \ + libXrender libXrender-devel \ + freetype freetype-devel \ + libXt libXt-devel \ + libSM libSM-devel \ + libICE libICE-devel \ + libXi libXi-devel \ + libXdmcp libXdmcp-devel \ + libXau libXau-devel \ + libgcc ifeq ($(ARCH),x86_64) @@ -90,7 +90,7 @@ ifeq ($(ARCH),x86_64) ifeq ($(BUILD),$(HOST)) ifeq ($(TARGET),$(HOST)) # When building the native compiler for x86_64, enable mixed mode. - RPM_ARCHS += i386 i686 + RPM_ARCHS += i386 i686 endif endif else @@ -110,47 +110,47 @@ endif # Ensure we have 32-bit libs also for x64. We enable mixed-mode. ifeq (x86_64,$(ARCH)) - LIBDIRS := lib64 lib - CFLAGS_lib := -m32 + LIBDIRS := lib64 lib + CFLAGS_lib := -m32 else - LIBDIRS := lib + LIBDIRS := lib endif # Define directories -RESULT := $(OUTPUT_ROOT)/result -BUILDDIR := $(OUTPUT_ROOT)/$(HOST)/$(TARGET) -PREFIX := $(RESULT)/$(HOST) -TARGETDIR := $(PREFIX)/$(TARGET) -SYSROOT := $(TARGETDIR)/sys-root -DOWNLOAD := $(OUTPUT_ROOT)/download -SRCDIR := $(OUTPUT_ROOT)/src +RESULT := $(OUTPUT_ROOT)/result +BUILDDIR := $(OUTPUT_ROOT)/$(HOST)/$(TARGET) +PREFIX := $(RESULT)/$(HOST) +TARGETDIR := $(PREFIX)/$(TARGET) +SYSROOT := $(TARGETDIR)/sys-root +DOWNLOAD := $(OUTPUT_ROOT)/download +SRCDIR := $(OUTPUT_ROOT)/src # Marker file for unpacking rpms -rpms := $(SYSROOT)/rpms_unpacked +rpms := $(SYSROOT)/rpms_unpacked -# Need to patch libs that are linker scripts to use non-absolute paths -libs := $(SYSROOT)/libs_patched +# Need to patch libs that are linker scripts to use non-absolute paths +libs := $(SYSROOT)/libs_patched ########################################################################################## # Unpack source packages -# Generate downloading + unpacking of sources. +# Generate downloading + unpacking of sources. define Download -$(1)_DIR = $(abspath $(SRCDIR)/$(basename $(basename $(notdir $($(1)))))) -$(1)_CFG = $$($(1)_DIR)/configure -$(1)_FILE = $(DOWNLOAD)/$(notdir $($(1))) + $(1)_DIR = $(abspath $(SRCDIR)/$(basename $(basename $(notdir $($(1)))))) + $(1)_CFG = $$($(1)_DIR)/configure + $(1)_FILE = $(DOWNLOAD)/$(notdir $($(1))) -$$($(1)_CFG) : $$($(1)_FILE) - mkdir -p $$(SRCDIR) - tar -C $$(SRCDIR) -x$$(if $$(findstring .gz, $$<),z,j)f $$< - $$(foreach p,$$(abspath $$(wildcard $$(notdir $$($(1)_DIR)).patch)), \ - echo PATCHING $$(p) ; \ - patch -d $$($(1)_DIR) -p1 -i $$(p) ; \ - ) - touch $$@ + $$($(1)_CFG) : $$($(1)_FILE) + mkdir -p $$(SRCDIR) + tar -C $$(SRCDIR) -x$$(if $$(findstring .gz, $$<),z,j)f $$< + $$(foreach p,$$(abspath $$(wildcard $$(notdir $$($(1)_DIR)).patch)), \ + echo PATCHING $$(p) ; \ + patch -d $$($(1)_DIR) -p1 -i $$(p) ; \ + ) + touch $$@ -$$($(1)_FILE) : - wget -P $(DOWNLOAD) $$($(1)) + $$($(1)_FILE) : + wget -P $(DOWNLOAD) $$($(1)) endef # Download and unpack all source packages @@ -159,48 +159,48 @@ $(foreach p,GCC BINUTILS CCACHE MPFR GMP MPC,$(eval $(call Download,$(p)))) ########################################################################################## # Unpack RPMS -# Note. For building linux you should install rpm2cpio. +# Note. For building linux you should install rpm2cpio. define unrpm -$(SYSROOT)/$(notdir $(1)).unpacked \ - : $(1) -$$(rpms) : $(SYSROOT)/$(notdir $(1)).unpacked + $(SYSROOT)/$(notdir $(1)).unpacked \ + : $(1) + $$(rpms) : $(SYSROOT)/$(notdir $(1)).unpacked endef -%.unpacked : - $(info Unpacking target rpms and libraries from $<) - @(mkdir -p $(@D); \ - cd $(@D); \ - rpm2cpio $< | \ - cpio --extract --make-directories \ - -f \ - "./usr/share/doc/*" \ - "./usr/share/man/*" \ - "./usr/X11R6/man/*" \ - "*/X11/locale/*" \ - || die ; ) - touch $@ +%.unpacked : + $(info Unpacking target rpms and libraries from $<) + @(mkdir -p $(@D); \ + cd $(@D); \ + rpm2cpio $< | \ + cpio --extract --make-directories \ + -f \ + "./usr/share/doc/*" \ + "./usr/share/man/*" \ + "./usr/X11R6/man/*" \ + "*/X11/locale/*" \ + || die ; ) + touch $@ $(foreach p,$(RPM_FILE_LIST),$(eval $(call unrpm,$(p)))) ########################################################################################## -# Note: MUST create a /usr/lib even if not really needed. -# gcc will use a path relative to it to resolve lib64. (x86_64). -# we're creating multi-lib compiler with 32bit libc as well, so we should +# Note: MUST create a /usr/lib even if not really needed. +# gcc will use a path relative to it to resolve lib64. (x86_64). +# we're creating multi-lib compiler with 32bit libc as well, so we should # have it anyway, but just to make sure... # Patch libc.so and libpthread.so to force linking against libraries in sysroot # and not the ones installed on the build machine. -$(libs) : $(rpms) - @echo Patching libc and pthreads - @(for f in `find $(SYSROOT) -name libc.so -o -name libpthread.so`; do \ - (cat $$f | sed -e 's|/usr/lib64/||g' \ - -e 's|/usr/lib/||g' \ - -e 's|/lib64/||g' \ - -e 's|/lib/||g' ) > $$f.tmp ; \ - mv $$f.tmp $$f ; \ - done) - @mkdir -p $(SYSROOT)/usr/lib - @touch $@ +$(libs) : $(rpms) + @echo Patching libc and pthreads + @(for f in `find $(SYSROOT) -name libc.so -o -name libpthread.so`; do \ + (cat $$f | sed -e 's|/usr/lib64/||g' \ + -e 's|/usr/lib/||g' \ + -e 's|/lib64/||g' \ + -e 's|/lib/||g' ) > $$f.tmp ; \ + mv $$f.tmp $$f ; \ + done) + @mkdir -p $(SYSROOT)/usr/lib + @touch $@ ########################################################################################## @@ -210,264 +210,264 @@ $(foreach t,binutils mpfr gmp mpc gcc ccache,$(eval $(t) = $(TARGETDIR)/$($(t)_v ########################################################################################## # Default base config -CONFIG = --target=$(TARGET) \ - --host=$(HOST) --build=$(BUILD) \ - --prefix=$(PREFIX) +CONFIG = --target=$(TARGET) \ + --host=$(HOST) --build=$(BUILD) \ + --prefix=$(PREFIX) -PATHEXT = $(RESULT)/$(BUILD)/bin: +PATHEXT = $(RESULT)/$(BUILD)/bin: -PATHPRE = PATH=$(PATHEXT)$(PATH) -BUILDPAR = -j16 +PATHPRE = PATH=$(PATHEXT)$(PATH) +BUILDPAR = -j16 # Default commands to when making -MAKECMD = -INSTALLCMD = install +MAKECMD = +INSTALLCMD = install -declare_tools = CC$(1)=$(2)gcc LD$(1)=$(2)ld AR$(1)=$(2)ar AS$(1)=$(2)as RANLIB$(1)=$(2)ranlib CXX$(1)=$(2)g++ OBJDUMP$(1)=$(2)objdump +declare_tools = CC$(1)=$(2)gcc LD$(1)=$(2)ld AR$(1)=$(2)ar AS$(1)=$(2)as RANLIB$(1)=$(2)ranlib CXX$(1)=$(2)g++ OBJDUMP$(1)=$(2)objdump ifeq ($(HOST),$(BUILD)) -ifeq ($(HOST),$(TARGET)) -TOOLS = $(call declare_tools,_FOR_TARGET,) -endif + ifeq ($(HOST),$(TARGET)) + TOOLS = $(call declare_tools,_FOR_TARGET,) + endif endif -TOOLS ?= $(call declare_tools,_FOR_TARGET,$(TARGET)-) +TOOLS ?= $(call declare_tools,_FOR_TARGET,$(TARGET)-) ########################################################################################## -# Create a TARGET bfd + libiberty only. +# Create a TARGET bfd + libiberty only. # Configure one or two times depending on mulitlib arch. -# If multilib, the second should be 32-bit, and we resolve +# If multilib, the second should be 32-bit, and we resolve # CFLAG_ to most likely -m32. define mk_bfd -$$(info Libs for $(1)) -$$(BUILDDIR)/$$(binutils_ver)-$(subst /,-,$(1))/Makefile \ - : CFLAGS += $$(CFLAGS_$(1)) -$$(BUILDDIR)/$$(binutils_ver)-$(subst /,-,$(1))/Makefile \ - : LIBDIRS = --libdir=$(TARGETDIR)/$(1) + $$(info Libs for $(1)) + $$(BUILDDIR)/$$(binutils_ver)-$(subst /,-,$(1))/Makefile \ + : CFLAGS += $$(CFLAGS_$(1)) + $$(BUILDDIR)/$$(binutils_ver)-$(subst /,-,$(1))/Makefile \ + : LIBDIRS = --libdir=$(TARGETDIR)/$(1) -bfdlib += $$(TARGETDIR)/$$(binutils_ver)-$(subst /,-,$(1)).done -bfdmakes += $$(BUILDDIR)/$$(binutils_ver)-$(subst /,-,$(1))/Makefile + bfdlib += $$(TARGETDIR)/$$(binutils_ver)-$(subst /,-,$(1)).done + bfdmakes += $$(BUILDDIR)/$$(binutils_ver)-$(subst /,-,$(1))/Makefile endef # Create one set of bfds etc for each multilib arch $(foreach l,$(LIBDIRS),$(eval $(call mk_bfd,$(l)))) # Only build these two libs. -$(bfdlib) : MAKECMD = all-libiberty all-bfd -$(bfdlib) : INSTALLCMD = install-libiberty install-bfd +$(bfdlib) : MAKECMD = all-libiberty all-bfd +$(bfdlib) : INSTALLCMD = install-libiberty install-bfd -# Building targets libbfd + libiberty. HOST==TARGET, i.e not -# for a cross env. -$(bfdmakes) : CONFIG = --target=$(TARGET) \ - --host=$(TARGET) --build=$(BUILD) \ - --prefix=$(TARGETDIR) \ - --with-sysroot=$(SYSROOT) \ - $(LIBDIRS) +# Building targets libbfd + libiberty. HOST==TARGET, i.e not +# for a cross env. +$(bfdmakes) : CONFIG = --target=$(TARGET) \ + --host=$(TARGET) --build=$(BUILD) \ + --prefix=$(TARGETDIR) \ + --with-sysroot=$(SYSROOT) \ + $(LIBDIRS) -$(bfdmakes) : TOOLS = $(call declare_tools,_FOR_TARGET,$(TARGET)-) $(call declare_tools,,$(TARGET)-) +$(bfdmakes) : TOOLS = $(call declare_tools,_FOR_TARGET,$(TARGET)-) $(call declare_tools,,$(TARGET)-) ########################################################################################## -$(gcc) \ -$(binutils) \ -$(gmp) \ -$(mpfr) \ -$(mpc) \ -$(bfdmakes) \ -$(ccache) : ENVS += $(TOOLS) +$(gcc) \ + $(binutils) \ + $(gmp) \ + $(mpfr) \ + $(mpc) \ + $(bfdmakes) \ + $(ccache) : ENVS += $(TOOLS) # libdir to work around hateful bfd stuff installing into wrong dirs... -# ensure we have 64 bit bfd support in the HOST library. I.e our +# ensure we have 64 bit bfd support in the HOST library. I.e our # compiler on i686 will know 64 bit symbols, BUT later -# we build just the libs again for TARGET, then with whatever the arch +# we build just the libs again for TARGET, then with whatever the arch # wants. $(BUILDDIR)/$(binutils_ver)/Makefile : CONFIG += --enable-64-bit-bfd --libdir=$(PREFIX)/$(word 1,$(LIBDIRS)) # Makefile creation. Simply run configure in build dir. -$(bfdmakes) \ -$(BUILDDIR)/$(binutils_ver)/Makefile \ - : $(BINUTILS_CFG) - $(info Configuring $@. Log in $(@D)/log.config) - @mkdir -p $(@D) - ( \ - cd $(@D) ; \ - $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" \ - $(BINUTILS_CFG) \ - $(CONFIG) \ - --with-sysroot=$(SYSROOT) \ - --disable-nls \ - --program-prefix=$(TARGET)- \ - --enable-multilib \ - ) > $(@D)/log.config 2>&1 - @echo 'done' +$(bfdmakes) \ +$(BUILDDIR)/$(binutils_ver)/Makefile \ + : $(BINUTILS_CFG) + $(info Configuring $@. Log in $(@D)/log.config) + @mkdir -p $(@D) + ( \ + cd $(@D) ; \ + $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" \ + $(BINUTILS_CFG) \ + $(CONFIG) \ + --with-sysroot=$(SYSROOT) \ + --disable-nls \ + --program-prefix=$(TARGET)- \ + --enable-multilib \ + ) > $(@D)/log.config 2>&1 + @echo 'done' -$(BUILDDIR)/$(mpfr_ver)/Makefile \ - : $(MPFR_CFG) - $(info Configuring $@. Log in $(@D)/log.config) - @mkdir -p $(@D) - ( \ - cd $(@D) ; \ - $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" \ - $(MPFR_CFG) \ - $(CONFIG) \ - --program-prefix=$(TARGET)- \ - --enable-shared=no \ - --with-gmp=$(PREFIX) \ - ) > $(@D)/log.config 2>&1 - @echo 'done' +$(BUILDDIR)/$(mpfr_ver)/Makefile \ + : $(MPFR_CFG) + $(info Configuring $@. Log in $(@D)/log.config) + @mkdir -p $(@D) + ( \ + cd $(@D) ; \ + $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" \ + $(MPFR_CFG) \ + $(CONFIG) \ + --program-prefix=$(TARGET)- \ + --enable-shared=no \ + --with-gmp=$(PREFIX) \ + ) > $(@D)/log.config 2>&1 + @echo 'done' -$(BUILDDIR)/$(gmp_ver)/Makefile \ - : $(GMP_CFG) - $(info Configuring $@. Log in $(@D)/log.config) - @mkdir -p $(@D) - ( \ - cd $(@D) ; \ - $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" \ - $(GMP_CFG) \ - --host=$(HOST) --build=$(BUILD) \ - --prefix=$(PREFIX) \ - --disable-nls \ - --program-prefix=$(TARGET)- \ - --enable-shared=no \ - --with-mpfr=$(PREFIX) \ - ) > $(@D)/log.config 2>&1 - @echo 'done' +$(BUILDDIR)/$(gmp_ver)/Makefile \ + : $(GMP_CFG) + $(info Configuring $@. Log in $(@D)/log.config) + @mkdir -p $(@D) + ( \ + cd $(@D) ; \ + $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" \ + $(GMP_CFG) \ + --host=$(HOST) --build=$(BUILD) \ + --prefix=$(PREFIX) \ + --disable-nls \ + --program-prefix=$(TARGET)- \ + --enable-shared=no \ + --with-mpfr=$(PREFIX) \ + ) > $(@D)/log.config 2>&1 + @echo 'done' -$(BUILDDIR)/$(mpc_ver)/Makefile \ - : $(MPC_CFG) - $(info Configuring $@. Log in $(@D)/log.config) - @mkdir -p $(@D) - ( \ - cd $(@D) ; \ - $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" \ - $(MPC_CFG) \ - $(CONFIG) \ - --program-prefix=$(TARGET)- \ - --enable-shared=no \ - --with-mpfr=$(PREFIX) \ - --with-gmp=$(PREFIX) \ - ) > $(@D)/log.config 2>&1 - @echo 'done' +$(BUILDDIR)/$(mpc_ver)/Makefile \ + : $(MPC_CFG) + $(info Configuring $@. Log in $(@D)/log.config) + @mkdir -p $(@D) + ( \ + cd $(@D) ; \ + $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" \ + $(MPC_CFG) \ + $(CONFIG) \ + --program-prefix=$(TARGET)- \ + --enable-shared=no \ + --with-mpfr=$(PREFIX) \ + --with-gmp=$(PREFIX) \ + ) > $(@D)/log.config 2>&1 + @echo 'done' # Only valid if glibc target -> linux # proper destructor handling for c++ ifneq (,$(findstring linux,$(TARGET))) -$(BUILDDIR)/$(gcc_ver)/Makefile : CONFIG += --enable-__cxa_atexit + $(BUILDDIR)/$(gcc_ver)/Makefile : CONFIG += --enable-__cxa_atexit endif # Want: -# c,c++ -# shared libs -# multilib (-m32/-m64 on x64) -# skip native language. -# and link and assemble with the binutils we created -# earlier, so --with-gnu* -$(BUILDDIR)/$(gcc_ver)/Makefile \ - : $(GCC_CFG) - $(info Configuring $@. Log in $(@D)/log.config) - mkdir -p $(@D) - ( \ - cd $(@D) ; \ - $(PATHPRE) $(ENVS) $(GCC_CFG) $(EXTRA_CFLAGS) \ - $(CONFIG) \ - --with-sysroot=$(SYSROOT) \ - --enable-languages=c,c++ \ - --enable-shared \ - --enable-multilib \ - --disable-nls \ - --with-gnu-as \ - --with-gnu-ld \ - --with-mpfr=$(PREFIX) \ - --with-gmp=$(PREFIX) \ - --with-mpc=$(PREFIX) \ - ) > $(@D)/log.config 2>&1 - @echo 'done' +# c,c++ +# shared libs +# multilib (-m32/-m64 on x64) +# skip native language. +# and link and assemble with the binutils we created +# earlier, so --with-gnu* +$(BUILDDIR)/$(gcc_ver)/Makefile \ + : $(GCC_CFG) + $(info Configuring $@. Log in $(@D)/log.config) + mkdir -p $(@D) + ( \ + cd $(@D) ; \ + $(PATHPRE) $(ENVS) $(GCC_CFG) $(EXTRA_CFLAGS) \ + $(CONFIG) \ + --with-sysroot=$(SYSROOT) \ + --enable-languages=c,c++ \ + --enable-shared \ + --enable-multilib \ + --disable-nls \ + --with-gnu-as \ + --with-gnu-ld \ + --with-mpfr=$(PREFIX) \ + --with-gmp=$(PREFIX) \ + --with-mpc=$(PREFIX) \ + ) > $(@D)/log.config 2>&1 + @echo 'done' # need binutils for gcc -$(gcc) : $(binutils) +$(gcc) : $(binutils) # as of 4.3 or so need these for doing config $(BUILDDIR)/$(gcc_ver)/Makefile : $(gmp) $(mpfr) $(mpc) -$(mpfr) : $(gmp) -$(mpc) : $(gmp) $(mpfr) +$(mpfr) : $(gmp) +$(mpc) : $(gmp) $(mpfr) ########################################################################################## -# very straightforward. just build a ccache. it is only for host. -$(BUILDDIR)/$(ccache_ver)/Makefile \ - : $(CCACHE_CFG) - $(info Configuring $@. Log in $(@D)/log.config) - @mkdir -p $(@D) - @( \ - cd $(@D) ; \ - $(PATHPRE) $(ENVS) $(CCACHE_CFG) \ - $(CONFIG) \ - ) > $(@D)/log.config 2>&1 - @echo 'done' +# very straightforward. just build a ccache. it is only for host. +$(BUILDDIR)/$(ccache_ver)/Makefile \ + : $(CCACHE_CFG) + $(info Configuring $@. Log in $(@D)/log.config) + @mkdir -p $(@D) + @( \ + cd $(@D) ; \ + $(PATHPRE) $(ENVS) $(CCACHE_CFG) \ + $(CONFIG) \ + ) > $(@D)/log.config 2>&1 + @echo 'done' -gccpatch = $(TARGETDIR)/gcc-patched +gccpatch = $(TARGETDIR)/gcc-patched ########################################################################################## -# For some reason cpp is not created as a target-compiler +# For some reason cpp is not created as a target-compiler ifeq ($(HOST),$(TARGET)) -$(gccpatch) : $(gcc) link_libs - @echo -n 'Creating compiler symlinks...' - @for f in cpp; do \ - if [ ! -e $(PREFIX)/bin/$(TARGET)-$$f ];\ - then \ - cd $(PREFIX)/bin && \ - ln -s $$f $(TARGET)-$$f ; \ - fi \ - done - @touch $@ - @echo 'done' + $(gccpatch) : $(gcc) link_libs + @echo -n 'Creating compiler symlinks...' + @for f in cpp; do \ + if [ ! -e $(PREFIX)/bin/$(TARGET)-$$f ]; \ + then \ + cd $(PREFIX)/bin && \ + ln -s $$f $(TARGET)-$$f ; \ + fi \ + done + @touch $@ + @echo 'done' -########################################################################################## -# Ugly at best. Seems that when we compile host->host compiler, that are NOT -# the BUILD compiler, the result will not try searching for libs in package root. -# "Solve" this by create links from the target libdirs to where they are. -link_libs: - @echo -n 'Creating library symlinks...' - @$(foreach l,$(LIBDIRS), \ - for f in `cd $(PREFIX)/$(l) && ls`; do \ - if [ ! -e $(TARGETDIR)/$(l)/$$f ]; then \ - mkdir -p $(TARGETDIR)/$(l) && \ - cd $(TARGETDIR)/$(l)/ && \ - ln -s $(if $(findstring /,$(l)),../,)../../$(l)/$$f $$f; \ - fi \ - done;) - @echo 'done' + ########################################################################################## + # Ugly at best. Seems that when we compile host->host compiler, that are NOT + # the BUILD compiler, the result will not try searching for libs in package root. + # "Solve" this by create links from the target libdirs to where they are. + link_libs: + @echo -n 'Creating library symlinks...' + @$(foreach l,$(LIBDIRS), \ + for f in `cd $(PREFIX)/$(l) && ls`; do \ + if [ ! -e $(TARGETDIR)/$(l)/$$f ]; then \ + mkdir -p $(TARGETDIR)/$(l) && \ + cd $(TARGETDIR)/$(l)/ && \ + ln -s $(if $(findstring /,$(l)),../,)../../$(l)/$$f $$f; \ + fi \ + done;) + @echo 'done' else -$(gccpatch) : - @echo 'done' + $(gccpatch) : + @echo 'done' endif ########################################################################################## -# Build in two steps. +# Build in two steps. # make -# make install. +# make install. # Use path to our build hosts cross tools -# Always need to build cross tools for build host self. -$(TARGETDIR)/%.done : $(BUILDDIR)/%/Makefile - $(info Building $(basename $@). Log in $( $(&1 - @echo -n 'installing...' - $(PATHPRE) $(MAKE) $(INSTALLPAR) -f $< -C $( $(&1 - @touch $@ - @echo 'done' +# Always need to build cross tools for build host self. +$(TARGETDIR)/%.done : $(BUILDDIR)/%/Makefile + $(info Building $(basename $@). Log in $( $(&1 + @echo -n 'installing...' + $(PATHPRE) $(MAKE) $(INSTALLPAR) -f $< -C $( $(&1 + @touch $@ + @echo 'done' ########################################################################################## -bfdlib : $(bfdlib) -binutils : $(binutils) -rpms : $(rpms) -libs : $(libs) -sysroot : rpms libs -gcc : sysroot $(gcc) $(gccpatch) -all : binutils gcc bfdlib +bfdlib : $(bfdlib) +binutils : $(binutils) +rpms : $(rpms) +libs : $(libs) +sysroot : rpms libs +gcc : sysroot $(gcc) $(gccpatch) +all : binutils gcc bfdlib -# this is only built for host. so separate. -ccache : $(ccache) +# this is only built for host. so separate. +ccache : $(ccache) -.PHONY : gcc all binutils bfdlib link_libs rpms libs sysroot +.PHONY : gcc all binutils bfdlib link_libs rpms libs sysroot diff --git a/common/makefiles/javadoc/CORE_PKGS.gmk b/common/makefiles/javadoc/CORE_PKGS.gmk index aede99422ff..9c85da65ec7 100644 --- a/common/makefiles/javadoc/CORE_PKGS.gmk +++ b/common/makefiles/javadoc/CORE_PKGS.gmk @@ -24,49 +24,48 @@ # # EXCLUDE_PKGS is the list of packages to exclude from the -# Java API Specification. Do not add these to CORE_PKGS. +# Java API Specification. Do not add these to CORE_PKGS. # The concatenation of EXCLUDE_PKGS and CORE_PKGS # should make up the list of all packages under the # src/shared/classes directory of the JDK source tree. # -EXCLUDE_PKGS = \ - java.awt.peer \ - java.awt.dnd.peer \ - sun.* \ - com.sun.* \ - org.apache.* \ - org.jcp.* \ - org.w3c.dom.css \ - org.w3c.dom.html \ - org.w3c.dom.stylesheets \ - org.w3c.dom.traversal \ - org.w3c.dom.ranges \ - org.w3c.dom.views \ - org.omg.stub.javax.management.remote.rmi +EXCLUDE_PKGS = \ + java.awt.peer \ + java.awt.dnd.peer \ + sun.* \ + com.sun.* \ + org.apache.* \ + org.jcp.* \ + org.w3c.dom.css \ + org.w3c.dom.html \ + org.w3c.dom.stylesheets \ + org.w3c.dom.traversal \ + org.w3c.dom.ranges \ + org.omg.stub.javax.management.remote.rmi # # ACTIVE_JSR_PKGS are packages that are part of an active JSR process-- # one that is doing its own review. These packages are not included when # creating diff pages for the platform's JCP process. -# -# (see /java/pubs/apisrc/jdk/6.0/beta/make/docs/active_jsr_pkgs) +# +# (see /java/pubs/apisrc/jdk/6.0/beta/make/docs/active_jsr_pkgs) # Note: # This is a list of regular expressions. So foo.* matches "foo" and "foo.bar". # ACTIVE_JSR_PKGS= \ - java.lang.invoke \ - java.sql \ - javax.activation \ - javax.annotation.* \ - javax.jws.* \ - javax.lang.* \ - javax.management.* \ - javax.script \ - javax.sql.* \ - javax.tools.* \ - javax.xml.* \ - org.w3c.* \ - org.xml.sax + java.lang.invoke \ + java.sql \ + javax.activation \ + javax.annotation.* \ + javax.jws.* \ + javax.lang.* \ + javax.management.* \ + javax.script \ + javax.sql.* \ + javax.tools.* \ + javax.xml.* \ + org.w3c.* \ + org.xml.sax # # CORE_PKGS is the list of packages that form the @@ -77,224 +76,225 @@ ACTIVE_JSR_PKGS= \ ### determines which table the packages go in on the main page. ### Currently, there is only table ("Platform Packages") and ### everything goes in it, so REGEXP is "*". But if that policy -### changes, packages added will need to be reflected in that +### changes, packages added will need to be reflected in that ### list of wildcard expressions, as well. ### -CORE_PKGS = \ - java.applet \ - java.awt \ - java.awt.color \ - java.awt.datatransfer \ - java.awt.dnd \ - java.awt.event \ - java.awt.font \ - java.awt.geom \ - java.awt.im \ - java.awt.im.spi \ - java.awt.image \ - java.awt.image.renderable \ - java.awt.print \ - java.beans \ - java.beans.beancontext \ - java.io \ - java.lang \ - java.lang.annotation \ - java.lang.instrument \ - java.lang.invoke \ - java.lang.management \ - java.lang.ref \ - java.lang.reflect \ - java.math \ - java.net \ - java.nio \ - java.nio.channels \ - java.nio.channels.spi \ - java.nio.charset \ - java.nio.charset.spi \ - java.nio.file \ - java.nio.file.attribute \ - java.nio.file.spi \ - java.rmi \ - java.rmi.activation \ - java.rmi.dgc \ - java.rmi.registry \ - java.rmi.server \ - java.security \ - java.security.acl \ - java.security.cert \ - java.security.interfaces \ - java.security.spec \ - java.sql \ - java.text \ - java.text.spi \ - java.time \ - java.time.chrono \ - java.time.format \ - java.time.temporal \ - java.time.zone \ - java.util \ - java.util.concurrent \ - java.util.concurrent.atomic \ - java.util.concurrent.locks \ - java.util.function \ - java.util.jar \ - java.util.logging \ - java.util.prefs \ - java.util.regex \ - java.util.spi \ - java.util.stream \ - java.util.zip \ - javax.accessibility \ - javax.activation \ - javax.activity \ - javax.annotation \ - javax.annotation.processing \ - javax.crypto \ - javax.crypto.interfaces \ - javax.crypto.spec \ - javax.imageio \ - javax.imageio.event \ - javax.imageio.metadata \ - javax.imageio.plugins.jpeg \ - javax.imageio.plugins.bmp \ - javax.imageio.spi \ - javax.imageio.stream \ - javax.jws \ - javax.jws.soap \ - javax.lang.model \ - javax.lang.model.element \ - javax.lang.model.type \ - javax.lang.model.util \ - javax.management \ - javax.management.loading \ - javax.management.monitor \ - javax.management.relation \ - javax.management.openmbean \ - javax.management.timer \ - javax.management.modelmbean \ - javax.management.remote \ - javax.management.remote.rmi \ - javax.naming \ - javax.naming.directory \ - javax.naming.event \ - javax.naming.ldap \ - javax.naming.spi \ - javax.net \ - javax.net.ssl \ - javax.print \ - javax.print.attribute \ - javax.print.attribute.standard \ - javax.print.event \ - javax.rmi \ - javax.rmi.CORBA \ - javax.rmi.ssl \ - javax.script \ - javax.security.auth \ - javax.security.auth.callback \ - javax.security.auth.kerberos \ - javax.security.auth.login \ - javax.security.auth.spi \ - javax.security.auth.x500 \ - javax.security.cert \ - javax.security.sasl \ - javax.sound.sampled \ - javax.sound.sampled.spi \ - javax.sound.midi \ - javax.sound.midi.spi \ - javax.sql \ - javax.sql.rowset \ - javax.sql.rowset.serial \ - javax.sql.rowset.spi \ - javax.swing \ - javax.swing.border \ - javax.swing.colorchooser \ - javax.swing.filechooser \ - javax.swing.event \ - javax.swing.table \ - javax.swing.text \ - javax.swing.text.html \ - javax.swing.text.html.parser \ - javax.swing.text.rtf \ - javax.swing.tree \ - javax.swing.undo \ - javax.swing.plaf \ - javax.swing.plaf.basic \ - javax.swing.plaf.metal \ - javax.swing.plaf.multi \ - javax.swing.plaf.nimbus \ - javax.swing.plaf.synth \ - javax.tools \ - javax.tools.annotation \ - javax.transaction \ - javax.transaction.xa \ - javax.xml.parsers \ - javax.xml.bind \ - javax.xml.bind.annotation \ - javax.xml.bind.annotation.adapters \ - javax.xml.bind.attachment \ - javax.xml.bind.helpers \ - javax.xml.bind.util \ - javax.xml.soap \ - javax.xml.ws \ - javax.xml.ws.handler \ - javax.xml.ws.handler.soap \ - javax.xml.ws.http \ - javax.xml.ws.soap \ - javax.xml.ws.spi \ - javax.xml.ws.spi.http \ - javax.xml.ws.wsaddressing \ - javax.xml.transform \ - javax.xml.transform.sax \ - javax.xml.transform.dom \ - javax.xml.transform.stax \ - javax.xml.transform.stream \ - javax.xml \ - javax.xml.crypto \ - javax.xml.crypto.dom \ - javax.xml.crypto.dsig \ - javax.xml.crypto.dsig.dom \ - javax.xml.crypto.dsig.keyinfo \ - javax.xml.crypto.dsig.spec \ - javax.xml.datatype \ - javax.xml.validation \ - javax.xml.namespace \ - javax.xml.xpath \ - javax.xml.stream \ - javax.xml.stream.events \ - javax.xml.stream.util \ - org.ietf.jgss \ - org.omg.CORBA \ - org.omg.CORBA.DynAnyPackage \ - org.omg.CORBA.ORBPackage \ - org.omg.CORBA.TypeCodePackage \ - org.omg.stub.java.rmi \ - org.omg.CORBA.portable \ - org.omg.CORBA_2_3 \ - org.omg.CORBA_2_3.portable \ - org.omg.CosNaming \ - org.omg.CosNaming.NamingContextExtPackage \ - org.omg.CosNaming.NamingContextPackage \ - org.omg.SendingContext \ - org.omg.PortableServer \ - org.omg.PortableServer.CurrentPackage \ - org.omg.PortableServer.POAPackage \ - org.omg.PortableServer.POAManagerPackage \ - org.omg.PortableServer.ServantLocatorPackage \ - org.omg.PortableServer.portable \ - org.omg.PortableInterceptor \ - org.omg.PortableInterceptor.ORBInitInfoPackage \ - org.omg.Messaging \ - org.omg.IOP \ - org.omg.IOP.CodecFactoryPackage \ - org.omg.IOP.CodecPackage \ - org.omg.Dynamic \ - org.omg.DynamicAny \ - org.omg.DynamicAny.DynAnyPackage \ - org.omg.DynamicAny.DynAnyFactoryPackage \ - org.w3c.dom \ - org.w3c.dom.events \ - org.w3c.dom.bootstrap \ - org.w3c.dom.ls \ - org.xml.sax \ - org.xml.sax.ext \ - org.xml.sax.helpers +CORE_PKGS = \ + java.applet \ + java.awt \ + java.awt.color \ + java.awt.datatransfer \ + java.awt.dnd \ + java.awt.event \ + java.awt.font \ + java.awt.geom \ + java.awt.im \ + java.awt.im.spi \ + java.awt.image \ + java.awt.image.renderable \ + java.awt.print \ + java.beans \ + java.beans.beancontext \ + java.io \ + java.lang \ + java.lang.annotation \ + java.lang.instrument \ + java.lang.invoke \ + java.lang.management \ + java.lang.ref \ + java.lang.reflect \ + java.math \ + java.net \ + java.nio \ + java.nio.channels \ + java.nio.channels.spi \ + java.nio.charset \ + java.nio.charset.spi \ + java.nio.file \ + java.nio.file.attribute \ + java.nio.file.spi \ + java.rmi \ + java.rmi.activation \ + java.rmi.dgc \ + java.rmi.registry \ + java.rmi.server \ + java.security \ + java.security.acl \ + java.security.cert \ + java.security.interfaces \ + java.security.spec \ + java.sql \ + java.text \ + java.text.spi \ + java.time \ + java.time.chrono \ + java.time.format \ + java.time.temporal \ + java.time.zone \ + java.util \ + java.util.concurrent \ + java.util.concurrent.atomic \ + java.util.concurrent.locks \ + java.util.function \ + java.util.jar \ + java.util.logging \ + java.util.prefs \ + java.util.regex \ + java.util.spi \ + java.util.stream \ + java.util.zip \ + javax.accessibility \ + javax.activation \ + javax.activity \ + javax.annotation \ + javax.annotation.processing \ + javax.crypto \ + javax.crypto.interfaces \ + javax.crypto.spec \ + javax.imageio \ + javax.imageio.event \ + javax.imageio.metadata \ + javax.imageio.plugins.jpeg \ + javax.imageio.plugins.bmp \ + javax.imageio.spi \ + javax.imageio.stream \ + javax.jws \ + javax.jws.soap \ + javax.lang.model \ + javax.lang.model.element \ + javax.lang.model.type \ + javax.lang.model.util \ + javax.management \ + javax.management.loading \ + javax.management.monitor \ + javax.management.relation \ + javax.management.openmbean \ + javax.management.timer \ + javax.management.modelmbean \ + javax.management.remote \ + javax.management.remote.rmi \ + javax.naming \ + javax.naming.directory \ + javax.naming.event \ + javax.naming.ldap \ + javax.naming.spi \ + javax.net \ + javax.net.ssl \ + javax.print \ + javax.print.attribute \ + javax.print.attribute.standard \ + javax.print.event \ + javax.rmi \ + javax.rmi.CORBA \ + javax.rmi.ssl \ + javax.script \ + javax.security.auth \ + javax.security.auth.callback \ + javax.security.auth.kerberos \ + javax.security.auth.login \ + javax.security.auth.spi \ + javax.security.auth.x500 \ + javax.security.cert \ + javax.security.sasl \ + javax.sound.sampled \ + javax.sound.sampled.spi \ + javax.sound.midi \ + javax.sound.midi.spi \ + javax.sql \ + javax.sql.rowset \ + javax.sql.rowset.serial \ + javax.sql.rowset.spi \ + javax.swing \ + javax.swing.border \ + javax.swing.colorchooser \ + javax.swing.filechooser \ + javax.swing.event \ + javax.swing.table \ + javax.swing.text \ + javax.swing.text.html \ + javax.swing.text.html.parser \ + javax.swing.text.rtf \ + javax.swing.tree \ + javax.swing.undo \ + javax.swing.plaf \ + javax.swing.plaf.basic \ + javax.swing.plaf.metal \ + javax.swing.plaf.multi \ + javax.swing.plaf.nimbus \ + javax.swing.plaf.synth \ + javax.tools \ + javax.tools.annotation \ + javax.transaction \ + javax.transaction.xa \ + javax.xml.parsers \ + javax.xml.bind \ + javax.xml.bind.annotation \ + javax.xml.bind.annotation.adapters \ + javax.xml.bind.attachment \ + javax.xml.bind.helpers \ + javax.xml.bind.util \ + javax.xml.soap \ + javax.xml.ws \ + javax.xml.ws.handler \ + javax.xml.ws.handler.soap \ + javax.xml.ws.http \ + javax.xml.ws.soap \ + javax.xml.ws.spi \ + javax.xml.ws.spi.http \ + javax.xml.ws.wsaddressing \ + javax.xml.transform \ + javax.xml.transform.sax \ + javax.xml.transform.dom \ + javax.xml.transform.stax \ + javax.xml.transform.stream \ + javax.xml \ + javax.xml.crypto \ + javax.xml.crypto.dom \ + javax.xml.crypto.dsig \ + javax.xml.crypto.dsig.dom \ + javax.xml.crypto.dsig.keyinfo \ + javax.xml.crypto.dsig.spec \ + javax.xml.datatype \ + javax.xml.validation \ + javax.xml.namespace \ + javax.xml.xpath \ + javax.xml.stream \ + javax.xml.stream.events \ + javax.xml.stream.util \ + org.ietf.jgss \ + org.omg.CORBA \ + org.omg.CORBA.DynAnyPackage \ + org.omg.CORBA.ORBPackage \ + org.omg.CORBA.TypeCodePackage \ + org.omg.stub.java.rmi \ + org.omg.CORBA.portable \ + org.omg.CORBA_2_3 \ + org.omg.CORBA_2_3.portable \ + org.omg.CosNaming \ + org.omg.CosNaming.NamingContextExtPackage \ + org.omg.CosNaming.NamingContextPackage \ + org.omg.SendingContext \ + org.omg.PortableServer \ + org.omg.PortableServer.CurrentPackage \ + org.omg.PortableServer.POAPackage \ + org.omg.PortableServer.POAManagerPackage \ + org.omg.PortableServer.ServantLocatorPackage \ + org.omg.PortableServer.portable \ + org.omg.PortableInterceptor \ + org.omg.PortableInterceptor.ORBInitInfoPackage \ + org.omg.Messaging \ + org.omg.IOP \ + org.omg.IOP.CodecFactoryPackage \ + org.omg.IOP.CodecPackage \ + org.omg.Dynamic \ + org.omg.DynamicAny \ + org.omg.DynamicAny.DynAnyPackage \ + org.omg.DynamicAny.DynAnyFactoryPackage \ + org.w3c.dom \ + org.w3c.dom.events \ + org.w3c.dom.bootstrap \ + org.w3c.dom.ls \ + org.w3c.dom.views \ + org.xml.sax \ + org.xml.sax.ext \ + org.xml.sax.helpers diff --git a/common/makefiles/javadoc/Javadoc.gmk b/common/makefiles/javadoc/Javadoc.gmk index 9fe25223fb8..5c5b5fe87e2 100644 --- a/common/makefiles/javadoc/Javadoc.gmk +++ b/common/makefiles/javadoc/Javadoc.gmk @@ -47,31 +47,31 @@ HOTSPOT_DOCS_IMPORT_PATH=$(HOTSPOT_OUTPUTDIR)/docs BUILD_NUMBER=$(JDK_BUILD_NUMBER) JAVADOC_CMD = $(JAVA) \ - -Xmx1024m \ - -Djava.awt.headless=true \ - $(NEW_JAVADOC) \ - -bootclasspath $(JDK_OUTPUTDIR)/classes + -Xmx1024m \ + -Djava.awt.headless=true \ + $(NEW_JAVADOC) \ + -bootclasspath $(JDK_OUTPUTDIR)/classes # Copyright year for beginning of Java and some of the apis -# (Needed when creating the javadocs) -FIRST_COPYRIGHT_YEAR = 1993 -DOMAPI_FIRST_COPYRIGHT_YEAR = 2005 -MIRROR_FIRST_COPYRIGHT_YEAR = 2004 -DOCLETAPI_FIRST_COPYRIGHT_YEAR = 1993 -TAGLETAPI_FIRST_COPYRIGHT_YEAR = 1993 -JDI_FIRST_COPYRIGHT_YEAR = 1999 -JAAS_FIRST_COPYRIGHT_YEAR = 1998 -JGSS_FIRST_COPYRIGHT_YEAR = 2000 -SMARTCARDIO_FIRST_COPYRIGHT_YEAR = 2005 -HTTPSERVER_FIRST_COPYRIGHT_YEAR = 2005 -MGMT_FIRST_COPYRIGHT_YEAR = 2003 -ATTACH_FIRST_COPYRIGHT_YEAR = 2005 -JCONSOLE_FIRST_COPYRIGHT_YEAR = 2006 -SCTPAPI_FIRST_COPYRIGHT_YEAR = 2009 -TRACING_FIRST_COPYRIGHT_YEAR = 2008 -TREEAPI_FIRST_COPYRIGHT_YEAR = 2005 -JNLP_FIRST_COPYRIGHT_YEAR = 1998 -PLUGIN2_FIRST_COPYRIGHT_YEAR = 2007 +# (Needed when creating the javadocs) +FIRST_COPYRIGHT_YEAR = 1993 +DOMAPI_FIRST_COPYRIGHT_YEAR = 2005 +MIRROR_FIRST_COPYRIGHT_YEAR = 2004 +DOCLETAPI_FIRST_COPYRIGHT_YEAR = 1993 +TAGLETAPI_FIRST_COPYRIGHT_YEAR = 1993 +JDI_FIRST_COPYRIGHT_YEAR = 1999 +JAAS_FIRST_COPYRIGHT_YEAR = 1998 +JGSS_FIRST_COPYRIGHT_YEAR = 2000 +SMARTCARDIO_FIRST_COPYRIGHT_YEAR = 2005 +HTTPSERVER_FIRST_COPYRIGHT_YEAR = 2005 +MGMT_FIRST_COPYRIGHT_YEAR = 2003 +ATTACH_FIRST_COPYRIGHT_YEAR = 2005 +JCONSOLE_FIRST_COPYRIGHT_YEAR = 2006 +SCTPAPI_FIRST_COPYRIGHT_YEAR = 2009 +TRACING_FIRST_COPYRIGHT_YEAR = 2008 +TREEAPI_FIRST_COPYRIGHT_YEAR = 2005 +JNLP_FIRST_COPYRIGHT_YEAR = 1998 +PLUGIN2_FIRST_COPYRIGHT_YEAR = 2007 # Oracle name FULL_COMPANY_NAME = Oracle and/or its affiliates @@ -83,15 +83,15 @@ COMPANY_ADDRESS = 500 Oracle Parkway
Redwood Shores, CA 94065 USA. TRADEMARK = ™ # Common copyright lines used -# The word "Copyright" might optionally be a link to the file cpyr.html. -# The first year of copyright may vary or not be available. -# The address to the company might be optional. +# The word "Copyright" might optionally be a link to the file cpyr.html. +# The first year of copyright may vary or not be available. +# The address to the company might be optional. COMMA:= , EMPTY:= SPACE:=$(EMPTY) $(EMPTY) COPYRIGHT_SYMBOL = &\#x00a9; # Macro to construct the copyright line -# (The GNU make 3.78.1 "if" conditional is broken, fixed in GNU make 3.81) +# (The GNU make 3.78.1 "if" conditional is broken, fixed in GNU make 3.81) define CopyrightLine # optionalurl optionalfirstyear optionaladdress $(if $(strip $1),Copyright,Copyright) \ $(COPYRIGHT_SYMBOL) $(if $2,$2${COMMA},) $(COPYRIGHT_YEAR),\ @@ -114,10 +114,9 @@ BUG_SUBMIT_URL = http://bugreport.sun.com/bugreport/ BUG_SUBMIT_LINE = Submit a bug or feature # Url to devdocs page -# Was: http://java.sun.com/javase/6/webnotes/devdocs-vs-specs.html +# Was: http://java.sun.com/javase/6/webnotes/devdocs-vs-specs.html DEV_DOCS_URL-7 = http://download.oracle.com/javase/7/docs/index.html -# This isn't added in old build yet. -#DEV_DOCS_URL-8 = http://download.oracle.com/javase/7/docs/index.html +DEV_DOCS_URL-8 = http://download.oracle.com/javase/8/docs/index.html DEV_DOCS_URL = $(DEV_DOCS_URL-$(JDK_MINOR_VERSION)) DOCS_BASE_URL = http://download.oracle.com/javase/7/docs @@ -130,17 +129,17 @@ $(FULL_COMPANY_NAME) in the US and other countries. # List of all possible directories for javadoc to look for sources -# NOTE: Quotes are required around sourcepath argument only on Windows. -# Otherwise, you get "No packages or classes specified." due -# to $(PATH_SEP) being interpreted as an end of -# command (newline or shell ; character) +# NOTE: Quotes are required around sourcepath argument only on Windows. +# Otherwise, you get "No packages or classes specified." due +# to $(PATH_SEP) being interpreted as an end of +# command (newline or shell ; character) ALL_SOURCE_DIRS = $(JDK_SHARE_CLASSES) \ - $(JDK_IMPSRC) \ - $(JDK_GENSRC) \ - $(JDK_OUTPUTDIR)/gendocsrc_rmic \ - $(JDK_TOPDIR)/src/solaris/classes \ - $(JDK_TOPDIR)/src/windows/classes \ - $(JDK_SHARE_SRC)/doc/stub + $(JDK_IMPSRC) \ + $(JDK_GENSRC) \ + $(JDK_OUTPUTDIR)/gendocsrc_rmic \ + $(JDK_TOPDIR)/src/solaris/classes \ + $(JDK_TOPDIR)/src/windows/classes \ + $(JDK_SHARE_SRC)/doc/stub # List of directories that actually exist ALL_EXISTING_SOURCE_DIRS := $(wildcard $(ALL_SOURCE_DIRS)) @@ -152,60 +151,60 @@ RELEASEDOCS_SOURCEPATH = \ $(subst $(SPACE),$(PATH_SEP),$(strip $(ALL_SOURCE_DIRS))) define prep-target -$(MKDIR) -p $(@D) -$(RM) $@ + $(MKDIR) -p $(@D) + $(RM) $@ endef # Prep for javadoc creation, assumes $@ is an index.html file define prep-javadoc -@if [ -f "$@" -a "$?" != "" ] ; then \ - $(ECHO) "# Dependencies have changed: $?"; \ -fi -$(RM) -r $(@D) -$(MKDIR) -p $(@D) + @if [ -f "$@" -a "$?" != "" ] ; then \ + $(ECHO) "# Dependencies have changed: $?"; \ + fi + $(RM) -r $(@D) + $(MKDIR) -p $(@D) endef # A cache of the directories in ALL_SOURCE_DIRS DIRECTORY_CACHE = $(DOCSTMPDIR)/directory.cache # Given a list of packages, return a list of files or dirs to be dependent on -# (Currently only returning a list of directories) +# (Currently only returning a list of directories) define PackageDependencies # packages -$(shell \ - if [ "$1" != "" -a -f $(DIRECTORY_CACHE) ] ; then \ - for p in $1 ; do \ - pd=`$(ECHO) $${p} | $(SED) -e 's@[.]@/@g'`; \ - $(CAT) $(DIRECTORY_CACHE) | $(GREP) "/$${pd}/" ; \ - done; \ - fi \ -) + $(shell \ + if [ "$1" != "" -a -f $(DIRECTORY_CACHE) ] ; then \ + for p in $1 ; do \ + pd=`$(ECHO) $${p} | $(SED) -e 's@[.]@/@g'`; \ + $(CAT) $(DIRECTORY_CACHE) | $(GREP) "/$${pd}/" ; \ + done; \ + fi \ + ) endef # Given a list of packages, add packages that exist to $@, print summary define PackageFilter # packages -@if [ "$1" != "" ] ; then \ - for p in $1 ; do \ - pd=`$(ECHO) $${p} | $(SED) -e 's@[.]@/@g'`; \ - found="false"; \ - for cp in $(ALL_SOURCE_DIRS) ; do \ - if [ -d $${cp}/$${pd} ] ; then \ - $(ECHO) "$${p}" >> $@; \ - found="true"; \ - break; \ - fi; \ - done; \ - if [ "$${found}" = "false" ] ; then \ - $(ECHO) "WARNING: Package not found: $${p}"; \ - fi; \ - done; \ -fi + @if [ "$1" != "" ] ; then \ + for p in $1 ; do \ + pd=`$(ECHO) $${p} | $(SED) -e 's@[.]@/@g'`; \ + found="false"; \ + for cp in $(ALL_SOURCE_DIRS) ; do \ + if [ -d $${cp}/$${pd} ] ; then \ + $(ECHO) "$${p}" >> $@; \ + found="true"; \ + break; \ + fi; \ + done; \ + if [ "$${found}" = "false" ] ; then \ + $(ECHO) "WARNING: Package not found: $${p}"; \ + fi; \ + done; \ + fi endef # Print out a summary of the javadoc command about to be run define JavadocSummary # optionsfile packagesfile -@$(ECHO) "# Summary for $@";\ - $(ECHO) "# Options (`$(BASENAME) $1`):"; $(SED) -e 's@^@# @' $1; \ - $(ECHO) "# Packages (`$(BASENAME) $2`):";$(SED) -e 's@^@# @' $2 + @$(ECHO) "# Summary for $@"; \ + $(ECHO) "# Options (`$(BASENAME) $1`):"; $(SED) -e 's@^@# @' $1; \ + $(ECHO) "# Packages (`$(BASENAME) $2`):";$(SED) -e 's@^@# @' $2 endef # @@ -216,15 +215,15 @@ DOCSTMPDIR = $(TEMPDIR)/doctmp # # Different api directories created from root directory # -COREAPI_DOCSDIR = $(DOCSDIR)/api -JDK_API_DOCSDIR = $(DOCSDIR)/jdk/api -JRE_API_DOCSDIR = $(DOCSDIR)/jre/api -PLATFORM_DOCSDIR = $(DOCSDIR)/platform +COREAPI_DOCSDIR = $(DOCSDIR)/api +JDK_API_DOCSDIR = $(DOCSDIR)/jdk/api +JRE_API_DOCSDIR = $(DOCSDIR)/jre/api +PLATFORM_DOCSDIR = $(DOCSDIR)/platform # The non-core api javadocs need to be able to access the root of the core -# api directory, so for jdk/api or jre/api to get to the core api/ -# directory we would use this: -JDKJRE2COREAPI = ../../api +# api directory, so for jdk/api or jre/api to get to the core api/ +# directory we would use this: +JDKJRE2COREAPI = ../../api # Common bottom argument define CommonBottom # year @@ -241,13 +240,13 @@ endef # Common echo of option define OptionOnly # opt -$(PRINTF) "%s\n" "$1" + $(PRINTF) "%s\n" "$1" endef define OptionPair # opt arg -$(PRINTF) "%s '%s'\n" "$1" '$2' + $(PRINTF) "%s '%s'\n" "$1" '$2' endef define OptionTrip # opt arg arg -$(PRINTF) "%s '%s' '%s'\n" "$1" '$2' '$3' + $(PRINTF) "%s '%s' '%s'\n" "$1" '$2' '$3' endef # Core api bottom argument (with special sauce) @@ -261,18 +260,18 @@ $(call CopyrightLine,$(COPYRIGHT_URL),$(FIRST_COPYRIGHT_YEAR),)\ # Common javadoc options used by all -COMMON_JAVADOCFLAGS = \ - -XDignore.symbol.file=true \ - -quiet \ - -use \ - -keywords \ - -Xdoclint:none \ - -Xprofilespath $(JDK_TOPDIR)/makefiles/profile-rtjar-includes.txt \ - $(ADDITIONAL_JAVADOCFLAGS) +COMMON_JAVADOCFLAGS = \ + -XDignore.symbol.file=true \ + -quiet \ + -use \ + -keywords \ + -Xdoclint:none \ + -Xprofilespath $(JDK_TOPDIR)/makefiles/profile-rtjar-includes.txt \ + $(ADDITIONAL_JAVADOCFLAGS) ifdef OPENJDK - ADDITIONAL_JAVADOCFLAGS = \ - -Xdocrootparent $(DOCS_BASE_URL) + ADDITIONAL_JAVADOCFLAGS = \ + -Xdocrootparent $(DOCS_BASE_URL) else ADDITIONAL_JAVADOCFLAGS = endif @@ -280,11 +279,11 @@ endif # Draft used for non-fcs documents DRAFT_HEADER = ifneq ($(MILESTONE), fcs) - DRAFT_HEADER =
DRAFT $(MILESTONE)-$(BUILD_NUMBER) - DRAFT_BOTTOM =
DRAFT $(MILESTONE)-$(BUILD_NUMBER) - DRAFT_WINTITLE = $(BUILD_NUMBER) - # Early access top text (not used in FCS releases) - COREAPI_TOP_EARLYACCESS = \ + DRAFT_HEADER =
DRAFT $(MILESTONE)-$(BUILD_NUMBER) + DRAFT_BOTTOM =
DRAFT $(MILESTONE)-$(BUILD_NUMBER) + DRAFT_WINTITLE = $(BUILD_NUMBER) + # Early access top text (not used in FCS releases) + COREAPI_TOP_EARLYACCESS = \
\
API Specification -COREAPI_WINDOWTITLE = Java Platform SE $(JDK_MINOR_VERSION) +COREAPI_WINDOWTITLE = Java Platform SE $(JDK_MINOR_VERSION) COREAPI_HEADER = \ Java$(TRADEMARK) Platform
Standard Ed. $(JDK_MINOR_VERSION)
@@ -361,8 +361,8 @@ The Java™ Language Specification: COREAPI_OVERVIEW = $(JDK_SHARE_CLASSES)/overview-core.html # The index.html, options, and packages files -COREAPI_INDEX_FILE = $(COREAPI_DOCSDIR)/index.html -COREAPI_OPTIONS_FILE = $(DOCSTMPDIR)/coredocs.options +COREAPI_INDEX_FILE = $(COREAPI_DOCSDIR)/index.html +COREAPI_OPTIONS_FILE = $(DOCSTMPDIR)/coredocs.options COREAPI_PACKAGES_FILE = $(DOCSTMPDIR)/coredocs.packages coredocs: $(COREAPI_INDEX_FILE) @@ -375,43 +375,43 @@ $(COREAPI_INDEX_FILE): $(COREAPI_OPTIONS_FILE) $(COREAPI_PACKAGES_FILE) $(prep-javadoc) $(call JavadocSummary,$(COREAPI_OPTIONS_FILE),$(COREAPI_PACKAGES_FILE)) $(JAVADOC_CMD) -d $(@D) \ - @$(COREAPI_OPTIONS_FILE) @$(COREAPI_PACKAGES_FILE) + @$(COREAPI_OPTIONS_FILE) @$(COREAPI_PACKAGES_FILE) # Create file with javadoc options in it $(COREAPI_OPTIONS_FILE): $(COREAPI_OVERVIEW) $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ISO-8859-1) ; \ - $(call OptionPair,-tag,beaninfo:X) ; \ - $(call OptionPair,-tag,revised:X) ; \ - $(call OptionPair,-tag,since.unbundled:X) ; \ - $(call OptionPair,-tag,spec:X) ; \ - $(call OptionPair,-tag,specdefault:X) ; \ - $(call OptionPair,-tag,Note:X) ; \ - $(call OptionPair,-tag,ToDo:X) ; \ - $(call OptionPair,-tag,apiNote:a:API Note:) ; \ - $(call OptionPair,-tag,implSpec:a:Implementation Requirements:) ; \ - $(call OptionPair,-tag,implNote:a:Implementation Note:) ; \ - $(call OptionPair,-tag,param) ; \ - $(call OptionPair,-tag,return) ; \ - $(call OptionPair,-tag,throws) ; \ - $(call OptionPair,-tag,since) ; \ - $(call OptionPair,-tag,version) ; \ - $(call OptionPair,-tag,serialData) ; \ - $(call OptionPair,-tag,factory) ; \ - $(call OptionPair,-tag,see) ; \ - $(call OptionPair,-tag,$(TAG_JLS)) ; \ - $(call OptionOnly,-splitIndex) ; \ - $(call OptionPair,-overview,$(COREAPI_OVERVIEW)) ; \ - $(call OptionPair,-doctitle,$(COREAPI_DOCTITLE)) ; \ - $(call OptionPair,-windowtitle,$(COREAPI_WINDOWTITLE) $(DRAFT_WINTITLE)) ;\ - $(call OptionPair,-header,$(COREAPI_HEADER)$(DRAFT_HEADER)) ; \ - $(call OptionPair,-bottom,$(COREAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \ - ) >> $@ -ifdef COREAPI_TOP_EARLYACCESS - @$(call OptionPair,-top,$(COREAPI_TOP_EARLYACCESS)) >> $@ -endif + @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ + $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-encoding,ISO-8859-1) ; \ + $(call OptionPair,-tag,beaninfo:X) ; \ + $(call OptionPair,-tag,revised:X) ; \ + $(call OptionPair,-tag,since.unbundled:X) ; \ + $(call OptionPair,-tag,spec:X) ; \ + $(call OptionPair,-tag,specdefault:X) ; \ + $(call OptionPair,-tag,Note:X) ; \ + $(call OptionPair,-tag,ToDo:X) ; \ + $(call OptionPair,-tag,apiNote:a:API Note:) ; \ + $(call OptionPair,-tag,implSpec:a:Implementation Requirements:) ; \ + $(call OptionPair,-tag,implNote:a:Implementation Note:) ; \ + $(call OptionPair,-tag,param) ; \ + $(call OptionPair,-tag,return) ; \ + $(call OptionPair,-tag,throws) ; \ + $(call OptionPair,-tag,since) ; \ + $(call OptionPair,-tag,version) ; \ + $(call OptionPair,-tag,serialData) ; \ + $(call OptionPair,-tag,factory) ; \ + $(call OptionPair,-tag,see) ; \ + $(call OptionPair,-tag,$(TAG_JLS)) ; \ + $(call OptionOnly,-splitIndex) ; \ + $(call OptionPair,-overview,$(COREAPI_OVERVIEW)) ; \ + $(call OptionPair,-doctitle,$(COREAPI_DOCTITLE)) ; \ + $(call OptionPair,-windowtitle,$(COREAPI_WINDOWTITLE) $(DRAFT_WINTITLE)) ; \ + $(call OptionPair,-header,$(COREAPI_HEADER)$(DRAFT_HEADER)) ; \ + $(call OptionPair,-bottom,$(COREAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \ + ) >> $@ + ifdef COREAPI_TOP_EARLYACCESS + @$(call OptionPair,-top,$(COREAPI_TOP_EARLYACCESS)) >> $@ + endif # Create a file with the package names in it $(COREAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(CORE_PKGS)) @@ -425,19 +425,19 @@ $(COREAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(CORE_P ALL_OTHER_TARGETS += docletapidocs -DOCLETAPI_DOCDIR := $(JDK_API_DOCSDIR)/javadoc/doclet -DOCLETAPI2COREAPI := ../../$(JDKJRE2COREAPI) -DOCLETAPI_DOCTITLE := Doclet API -DOCLETAPI_WINDOWTITLE := Doclet API -DOCLETAPI_HEADER := Doclet API -DOCLETAPI_BOTTOM := $(call CommonTrademarkBottom,$(DOCLETAPI_FIRST_COPYRIGHT_YEAR)) -DOCLETAPI_GROUPNAME := Packages -DOCLETAPI_REGEXP := com.sun.javadoc +DOCLETAPI_DOCDIR := $(JDK_API_DOCSDIR)/javadoc/doclet +DOCLETAPI2COREAPI := ../../$(JDKJRE2COREAPI) +DOCLETAPI_DOCTITLE := Doclet API +DOCLETAPI_WINDOWTITLE := Doclet API +DOCLETAPI_HEADER := Doclet API +DOCLETAPI_BOTTOM := $(call CommonTrademarkBottom,$(DOCLETAPI_FIRST_COPYRIGHT_YEAR)) +DOCLETAPI_GROUPNAME := Packages +DOCLETAPI_REGEXP := com.sun.javadoc # DOCLETAPI_PKGS is located in NON_CORE_PKGS.gmk # The index.html, options, and packages files -DOCLETAPI_INDEX_FILE = $(DOCLETAPI_DOCDIR)/index.html -DOCLETAPI_OPTIONS_FILE = $(DOCSTMPDIR)/docletapi.options +DOCLETAPI_INDEX_FILE = $(DOCLETAPI_DOCDIR)/index.html +DOCLETAPI_OPTIONS_FILE = $(DOCSTMPDIR)/docletapi.options DOCLETAPI_PACKAGES_FILE = $(DOCSTMPDIR)/docletapi.packages docletapidocs: $(DOCLETAPI_INDEX_FILE) @@ -450,22 +450,22 @@ $(DOCLETAPI_INDEX_FILE): $(DOCLETAPI_OPTIONS_FILE) $(DOCLETAPI_PACKAGES_FILE) co $(prep-javadoc) $(call JavadocSummary,$(DOCLETAPI_OPTIONS_FILE),$(DOCLETAPI_PACKAGES_FILE)) $(JAVADOC_CMD) -d $(@D) \ - @$(DOCLETAPI_OPTIONS_FILE) @$(DOCLETAPI_PACKAGES_FILE) + @$(DOCLETAPI_OPTIONS_FILE) @$(DOCLETAPI_PACKAGES_FILE) # Create file with javadoc options in it $(DOCLETAPI_OPTIONS_FILE): $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionOnly,-breakiterator) ; \ - $(call OptionPair,-doctitle,$(DOCLETAPI_DOCTITLE)) ; \ - $(call OptionPair,-windowtitle,$(DOCLETAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\ - $(call OptionPair,-header,$(DOCLETAPI_HEADER)$(DRAFT_HEADER)) ; \ - $(call OptionPair,-bottom,$(DOCLETAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \ + @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ + $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-encoding,ascii) ; \ + $(call OptionOnly,-breakiterator) ; \ + $(call OptionPair,-doctitle,$(DOCLETAPI_DOCTITLE)) ; \ + $(call OptionPair,-windowtitle,$(DOCLETAPI_WINDOWTITLE) $(DRAFT_WINTITLE)); \ + $(call OptionPair,-header,$(DOCLETAPI_HEADER)$(DRAFT_HEADER)) ; \ + $(call OptionPair,-bottom,$(DOCLETAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \ $(call OptionTrip,-group,$(DOCLETAPI_GROUPNAME),$(DOCLETAPI_REGEXP)); \ $(call OptionTrip,-linkoffline,$(DOCLETAPI2COREAPI),$(COREAPI_DOCSDIR)/); \ - ) >> $@ + ) >> $@ # Create a file with the package names in it $(DOCLETAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(DOCLETAPI_PKGS)) @@ -478,17 +478,17 @@ $(DOCLETAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(DOCL # ALL_OTHER_TARGETS += tagletapidocs -TAGLETAPI_DOCDIR := $(JDK_API_DOCSDIR)/javadoc/taglet -TAGLETAPI2COREAPI := ../../$(JDKJRE2COREAPI) -TAGLETAPI_BOTTOM := $(call CommonTrademarkBottom,$(TAGLETAPI_FIRST_COPYRIGHT_YEAR)) +TAGLETAPI_DOCDIR := $(JDK_API_DOCSDIR)/javadoc/taglet +TAGLETAPI2COREAPI := ../../$(JDKJRE2COREAPI) +TAGLETAPI_BOTTOM := $(call CommonTrademarkBottom,$(TAGLETAPI_FIRST_COPYRIGHT_YEAR)) # TAGLETAPI_FILE is located in NON_CORE_PKGS.gmk # Temporary directory (special generation rules) -TAGLETAPI_TEMPDIR = $(DOCSTMPDIR)/taglets_temp +TAGLETAPI_TEMPDIR = $(DOCSTMPDIR)/taglets_temp # The index.html, options, and packages files -TAGLETAPI_INDEX_FILE = $(TAGLETAPI_DOCDIR)/index.html -TAGLETAPI_OPTIONS_FILE = $(DOCSTMPDIR)/tagletapi.options +TAGLETAPI_INDEX_FILE = $(TAGLETAPI_DOCDIR)/index.html +TAGLETAPI_OPTIONS_FILE = $(DOCSTMPDIR)/tagletapi.options TAGLETAPI_PACKAGES_FILE = $(DOCSTMPDIR)/tagletapi.packages tagletapidocs: $(TAGLETAPI_INDEX_FILE) @@ -503,7 +503,7 @@ $(TAGLETAPI_INDEX_FILE): $(TAGLETAPI_OPTIONS_FILE) $(TAGLETAPI_PACKAGES_FILE) co $(MKDIR) -p $(TAGLETAPI_TEMPDIR) $(call JavadocSummary,$(TAGLETAPI_OPTIONS_FILE),$(TAGLETAPI_PACKAGES_FILE)) $(JAVADOC_CMD) -d $(TAGLETAPI_TEMPDIR) \ - @$(TAGLETAPI_OPTIONS_FILE) @$(TAGLETAPI_PACKAGES_FILE) + @$(TAGLETAPI_OPTIONS_FILE) @$(TAGLETAPI_PACKAGES_FILE) cp -r $(TAGLETAPI_TEMPDIR)/com $(@D) cp $(TAGLETAPI_TEMPDIR)/stylesheet.css $(@D) $(RM) -r $(TAGLETAPI_TEMPDIR) @@ -511,14 +511,14 @@ $(TAGLETAPI_INDEX_FILE): $(TAGLETAPI_OPTIONS_FILE) $(TAGLETAPI_PACKAGES_FILE) co # Create file with javadoc options in it $(TAGLETAPI_OPTIONS_FILE): $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionOnly,-nonavbar) ; \ - $(call OptionOnly,-noindex) ; \ - $(call OptionPair,-bottom,$(TAGLETAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \ + @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ + $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-encoding,ascii) ; \ + $(call OptionOnly,-nonavbar) ; \ + $(call OptionOnly,-noindex) ; \ + $(call OptionPair,-bottom,$(TAGLETAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \ $(call OptionTrip,-linkoffline,$(TAGLETAPI2COREAPI),$(COREAPI_DOCSDIR)/); \ - ) >> $@ + ) >> $@ # Create a file with the package names in it $(TAGLETAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(TAGLETAPI_PKGS)) @@ -532,19 +532,19 @@ $(TAGLETAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(TAGL ALL_OTHER_TARGETS += domapidocs -DOMAPI_DOCDIR := $(JRE_API_DOCSDIR)/plugin/dom -DOMAPI2COREAPI := ../../$(JDKJRE2COREAPI) -DOMAPI_DOCTITLE := Common DOM API -DOMAPI_WINDOWTITLE := Common DOM API -DOMAPI_HEADER := Common DOM API -DOMAPI_BOTTOM := $(call CommonTrademarkBottom,$(DOMAPI_FIRST_COPYRIGHT_YEAR)) -DOMAPI_GROUPNAME := Packages -DOMAPI_REGEXP := com.sun.java.browser.dom:org.w3c.dom* +DOMAPI_DOCDIR := $(JRE_API_DOCSDIR)/plugin/dom +DOMAPI2COREAPI := ../../$(JDKJRE2COREAPI) +DOMAPI_DOCTITLE := Common DOM API +DOMAPI_WINDOWTITLE := Common DOM API +DOMAPI_HEADER := Common DOM API +DOMAPI_BOTTOM := $(call CommonTrademarkBottom,$(DOMAPI_FIRST_COPYRIGHT_YEAR)) +DOMAPI_GROUPNAME := Packages +DOMAPI_REGEXP := com.sun.java.browser.dom:org.w3c.dom* # DOMAPI_PKGS is located in NON_CORE_PKGS.gmk # The index.html, options, and packages files -DOMAPI_INDEX_FILE = $(DOMAPI_DOCDIR)/index.html -DOMAPI_OPTIONS_FILE = $(DOCSTMPDIR)/domapi.options +DOMAPI_INDEX_FILE = $(DOMAPI_DOCDIR)/index.html +DOMAPI_OPTIONS_FILE = $(DOCSTMPDIR)/domapi.options DOMAPI_PACKAGES_FILE = $(DOCSTMPDIR)/domapi.packages domapidocs: $(DOMAPI_INDEX_FILE) @@ -557,22 +557,22 @@ $(DOMAPI_INDEX_FILE): $(DOMAPI_OPTIONS_FILE) $(DOMAPI_PACKAGES_FILE) coredocs $(prep-javadoc) $(call JavadocSummary,$(DOMAPI_OPTIONS_FILE),$(DOMAPI_PACKAGES_FILE)) $(JAVADOC_CMD) -d $(@D) \ - @$(DOMAPI_OPTIONS_FILE) @$(DOMAPI_PACKAGES_FILE) + @$(DOMAPI_OPTIONS_FILE) @$(DOMAPI_PACKAGES_FILE) # Create file with javadoc options in it $(DOMAPI_OPTIONS_FILE): $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionOnly,-splitIndex) ; \ - $(call OptionPair,-doctitle,$(DOMAPI_DOCTITLE)) ; \ - $(call OptionPair,-windowtitle,$(DOMAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\ - $(call OptionPair,-header,$(DOMAPI_HEADER)$(DRAFT_HEADER)) ; \ - $(call OptionPair,-bottom,$(DOMAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \ + @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ + $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-encoding,ascii) ; \ + $(call OptionOnly,-splitIndex) ; \ + $(call OptionPair,-doctitle,$(DOMAPI_DOCTITLE)) ; \ + $(call OptionPair,-windowtitle,$(DOMAPI_WINDOWTITLE) $(DRAFT_WINTITLE)); \ + $(call OptionPair,-header,$(DOMAPI_HEADER)$(DRAFT_HEADER)) ; \ + $(call OptionPair,-bottom,$(DOMAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \ $(call OptionTrip,-group,$(DOMAPI_GROUPNAME),$(DOMAPI_REGEXP)); \ $(call OptionTrip,-linkoffline,$(DOMAPI2COREAPI),$(COREAPI_DOCSDIR)/); \ - ) >> $@ + ) >> $@ # Create a file with the package names in it $(DOMAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(DOMAPI_PKGS)) @@ -595,18 +595,18 @@ jpdadocs: jdidocs jdwpdocs jvmtidocs ALL_OTHER_TARGETS += jdidocs -JDI_DOCDIR := $(JDK_API_DOCSDIR)/jpda/jdi -JDI2COREAPI := ../../$(JDKJRE2COREAPI) -JDI_DOCTITLE := Java$(TRADEMARK) Debug Interface +JDI_DOCDIR := $(JDK_API_DOCSDIR)/jpda/jdi +JDI2COREAPI := ../../$(JDKJRE2COREAPI) +JDI_DOCTITLE := Java$(TRADEMARK) Debug Interface JDI_WINDOWTITLE := Java Debug Interface -JDI_HEADER := Java Debug Interface -JDI_BOTTOM := $(call CommonBottom,$(JDI_FIRST_COPYRIGHT_YEAR)) -JDI_OVERVIEW := $(JDK_SHARE_CLASSES)/jdi-overview.html +JDI_HEADER := Java Debug Interface +JDI_BOTTOM := $(call CommonBottom,$(JDI_FIRST_COPYRIGHT_YEAR)) +JDI_OVERVIEW := $(JDK_SHARE_CLASSES)/jdi-overview.html # JDI_PKGS is located in NON_CORE_PKGS.gmk # The index.html, options, and packages files -JDI_INDEX_FILE = $(JDI_DOCDIR)/index.html -JDI_OPTIONS_FILE = $(DOCSTMPDIR)/jdi.options +JDI_INDEX_FILE = $(JDI_DOCDIR)/index.html +JDI_OPTIONS_FILE = $(DOCSTMPDIR)/jdi.options JDI_PACKAGES_FILE = $(DOCSTMPDIR)/jdi.packages jdidocs: $(JDI_INDEX_FILE) @@ -619,21 +619,21 @@ $(JDI_INDEX_FILE): $(JDI_OPTIONS_FILE) $(JDI_PACKAGES_FILE) coredocs $(prep-javadoc) $(call JavadocSummary,$(JDI_OPTIONS_FILE),$(JDI_PACKAGES_FILE)) $(JAVADOC_CMD) -d $(@D) \ - @$(JDI_OPTIONS_FILE) @$(JDI_PACKAGES_FILE) + @$(JDI_OPTIONS_FILE) @$(JDI_PACKAGES_FILE) # Create file with javadoc options in it $(JDI_OPTIONS_FILE): $(JDI_OVERVIEW) $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionPair,-overview,$(JDI_OVERVIEW)) ; \ - $(call OptionPair,-doctitle,$(JDI_DOCTITLE)) ; \ + @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ + $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-encoding,ascii) ; \ + $(call OptionPair,-overview,$(JDI_OVERVIEW)) ; \ + $(call OptionPair,-doctitle,$(JDI_DOCTITLE)) ; \ $(call OptionPair,-windowtitle,$(JDI_WINDOWTITLE) $(DRAFT_WINTITLE)); \ - $(call OptionPair,-header,$(JDI_HEADER)$(DRAFT_HEADER)) ; \ - $(call OptionPair,-bottom,$(JDI_BOTTOM)$(DRAFT_BOTTOM)) ; \ + $(call OptionPair,-header,$(JDI_HEADER)$(DRAFT_HEADER)) ; \ + $(call OptionPair,-bottom,$(JDI_BOTTOM)$(DRAFT_BOTTOM)) ; \ $(call OptionTrip,-linkoffline,$(JDI2COREAPI),$(COREAPI_DOCSDIR)/); \ - ) >> $@ + ) >> $@ # Create a file with the package names in it $(JDI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JDI_PKGS)) @@ -647,7 +647,7 @@ $(JDI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JDI_PKGS)) ALL_OTHER_TARGETS += jdwpdocs -JDWP_DOCDIR = $(PLATFORM_DOCSDIR)/jpda/jdwp +JDWP_DOCDIR = $(PLATFORM_DOCSDIR)/jpda/jdwp jdwpdocs: $(JDWP_DOCDIR)/jdwp-protocol.html $(JDWP_DOCDIR)/jdwp-protocol.html : $(JDK_OUTPUTDIR)/gensrc_jdwp_doc/jdwp-protocol.html @@ -662,16 +662,16 @@ $(JDWP_DOCDIR)/jdwp-protocol.html : $(JDK_OUTPUTDIR)/gensrc_jdwp_doc/jdwp-protoc ALL_OTHER_TARGETS += jvmtidocs -JVMTI_DOCDIR = $(PLATFORM_DOCSDIR)/jvmti -JVMTI_HTML = $(HOTSPOT_DIST)/docs/platform/jvmti/jvmti.html +JVMTI_DOCDIR = $(PLATFORM_DOCSDIR)/jvmti +JVMTI_HTML = $(HOTSPOT_DIST)/docs/platform/jvmti/jvmti.html -jvmtidocs: $(JVMTI_DOCDIR)/jvmti.html +jvmtidocs: $(JVMTI_DOCDIR)/jvmti.html $(JVMTI_DOCDIR)/jvmti.html: @$(prep-javadoc) - @if [ -f $(JVMTI_HTML) ] ; then \ - $(ECHO) "$(CP) $(JVMTI_HTML) $@"; \ - $(CP) $(JVMTI_HTML) $@; \ - else \ + @if [ -f $(JVMTI_HTML) ] ; then \ + $(ECHO) "$(CP) $(JVMTI_HTML) $@"; \ + $(CP) $(JVMTI_HTML) $@; \ + else \ $(ECHO) "WARNING: Generated file does not exist: $(JVMTI_HTML)"; \ fi @@ -682,18 +682,18 @@ $(JVMTI_DOCDIR)/jvmti.html: ALL_OTHER_TARGETS += jaasdocs -JAAS_DOCDIR := $(JRE_API_DOCSDIR)/security/jaas/spec -JAAS2COREAPI := ../../../$(JDKJRE2COREAPI) -JAAS_DOCTITLE := Java$(TRADEMARK) Authentication and Authorization Service +JAAS_DOCDIR := $(JRE_API_DOCSDIR)/security/jaas/spec +JAAS2COREAPI := ../../../$(JDKJRE2COREAPI) +JAAS_DOCTITLE := Java$(TRADEMARK) Authentication and Authorization Service JAAS_WINDOWTITLE := Java Authentication and Authorization Service -JAAS_HEADER := Java Authentication and Authorization Service -JAAS_BOTTOM := $(call CommonBottom,$(JAAS_FIRST_COPYRIGHT_YEAR)) +JAAS_HEADER := Java Authentication and Authorization Service +JAAS_BOTTOM := $(call CommonBottom,$(JAAS_FIRST_COPYRIGHT_YEAR)) # JAAS_PKGS is located in NON_CORE_PKGS.gmk -JAAS_OVERVIEW := $(JDK_SHARE_CLASSES)/com/sun/security/auth/jaas-overview.html +JAAS_OVERVIEW := $(JDK_SHARE_CLASSES)/com/sun/security/auth/jaas-overview.html # The index.html, options, and packages files -JAAS_INDEX_FILE = $(JAAS_DOCDIR)/index.html -JAAS_OPTIONS_FILE = $(DOCSTMPDIR)/jaas.options +JAAS_INDEX_FILE = $(JAAS_DOCDIR)/index.html +JAAS_OPTIONS_FILE = $(DOCSTMPDIR)/jaas.options JAAS_PACKAGES_FILE = $(DOCSTMPDIR)/jaas.packages jaasdocs: $(JAAS_INDEX_FILE) @@ -706,21 +706,21 @@ $(JAAS_INDEX_FILE): $(JAAS_OPTIONS_FILE) $(JAAS_PACKAGES_FILE) coredocs $(prep-javadoc) $(call JavadocSummary,$(JAAS_OPTIONS_FILE),$(JAAS_PACKAGES_FILE)) $(JAVADOC_CMD) -d $(@D) \ - @$(JAAS_OPTIONS_FILE) @$(JAAS_PACKAGES_FILE) + @$(JAAS_OPTIONS_FILE) @$(JAAS_PACKAGES_FILE) # Create file with javadoc options in it $(JAAS_OPTIONS_FILE): $(JAAS_OVERVIEW) $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionPair,-overview,$(JAAS_OVERVIEW)) ; \ - $(call OptionPair,-doctitle,$(JAAS_DOCTITLE)) ; \ + @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ + $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-encoding,ascii) ; \ + $(call OptionPair,-overview,$(JAAS_OVERVIEW)) ; \ + $(call OptionPair,-doctitle,$(JAAS_DOCTITLE)) ; \ $(call OptionPair,-windowtitle,$(JAAS_WINDOWTITLE) $(DRAFT_WINTITLE)); \ - $(call OptionPair,-header,$(JAAS_HEADER)$(DRAFT_HEADER)) ; \ - $(call OptionPair,-bottom,$(JAAS_BOTTOM)$(DRAFT_BOTTOM)) ; \ + $(call OptionPair,-header,$(JAAS_HEADER)$(DRAFT_HEADER)) ; \ + $(call OptionPair,-bottom,$(JAAS_BOTTOM)$(DRAFT_BOTTOM)) ; \ $(call OptionTrip,-linkoffline,$(JAAS2COREAPI),$(COREAPI_DOCSDIR)/); \ - ) >> $@ + ) >> $@ # Create a file with the package names in it $(JAAS_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JAAS_PKGS)) @@ -734,18 +734,18 @@ $(JAAS_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JAAS_PKGS ALL_OTHER_TARGETS += jgssdocs -JGSS_DOCDIR := $(JRE_API_DOCSDIR)/security/jgss/spec -JGSS2COREAPI := ../../../$(JDKJRE2COREAPI) -JGSS_DOCTITLE := Java$(TRADEMARK) GSS-API Utilities +JGSS_DOCDIR := $(JRE_API_DOCSDIR)/security/jgss/spec +JGSS2COREAPI := ../../../$(JDKJRE2COREAPI) +JGSS_DOCTITLE := Java$(TRADEMARK) GSS-API Utilities JGSS_WINDOWTITLE := Java GSS-API Utilities -JGSS_HEADER := Java GSS-API Utilities -JGSS_BOTTOM := $(call CommonBottom,$(JGSS_FIRST_COPYRIGHT_YEAR)) -JGSS_OVERVIEW := $(JDK_SHARE_CLASSES)/com/sun/security/jgss/jgss-overview.html +JGSS_HEADER := Java GSS-API Utilities +JGSS_BOTTOM := $(call CommonBottom,$(JGSS_FIRST_COPYRIGHT_YEAR)) +JGSS_OVERVIEW := $(JDK_SHARE_CLASSES)/com/sun/security/jgss/jgss-overview.html # JGSS_PKGS is located in NON_CORE_PKGS.gmk # The index.html, options, and packages files -JGSS_INDEX_FILE = $(JGSS_DOCDIR)/index.html -JGSS_OPTIONS_FILE = $(DOCSTMPDIR)/jgss.options +JGSS_INDEX_FILE = $(JGSS_DOCDIR)/index.html +JGSS_OPTIONS_FILE = $(DOCSTMPDIR)/jgss.options JGSS_PACKAGES_FILE = $(DOCSTMPDIR)/jgss.packages jgssdocs: $(JGSS_INDEX_FILE) @@ -758,22 +758,22 @@ $(JGSS_INDEX_FILE): $(JGSS_OPTIONS_FILE) $(JGSS_PACKAGES_FILE) coredocs $(prep-javadoc) $(call JavadocSummary,$(JGSS_OPTIONS_FILE),$(JGSS_PACKAGES_FILE)) $(JAVADOC_CMD) -d $(@D) \ - @$(JGSS_OPTIONS_FILE) @$(JGSS_PACKAGES_FILE) + @$(JGSS_OPTIONS_FILE) @$(JGSS_PACKAGES_FILE) # Create file with javadoc options in it $(JGSS_OPTIONS_FILE): $(JGSS_OVERVIEW) $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionOnly,-nodeprecatedlist) ; \ - $(call OptionPair,-overview,$(JGSS_OVERVIEW)) ; \ - $(call OptionPair,-doctitle,$(JGSS_DOCTITLE)) ; \ + @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ + $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-encoding,ascii) ; \ + $(call OptionOnly,-nodeprecatedlist) ; \ + $(call OptionPair,-overview,$(JGSS_OVERVIEW)) ; \ + $(call OptionPair,-doctitle,$(JGSS_DOCTITLE)) ; \ $(call OptionPair,-windowtitle,$(JGSS_WINDOWTITLE) $(DRAFT_WINTITLE)); \ - $(call OptionPair,-header,$(JGSS_HEADER)$(DRAFT_HEADER)) ; \ - $(call OptionPair,-bottom,$(JGSS_BOTTOM)$(DRAFT_BOTTOM)) ; \ + $(call OptionPair,-header,$(JGSS_HEADER)$(DRAFT_HEADER)) ; \ + $(call OptionPair,-bottom,$(JGSS_BOTTOM)$(DRAFT_BOTTOM)) ; \ $(call OptionTrip,-linkoffline,$(JGSS2COREAPI),$(COREAPI_DOCSDIR)/); \ - ) >> $@ + ) >> $@ # Create a file with the package names in it $(JGSS_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JGSS_PKGS)) @@ -787,17 +787,17 @@ $(JGSS_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JGSS_PKGS ALL_OTHER_TARGETS += smartcardiodocs -SMARTCARDIO_DOCDIR := $(JRE_API_DOCSDIR)/security/smartcardio/spec -SMARTCARDIO2COREAPI := ../../../$(JDKJRE2COREAPI) -SMARTCARDIO_DOCTITLE := Java$(TRADEMARK) Smart Card I/O +SMARTCARDIO_DOCDIR := $(JRE_API_DOCSDIR)/security/smartcardio/spec +SMARTCARDIO2COREAPI := ../../../$(JDKJRE2COREAPI) +SMARTCARDIO_DOCTITLE := Java$(TRADEMARK) Smart Card I/O SMARTCARDIO_WINDOWTITLE := Java Smart Card I/O -SMARTCARDIO_HEADER := Java Smart Card I/O -SMARTCARDIO_BOTTOM := $(call CommonBottom,$(SMARTCARDIO_FIRST_COPYRIGHT_YEAR)) +SMARTCARDIO_HEADER := Java Smart Card I/O +SMARTCARDIO_BOTTOM := $(call CommonBottom,$(SMARTCARDIO_FIRST_COPYRIGHT_YEAR)) # SMARTCARDIO_PKGS is located in NON_CORE_PKGS.gmk # The index.html, options, and packages files -SMARTCARDIO_INDEX_FILE = $(SMARTCARDIO_DOCDIR)/index.html -SMARTCARDIO_OPTIONS_FILE = $(DOCSTMPDIR)/smartcardio.options +SMARTCARDIO_INDEX_FILE = $(SMARTCARDIO_DOCDIR)/index.html +SMARTCARDIO_OPTIONS_FILE = $(DOCSTMPDIR)/smartcardio.options SMARTCARDIO_PACKAGES_FILE = $(DOCSTMPDIR)/smartcardio.packages smartcardiodocs: $(SMARTCARDIO_INDEX_FILE) @@ -810,21 +810,21 @@ $(SMARTCARDIO_INDEX_FILE): $(SMARTCARDIO_OPTIONS_FILE) $(SMARTCARDIO_PACKAGES_FI $(prep-javadoc) $(call JavadocSummary,$(SMARTCARDIO_OPTIONS_FILE),$(SMARTCARDIO_PACKAGES_FILE)) $(JAVADOC_CMD) -d $(@D) \ - @$(SMARTCARDIO_OPTIONS_FILE) @$(SMARTCARDIO_PACKAGES_FILE) + @$(SMARTCARDIO_OPTIONS_FILE) @$(SMARTCARDIO_PACKAGES_FILE) # Create file with javadoc options in it $(SMARTCARDIO_OPTIONS_FILE): $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionOnly,-nodeprecatedlist) ; \ - $(call OptionPair,-doctitle,$(SMARTCARDIO_DOCTITLE)) ; \ - $(call OptionPair,-windowtitle,$(SMARTCARDIO_WINDOWTITLE) $(DRAFT_WINTITLE));\ + @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ + $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-encoding,ascii) ; \ + $(call OptionOnly,-nodeprecatedlist) ; \ + $(call OptionPair,-doctitle,$(SMARTCARDIO_DOCTITLE)) ; \ + $(call OptionPair,-windowtitle,$(SMARTCARDIO_WINDOWTITLE) $(DRAFT_WINTITLE)); \ $(call OptionPair,-header,$(SMARTCARDIO_HEADER)$(DRAFT_HEADER)); \ $(call OptionPair,-bottom,$(SMARTCARDIO_BOTTOM)$(DRAFT_BOTTOM)); \ $(call OptionTrip,-linkoffline,$(SMARTCARDIO2COREAPI),$(COREAPI_DOCSDIR)/); \ - ) >> $@ + ) >> $@ # Create a file with the package names in it $(SMARTCARDIO_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(SMARTCARDIO_PKGS)) @@ -838,16 +838,16 @@ $(SMARTCARDIO_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(SM ALL_OTHER_TARGETS += httpserverdocs -HTTPSERVER_DOCDIR := $(JRE_API_DOCSDIR)/net/httpserver/spec -HTTPSERVER2COREAPI := ../../../$(JDKJRE2COREAPI) -HTTPSERVER_DOCTITLE := Java$(TRADEMARK) HTTP Server +HTTPSERVER_DOCDIR := $(JRE_API_DOCSDIR)/net/httpserver/spec +HTTPSERVER2COREAPI := ../../../$(JDKJRE2COREAPI) +HTTPSERVER_DOCTITLE := Java$(TRADEMARK) HTTP Server HTTPSERVER_WINDOWTITLE := Java HTTP Server -HTTPSERVER_HEADER := Java HTTP Server -HTTPSERVER_BOTTOM := $(call CommonBottom,$(HTTPSERVER_FIRST_COPYRIGHT_YEAR)) +HTTPSERVER_HEADER := Java HTTP Server +HTTPSERVER_BOTTOM := $(call CommonBottom,$(HTTPSERVER_FIRST_COPYRIGHT_YEAR)) # HTTPSERVER_PKGS is located in NON_CORE_PKGS.gmk -HTTPSERVER_INDEX_HTML = $(HTTPSERVER_DOCDIR)/index.html -HTTPSERVER_OPTIONS_FILE = $(DOCSTMPDIR)/httpserver.options +HTTPSERVER_INDEX_HTML = $(HTTPSERVER_DOCDIR)/index.html +HTTPSERVER_OPTIONS_FILE = $(DOCSTMPDIR)/httpserver.options HTTPSERVER_PACKAGES_FILE = $(DOCSTMPDIR)/httpserver.packages httpserverdocs: $(HTTPSERVER_INDEX_HTML) @@ -860,21 +860,21 @@ $(HTTPSERVER_INDEX_HTML): $(HTTPSERVER_OPTIONS_FILE) $(HTTPSERVER_PACKAGES_FILE) $(prep-javadoc) $(call JavadocSummary,$(HTTPSERVER_OPTIONS_FILE),$(HTTPSERVER_PACKAGES_FILE)) $(JAVADOC_CMD) -d $(@D) \ - @$(HTTPSERVER_OPTIONS_FILE) @$(HTTPSERVER_PACKAGES_FILE) + @$(HTTPSERVER_OPTIONS_FILE) @$(HTTPSERVER_PACKAGES_FILE) # Create file with javadoc options in it $(HTTPSERVER_OPTIONS_FILE): $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionOnly,-nodeprecatedlist) ; \ - $(call OptionPair,-doctitle,$(HTTPSERVER_DOCTITLE)) ; \ - $(call OptionPair,-windowtitle,$(HTTPSERVER_WINDOWTITLE) $(DRAFT_WINTITLE));\ + @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ + $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-encoding,ascii) ; \ + $(call OptionOnly,-nodeprecatedlist) ; \ + $(call OptionPair,-doctitle,$(HTTPSERVER_DOCTITLE)) ; \ + $(call OptionPair,-windowtitle,$(HTTPSERVER_WINDOWTITLE) $(DRAFT_WINTITLE)); \ $(call OptionPair,-header,$(HTTPSERVER_HEADER)$(DRAFT_HEADER)); \ $(call OptionPair,-bottom,$(HTTPSERVER_BOTTOM)$(DRAFT_BOTTOM)); \ $(call OptionTrip,-linkoffline,$(HTTPSERVER2COREAPI),$(COREAPI_DOCSDIR)/); \ - ) >> $@ + ) >> $@ # Create a file with the package names in it $(HTTPSERVER_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(HTTPSERVER_PKGS)) @@ -888,20 +888,20 @@ $(HTTPSERVER_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(HTT ALL_OTHER_TARGETS += mgmtdocs -MGMT_DOCDIR := $(JRE_API_DOCSDIR)/management/extension -MGMT2COREAPI := ../../$(JDKJRE2COREAPI) -JVM_MIB_NAME := JVM-MANAGEMENT-MIB.mib -JVM_MIB_SRC := $(JDK_TOPDIR)/src/closed/share/classes/sun/management/snmp/$(JVM_MIB_NAME) -MGMT_DOCTITLE := Monitoring and Management Interface for the Java$(TRADEMARK) Platform +MGMT_DOCDIR := $(JRE_API_DOCSDIR)/management/extension +MGMT2COREAPI := ../../$(JDKJRE2COREAPI) +JVM_MIB_NAME := JVM-MANAGEMENT-MIB.mib +JVM_MIB_SRC := $(JDK_TOPDIR)/src/closed/share/classes/sun/management/snmp/$(JVM_MIB_NAME) +MGMT_DOCTITLE := Monitoring and Management Interface for the Java$(TRADEMARK) Platform MGMT_WINDOWTITLE := Monitoring and Management Interface for the Java Platform -MGMT_HEADER := Monitoring and Management Interface for the Java Platform -MGMT_BOTTOM := $(call CommonBottom,$(MGMT_FIRST_COPYRIGHT_YEAR)) -MGMT_OVERVIEW := $(JDK_SHARE_CLASSES)/com/sun/management/mgmt-overview.html +MGMT_HEADER := Monitoring and Management Interface for the Java Platform +MGMT_BOTTOM := $(call CommonBottom,$(MGMT_FIRST_COPYRIGHT_YEAR)) +MGMT_OVERVIEW := $(JDK_SHARE_CLASSES)/com/sun/management/mgmt-overview.html # MGMT_PKGS is located in NON_CORE_PKGS.gmk # The index.html, options, and packages files -MGMT_INDEX_FILE = $(MGMT_DOCDIR)/index.html -MGMT_OPTIONS_FILE = $(DOCSTMPDIR)/mgmt.options +MGMT_INDEX_FILE = $(MGMT_DOCDIR)/index.html +MGMT_OPTIONS_FILE = $(DOCSTMPDIR)/mgmt.options MGMT_PACKAGES_FILE = $(DOCSTMPDIR)/mgmt.packages mgmtdocs: $(MGMT_INDEX_FILE) @@ -912,30 +912,30 @@ $(MGMT_INDEX_FILE): GET2DOCSDIR=$(MGMT2COREAPI)/.. # Run javadoc if the index file is out of date or missing $(MGMT_INDEX_FILE): $(MGMT_OPTIONS_FILE) $(MGMT_PACKAGES_FILE) coredocs $(prep-javadoc) - @if [ -f $(JVM_MIB_SRC) ] ; then \ - $(ECHO) "$(CP) $(JVM_MIB_SRC) $(@D)/.."; \ - $(CP) $(JVM_MIB_SRC) $(@D)/.. ; \ - else \ - $(ECHO) "WARNING: File $(JVM_MIB_NAME) not available."; \ + @if [ -f $(JVM_MIB_SRC) ] ; then \ + $(ECHO) "$(CP) $(JVM_MIB_SRC) $(@D)/.."; \ + $(CP) $(JVM_MIB_SRC) $(@D)/.. ; \ + else \ + $(ECHO) "WARNING: File $(JVM_MIB_NAME) not available."; \ fi $(call JavadocSummary,$(MGMT_OPTIONS_FILE),$(MGMT_PACKAGES_FILE)) $(JAVADOC_CMD) -d $(@D) \ - @$(MGMT_OPTIONS_FILE) @$(MGMT_PACKAGES_FILE) + @$(MGMT_OPTIONS_FILE) @$(MGMT_PACKAGES_FILE) # Create file with javadoc options in it $(MGMT_OPTIONS_FILE): $(MGMT_OVERVIEW) $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionOnly,-nodeprecatedlist) ; \ - $(call OptionPair,-overview,$(MGMT_OVERVIEW)) ; \ - $(call OptionPair,-doctitle,$(MGMT_DOCTITLE)) ; \ + @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ + $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-encoding,ascii) ; \ + $(call OptionOnly,-nodeprecatedlist) ; \ + $(call OptionPair,-overview,$(MGMT_OVERVIEW)) ; \ + $(call OptionPair,-doctitle,$(MGMT_DOCTITLE)) ; \ $(call OptionPair,-windowtitle,$(MGMT_WINDOWTITLE) $(DRAFT_WINTITLE)); \ - $(call OptionPair,-header,$(MGMT_HEADER)$(DRAFT_HEADER)) ; \ - $(call OptionPair,-bottom,$(MGMT_BOTTOM)$(DRAFT_BOTTOM)) ; \ + $(call OptionPair,-header,$(MGMT_HEADER)$(DRAFT_HEADER)) ; \ + $(call OptionPair,-bottom,$(MGMT_BOTTOM)$(DRAFT_BOTTOM)) ; \ $(call OptionTrip,-linkoffline,$(MGMT2COREAPI),$(COREAPI_DOCSDIR)/); \ - ) >> $@ + ) >> $@ # Create a file with the package names in it $(MGMT_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(MGMT_PKGS)) @@ -949,16 +949,16 @@ $(MGMT_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(MGMT_PKGS ALL_OTHER_TARGETS += attachdocs -ATTACH_DOCDIR := $(JDK_API_DOCSDIR)/attach/spec -ATTACH2COREAPI := ../../$(JDKJRE2COREAPI) -ATTACH_DOCTITLE := Attach API +ATTACH_DOCDIR := $(JDK_API_DOCSDIR)/attach/spec +ATTACH2COREAPI := ../../$(JDKJRE2COREAPI) +ATTACH_DOCTITLE := Attach API ATTACH_WINDOWTITLE := Attach API -ATTACH_HEADER := Attach API -ATTACH_BOTTOM := $(call CommonBottom,$(ATTACH_FIRST_COPYRIGHT_YEAR)) +ATTACH_HEADER := Attach API +ATTACH_BOTTOM := $(call CommonBottom,$(ATTACH_FIRST_COPYRIGHT_YEAR)) # ATTACH_PKGS is located in NON_CORE_PKGS.gmk -ATTACH_INDEX_HTML = $(ATTACH_DOCDIR)/index.html -ATTACH_OPTIONS_FILE = $(DOCSTMPDIR)/attach.options +ATTACH_INDEX_HTML = $(ATTACH_DOCDIR)/index.html +ATTACH_OPTIONS_FILE = $(DOCSTMPDIR)/attach.options ATTACH_PACKAGES_FILE = $(DOCSTMPDIR)/attach.packages attachdocs: $(ATTACH_INDEX_HTML) @@ -971,21 +971,21 @@ $(ATTACH_INDEX_HTML): $(ATTACH_OPTIONS_FILE) $(ATTACH_PACKAGES_FILE) coredocs $(prep-javadoc) $(call JavadocSummary,$(ATTACH_OPTIONS_FILE),$(ATTACH_PACKAGES_FILE)) $(JAVADOC_CMD) -d $(@D) \ - @$(ATTACH_OPTIONS_FILE) @$(ATTACH_PACKAGES_FILE) + @$(ATTACH_OPTIONS_FILE) @$(ATTACH_PACKAGES_FILE) # Create file with javadoc options in it $(ATTACH_OPTIONS_FILE): $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionOnly,-nodeprecatedlist) ; \ - $(call OptionPair,-doctitle,$(ATTACH_DOCTITLE)) ; \ - $(call OptionPair,-windowtitle,$(ATTACH_WINDOWTITLE) $(DRAFT_WINTITLE));\ - $(call OptionPair,-header,$(ATTACH_HEADER)$(DRAFT_HEADER)) ; \ - $(call OptionPair,-bottom,$(ATTACH_BOTTOM)$(DRAFT_BOTTOM)) ; \ + @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ + $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-encoding,ascii) ; \ + $(call OptionOnly,-nodeprecatedlist) ; \ + $(call OptionPair,-doctitle,$(ATTACH_DOCTITLE)) ; \ + $(call OptionPair,-windowtitle,$(ATTACH_WINDOWTITLE) $(DRAFT_WINTITLE)); \ + $(call OptionPair,-header,$(ATTACH_HEADER)$(DRAFT_HEADER)) ; \ + $(call OptionPair,-bottom,$(ATTACH_BOTTOM)$(DRAFT_BOTTOM)) ; \ $(call OptionTrip,-linkoffline,$(ATTACH2COREAPI),$(COREAPI_DOCSDIR)/); \ - ) >> $@ + ) >> $@ # Create a file with the package names in it $(ATTACH_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(ATTACH_PKGS)) @@ -999,16 +999,16 @@ $(ATTACH_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(ATTACH_ ALL_OTHER_TARGETS += jconsoledocs -JCONSOLE_DOCDIR := $(JDK_API_DOCSDIR)/jconsole/spec -JCONSOLE2COREAPI := ../../$(JDKJRE2COREAPI) -JCONSOLE_DOCTITLE := JConsole API +JCONSOLE_DOCDIR := $(JDK_API_DOCSDIR)/jconsole/spec +JCONSOLE2COREAPI := ../../$(JDKJRE2COREAPI) +JCONSOLE_DOCTITLE := JConsole API JCONSOLE_WINDOWTITLE := JConsole API -JCONSOLE_HEADER := JConsole API -JCONSOLE_BOTTOM := $(call CommonBottom,$(JCONSOLE_FIRST_COPYRIGHT_YEAR)) +JCONSOLE_HEADER := JConsole API +JCONSOLE_BOTTOM := $(call CommonBottom,$(JCONSOLE_FIRST_COPYRIGHT_YEAR)) # JCONSOLE_PKGS is located in NON_CORE_PKGS.gmk -JCONSOLE_INDEX_HTML = $(JCONSOLE_DOCDIR)/index.html -JCONSOLE_OPTIONS_FILE = $(DOCSTMPDIR)/jconsole.options +JCONSOLE_INDEX_HTML = $(JCONSOLE_DOCDIR)/index.html +JCONSOLE_OPTIONS_FILE = $(DOCSTMPDIR)/jconsole.options JCONSOLE_PACKAGES_FILE = $(DOCSTMPDIR)/jconsole.packages jconsoledocs: $(JCONSOLE_INDEX_HTML) @@ -1021,21 +1021,21 @@ $(JCONSOLE_INDEX_HTML): $(JCONSOLE_OPTIONS_FILE) $(JCONSOLE_PACKAGES_FILE) cored $(prep-javadoc) $(call JavadocSummary,$(JCONSOLE_OPTIONS_FILE),$(JCONSOLE_PACKAGES_FILE)) $(JAVADOC_CMD) -d $(@D) \ - @$(JCONSOLE_OPTIONS_FILE) @$(JCONSOLE_PACKAGES_FILE) + @$(JCONSOLE_OPTIONS_FILE) @$(JCONSOLE_PACKAGES_FILE) # Create file with javadoc options in it $(JCONSOLE_OPTIONS_FILE): $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionOnly,-nodeprecatedlist) ; \ - $(call OptionPair,-doctitle,$(JCONSOLE_DOCTITLE)) ; \ - $(call OptionPair,-windowtitle,$(JCONSOLE_WINDOWTITLE) $(DRAFT_WINTITLE));\ - $(call OptionPair,-header,$(JCONSOLE_HEADER)$(DRAFT_HEADER)) ; \ - $(call OptionPair,-bottom,$(JCONSOLE_BOTTOM)$(DRAFT_BOTTOM)) ; \ + @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ + $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-encoding,ascii) ; \ + $(call OptionOnly,-nodeprecatedlist) ; \ + $(call OptionPair,-doctitle,$(JCONSOLE_DOCTITLE)) ; \ + $(call OptionPair,-windowtitle,$(JCONSOLE_WINDOWTITLE) $(DRAFT_WINTITLE)); \ + $(call OptionPair,-header,$(JCONSOLE_HEADER)$(DRAFT_HEADER)) ; \ + $(call OptionPair,-bottom,$(JCONSOLE_BOTTOM)$(DRAFT_BOTTOM)) ; \ $(call OptionTrip,-linkoffline,$(JCONSOLE2COREAPI),$(COREAPI_DOCSDIR)/); \ - ) >> $@ + ) >> $@ # Create a file with the package names in it $(JCONSOLE_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JCONSOLE_PKGS)) @@ -1049,18 +1049,18 @@ $(JCONSOLE_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JCONS ALL_OTHER_TARGETS += treeapidocs -TREEAPI_DOCDIR := $(JDK_API_DOCSDIR)/javac/tree -TREEAPI2COREAPI := ../../$(JDKJRE2COREAPI) -TREEAPI_DOCTITLE := Compiler Tree API -TREEAPI_WINDOWTITLE := Compiler Tree API -TREEAPI_HEADER := Compiler Tree API -TREEAPI_BOTTOM := $(call CommonBottom,$(TREEAPI_FIRST_COPYRIGHT_YEAR)) -TREEAPI_GROUPNAME := Packages -TREEAPI_REGEXP := com.sun.source.* +TREEAPI_DOCDIR := $(JDK_API_DOCSDIR)/javac/tree +TREEAPI2COREAPI := ../../$(JDKJRE2COREAPI) +TREEAPI_DOCTITLE := Compiler Tree API +TREEAPI_WINDOWTITLE := Compiler Tree API +TREEAPI_HEADER := Compiler Tree API +TREEAPI_BOTTOM := $(call CommonBottom,$(TREEAPI_FIRST_COPYRIGHT_YEAR)) +TREEAPI_GROUPNAME := Packages +TREEAPI_REGEXP := com.sun.source.* # TREEAPI_PKGS is located in NON_CORE_PKGS.gmk -TREEAPI_INDEX_HTML = $(TREEAPI_DOCDIR)/index.html -TREEAPI_OPTIONS_FILE = $(DOCSTMPDIR)/treeapi.options +TREEAPI_INDEX_HTML = $(TREEAPI_DOCDIR)/index.html +TREEAPI_OPTIONS_FILE = $(DOCSTMPDIR)/treeapi.options TREEAPI_PACKAGES_FILE = $(DOCSTMPDIR)/treeapi.packages treeapidocs: $(TREEAPI_INDEX_HTML) @@ -1073,22 +1073,22 @@ $(TREEAPI_INDEX_HTML): $(TREEAPI_OPTIONS_FILE) $(TREEAPI_PACKAGES_FILE) coredocs $(prep-javadoc) $(call JavadocSummary,$(TREEAPI_OPTIONS_FILE),$(TREEAPI_PACKAGES_FILE)) $(JAVADOC_CMD) -d $(@D) \ - @$(TREEAPI_OPTIONS_FILE) @$(TREEAPI_PACKAGES_FILE) + @$(TREEAPI_OPTIONS_FILE) @$(TREEAPI_PACKAGES_FILE) # Create file with javadoc options in it $(TREEAPI_OPTIONS_FILE): $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionPair,-doctitle,$(TREEAPI_DOCTITLE)) ; \ - $(call OptionPair,-windowtitle,$(TREEAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\ - $(call OptionPair,-header,$(TREEAPI_HEADER)$(DRAFT_HEADER)) ; \ - $(call OptionPair,-tag,$(TAG_JLS)) ; \ - $(call OptionPair,-bottom,$(TREEAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \ + @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ + $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-encoding,ascii) ; \ + $(call OptionPair,-doctitle,$(TREEAPI_DOCTITLE)) ; \ + $(call OptionPair,-windowtitle,$(TREEAPI_WINDOWTITLE) $(DRAFT_WINTITLE)); \ + $(call OptionPair,-header,$(TREEAPI_HEADER)$(DRAFT_HEADER)) ; \ + $(call OptionPair,-tag,$(TAG_JLS)) ; \ + $(call OptionPair,-bottom,$(TREEAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \ $(call OptionTrip,-group,$(TREEAPI_GROUPNAME),$(TREEAPI_REGEXP)); \ $(call OptionTrip,-linkoffline,$(TREEAPI2COREAPI),$(COREAPI_DOCSDIR)/); \ - ) >> $@ + ) >> $@ # Create a file with the package names in it $(TREEAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(TREEAPI_PKGS)) @@ -1102,16 +1102,16 @@ $(TREEAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(TREEAP ALL_OTHER_TARGETS += sctpdocs -SCTPAPI_DOCDIR := $(JRE_API_DOCSDIR)/nio/sctp/spec -SCTPAPI2COREAPI := ../../../$(JDKJRE2COREAPI) -SCTPAPI_DOCTITLE := SCTP API +SCTPAPI_DOCDIR := $(JRE_API_DOCSDIR)/nio/sctp/spec +SCTPAPI2COREAPI := ../../../$(JDKJRE2COREAPI) +SCTPAPI_DOCTITLE := SCTP API SCTPAPI_WINDOWTITLE := SCTP API -SCTPAPI_HEADER := SCTP API -SCTPAPI_BOTTOM := $(call CommonBottom,$(SCTPAPI_FIRST_COPYRIGHT_YEAR)) +SCTPAPI_HEADER := SCTP API +SCTPAPI_BOTTOM := $(call CommonBottom,$(SCTPAPI_FIRST_COPYRIGHT_YEAR)) # SCTPAPI_PKGS is located in NON_CORE_PKGS.gmk -SCTPAPI_INDEX_HTML = $(SCTPAPI_DOCDIR)/index.html -SCTPAPI_OPTIONS_FILE = $(DOCSTMPDIR)/sctp.options +SCTPAPI_INDEX_HTML = $(SCTPAPI_DOCDIR)/index.html +SCTPAPI_OPTIONS_FILE = $(DOCSTMPDIR)/sctp.options SCTPAPI_PACKAGES_FILE = $(DOCSTMPDIR)/sctp.packages sctpdocs: $(SCTPAPI_INDEX_HTML) @@ -1124,21 +1124,21 @@ $(SCTPAPI_INDEX_HTML): $(SCTPAPI_OPTIONS_FILE) $(SCTPAPI_PACKAGES_FILE) coredocs $(prep-javadoc) $(call JavadocSummary,$(SCTPAPI_OPTIONS_FILE),$(SCTPAPI_PACKAGES_FILE)) $(JAVADOC_CMD) -d $(@D) \ - @$(SCTPAPI_OPTIONS_FILE) @$(SCTPAPI_PACKAGES_FILE) + @$(SCTPAPI_OPTIONS_FILE) @$(SCTPAPI_PACKAGES_FILE) # Create file with javadoc options in it $(SCTPAPI_OPTIONS_FILE): $(prep-target) - @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ - $(call OptionPair,-encoding,ascii) ; \ - $(call OptionOnly,-nodeprecatedlist) ; \ - $(call OptionPair,-doctitle,$(SCTPAPI_DOCTITLE)) ; \ - $(call OptionPair,-windowtitle,$(SCTPAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\ - $(call OptionPair,-header,$(SCTPAPI_HEADER)$(DRAFT_HEADER)) ; \ - $(call OptionPair,-bottom,$(SCTPAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \ + @($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \ + $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-encoding,ascii) ; \ + $(call OptionOnly,-nodeprecatedlist) ; \ + $(call OptionPair,-doctitle,$(SCTPAPI_DOCTITLE)) ; \ + $(call OptionPair,-windowtitle,$(SCTPAPI_WINDOWTITLE) $(DRAFT_WINTITLE)); \ + $(call OptionPair,-header,$(SCTPAPI_HEADER)$(DRAFT_HEADER)) ; \ + $(call OptionPair,-bottom,$(SCTPAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \ $(call OptionTrip,-linkoffline,$(SCTPAPI2COREAPI),$(COREAPI_DOCSDIR)/); \ - ) >> $@ + ) >> $@ # Create a file with the package names in it $(SCTPAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(SCTPAPI_PKGS)) @@ -1151,9 +1151,9 @@ $(SCTPAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(SCTPAP $(DIRECTORY_CACHE): $(ALL_EXISTING_SOURCE_DIRS) $(prep-target) - @for cp in $(ALL_EXISTING_SOURCE_DIRS) ; do \ - $(ECHO) "$(FIND) $${cp} -type f >> $@"; \ - $(FIND) $${cp} -type f >> $@; \ + @for cp in $(ALL_EXISTING_SOURCE_DIRS) ; do \ + $(ECHO) "$(FIND) $${cp} -type f >> $@"; \ + $(FIND) $${cp} -type f >> $@; \ done ############################################################# @@ -1178,11 +1178,11 @@ clean: # is set properly, and to help identify values we can use instead of making new ones. # (Most of them come from common/shared/Defs.gmk) # -# Notes: -# * BUILD_NUMBER defaults to b00 if not set on command line with BUILD_NUMBER= -# * MILESTONE defaults to internal unless set to beta, rc, or fcs on command line +# Notes: +# * BUILD_NUMBER defaults to b00 if not set on command line with BUILD_NUMBER= +# * MILESTONE defaults to internal unless set to beta, rc, or fcs on command line # ############################################################# .PHONY: all docs coredocs rel-docs otherdocs rel-coredocs \ - sanitycheckcoredocs $(ALL_OTHER_TARGETS) + sanitycheckcoredocs $(ALL_OTHER_TARGETS) diff --git a/common/makefiles/javadoc/NON_CORE_PKGS.gmk b/common/makefiles/javadoc/NON_CORE_PKGS.gmk index c2e481119eb..0b9975d163e 100644 --- a/common/makefiles/javadoc/NON_CORE_PKGS.gmk +++ b/common/makefiles/javadoc/NON_CORE_PKGS.gmk @@ -24,87 +24,87 @@ # # -# This file contains the package names of all the "non-core" -# API published in the Java 2 SDK documentation. "Non-core" means +# This file contains the package names of all the "non-core" +# API published in the Java 2 SDK documentation. "Non-core" means # it includes all published API outside of the JDK API specification. # -# These environment variables are used by javadoc in +# These environment variables are used by javadoc in # make/docs/Makefile and are referenced by the localization # team when determining which APIs to extract javadoc # comments from. -DOMAPI_PKGS = com.sun.java.browser.dom \ - org.w3c.dom \ - org.w3c.dom.bootstrap \ - org.w3c.dom.ls \ - org.w3c.dom.ranges \ - org.w3c.dom.traversal \ - org.w3c.dom.html \ - org.w3c.dom.stylesheets \ - org.w3c.dom.css \ - org.w3c.dom.events \ - org.w3c.dom.views +DOMAPI_PKGS = com.sun.java.browser.dom \ + org.w3c.dom \ + org.w3c.dom.bootstrap \ + org.w3c.dom.ls \ + org.w3c.dom.ranges \ + org.w3c.dom.traversal \ + org.w3c.dom.html \ + org.w3c.dom.stylesheets \ + org.w3c.dom.css \ + org.w3c.dom.events \ + org.w3c.dom.views -JDI_PKGS = com.sun.jdi \ - com.sun.jdi.event \ - com.sun.jdi.request \ - com.sun.jdi.connect \ - com.sun.jdi.connect.spi +JDI_PKGS = com.sun.jdi \ + com.sun.jdi.event \ + com.sun.jdi.request \ + com.sun.jdi.connect \ + com.sun.jdi.connect.spi -MGMT_PKGS = com.sun.management +MGMT_PKGS = com.sun.management -JAAS_PKGS = com.sun.security.auth \ - com.sun.security.auth.callback \ - com.sun.security.auth.login \ - com.sun.security.auth.module +JAAS_PKGS = com.sun.security.auth \ + com.sun.security.auth.callback \ + com.sun.security.auth.login \ + com.sun.security.auth.module -JGSS_PKGS = com.sun.security.jgss +JGSS_PKGS = com.sun.security.jgss -OLD_JSSE_PKGS = com.sun.net.ssl +OLD_JSSE_PKGS = com.sun.net.ssl -HTTPSERVER_PKGS = com.sun.net.httpserver \ - com.sun.net.httpserver.spi +HTTPSERVER_PKGS = com.sun.net.httpserver \ + com.sun.net.httpserver.spi -NIO_PKGS = com.sun.nio.file +NIO_PKGS = com.sun.nio.file -DOCLETAPI_PKGS = com.sun.javadoc +DOCLETAPI_PKGS = com.sun.javadoc -TAGLETAPI_FILE = com/sun/tools/doclets/Taglet.java +TAGLETAPI_FILE = com/sun/tools/doclets/Taglet.java -TAGLETAPI_PKGS = com.sun.tools.doclets +TAGLETAPI_PKGS = com.sun.tools.doclets -ATTACH_PKGS = com.sun.tools.attach \ - com.sun.tools.attach.spi +ATTACH_PKGS = com.sun.tools.attach \ + com.sun.tools.attach.spi -JCONSOLE_PKGS = com.sun.tools.jconsole +JCONSOLE_PKGS = com.sun.tools.jconsole -TREEAPI_PKGS = com.sun.source.doctree \ - com.sun.source.tree \ - com.sun.source.util \ - jdk +TREEAPI_PKGS = com.sun.source.doctree \ + com.sun.source.tree \ + com.sun.source.util \ + jdk SMARTCARDIO_PKGS = javax.smartcardio -SCTPAPI_PKGS = com.sun.nio.sctp +SCTPAPI_PKGS = com.sun.nio.sctp ifeq ($(PLATFORM), macosx) -APPLE_EXT_PKGS = com.apple.concurrent \ - com.apple.eawt \ - com.apple.eawt.event \ - com.apple.eio + APPLE_EXT_PKGS = com.apple.concurrent \ + com.apple.eawt \ + com.apple.eawt.event \ + com.apple.eio endif -JDK_PKGS = jdk +JDK_PKGS = jdk # non-core packages in rt.jar -NON_CORE_PKGS = $(DOMAPI_PKGS) \ - $(MGMT_PKGS) \ - $(JAAS_PKGS) \ - $(JGSS_PKGS) \ - $(NIO_PKGS) \ - $(OLD_JSSE_PKGS) \ - $(HTTPSERVER_PKGS) \ - $(SMARTCARDIO_PKGS) \ - $(SCTPAPI_PKGS) \ - $(APPLE_EXT_PKGS) \ - $(JDK_PKGS) +NON_CORE_PKGS = $(DOMAPI_PKGS) \ + $(MGMT_PKGS) \ + $(JAAS_PKGS) \ + $(JGSS_PKGS) \ + $(NIO_PKGS) \ + $(OLD_JSSE_PKGS) \ + $(HTTPSERVER_PKGS) \ + $(SMARTCARDIO_PKGS) \ + $(SCTPAPI_PKGS) \ + $(APPLE_EXT_PKGS) \ + $(JDK_PKGS) diff --git a/common/makefiles/javadoc/Notes.html b/common/makefiles/javadoc/Notes.html index e3d8ae1f26b..2705d762bc3 100644 --- a/common/makefiles/javadoc/Notes.html +++ b/common/makefiles/javadoc/Notes.html @@ -8,42 +8,42 @@


REGEXP

-

REGEXP is a list of wildcard patterns that determines which packages listed - in CORE_PKGS.gmk go into which summary-table on the main API index page. It - was motivated by the need to divide the world into "core packages" - (java.*) and "extension packages" (javax.*). In time, the distinction - went away. The whole table is now called "Platform Packages"--which - eliminated the need for this list of regular expressions. But it lingered on, - accreting all of the packages in the JVM, one by one. I pruned it back to "*", - so it now covers every package in the Java platform API docs. If some separation - is needed in the future, it can grow back into a colon-separated list, starting - with this, which is in all respects equivalent to "*" at this point +

REGEXP is a list of wildcard patterns that determines which packages listed + in CORE_PKGS.gmk go into which summary-table on the main API index page. It + was motivated by the need to divide the world into "core packages" + (java.*) and "extension packages" (javax.*). In time, the distinction + went away. The whole table is now called "Platform Packages"--which + eliminated the need for this list of regular expressions. But it lingered on, + accreting all of the packages in the JVM, one by one. I pruned it back to "*", + so it now covers every package in the Java platform API docs. If some separation + is needed in the future, it can grow back into a colon-separated list, starting + with this, which is in all respects equivalent to "*" at this point in time:

-
+
REGEXP = "java.*:javax.*:org.ietf*:org.omg.


Release Targets

(Thanks to Kelly O'Hair for this info.)

-

The rel-coredocs and rel-docs targets were added by Eric - Armstrong. rel-coredocs assumes the kind of large, 32-bit machine used - in the javapubs group's docs-release process. It specifies memory settings accordingly +

The rel-coredocs and rel-docs targets were added by Eric + Armstrong. rel-coredocs assumes the kind of large, 32-bit machine used + in the javapubs group's docs-release process. It specifies memory settings accordingly to maximize performance.

-

The performance settings, like the sanity check, are most important for the - core docs--the platform APIs. Running javadoc on those APIs takes a significant - amount of time and memory. Setting the initial heap size as large as possible - is important to prevent thrashing as the heap grows. Setting the maximum as +

The performance settings, like the sanity check, are most important for the + core docs--the platform APIs. Running javadoc on those APIs takes a significant + amount of time and memory. Setting the initial heap size as large as possible + is important to prevent thrashing as the heap grows. Setting the maximum as large as necessary is also important to keep the job from failing.

-J-Xmx512 sets a maximum of 512, which became necessary in 6.0
-J-Xms256 sets starting size to 256 (default is 8)

-

rel-coredocs also includes a sanity check to help ensure that BUILD_NUMBER - and MILESTONE are specified properly when docs are built outside of - the normal release engineering process, with the intention of releasing them - on the web or in a downloaded docs bundle. (When invoked in release engineering's - control build, the values are always set properly. But when the targets are - run by themselves, they default to b00 and "internal"--which silently +

rel-coredocs also includes a sanity check to help ensure that BUILD_NUMBER + and MILESTONE are specified properly when docs are built outside of + the normal release engineering process, with the intention of releasing them + on the web or in a downloaded docs bundle. (When invoked in release engineering's + control build, the values are always set properly. But when the targets are + run by themselves, they default to b00 and "internal"--which silently sabotage the result of a build that can take many hours to complete.

diff --git a/corba/.hgtags b/corba/.hgtags index 7271ad7b3fa..db7d697f130 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -230,3 +230,10 @@ d411c60a8c2fe8fdc572af907775e90f7eefd513 jdk8-b104 2e3a056c84a71eba78945c18b05397858ffd7ad0 jdk8-b106 23fc34133152692b725db4bd617b4c8dfd6ccb05 jdk8-b107 a4bb3b4500164748a9c33b2283cfda76d89f25ab jdk8-b108 +428428cf5e06163322144cfb5367e1faa86acf20 jdk8-b109 +3d2b7ce93c5c2e3db748f29c3d29620a8b3b748a jdk8-b110 +85c1c94e723582f9a1dd0251502c42b73d6deea7 jdk8-b111 +43cec76d1d62587a07af07e2d9bec93aba2a506b jdk8-b112 +a259ff3e42d91da68f4d4f09d7eb9dc22bc024fc jdk8-b113 +0bbccf77c23e566170b88b52c2cf28e5d31ce927 jdk8-b114 +8d07115924b7d703a5048adb24e8aba751442f13 jdk8-b115 diff --git a/corba/make/jprt.properties b/corba/make/jprt.properties index b03c53ca656..5dfce3c118c 100644 --- a/corba/make/jprt.properties +++ b/corba/make/jprt.properties @@ -33,9 +33,7 @@ jprt.build.flavors=product,fastdebug # Standard list of jprt build targets for this source tree jprt.build.targets= \ - solaris_sparc_5.10-{product|fastdebug}, \ solaris_sparcv9_5.10-{product|fastdebug}, \ - solaris_i586_5.10-{product|fastdebug}, \ solaris_x64_5.10-{product|fastdebug}, \ linux_i586_2.6-{product|fastdebug}, \ linux_x64_2.6-{product|fastdebug}, \ diff --git a/corba/makefiles/BuildCorba.gmk b/corba/makefiles/BuildCorba.gmk index b177ff2d212..3190ce899cf 100644 --- a/corba/makefiles/BuildCorba.gmk +++ b/corba/makefiles/BuildCorba.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -36,216 +36,230 @@ include JavaCompilation.gmk include IdlCompilation.gmk # The Corba sources are old and generates a LOT of warnings. -# Disable these using Xlint, until someone cares to fix them. -DISABLE_CORBA_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-serial,-fallthrough,-cast,-rawtypes,-static,-dep-ann +# Disable these using Xlint, until someone cares to fix them. +DISABLE_CORBA_WARNINGS := -Xlint:all,-deprecation,-unchecked,-serial,-fallthrough,-cast,-rawtypes,-static,-dep-ann # The "generate old bytecode" javac setup uses the new compiler to compile for the # boot jdk to generate tools that need to be run with the boot jdk. # Thus we force the target bytecode to the boot jdk bytecode. -$(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE,\ - JVM:=$(JAVA),\ - JAVAC:=$(NEW_JAVAC),\ - FLAGS:=$(BOOT_JDK_SOURCETARGET) -bootclasspath $(BOOT_RTJAR) $(DISABLE_CORBA_WARNINGS),\ - SERVER_DIR:=$(SJAVAC_SERVER_DIR),\ - SERVER_JVM:=$(SJAVAC_SERVER_JAVA))) +$(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \ + JVM := $(JAVA), \ + JAVAC := $(NEW_JAVAC), \ + FLAGS := $(BOOT_JDK_SOURCETARGET) \ + -bootclasspath "$(BOOT_RTJAR)$(PATH_SEP)$(BOOT_TOOLSJAR)" \ + $(DISABLE_CORBA_WARNINGS), \ + SERVER_DIR := $(SJAVAC_SERVER_DIR), \ + SERVER_JVM := $(SJAVAC_SERVER_JAVA))) # The "generate new bytecode" uses the new compiler to generate bytecode # for the new jdk that is being built. The code compiled by this setup # cannot necessarily be run with the boot jdk. -$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE,\ - JVM:=$(JAVA),\ - JAVAC:=$(NEW_JAVAC),\ - FLAGS:=-cp $(BOOT_TOOLSJAR) -XDignore.symbol.file=true $(DISABLE_CORBA_WARNINGS),\ - SERVER_DIR:=$(SJAVAC_SERVER_DIR),\ - SERVER_JVM:=$(SJAVAC_SERVER_JAVA))) +$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE, \ + JVM := $(JAVA), \ + JAVAC := $(NEW_JAVAC), \ + FLAGS := -cp $(BOOT_TOOLSJAR) -XDignore.symbol.file=true $(DISABLE_CORBA_WARNINGS), \ + SERVER_DIR := $(SJAVAC_SERVER_DIR), \ + SERVER_JVM := $(SJAVAC_SERVER_JAVA))) -$(eval $(call SetupJavaCompilation,BUILD_STRIPPROP,\ - SETUP:=GENERATE_OLDBYTECODE,\ - SRC:=$(CORBA_TOPDIR)/make/tools/src,\ - BIN:=$(CORBA_OUTPUTDIR)/btclasses/stripprop_classes)) +$(eval $(call SetupJavaCompilation,BUILD_STRIPPROP, \ + SETUP := GENERATE_OLDBYTECODE, \ + SRC := $(CORBA_TOPDIR)/make/tools/src, \ + BIN := $(CORBA_OUTPUTDIR)/btclasses/stripprop_classes)) -$(eval $(call SetupArchive,ARCHIVE_STRIPPROP,$(BUILD_STRIPPROP),\ - SRCS:=$(CORBA_OUTPUTDIR)/btclasses/stripprop_classes,\ - JAR:=$(CORBA_OUTPUTDIR)/btjars/stripproperties.jar,\ - JARMAIN:=build.tools.stripproperties.StripPropertiesCorba)) +$(eval $(call SetupArchive,ARCHIVE_STRIPPROP, $(BUILD_STRIPPROP), \ + SRCS := $(CORBA_OUTPUTDIR)/btclasses/stripprop_classes, \ + JAR := $(CORBA_OUTPUTDIR)/btjars/stripproperties.jar, \ + JARMAIN := build.tools.stripproperties.StripPropertiesCorba)) -$(eval $(call SetupJavaCompilation,BUILD_IDLJ,\ - SETUP:=GENERATE_OLDBYTECODE,\ - SRC:=$(CORBA_TOPDIR)/src/share/classes,\ - BIN:=$(CORBA_OUTPUTDIR)/btclasses/idlj_classes,\ - COPY:=.prp,\ - INCLUDES:=com/sun/tools/corba/se/idl,\ - EXCLUDE_FILES:=ResourceBundleUtil.java)) +$(eval $(call SetupJavaCompilation,BUILD_IDLJ, \ + SETUP := GENERATE_OLDBYTECODE, \ + SRC := $(CORBA_TOPDIR)/src/share/classes, \ + BIN := $(CORBA_OUTPUTDIR)/btclasses/idlj_classes, \ + COPY := .prp, \ + INCLUDES := com/sun/tools/corba/se/idl, \ + EXCLUDE_FILES := ResourceBundleUtil.java)) -$(eval $(call SetupArchive,ARCHIVE_IDLJ,$(BUILD_IDLJ),\ - SRCS:=$(CORBA_OUTPUTDIR)/btclasses/idlj_classes,\ - SUFFIXES:=.class .prp,\ - JAR:=$(CORBA_OUTPUTDIR)/btjars/idlj.jar,\ - JARMAIN:=com.sun.tools.corba.se.idl.toJavaPortable.Compile)) +$(eval $(call SetupArchive,ARCHIVE_IDLJ, $(BUILD_IDLJ), \ + SRCS := $(CORBA_OUTPUTDIR)/btclasses/idlj_classes, \ + SUFFIXES := .class .prp, \ + JAR := $(CORBA_OUTPUTDIR)/btjars/idlj.jar, \ + JARMAIN := com.sun.tools.corba.se.idl.toJavaPortable.Compile)) -$(eval $(call SetupJavaCompilation,BUILD_LOGUTIL,\ - SETUP:=GENERATE_OLDBYTECODE,\ - SRC:=$(CORBA_TOPDIR)/src/share/classes,\ - BIN:=$(CORBA_OUTPUTDIR)/btclasses/logutil_classes,\ - INCLUDES:=com/sun/tools/corba/se/logutil)) +$(eval $(call SetupJavaCompilation,BUILD_LOGUTIL, \ + SETUP := GENERATE_OLDBYTECODE, \ + SRC := $(CORBA_TOPDIR)/src/share/classes, \ + BIN := $(CORBA_OUTPUTDIR)/btclasses/logutil_classes, \ + INCLUDES := com/sun/tools/corba/se/logutil)) -$(eval $(call SetupArchive,ARCHIVE_LOGUTIL,$(BUILD_LOGUTIL),\ - SRCS:=$(CORBA_OUTPUTDIR)/btclasses/logutil_classes,\ - JAR:=$(CORBA_OUTPUTDIR)/btjars/logutil.jar,\ - JARMAIN:=com.sun.tools.corba.se.logutil.MC)) +$(eval $(call SetupArchive,ARCHIVE_LOGUTIL, $(BUILD_LOGUTIL), \ + SRCS := $(CORBA_OUTPUTDIR)/btclasses/logutil_classes, \ + JAR := $(CORBA_OUTPUTDIR)/btjars/logutil.jar, \ + JARMAIN := com.sun.tools.corba.se.logutil.MC)) -# Generate LogWrapper classes -$(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/%SystemException.java : \ - $(CORBA_TOPDIR)/src/share/classes/com/sun/corba/se/spi/logging/data/%.mc \ - $(CORBA_OUTPUTDIR)/btjars/logutil.jar +# Generate LogWrapper classes +$(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/%SystemException.java: \ + $(CORBA_TOPDIR)/src/share/classes/com/sun/corba/se/spi/logging/data/%.mc \ + $(CORBA_OUTPUTDIR)/btjars/logutil.jar $(MKDIR) -p $(@D) $(RM) -f $(@D)/_the_wrappers.d - $(ECHO) $(LOG_INFO) Generating class file from $*.mc + $(ECHO) $(LOG_INFO) Generating class file from $*.mc $(JAVA) -jar $(CORBA_OUTPUTDIR)/btjars/logutil.jar make-class $< $(@D) -# Generate LogWrapper properties file by concatening resource files +# Generate LogWrapper properties file by concatening resource files $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/LogStrings.properties: \ - $(CORBA_OUTPUTDIR)/logwrappers/ActivationSystemException.resource \ - $(CORBA_OUTPUTDIR)/logwrappers/IORSystemException.resource \ - $(CORBA_OUTPUTDIR)/logwrappers/InterceptorsSystemException.resource \ - $(CORBA_OUTPUTDIR)/logwrappers/NamingSystemException.resource \ - $(CORBA_OUTPUTDIR)/logwrappers/OMGSystemException.resource \ - $(CORBA_OUTPUTDIR)/logwrappers/ORBUtilSystemException.resource \ - $(CORBA_OUTPUTDIR)/logwrappers/POASystemException.resource \ - $(CORBA_OUTPUTDIR)/logwrappers/UtilSystemException.resource + $(CORBA_OUTPUTDIR)/logwrappers/ActivationSystemException.resource \ + $(CORBA_OUTPUTDIR)/logwrappers/IORSystemException.resource \ + $(CORBA_OUTPUTDIR)/logwrappers/InterceptorsSystemException.resource \ + $(CORBA_OUTPUTDIR)/logwrappers/NamingSystemException.resource \ + $(CORBA_OUTPUTDIR)/logwrappers/OMGSystemException.resource \ + $(CORBA_OUTPUTDIR)/logwrappers/ORBUtilSystemException.resource \ + $(CORBA_OUTPUTDIR)/logwrappers/POASystemException.resource \ + $(CORBA_OUTPUTDIR)/logwrappers/UtilSystemException.resource $(MKDIR) -p $(@D) $(ECHO) $(LOG_INFO) Concatenating 8 resource files into $(@F) $(CAT) $^ > $@ # The resources files are generated from lisp-like .mc files. -$(CORBA_OUTPUTDIR)/logwrappers/%SystemException.resource : $(CORBA_TOPDIR)/src/share/classes/com/sun/corba/se/spi/logging/data/%.mc $(CORBA_OUTPUTDIR)/btjars/logutil.jar +$(CORBA_OUTPUTDIR)/logwrappers/%SystemException.resource: $(CORBA_TOPDIR)/src/share/classes/com/sun/corba/se/spi/logging/data/%.mc $(CORBA_OUTPUTDIR)/btjars/logutil.jar $(MKDIR) -p $(@D) $(RM) -f $(@D)/_the_wrappers.d - $(ECHO) $(LOG_INFO) Generating resource file from $*.mc + $(ECHO) $(LOG_INFO) Generating resource file from $*.mc $(JAVA) -jar $(CORBA_OUTPUTDIR)/btjars/logutil.jar make-resource $< $(@D) -$(CORBA_OUTPUTDIR)/logwrappers/_the_wrappers.d : $(CORBA_OUTPUTDIR)/btjars/logutil.jar \ - $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/ActivationSystemException.java \ - $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/IORSystemException.java \ - $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/InterceptorsSystemException.java \ - $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/NamingSystemException.java \ - $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/OMGSystemException.java \ - $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/ORBUtilSystemException.java \ - $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/POASystemException.java \ - $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/UtilSystemException.java \ - $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/LogStrings.properties - $(MKDIR) -p $(@D) - $(ECHO) LOGWRAPPERS_ARE_CREATED=yes > $@ +$(CORBA_OUTPUTDIR)/logwrappers/_the_wrappers.d: $(CORBA_OUTPUTDIR)/btjars/logutil.jar \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/ActivationSystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/IORSystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/InterceptorsSystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/NamingSystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/OMGSystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/ORBUtilSystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/POASystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/UtilSystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/LogStrings.properties + $(MKDIR) -p $(@D) + $(ECHO) LOGWRAPPERS_ARE_CREATED = yes > $@ # Trigger the generation of the logwrappers. After the logwrapper classes and # resources have been created, then the makefile will restart and the newly # created java files will become part of the build further along in the makefile. -include $(CORBA_OUTPUTDIR)/logwrappers/_the_wrappers.d -ifeq ($(LOGWRAPPERS_ARE_CREATED),yes) - $(eval $(call SetupIdlCompilation,BUILD_IDLS,\ - IDLJ:=$(JAVA) -jar $(CORBA_OUTPUTDIR)/btjars/idlj.jar,\ - SRC:=$(CORBA_TOPDIR)/src/share/classes,\ - BIN:=$(CORBA_OUTPUTDIR)/gensrc,\ - EXCLUDES:=com/sun/tools/corba/se/idl/% \ - org/omg/CORBA/% \ - com/sun/corba/se/GiopIDL/% \ - org/omg/PortableServer/corba.idl,\ - INCLUDES:=%,\ - OLDIMPLBASES:=com/sun/corba/se/PortableActivationIDL/activation.idl \ - com/sun/corba/se/spi/activation/activation.idl,\ - DELETES:=DYNANYDELETEFILES org/omg/DynamicAny/*POA* org/omg/DynamicAny/*Holder* org/omg/DynamicAny/DynValueBoxHelper.java org/omg/DynamicAny/DynValueCommonHelper.java org/omg/DynamicAny/_DynValueCommonStub.java org/omg/DynamicAny/_DynValueBoxStub.java org/omg/DynamicAny/DynAnyPackage/TypeMismatchHolder.java org/omg/DynamicAny/DynAnyPackage/InvalidValueHolder.java org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHolder.java IOPDELETEFILES org/omg/IOP/BI_DIR_IIOP.java org/omg/IOP/ChainBypassCheck.java org/omg/IOP/ChainBypassInfo.java org/omg/IOP/FORWARDED_IDENTITY.java org/omg/IOP/INVOCATION_POLICIES.java org/omg/IOP/LogicalThreadId.java org/omg/IOP/SendingContextRunTime.java org/omg/IOP/UnknownExceptionInfo.java org/omg/IOP/TaggedComponentSeqHolder.java POAHELHOLFILES org/omg/PortableServer/CurrentPackage/NoContextHolder.java org/omg/PortableServer/ForwardRequestHolder.java org/omg/PortableServer/IdAssignmentPolicyValueHelper.java org/omg/PortableServer/IdAssignmentPolicyValueHolder.java org/omg/PortableServer/IdUniquenessPolicyValueHelper.java org/omg/PortableServer/IdUniquenessPolicyValueHolder.java org/omg/PortableServer/ImplicitActivationPolicyValueHelper.java org/omg/PortableServer/ImplicitActivationPolicyValueHolder.java org/omg/PortableServer/LifespanPolicyValueHelper.java org/omg/PortableServer/LifespanPolicyValueHolder.java org/omg/PortableServer/ServantRetentionPolicyValueHelper.java org/omg/PortableServer/ServantRetentionPolicyValueHolder.java org/omg/PortableServer/ObjectIdHelper.java org/omg/PortableServer/ObjectIdHolder.java org/omg/PortableServer/POAListHelper.java org/omg/PortableServer/POAListHolder.java org/omg/PortableServer/POAManagerPackage/AdapterInactiveHolder.java org/omg/PortableServer/POAManagerPackage/StateHelper.java org/omg/PortableServer/POAManagerPackage/StateHolder.java org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHolder.java org/omg/PortableServer/POAPackage/AdapterNonExistentHolder.java org/omg/PortableServer/POAPackage/InvalidPolicyHolder.java org/omg/PortableServer/POAPackage/NoServantHolder.java org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHolder.java org/omg/PortableServer/POAPackage/ObjectNotActiveHolder.java org/omg/PortableServer/POAPackage/ServantAlreadyActiveHolder.java org/omg/PortableServer/POAPackage/ServantNotActiveHolder.java org/omg/PortableServer/POAPackage/WrongAdapterHolder.java org/omg/PortableServer/POAPackage/WrongPolicyHolder.java org/omg/PortableServer/RequestProcessingPolicyValueHelper.java org/omg/PortableServer/RequestProcessingPolicyValueHolder.java org/omg/PortableServer/ServantActivatorHolder.java org/omg/PortableServer/ServantLocatorHolder.java org/omg/PortableServer/ThreadPolicyValueHelper.java org/omg/PortableServer/ThreadPolicyValueHolder.java PIHELHOLFILES org/omg/PortableInterceptor/ClientRequestInfoHelper.java org/omg/PortableInterceptor/ClientRequestInterceptorHelper.java org/omg/PortableInterceptor/IORInfoHelper.java org/omg/PortableInterceptor/IORInterceptorHelper.java org/omg/PortableInterceptor/InterceptorHelper.java org/omg/PortableInterceptor/ORBInitInfoHelper.java org/omg/PortableInterceptor/ORBInitializerHelper.java org/omg/PortableInterceptor/PolicyFactoryHelper.java org/omg/PortableInterceptor/ReplyStatusHelper.java org/omg/PortableInterceptor/RequestInfoHelper.java org/omg/PortableInterceptor/ServerRequestInfoHelper.java org/omg/PortableInterceptor/ServerRequestInterceptorHelper.java org/omg/PortableInterceptor/SlotIdHelper.java org/omg/PortableInterceptor/ClientRequestInfoHolder.java org/omg/PortableInterceptor/ClientRequestInterceptorHolder.java org/omg/PortableInterceptor/CurrentHolder.java org/omg/PortableInterceptor/ForwardRequestHolder.java org/omg/PortableInterceptor/IORInfoHolder.java org/omg/PortableInterceptor/IORInterceptorHolder.java org/omg/PortableInterceptor/InterceptorHolder.java org/omg/PortableInterceptor/InvalidSlotHolder.java org/omg/PortableInterceptor/ORBInitInfoHolder.java org/omg/PortableInterceptor/ORBInitializerHolder.java org/omg/PortableInterceptor/PolicyFactoryHolder.java org/omg/PortableInterceptor/RequestInfoHolder.java org/omg/PortableInterceptor/ServerRequestInfoHolder.java org/omg/PortableInterceptor/ServerRequestInterceptorHolder.java org/omg/PortableInterceptor/TaggedComponentSeqHolder.java org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHolder.java org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHolder.java org/omg/IOP/CodecPackage/FormatMismatchHolder.java org/omg/IOP/CodecPackage/InvalidTypeForEncodingHolder.java org/omg/IOP/CodecPackage/TypeMismatchHolder.java org/omg/IOP/CodecHelper.java org/omg/IOP/EncodingFormatHelper.java org/omg/IOP/EncodingHelper.java org/omg/IOP/CodecFactoryPackage/UnknownEncodingHolder.java org/omg/IOP/CodecFactoryHolder.java org/omg/IOP/CodecHolder.java org/omg/IOP/EncodingHolder.java org/omg/IOP/TaggedComponentSeqHelper.java org/omg/Dynamic/ContextListHelper.java org/omg/Dynamic/ExceptionListHelper.java org/omg/Dynamic/ParameterHolder.java org/omg/Dynamic/ParameterListHolder.java org/omg/Dynamic/ExceptionListHolder.java org/omg/Dynamic/ParameterHelper.java org/omg/Dynamic/ParameterListHelper.java org/omg/Dynamic/RequestContextHelper.java CORBAX org/omg/CORBA/OctetSeqHelper.java org/omg/CORBA/OctetSeqHolder.java org/omg/CORBA/PolicyError.java org/omg/CORBA/RepositoryIdHelper.java)) +ifeq ($(LOGWRAPPERS_ARE_CREATED), yes) - $(BUILD_IDLS) : $(CORBA_OUTPUTDIR)/btjars/idlj.jar + $(eval $(call SetupIdlCompilation,BUILD_IDLS, \ + IDLJ := $(JAVA) -jar $(CORBA_OUTPUTDIR)/btjars/idlj.jar, \ + SRC := $(CORBA_TOPDIR)/src/share/classes, \ + BIN := $(CORBA_OUTPUTDIR)/gensrc, \ + EXCLUDES := com/sun/tools/corba/se/idl/% \ + org/omg/CORBA/% \ + com/sun/corba/se/GiopIDL/% \ + org/omg/PortableServer/corba.idl, \ + INCLUDES := %, \ + OLDIMPLBASES := com/sun/corba/se/PortableActivationIDL/activation.idl \ + com/sun/corba/se/spi/activation/activation.idl, \ + DELETES := DYNANYDELETEFILES org/omg/DynamicAny/*POA* org/omg/DynamicAny/*Holder* org/omg/DynamicAny/DynValueBoxHelper.java org/omg/DynamicAny/DynValueCommonHelper.java org/omg/DynamicAny/_DynValueCommonStub.java org/omg/DynamicAny/_DynValueBoxStub.java org/omg/DynamicAny/DynAnyPackage/TypeMismatchHolder.java org/omg/DynamicAny/DynAnyPackage/InvalidValueHolder.java org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHolder.java IOPDELETEFILES org/omg/IOP/BI_DIR_IIOP.java org/omg/IOP/ChainBypassCheck.java org/omg/IOP/ChainBypassInfo.java org/omg/IOP/FORWARDED_IDENTITY.java org/omg/IOP/INVOCATION_POLICIES.java org/omg/IOP/LogicalThreadId.java org/omg/IOP/SendingContextRunTime.java org/omg/IOP/UnknownExceptionInfo.java org/omg/IOP/TaggedComponentSeqHolder.java POAHELHOLFILES org/omg/PortableServer/CurrentPackage/NoContextHolder.java org/omg/PortableServer/ForwardRequestHolder.java org/omg/PortableServer/IdAssignmentPolicyValueHelper.java org/omg/PortableServer/IdAssignmentPolicyValueHolder.java org/omg/PortableServer/IdUniquenessPolicyValueHelper.java org/omg/PortableServer/IdUniquenessPolicyValueHolder.java org/omg/PortableServer/ImplicitActivationPolicyValueHelper.java org/omg/PortableServer/ImplicitActivationPolicyValueHolder.java org/omg/PortableServer/LifespanPolicyValueHelper.java org/omg/PortableServer/LifespanPolicyValueHolder.java org/omg/PortableServer/ServantRetentionPolicyValueHelper.java org/omg/PortableServer/ServantRetentionPolicyValueHolder.java org/omg/PortableServer/ObjectIdHelper.java org/omg/PortableServer/ObjectIdHolder.java org/omg/PortableServer/POAListHelper.java org/omg/PortableServer/POAListHolder.java org/omg/PortableServer/POAManagerPackage/AdapterInactiveHolder.java org/omg/PortableServer/POAManagerPackage/StateHelper.java org/omg/PortableServer/POAManagerPackage/StateHolder.java org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHolder.java org/omg/PortableServer/POAPackage/AdapterNonExistentHolder.java org/omg/PortableServer/POAPackage/InvalidPolicyHolder.java org/omg/PortableServer/POAPackage/NoServantHolder.java org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHolder.java org/omg/PortableServer/POAPackage/ObjectNotActiveHolder.java org/omg/PortableServer/POAPackage/ServantAlreadyActiveHolder.java org/omg/PortableServer/POAPackage/ServantNotActiveHolder.java org/omg/PortableServer/POAPackage/WrongAdapterHolder.java org/omg/PortableServer/POAPackage/WrongPolicyHolder.java org/omg/PortableServer/RequestProcessingPolicyValueHelper.java org/omg/PortableServer/RequestProcessingPolicyValueHolder.java org/omg/PortableServer/ServantActivatorHolder.java org/omg/PortableServer/ServantLocatorHolder.java org/omg/PortableServer/ThreadPolicyValueHelper.java org/omg/PortableServer/ThreadPolicyValueHolder.java PIHELHOLFILES org/omg/PortableInterceptor/ClientRequestInfoHelper.java org/omg/PortableInterceptor/ClientRequestInterceptorHelper.java org/omg/PortableInterceptor/IORInfoHelper.java org/omg/PortableInterceptor/IORInterceptorHelper.java org/omg/PortableInterceptor/InterceptorHelper.java org/omg/PortableInterceptor/ORBInitInfoHelper.java org/omg/PortableInterceptor/ORBInitializerHelper.java org/omg/PortableInterceptor/PolicyFactoryHelper.java org/omg/PortableInterceptor/ReplyStatusHelper.java org/omg/PortableInterceptor/RequestInfoHelper.java org/omg/PortableInterceptor/ServerRequestInfoHelper.java org/omg/PortableInterceptor/ServerRequestInterceptorHelper.java org/omg/PortableInterceptor/SlotIdHelper.java org/omg/PortableInterceptor/ClientRequestInfoHolder.java org/omg/PortableInterceptor/ClientRequestInterceptorHolder.java org/omg/PortableInterceptor/CurrentHolder.java org/omg/PortableInterceptor/ForwardRequestHolder.java org/omg/PortableInterceptor/IORInfoHolder.java org/omg/PortableInterceptor/IORInterceptorHolder.java org/omg/PortableInterceptor/InterceptorHolder.java org/omg/PortableInterceptor/InvalidSlotHolder.java org/omg/PortableInterceptor/ORBInitInfoHolder.java org/omg/PortableInterceptor/ORBInitializerHolder.java org/omg/PortableInterceptor/PolicyFactoryHolder.java org/omg/PortableInterceptor/RequestInfoHolder.java org/omg/PortableInterceptor/ServerRequestInfoHolder.java org/omg/PortableInterceptor/ServerRequestInterceptorHolder.java org/omg/PortableInterceptor/TaggedComponentSeqHolder.java org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHolder.java org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHolder.java org/omg/IOP/CodecPackage/FormatMismatchHolder.java org/omg/IOP/CodecPackage/InvalidTypeForEncodingHolder.java org/omg/IOP/CodecPackage/TypeMismatchHolder.java org/omg/IOP/CodecHelper.java org/omg/IOP/EncodingFormatHelper.java org/omg/IOP/EncodingHelper.java org/omg/IOP/CodecFactoryPackage/UnknownEncodingHolder.java org/omg/IOP/CodecFactoryHolder.java org/omg/IOP/CodecHolder.java org/omg/IOP/EncodingHolder.java org/omg/IOP/TaggedComponentSeqHelper.java org/omg/Dynamic/ContextListHelper.java org/omg/Dynamic/ExceptionListHelper.java org/omg/Dynamic/ParameterHolder.java org/omg/Dynamic/ParameterListHolder.java org/omg/Dynamic/ExceptionListHolder.java org/omg/Dynamic/ParameterHelper.java org/omg/Dynamic/ParameterListHelper.java org/omg/Dynamic/RequestContextHelper.java CORBAX org/omg/CORBA/OctetSeqHelper.java org/omg/CORBA/OctetSeqHolder.java org/omg/CORBA/PolicyError.java org/omg/CORBA/RepositoryIdHelper.java)) - $(CORBA_OUTPUTDIR)/gensrc/_the_idls.d : $(BUILD_IDLS) $(CORBA_OUTPUTDIR)/btjars/idlj.jar - $(MKDIR) -p $(@D) - $(ECHO) IDLS_ARE_CREATED=yes > $@ + $(BUILD_IDLS): $(CORBA_OUTPUTDIR)/btjars/idlj.jar - -include $(CORBA_OUTPUTDIR)/gensrc/_the_idls.d + $(CORBA_OUTPUTDIR)/gensrc/_the_idls.d: $(BUILD_IDLS) $(CORBA_OUTPUTDIR)/btjars/idlj.jar + $(MKDIR) -p $(@D) + $(ECHO) IDLS_ARE_CREATED = yes > $@ - ifeq ($(IDLS_ARE_CREATED),yes) - $(eval $(call SetupJavaCompilation,BUILD_CORBA,\ - SETUP:=GENERATE_NEWBYTECODE,\ - SRC:=$(CORBA_TOPDIR)/src/share/classes $(CORBA_OUTPUTDIR)/gensrc $(CORBA_OUTPUTDIR)/logwrappers,\ - EXCLUDES:=com/sun/corba/se/PortableActivationIDL\ - com/sun/tools/corba/se/logutil,\ - EXCLUDE_FILES:=com/sun/corba/se/impl/presentation/rmi/JNDIStateFactoryImpl.java \ - com/sun/corba/se/spi/presentation/rmi/StubWrapper.java \ - com/sun/org/omg/CORBA/IDLTypeOperations.java \ - com/sun/org/omg/CORBA/IRObjectOperations.java \ - org/omg/PortableInterceptor/UNKNOWN.java \ - com/sun/tools/corba/se/idl/ResourceBundleUtil.java\ - com/sun/corba/se/impl/presentation/rmi/jndi.properties,\ - COPY:=.prp LogStrings.properties,\ - BIN:=$(CORBA_OUTPUTDIR)/classes)) + -include $(CORBA_OUTPUTDIR)/gensrc/_the_idls.d - # Separate src.zip call to include sources that were excluded in the build to - # mimic behavior in old build system. - $(eval $(call SetupZipArchive,ARCHIVE_BUILD_CORBA,\ - SRC:=$(CORBA_TOPDIR)/src/share/classes $(CORBA_OUTPUTDIR)/gensrc $(CORBA_OUTPUTDIR)/logwrappers,\ - ZIP:=$(CORBA_OUTPUTDIR)/dist/lib/src.zip)) + ifeq ($(IDLS_ARE_CREATED), yes) - $(BUILD_CORBA) : $(BUILD_IDLS) $(LOGWRAPPER_DEPENDENCIES) + $(eval $(call SetupJavaCompilation,BUILD_CORBA, \ + SETUP := GENERATE_NEWBYTECODE, \ + SRC := $(CORBA_TOPDIR)/src/share/classes $(CORBA_OUTPUTDIR)/gensrc $(CORBA_OUTPUTDIR)/logwrappers, \ + EXCLUDES := com/sun/corba/se/PortableActivationIDL \ + com/sun/tools/corba/se/logutil, \ + EXCLUDE_FILES := com/sun/corba/se/impl/presentation/rmi/JNDIStateFactoryImpl.java \ + com/sun/corba/se/spi/presentation/rmi/StubWrapper.java \ + com/sun/org/omg/CORBA/IDLTypeOperations.java \ + com/sun/org/omg/CORBA/IRObjectOperations.java \ + org/omg/PortableInterceptor/UNKNOWN.java \ + com/sun/tools/corba/se/idl/ResourceBundleUtil.java \ + com/sun/corba/se/impl/presentation/rmi/jndi.properties, \ + COPY := .prp LogStrings.properties, \ + BIN := $(CORBA_OUTPUTDIR)/classes)) - # Run stripproperties on all sunorb resource files. - STRIP_PROP_SRC_FILES:=$(shell $(FIND) $(CORBA_TOPDIR)/src/share/classes -name "sunorb*.properties") - STRIP_PROP_FILES:=$(patsubst $(CORBA_TOPDIR)/src/share/classes/%,$(CORBA_OUTPUTDIR)/classes/%,\ - $(STRIP_PROP_SRC_FILES)) - # Simple delivery of zh_HK properties files just copies zh_TW properties files - STRIP_PROP_FILES+=$(patsubst $(CORBA_TOPDIR)/src/share/classes/%_zh_TW.properties,\ - $(CORBA_OUTPUTDIR)/classes/%_zh_HK.properties,\ - $(shell $(FIND) $(CORBA_TOPDIR)/src/share/classes -name "sunorb_zh_TW.properties")) - STRIP_PROP_SRC_FILES+=$(shell $(FIND) $(CORBA_TOPDIR)/src/share/classes -name "sunorb_zh_TW.properties") - STRIP_PROP_CMDLINE:=$(subst _SPACE_,$(SPACE),\ - $(join $(addprefix -clean_SPACE_,$(STRIP_PROP_SRC_FILES)), \ - $(addprefix _SPACE_,$(STRIP_PROP_FILES)))) + $(eval $(call SetupJavaCompilation,BUILD_BOOTSTRAP_CORBA, \ + SETUP := GENERATE_OLDBYTECODE, \ + SRC := $(BUILD_CORBA_SRC), \ + EXCLUDES := $(BUILD_CORBA_EXCLUDES), \ + EXCLUDE_FILES := $(BUILD_CORBA_EXCLUDE_FILES), \ + COPY := $(BUILD_CORBA_COPY), \ + BIN := $(CORBA_OUTPUTDIR)/btclasses/corba_classes, \ + JAR := $(CORBA_OUTPUTDIR)/btjars/btcorba.jar)) - $(CORBA_OUTPUTDIR)/_the.stripped_properties: $(STRIP_PROP_SRC_FILES) \ - $(CORBA_OUTPUTDIR)/btjars/stripproperties.jar - $(MKDIR) -p $(sort $(dir $(STRIP_PROP_FILES))) - $(call ListPathsSafely,STRIP_PROP_CMDLINE,\n, >> $(CORBA_OUTPUTDIR)/_the.strip_prop.cmdline) - $(JAVA) -jar $(CORBA_OUTPUTDIR)/btjars/stripproperties.jar \ - @$(CORBA_OUTPUTDIR)/_the.strip_prop.cmdline - $(TOUCH) $@ + # Separate src.zip call to include sources that were excluded in the build to + # mimic behavior in old build system. + $(eval $(call SetupZipArchive,ARCHIVE_BUILD_CORBA, \ + SRC := $(CORBA_TOPDIR)/src/share/classes $(CORBA_OUTPUTDIR)/gensrc $(CORBA_OUTPUTDIR)/logwrappers, \ + ZIP := $(CORBA_OUTPUTDIR)/dist/lib/src.zip)) - $(eval $(call SetupArchive,ARCHIVE_CORBA,\ - $(BUILD_CORBA) $(CORBA_OUTPUTDIR)/_the.stripped_properties,\ - SRCS:=$(CORBA_OUTPUTDIR)/classes,\ - SUFFIXES:=.class .prp .properties,\ - JAR:=$(CORBA_OUTPUTDIR)/dist/lib/classes.jar)) + $(BUILD_CORBA): $(BUILD_IDLS) $(LOGWRAPPER_DEPENDENCIES) - # The created classes.jar now contains Corba compiled to run on the target JDK - # and is ready for inclusion in jdk rt.jar. + # Run stripproperties on all sunorb resource files. + STRIP_PROP_SRC_FILES := $(shell $(FIND) $(CORBA_TOPDIR)/src/share/classes -name "sunorb*.properties") + STRIP_PROP_FILES := $(patsubst $(CORBA_TOPDIR)/src/share/classes/%, $(CORBA_OUTPUTDIR)/classes/%, \ + $(STRIP_PROP_SRC_FILES)) + # Simple delivery of zh_HK properties files just copies zh_TW properties files + STRIP_PROP_FILES += $(patsubst $(CORBA_TOPDIR)/src/share/classes/%_zh_TW.properties, \ + $(CORBA_OUTPUTDIR)/classes/%_zh_HK.properties, \ + $(shell $(FIND) $(CORBA_TOPDIR)/src/share/classes -name "sunorb_zh_TW.properties")) + STRIP_PROP_SRC_FILES += $(shell $(FIND) $(CORBA_TOPDIR)/src/share/classes -name "sunorb_zh_TW.properties") + STRIP_PROP_CMDLINE := $(subst _SPACE_, $(SPACE), \ + $(join $(addprefix -clean_SPACE_, $(STRIP_PROP_SRC_FILES)), \ + $(addprefix _SPACE_, $(STRIP_PROP_FILES)))) - # The created src.zip now contains .java and .properties files used to create the classes in classes.jar - # and is ready for inclusion into the jdk src.zip + $(CORBA_OUTPUTDIR)/_the.stripped_properties: $(STRIP_PROP_SRC_FILES) \ + $(CORBA_OUTPUTDIR)/btjars/stripproperties.jar + $(MKDIR) -p $(sort $(dir $(STRIP_PROP_FILES))) + $(call ListPathsSafely,STRIP_PROP_CMDLINE,\n, >> $(CORBA_OUTPUTDIR)/_the.strip_prop.cmdline) + $(JAVA) -jar $(CORBA_OUTPUTDIR)/btjars/stripproperties.jar \ + @$(CORBA_OUTPUTDIR)/_the.strip_prop.cmdline + $(TOUCH) $@ - BIN_FILES:=$(CORBA_TOPDIR)/src/share/classes/com/sun/tools/corba/se/idl/orb.idl \ - $(CORBA_TOPDIR)/src/share/classes/com/sun/tools/corba/se/idl/ir.idl + $(eval $(call SetupArchive,ARCHIVE_CORBA, \ + $(BUILD_CORBA) $(CORBA_OUTPUTDIR)/_the.stripped_properties, \ + SRCS := $(CORBA_OUTPUTDIR)/classes, \ + SUFFIXES := .class .prp .properties, \ + JAR := $(CORBA_OUTPUTDIR)/dist/lib/classes.jar)) - $(CORBA_OUTPUTDIR)/dist/lib/bin.zip : $(BIN_FILES) $(CORBA_OUTPUTDIR)/dist/lib/classes.jar - $(MKDIR) -p $(CORBA_OUTPUTDIR)/dist/lib - $(MKDIR) -p $(CORBA_OUTPUTDIR)/lib - $(RM) -f $@ - $(ECHO) Creating `basename $@` - $(CP) $(BIN_FILES) $(CORBA_OUTPUTDIR)/lib - $(CHMOD) ug+w $(CORBA_OUTPUTDIR)/lib/* - (cd $(CORBA_OUTPUTDIR); $(ZIP) -q $@ lib/orb.idl lib/ir.idl) + # The created classes.jar now contains Corba compiled to run on the target JDK + # and is ready for inclusion in jdk rt.jar. - # The created bin.zip now contains the corba specific binaries: orb.idl, ir.idl + # The created src.zip now contains .java and .properties files used to create the classes in classes.jar + # and is ready for inclusion into the jdk src.zip - all: $(CORBA_OUTPUTDIR)/btjars/stripproperties.jar \ - $(CORBA_OUTPUTDIR)/btjars/idlj.jar \ - $(CORBA_OUTPUTDIR)/btjars/logutil.jar \ - $(CORBA_OUTPUTDIR)/dist/lib/classes.jar \ - $(CORBA_OUTPUTDIR)/dist/lib/src.zip \ - $(CORBA_OUTPUTDIR)/dist/lib/bin.zip - endif + BIN_FILES := $(CORBA_TOPDIR)/src/share/classes/com/sun/tools/corba/se/idl/orb.idl \ + $(CORBA_TOPDIR)/src/share/classes/com/sun/tools/corba/se/idl/ir.idl + + $(CORBA_OUTPUTDIR)/dist/lib/bin.zip: $(BIN_FILES) $(CORBA_OUTPUTDIR)/dist/lib/classes.jar + $(MKDIR) -p $(CORBA_OUTPUTDIR)/dist/lib + $(MKDIR) -p $(CORBA_OUTPUTDIR)/lib + $(RM) -f $@ + $(ECHO) Creating `basename $@` + $(CP) $(BIN_FILES) $(CORBA_OUTPUTDIR)/lib + $(CHMOD) ug+w $(CORBA_OUTPUTDIR)/lib/* + (cd $(CORBA_OUTPUTDIR); $(ZIP) -q $@ lib/orb.idl lib/ir.idl) + + # The created bin.zip now contains the corba specific binaries: orb.idl, ir.idl + + all: $(CORBA_OUTPUTDIR)/btjars/stripproperties.jar \ + $(CORBA_OUTPUTDIR)/btjars/idlj.jar \ + $(CORBA_OUTPUTDIR)/btjars/logutil.jar \ + $(CORBA_OUTPUTDIR)/btjars/btcorba.jar \ + $(CORBA_OUTPUTDIR)/dist/lib/classes.jar \ + $(CORBA_OUTPUTDIR)/dist/lib/src.zip \ + $(CORBA_OUTPUTDIR)/dist/lib/bin.zip + endif endif clean: $(RM) -rf $(CORBA_OUTPUTDIR) -.PHONY: default all clean clobber +.PHONY: default all clean clobber diff --git a/corba/makefiles/Makefile b/corba/makefiles/Makefile index 9539fe0e255..c7d0dd00cbb 100644 --- a/corba/makefiles/Makefile +++ b/corba/makefiles/Makefile @@ -24,19 +24,19 @@ # # Locate this Makefile -ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),) - makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST)) +ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))), ) + makefile_path := $(CURDIR)/$(lastword $(MAKEFILE_LIST)) else - makefile_path:=$(lastword $(MAKEFILE_LIST)) + makefile_path := $(lastword $(MAKEFILE_LIST)) endif -repo_dir:=$(patsubst %/makefiles/Makefile,%,$(makefile_path)) +repo_dir := $(patsubst %/makefiles/Makefile, %, $(makefile_path)) # What is the name of this subsystem (langtools, corba, etc)? -subsystem_name:=$(notdir $(repo_dir)) +subsystem_name := $(notdir $(repo_dir)) # Try to locate top-level makefile -top_level_makefile:=$(repo_dir)/../common/makefiles/Makefile -ifneq ($(wildcard $(top_level_makefile)),) +top_level_makefile := $(repo_dir)/../common/makefiles/Makefile +ifneq ($(wildcard $(top_level_makefile)), ) $(info Will run $(subsystem_name) target on top-level Makefile) $(info WARNING: This is a non-recommended way of building!) $(info ===================================================) diff --git a/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java index 3018cdef99e..1b03be02dd1 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java @@ -580,7 +580,7 @@ public class AnyImpl extends Any java.lang.Object[] objholder = new java.lang.Object[1]; objholder[0] = object; long[] longholder = new long[1]; - TCUtility.unmarshalIn(in, typeCode, longholder, objholder); + TCUtility.unmarshalIn(in, realType(), longholder, objholder); value = longholder[0]; object = objholder[0]; stream = null; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java index dfe6581cc11..86a47992a72 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java @@ -905,28 +905,4 @@ public class IDLNameTranslatorImpl implements IDLNameTranslator { return contents.toString(); } - - public static void main(String[] args) { - - Class remoteInterface = java.rmi.Remote.class; - - if( args.length > 0 ) { - String className = args[0]; - try { - remoteInterface = Class.forName(className); - } catch(Exception e) { - e.printStackTrace(); - System.exit(-1); - } - } - - System.out.println("Building name translation for " + remoteInterface); - try { - IDLNameTranslator nameTranslator = - IDLNameTranslatorImpl.get(remoteInterface); - System.out.println(nameTranslator); - } catch(IllegalStateException ise) { - ise.printStackTrace(); - } - } } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/InvocationHandlerFactoryImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/InvocationHandlerFactoryImpl.java index 37a5968d87d..076ed1929ea 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/InvocationHandlerFactoryImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/InvocationHandlerFactoryImpl.java @@ -43,6 +43,8 @@ import com.sun.corba.se.spi.orbutil.proxy.InvocationHandlerFactory ; import com.sun.corba.se.spi.orbutil.proxy.DelegateInvocationHandlerImpl ; import com.sun.corba.se.spi.orbutil.proxy.CompositeInvocationHandler ; import com.sun.corba.se.spi.orbutil.proxy.CompositeInvocationHandlerImpl ; +import java.security.AccessController; +import java.security.PrivilegedAction; public class InvocationHandlerFactoryImpl implements InvocationHandlerFactory { @@ -114,24 +116,32 @@ public class InvocationHandlerFactoryImpl implements InvocationHandlerFactory // which extends org.omg.CORBA.Object. This handler delegates all // calls directly to a DynamicStubImpl, which extends // org.omg.CORBA.portable.ObjectImpl. - InvocationHandler dynamicStubHandler = + final InvocationHandler dynamicStubHandler = DelegateInvocationHandlerImpl.create( stub ) ; // Create an invocation handler that handles any remote interface // methods. - InvocationHandler stubMethodHandler = new StubInvocationHandlerImpl( + final InvocationHandler stubMethodHandler = new StubInvocationHandlerImpl( pm, classData, stub ) ; // Create a composite handler that handles the DynamicStub interface // as well as the remote interfaces. final CompositeInvocationHandler handler = new CustomCompositeInvocationHandlerImpl( stub ) ; + + AccessController.doPrivileged(new PrivilegedAction() { + @Override + public Void run() { handler.addInvocationHandler( DynamicStub.class, dynamicStubHandler ) ; handler.addInvocationHandler( org.omg.CORBA.Object.class, dynamicStubHandler ) ; handler.addInvocationHandler( Object.class, dynamicStubHandler ) ; + return null; + } + }); + // If the method passed to invoke is not from DynamicStub or its superclasses, // it must be from an implemented interface, so we just handle diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java index 7bd98805ab7..054071b7d8b 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,7 +55,7 @@ import com.sun.corba.se.impl.orbutil.ORBUtility; /** * @author Harold Carr */ -public class SelectorImpl +class SelectorImpl extends Thread implements diff --git a/corba/src/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandlerImpl.java b/corba/src/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandlerImpl.java index fb81ceee29c..91aacd5afae 100644 --- a/corba/src/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandlerImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandlerImpl.java @@ -36,6 +36,7 @@ import java.lang.reflect.InvocationHandler ; import com.sun.corba.se.spi.logging.CORBALogDomains ; import com.sun.corba.se.impl.logging.ORBUtilSystemException ; +import com.sun.corba.se.impl.presentation.rmi.DynamicAccessPermission; public class CompositeInvocationHandlerImpl implements CompositeInvocationHandler @@ -46,11 +47,13 @@ public class CompositeInvocationHandlerImpl implements public void addInvocationHandler( Class interf, InvocationHandler handler ) { + checkAccess(); classToInvocationHandler.put( interf, handler ) ; } public void setDefaultHandler( InvocationHandler handler ) { + checkAccess(); defaultHandler = handler ; } @@ -78,4 +81,12 @@ public class CompositeInvocationHandlerImpl implements return handler.invoke( proxy, method, args ) ; } + + private static final DynamicAccessPermission perm = new DynamicAccessPermission("access"); + private void checkAccess() { + final SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(perm); +} + } } diff --git a/corba/src/share/classes/javax/rmi/CORBA/Stub.java b/corba/src/share/classes/javax/rmi/CORBA/Stub.java index 72f9434c99f..227e28992b6 100644 --- a/corba/src/share/classes/javax/rmi/CORBA/Stub.java +++ b/corba/src/share/classes/javax/rmi/CORBA/Stub.java @@ -61,13 +61,11 @@ public abstract class Stub extends ObjectImpl private transient StubDelegate stubDelegate = null; private static Class stubDelegateClass = null; private static final String StubClassKey = "javax.rmi.CORBA.StubClass"; - private static final String defaultStubImplName = "com.sun.corba.se.impl.javax.rmi.CORBA.StubDelegateImpl"; static { - Object stubDelegateInstance = (Object) createDelegateIfSpecified(StubClassKey, defaultStubImplName); + Object stubDelegateInstance = createDelegate(StubClassKey); if (stubDelegateInstance != null) stubDelegateClass = stubDelegateInstance.getClass(); - } @@ -207,7 +205,7 @@ public abstract class Stub extends ObjectImpl // are in different packages and the visibility needs to be package for // security reasons. If you know a better solution how to share this code // then remove it from PortableRemoteObject. Also in Util.java - private static Object createDelegateIfSpecified(String classKey, String defaultClassName) { + private static Object createDelegate(String classKey) { String className = (String) AccessController.doPrivileged(new GetPropertyAction(classKey)); if (className == null) { @@ -218,7 +216,7 @@ public abstract class Stub extends ObjectImpl } if (className == null) { - className = defaultClassName; + return new com.sun.corba.se.impl.javax.rmi.CORBA.StubDelegateImpl(); } try { diff --git a/corba/src/share/classes/javax/rmi/CORBA/Util.java b/corba/src/share/classes/javax/rmi/CORBA/Util.java index 449788afa62..65df15f1a27 100644 --- a/corba/src/share/classes/javax/rmi/CORBA/Util.java +++ b/corba/src/share/classes/javax/rmi/CORBA/Util.java @@ -60,14 +60,11 @@ import com.sun.corba.se.impl.orbutil.GetPropertyAction; public class Util { // This can only be set at static initialization time (no sync necessary). - private static javax.rmi.CORBA.UtilDelegate utilDelegate = null; + private static final javax.rmi.CORBA.UtilDelegate utilDelegate; private static final String UtilClassKey = "javax.rmi.CORBA.UtilClass"; - private static final String defaultUtilImplName = -"com.sun.corba.se.impl.javax.rmi.CORBA.Util"; static { - utilDelegate = (javax.rmi.CORBA.UtilDelegate) - createDelegateIfSpecified(UtilClassKey, defaultUtilImplName); + utilDelegate = (javax.rmi.CORBA.UtilDelegate)createDelegate(UtilClassKey); } private Util(){} @@ -338,9 +335,7 @@ Tie#deactivate} // are in different packages and the visibility needs to be package for // security reasons. If you know a better solution how to share this code // then remove it from PortableRemoteObject. Also in Stub.java - private static Object createDelegateIfSpecified(String classKey, - String defaultClassName) - { + private static Object createDelegate(String classKey) { String className = (String) AccessController.doPrivileged(new GetPropertyAction(classKey)); if (className == null) { @@ -351,7 +346,7 @@ Tie#deactivate} } if (className == null) { - className = defaultClassName; + return new com.sun.corba.se.impl.javax.rmi.CORBA.Util(); } try { diff --git a/corba/src/share/classes/javax/rmi/PortableRemoteObject.java b/corba/src/share/classes/javax/rmi/PortableRemoteObject.java index cbd6df25510..951f06cb477 100644 --- a/corba/src/share/classes/javax/rmi/PortableRemoteObject.java +++ b/corba/src/share/classes/javax/rmi/PortableRemoteObject.java @@ -65,17 +65,14 @@ import com.sun.corba.se.impl.orbutil.GetPropertyAction; */ public class PortableRemoteObject { - private static javax.rmi.CORBA.PortableRemoteObjectDelegate proDelegate = null; + private static final javax.rmi.CORBA.PortableRemoteObjectDelegate proDelegate; private static final String PortableRemoteObjectClassKey = "javax.rmi.CORBA.PortableRemoteObjectClass"; - private static final String defaultPortableRemoteObjectImplName = - "com.sun.corba.se.impl.javax.rmi.PortableRemoteObject"; - static { proDelegate = (javax.rmi.CORBA.PortableRemoteObjectDelegate) - createDelegateIfSpecified(PortableRemoteObjectClassKey); + createDelegate(PortableRemoteObjectClassKey); } /** @@ -181,7 +178,7 @@ public class PortableRemoteObject { // are in different packages and the visibility needs to be package for // security reasons. If you know a better solution how to share this code // then remove it from here. - private static Object createDelegateIfSpecified(String classKey) { + private static Object createDelegate(String classKey) { String className = (String) AccessController.doPrivileged(new GetPropertyAction(classKey)); if (className == null) { @@ -191,7 +188,7 @@ public class PortableRemoteObject { } } if (className == null) { - className = defaultPortableRemoteObjectImplName; + return new com.sun.corba.se.impl.javax.rmi.PortableRemoteObject(); } try { diff --git a/corba/src/share/classes/org/omg/CORBA/ORB.java b/corba/src/share/classes/org/omg/CORBA/ORB.java index 42fe7bc0090..5b434097c65 100644 --- a/corba/src/share/classes/org/omg/CORBA/ORB.java +++ b/corba/src/share/classes/org/omg/CORBA/ORB.java @@ -173,15 +173,6 @@ abstract public class ORB { private static final String ORBClassKey = "org.omg.CORBA.ORBClass"; private static final String ORBSingletonClassKey = "org.omg.CORBA.ORBSingletonClass"; - // - // The last resort fallback ORB implementation classes in case - // no ORB implementation class is dynamically configured through - // properties or applet parameters. Change these values to - // vendor-specific class names. - // - private static final String defaultORB = "com.sun.corba.se.impl.orb.ORBImpl"; - private static final String defaultORBSingleton = "com.sun.corba.se.impl.orb.ORBSingleton"; - // // The global instance of the singleton ORB implementation which // acts as a factory for typecodes for generated Helper classes. @@ -294,10 +285,11 @@ abstract public class ORB { String className = getSystemProperty(ORBSingletonClassKey); if (className == null) className = getPropertyFromFile(ORBSingletonClassKey); - if (className == null) - className = defaultORBSingleton; - - singleton = create_impl(className); + if (className == null) { + singleton = new com.sun.corba.se.impl.orb.ORBSingleton(); + } else { + singleton = create_impl(className); + } } return singleton; } @@ -347,10 +339,12 @@ abstract public class ORB { className = getSystemProperty(ORBClassKey); if (className == null) className = getPropertyFromFile(ORBClassKey); - if (className == null) - className = defaultORB; + if (className == null) { + orb = new com.sun.corba.se.impl.orb.ORBImpl(); + } else { + orb = create_impl(className); + } - orb = create_impl(className); orb.set_parameters(args, props); return orb; } @@ -375,10 +369,12 @@ abstract public class ORB { className = getSystemProperty(ORBClassKey); if (className == null) className = getPropertyFromFile(ORBClassKey); - if (className == null) - className = defaultORB; + if (className == null) { + orb = new com.sun.corba.se.impl.orb.ORBImpl(); + } else { + orb = create_impl(className); + } - orb = create_impl(className); orb.set_parameters(app, props); return orb; } diff --git a/corba/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java b/corba/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java index aa3c6bea2f5..0d41c1edb90 100644 --- a/corba/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java +++ b/corba/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,9 @@ package sun.rmi.rmic.iiop; import java.io.File; import java.io.IOException; +import java.io.SerializablePermission; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.Vector; import java.util.Hashtable; import java.util.Enumeration; @@ -49,6 +52,7 @@ import com.sun.corba.se.impl.util.Utility; import com.sun.corba.se.impl.util.PackagePrefixChecker; import sun.rmi.rmic.Main; + /** * An IIOP stub/tie generator for rmic. * @@ -78,6 +82,7 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator { protected boolean castArray = false; protected Hashtable transactionalObjects = new Hashtable() ; protected boolean POATie = false ; + protected boolean emitPermissionCheck = false; /** * Default constructor for Main to use. @@ -193,6 +198,9 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator { } else if (argv[i].equals("-standardPackage")) { standardPackage = true; argv[i] = null; + } else if (argv[i].equals("-emitPermissionCheck")) { + emitPermissionCheck = true; + argv[i] = null; } else if (arg.equals("-xstubbase")) { argv[i] = null; if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) { @@ -390,9 +398,22 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator { writePackageAndImports(p); +// generate +// import java.security.AccessController; +// import java.security.PrivilegedAction; +// import java.io.SerializablePermission; + if (emitPermissionCheck) { + p.pln("import java.security.AccessController;"); + p.pln("import java.security.PrivilegedAction;"); + p.pln("import java.io.SerializablePermission;"); + p.pln(); + p.pln(); + } + // Declare the stub class; implement all remote interfaces. p.p("public class " + currentClass); + p.p(" extends " + getName(stubBaseClass)); p.p(" implements "); if (remoteInterfaces.length > 0) { @@ -422,6 +443,57 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator { writeIds( p, theType, false ); p.pln(); + if (emitPermissionCheck) { + + // produce the following generated code for example + // private static Void checkPermission() { + // SecurityManager sm = System.getSecurityManager(); + // if (sm != null) { + // sm.checkPermission(new SerializablePermission( + // "enableSubclassImplementation")); // testing + // } + // return null; + // } + // + // private _XXXXX_Stub(Void ignore) { + // } + // + // public _XXXXX_Stub() { + // this(checkPermission()); + // } + // + // where XXXXX is the name of the remote interface + + p.pln(); + p.plnI("private static Void checkPermission() {"); + p.plnI("SecurityManager sm = System.getSecurityManager();"); + p.pln("if (sm != null) {"); + p.pI(); + p.plnI("sm.checkPermission(new SerializablePermission("); + p.plnI("\"enableSubclassImplementation\"));"); + p.pO(); + p.pO(); + p.pOln("}"); + p.pln("return null;"); + p.pO(); + p.pOln("}"); + p.pln(); + p.pO(); + + p.pI(); + p.pln("private " + currentClass + "(Void ignore) { }"); + p.pln(); + + p.plnI("public " + currentClass + "() { "); + p.pln("this(checkPermission());"); + p.pOln("}"); + p.pln(); + } + + if (!emitPermissionCheck) { + p.pI(); + } + // Write the _ids() method... p.plnI("public String[] _ids() { "); @@ -815,7 +887,6 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator { CompoundType theType) throws IOException { // Wtite the method declaration and opening brace... - String methodName = method.getName(); String methodIDLName = method.getIDLName(); diff --git a/hotspot/.hgtags b/hotspot/.hgtags index d218a0c962d..9f29bef92ea 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -379,3 +379,17 @@ aed585cafc0d9655726af6d1e1081d1c94cb3b5c jdk8-b106 a09fe9d1e016c285307507a5793bc4fa6215e9c9 hs25-b50 85072013aad46050a362d10ab78e963121c8014c jdk8-b108 566db1b0e6efca31f181456e54c8911d0192410d hs25-b51 +c81dd5393a5e333df7cb1f6621f5897ada6522b5 jdk8-b109 +58043478c26d4e8bf48700acea5f97aba8b417d4 hs25-b52 +6209b0ed51c086d4127bac0e086c8f326d1764d7 jdk8-b110 +562a3d356de67670b4172b82aca2d30743449e04 hs25-b53 +f6962730bbde82f279a0ae3a1c14bc5e58096c6e jdk8-b111 +4a845c7a463844cead9e1e1641d6bcfb8a77f1c7 hs25-b54 +0ed9a90f45e1b392c671005f9ee22ce1acf02984 jdk8-b112 +23b8db5ea31d3079f1326afde4cd5c67b1dac49c hs25-b55 +4589b398ab03aba6a5da8c06ff53603488d1b8f4 jdk8-b113 +82a9cdbf683e374a76f2009352de53e16bed5a91 hs25-b56 +7fd913010dbbf75260688fd2fa8964763fa49a09 jdk8-b114 +3b32d287da89a47a45d16f6d9ba5bd3cd9bf4b3e hs25-b57 +9ebaac78a8a0061fb9597e07f806498cb626cdeb jdk8-b115 +e510dfdec6dd701410f3398ed86ebcdff0cca63a hs25-b58 diff --git a/hotspot/agent/src/os/bsd/ps_core.c b/hotspot/agent/src/os/bsd/ps_core.c index bb1191cc2bf..6e4c65ed4d2 100644 --- a/hotspot/agent/src/os/bsd/ps_core.c +++ b/hotspot/agent/src/os/bsd/ps_core.c @@ -44,6 +44,7 @@ // close all file descriptors static void close_files(struct ps_prochandle* ph) { lib_info* lib = NULL; + // close core file descriptor if (ph->core->core_fd >= 0) close(ph->core->core_fd); @@ -149,8 +150,7 @@ static map_info* add_class_share_map_info(struct ps_prochandle* ph, off_t offset // Return the map_info for the given virtual address. We keep a sorted // array of pointers in ph->map_array, so we can binary search. -static map_info* core_lookup(struct ps_prochandle *ph, uintptr_t addr) -{ +static map_info* core_lookup(struct ps_prochandle *ph, uintptr_t addr) { int mid, lo = 0, hi = ph->core->num_maps - 1; map_info *mp; @@ -230,9 +230,9 @@ struct FileMapHeader { size_t _used; // for setting space top on read // 4991491 NOTICE These are C++ bool's in filemap.hpp and must match up with - // the C type matching the C++ bool type on any given platform. For - // Hotspot on BSD we assume the corresponding C type is char but - // licensees on BSD versions may need to adjust the type of these fields. + // the C type matching the C++ bool type on any given platform. + // We assume the corresponding C type is char but licensees + // may need to adjust the type of these fields. char _read_only; // read only space? char _allow_exec; // executable code in space? @@ -286,10 +286,12 @@ static bool read_string(struct ps_prochandle* ph, uintptr_t addr, char* buf, siz #define USE_SHARED_SPACES_SYM "_UseSharedSpaces" // mangled name of Arguments::SharedArchivePath #define SHARED_ARCHIVE_PATH_SYM "_ZN9Arguments17SharedArchivePathE" +#define LIBJVM_NAME "/libjvm.dylib" #else #define USE_SHARED_SPACES_SYM "UseSharedSpaces" // mangled name of Arguments::SharedArchivePath #define SHARED_ARCHIVE_PATH_SYM "__ZN9Arguments17SharedArchivePathE" +#define LIBJVM_NAME "/libjvm.so" #endif // __APPLE_ static bool init_classsharing_workaround(struct ps_prochandle* ph) { @@ -300,12 +302,7 @@ static bool init_classsharing_workaround(struct ps_prochandle* ph) { // we are iterating over shared objects from the core dump. look for // libjvm.so. const char *jvm_name = 0; -#ifdef __APPLE__ - if ((jvm_name = strstr(lib->name, "/libjvm.dylib")) != 0) -#else - if ((jvm_name = strstr(lib->name, "/libjvm.so")) != 0) -#endif // __APPLE__ - { + if ((jvm_name = strstr(lib->name, LIBJVM_NAME)) != 0) { char classes_jsa[PATH_MAX]; struct FileMapHeader header; int fd = -1; @@ -399,8 +396,8 @@ static bool init_classsharing_workaround(struct ps_prochandle* ph) { } } return true; - } - lib = lib->next; + } + lib = lib->next; } return true; } @@ -432,8 +429,8 @@ static bool sort_map_array(struct ps_prochandle* ph) { // allocate map_array map_info** array; if ( (array = (map_info**) malloc(sizeof(map_info*) * num_maps)) == NULL) { - print_debug("can't allocate memory for map array\n"); - return false; + print_debug("can't allocate memory for map array\n"); + return false; } // add maps to array @@ -450,7 +447,7 @@ static bool sort_map_array(struct ps_prochandle* ph) { ph->core->map_array = array; // sort the map_info array by base virtual address. qsort(ph->core->map_array, ph->core->num_maps, sizeof (map_info*), - core_cmp_mapping); + core_cmp_mapping); // print map if (is_debug()) { @@ -458,7 +455,7 @@ static bool sort_map_array(struct ps_prochandle* ph) { print_debug("---- sorted virtual address map ----\n"); for (j = 0; j < ph->core->num_maps; j++) { print_debug("base = 0x%lx\tsize = %d\n", ph->core->map_array[j]->vaddr, - ph->core->map_array[j]->memsz); + ph->core->map_array[j]->memsz); } } @@ -1091,9 +1088,9 @@ static bool core_handle_note(struct ps_prochandle* ph, ELF_PHDR* note_phdr) { notep->n_type, notep->n_descsz); if (notep->n_type == NT_PRSTATUS) { - if (core_handle_prstatus(ph, descdata, notep->n_descsz) != true) { - return false; - } + if (core_handle_prstatus(ph, descdata, notep->n_descsz) != true) { + return false; + } } p = descdata + ROUNDUP(notep->n_descsz, 4); } @@ -1121,7 +1118,7 @@ static bool read_core_segments(struct ps_prochandle* ph, ELF_EHDR* core_ehdr) { * contains a set of saved /proc structures), and PT_LOAD (which * represents a memory mapping from the process's address space). * - * Difference b/w Solaris PT_NOTE and BSD PT_NOTE: + * Difference b/w Solaris PT_NOTE and Linux/BSD PT_NOTE: * * In Solaris there are two PT_NOTE segments the first PT_NOTE (if present) * contains /proc structs in the pre-2.6 unstructured /proc format. the last @@ -1167,32 +1164,61 @@ err: // read segments of a shared object static bool read_lib_segments(struct ps_prochandle* ph, int lib_fd, ELF_EHDR* lib_ehdr, uintptr_t lib_base) { - int i = 0; - ELF_PHDR* phbuf; - ELF_PHDR* lib_php = NULL; + int i = 0; + ELF_PHDR* phbuf; + ELF_PHDR* lib_php = NULL; - if ((phbuf = read_program_header_table(lib_fd, lib_ehdr)) == NULL) - return false; + int page_size=sysconf(_SC_PAGE_SIZE); - // we want to process only PT_LOAD segments that are not writable. - // i.e., text segments. The read/write/exec (data) segments would - // have been already added from core file segments. - for (lib_php = phbuf, i = 0; i < lib_ehdr->e_phnum; i++) { - if ((lib_php->p_type == PT_LOAD) && !(lib_php->p_flags & PF_W) && (lib_php->p_filesz != 0)) { - if (add_map_info(ph, lib_fd, lib_php->p_offset, lib_php->p_vaddr + lib_base, lib_php->p_filesz) == NULL) - goto err; + if ((phbuf = read_program_header_table(lib_fd, lib_ehdr)) == NULL) { + return false; + } + + // we want to process only PT_LOAD segments that are not writable. + // i.e., text segments. The read/write/exec (data) segments would + // have been already added from core file segments. + for (lib_php = phbuf, i = 0; i < lib_ehdr->e_phnum; i++) { + if ((lib_php->p_type == PT_LOAD) && !(lib_php->p_flags & PF_W) && (lib_php->p_filesz != 0)) { + + uintptr_t target_vaddr = lib_php->p_vaddr + lib_base; + map_info *existing_map = core_lookup(ph, target_vaddr); + + if (existing_map == NULL){ + if (add_map_info(ph, lib_fd, lib_php->p_offset, + target_vaddr, lib_php->p_filesz) == NULL) { + goto err; + } + } else { + if ((existing_map->memsz != page_size) && + (existing_map->fd != lib_fd) && + (existing_map->memsz != lib_php->p_filesz)){ + + print_debug("address conflict @ 0x%lx (size = %ld, flags = %d\n)", + target_vaddr, lib_php->p_filesz, lib_php->p_flags); + goto err; + } + + /* replace PT_LOAD segment with library segment */ + print_debug("overwrote with new address mapping (memsz %ld -> %ld)\n", + existing_map->memsz, lib_php->p_filesz); + + existing_map->fd = lib_fd; + existing_map->offset = lib_php->p_offset; + existing_map->memsz = lib_php->p_filesz; } - lib_php++; - } + } - free(phbuf); - return true; + lib_php++; + } + + free(phbuf); + return true; err: - free(phbuf); - return false; + free(phbuf); + return false; } -// process segments from interpreter (ld-elf.so.1) +// process segments from interpreter (ld.so or ld-linux.so or ld-elf.so) static bool read_interp_segments(struct ps_prochandle* ph) { ELF_EHDR interp_ehdr; @@ -1303,32 +1329,34 @@ static bool read_shared_lib_info(struct ps_prochandle* ph) { debug_base = dyn.d_un.d_ptr; // at debug_base we have struct r_debug. This has first link map in r_map field if (ps_pread(ph, (psaddr_t) debug_base + FIRST_LINK_MAP_OFFSET, - &first_link_map_addr, sizeof(uintptr_t)) != PS_OK) { + &first_link_map_addr, sizeof(uintptr_t)) != PS_OK) { print_debug("can't read first link map address\n"); return false; } // read ld_base address from struct r_debug - // XXX: There is no r_ldbase member on BSD - /* +#if 0 // There is no r_ldbase member on BSD if (ps_pread(ph, (psaddr_t) debug_base + LD_BASE_OFFSET, &ld_base_addr, sizeof(uintptr_t)) != PS_OK) { print_debug("can't read ld base address\n"); return false; } ph->core->ld_base_addr = ld_base_addr; - */ +#else ph->core->ld_base_addr = 0; +#endif print_debug("interpreter base address is 0x%lx\n", ld_base_addr); - // now read segments from interp (i.e ld-elf.so.1) - if (read_interp_segments(ph) != true) + // now read segments from interp (i.e ld.so or ld-linux.so or ld-elf.so) + if (read_interp_segments(ph) != true) { return false; + } // after adding interpreter (ld.so) mappings sort again - if (sort_map_array(ph) != true) + if (sort_map_array(ph) != true) { return false; + } print_debug("first link map is at 0x%lx\n", first_link_map_addr); @@ -1380,8 +1408,9 @@ static bool read_shared_lib_info(struct ps_prochandle* ph) { add_lib_info_fd(ph, lib_name, lib_fd, lib_base); // Map info is added for the library (lib_name) so // we need to re-sort it before calling the p_pdread. - if (sort_map_array(ph) != true) + if (sort_map_array(ph) != true) { return false; + } } else { print_debug("can't read ELF header for shared object %s\n", lib_name); close(lib_fd); @@ -1392,7 +1421,7 @@ static bool read_shared_lib_info(struct ps_prochandle* ph) { // read next link_map address if (ps_pread(ph, (psaddr_t) link_map_addr + LINK_MAP_NEXT_OFFSET, - &link_map_addr, sizeof(uintptr_t)) != PS_OK) { + &link_map_addr, sizeof(uintptr_t)) != PS_OK) { print_debug("can't read next link in link_map\n"); return false; } @@ -1408,7 +1437,7 @@ struct ps_prochandle* Pgrab_core(const char* exec_file, const char* core_file) { struct ps_prochandle* ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle)); if (ph == NULL) { - print_debug("cant allocate ps_prochandle\n"); + print_debug("can't allocate ps_prochandle\n"); return NULL; } @@ -1444,38 +1473,45 @@ struct ps_prochandle* Pgrab_core(const char* exec_file, const char* core_file) { } if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || exec_ehdr.e_type != ET_EXEC) { - print_debug("executable file is not a valid ELF ET_EXEC file\n"); - goto err; + print_debug("executable file is not a valid ELF ET_EXEC file\n"); + goto err; } // process core file segments - if (read_core_segments(ph, &core_ehdr) != true) - goto err; + if (read_core_segments(ph, &core_ehdr) != true) { + goto err; + } // process exec file segments - if (read_exec_segments(ph, &exec_ehdr) != true) - goto err; + if (read_exec_segments(ph, &exec_ehdr) != true) { + goto err; + } // exec file is also treated like a shared object for symbol search if (add_lib_info_fd(ph, exec_file, ph->core->exec_fd, - (uintptr_t)0 + find_base_address(ph->core->exec_fd, &exec_ehdr)) == NULL) - goto err; + (uintptr_t)0 + find_base_address(ph->core->exec_fd, &exec_ehdr)) == NULL) { + goto err; + } // allocate and sort maps into map_array, we need to do this // here because read_shared_lib_info needs to read from debuggee // address space - if (sort_map_array(ph) != true) + if (sort_map_array(ph) != true) { goto err; + } - if (read_shared_lib_info(ph) != true) + if (read_shared_lib_info(ph) != true) { goto err; + } // sort again because we have added more mappings from shared objects - if (sort_map_array(ph) != true) + if (sort_map_array(ph) != true) { goto err; + } - if (init_classsharing_workaround(ph) != true) + if (init_classsharing_workaround(ph) != true) { goto err; + } print_debug("Leave Pgrab_core\n"); return ph; diff --git a/hotspot/agent/src/os/bsd/ps_proc.c b/hotspot/agent/src/os/bsd/ps_proc.c index cf4a5d71d75..53cafe1f44e 100644 --- a/hotspot/agent/src/os/bsd/ps_proc.c +++ b/hotspot/agent/src/os/bsd/ps_proc.c @@ -131,7 +131,7 @@ static bool process_get_lwp_info(struct ps_prochandle *ph, lwpid_t lwp_id, void static bool ptrace_continue(pid_t pid, int signal) { // pass the signal to the process so we don't swallow it - if (ptrace(PTRACE_CONT, pid, NULL, signal) < 0) { + if (ptrace(PT_CONTINUE, pid, NULL, signal) < 0) { print_debug("ptrace(PTRACE_CONT, ..) failed for %d\n", pid); return false; } @@ -434,7 +434,6 @@ static ps_prochandle_ops process_ops = { // attach to the process. One and only one exposed stuff struct ps_prochandle* Pgrab(pid_t pid) { struct ps_prochandle* ph = NULL; - thread_info* thr = NULL; if ( (ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle))) == NULL) { print_debug("can't allocate memory for ps_prochandle\n"); diff --git a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c index 17f607e0af0..0d3960f7ae7 100644 --- a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c +++ b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -80,7 +81,7 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_in (JNIEnv *env, jclass cls) { jclass listClass; - if (init_libproc(getenv("LIBSAPROC_DEBUG")) != true) { + if (init_libproc(getenv("LIBSAPROC_DEBUG") != NULL) != true) { THROW_NEW_DEBUGGER_EXCEPTION("can't initialize libproc"); } diff --git a/hotspot/agent/src/os/linux/ps_core.c b/hotspot/agent/src/os/linux/ps_core.c index 85abab802e0..268fc2ad162 100644 --- a/hotspot/agent/src/os/linux/ps_core.c +++ b/hotspot/agent/src/os/linux/ps_core.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,155 +41,158 @@ // ps_prochandle cleanup helper functions // close all file descriptors -static void close_elf_files(struct ps_prochandle* ph) { - lib_info* lib = NULL; +static void close_files(struct ps_prochandle* ph) { + lib_info* lib = NULL; - // close core file descriptor - if (ph->core->core_fd >= 0) - close(ph->core->core_fd); + // close core file descriptor + if (ph->core->core_fd >= 0) + close(ph->core->core_fd); - // close exec file descriptor - if (ph->core->exec_fd >= 0) - close(ph->core->exec_fd); + // close exec file descriptor + if (ph->core->exec_fd >= 0) + close(ph->core->exec_fd); - // close interp file descriptor - if (ph->core->interp_fd >= 0) - close(ph->core->interp_fd); + // close interp file descriptor + if (ph->core->interp_fd >= 0) + close(ph->core->interp_fd); - // close class share archive file - if (ph->core->classes_jsa_fd >= 0) - close(ph->core->classes_jsa_fd); + // close class share archive file + if (ph->core->classes_jsa_fd >= 0) + close(ph->core->classes_jsa_fd); - // close all library file descriptors - lib = ph->libs; - while (lib) { - int fd = lib->fd; - if (fd >= 0 && fd != ph->core->exec_fd) close(fd); - lib = lib->next; - } + // close all library file descriptors + lib = ph->libs; + while (lib) { + int fd = lib->fd; + if (fd >= 0 && fd != ph->core->exec_fd) { + close(fd); + } + lib = lib->next; + } } // clean all map_info stuff static void destroy_map_info(struct ps_prochandle* ph) { map_info* map = ph->core->maps; while (map) { - map_info* next = map->next; - free(map); - map = next; + map_info* next = map->next; + free(map); + map = next; } if (ph->core->map_array) { - free(ph->core->map_array); + free(ph->core->map_array); } // Part of the class sharing workaround map = ph->core->class_share_maps; while (map) { - map_info* next = map->next; - free(map); - map = next; + map_info* next = map->next; + free(map); + map = next; } } // ps_prochandle operations static void core_release(struct ps_prochandle* ph) { - if (ph->core) { - close_elf_files(ph); - destroy_map_info(ph); - free(ph->core); - } + if (ph->core) { + close_files(ph); + destroy_map_info(ph); + free(ph->core); + } } static map_info* allocate_init_map(int fd, off_t offset, uintptr_t vaddr, size_t memsz) { - map_info* map; - if ( (map = (map_info*) calloc(1, sizeof(map_info))) == NULL) { - print_debug("can't allocate memory for map_info\n"); - return NULL; - } + map_info* map; + if ( (map = (map_info*) calloc(1, sizeof(map_info))) == NULL) { + print_debug("can't allocate memory for map_info\n"); + return NULL; + } - // initialize map - map->fd = fd; - map->offset = offset; - map->vaddr = vaddr; - map->memsz = memsz; - return map; + // initialize map + map->fd = fd; + map->offset = offset; + map->vaddr = vaddr; + map->memsz = memsz; + return map; } // add map info with given fd, offset, vaddr and memsz static map_info* add_map_info(struct ps_prochandle* ph, int fd, off_t offset, uintptr_t vaddr, size_t memsz) { - map_info* map; - if ((map = allocate_init_map(fd, offset, vaddr, memsz)) == NULL) { - return NULL; - } + map_info* map; + if ((map = allocate_init_map(fd, offset, vaddr, memsz)) == NULL) { + return NULL; + } - // add this to map list - map->next = ph->core->maps; - ph->core->maps = map; - ph->core->num_maps++; + // add this to map list + map->next = ph->core->maps; + ph->core->maps = map; + ph->core->num_maps++; - return map; + return map; } // Part of the class sharing workaround -static void add_class_share_map_info(struct ps_prochandle* ph, off_t offset, +static map_info* add_class_share_map_info(struct ps_prochandle* ph, off_t offset, uintptr_t vaddr, size_t memsz) { - map_info* map; - if ((map = allocate_init_map(ph->core->classes_jsa_fd, - offset, vaddr, memsz)) == NULL) { - return; - } + map_info* map; + if ((map = allocate_init_map(ph->core->classes_jsa_fd, + offset, vaddr, memsz)) == NULL) { + return NULL; + } - map->next = ph->core->class_share_maps; - ph->core->class_share_maps = map; + map->next = ph->core->class_share_maps; + ph->core->class_share_maps = map; + return map; } // Return the map_info for the given virtual address. We keep a sorted // array of pointers in ph->map_array, so we can binary search. -static map_info* core_lookup(struct ps_prochandle *ph, uintptr_t addr) -{ - int mid, lo = 0, hi = ph->core->num_maps - 1; - map_info *mp; +static map_info* core_lookup(struct ps_prochandle *ph, uintptr_t addr) { + int mid, lo = 0, hi = ph->core->num_maps - 1; + map_info *mp; - while (hi - lo > 1) { - mid = (lo + hi) / 2; - if (addr >= ph->core->map_array[mid]->vaddr) - lo = mid; - else - hi = mid; - } + while (hi - lo > 1) { + mid = (lo + hi) / 2; + if (addr >= ph->core->map_array[mid]->vaddr) { + lo = mid; + } else { + hi = mid; + } + } - if (addr < ph->core->map_array[hi]->vaddr) - mp = ph->core->map_array[lo]; - else - mp = ph->core->map_array[hi]; + if (addr < ph->core->map_array[hi]->vaddr) { + mp = ph->core->map_array[lo]; + } else { + mp = ph->core->map_array[hi]; + } - if (addr >= mp->vaddr && addr < mp->vaddr + mp->memsz) + if (addr >= mp->vaddr && addr < mp->vaddr + mp->memsz) { + return (mp); + } + + + // Part of the class sharing workaround + // Unfortunately, we have no way of detecting -Xshare state. + // Check out the share maps atlast, if we don't find anywhere. + // This is done this way so to avoid reading share pages + // ahead of other normal maps. For eg. with -Xshare:off we don't + // want to prefer class sharing data to data from core. + mp = ph->core->class_share_maps; + if (mp) { + print_debug("can't locate map_info at 0x%lx, trying class share maps\n", addr); + } + while (mp) { + if (addr >= mp->vaddr && addr < mp->vaddr + mp->memsz) { + print_debug("located map_info at 0x%lx from class share maps\n", addr); return (mp); + } + mp = mp->next; + } - - // Part of the class sharing workaround - // Unfortunately, we have no way of detecting -Xshare state. - // Check out the share maps atlast, if we don't find anywhere. - // This is done this way so to avoid reading share pages - // ahead of other normal maps. For eg. with -Xshare:off we don't - // want to prefer class sharing data to data from core. - mp = ph->core->class_share_maps; - if (mp) { - print_debug("can't locate map_info at 0x%lx, trying class share maps\n", - addr); - } - while (mp) { - if (addr >= mp->vaddr && addr < mp->vaddr + mp->memsz) { - print_debug("located map_info at 0x%lx from class share maps\n", - addr); - return (mp); - } - mp = mp->next; - } - - print_debug("can't locate map_info at 0x%lx\n", addr); - return (NULL); + print_debug("can't locate map_info at 0x%lx\n", addr); + return (NULL); } //--------------------------------------------------------------- @@ -226,9 +229,9 @@ struct FileMapHeader { size_t _used; // for setting space top on read // 4991491 NOTICE These are C++ bool's in filemap.hpp and must match up with - // the C type matching the C++ bool type on any given platform. For - // Hotspot on Linux we assume the corresponding C type is char but - // licensees on Linux versions may need to adjust the type of these fields. + // the C type matching the C++ bool type on any given platform. + // We assume the corresponding C type is char but licensees + // may need to adjust the type of these fields. char _read_only; // read only space? char _allow_exec; // executable code in space? @@ -238,154 +241,159 @@ struct FileMapHeader { }; static bool read_jboolean(struct ps_prochandle* ph, uintptr_t addr, jboolean* pvalue) { - jboolean i; - if (ps_pdread(ph, (psaddr_t) addr, &i, sizeof(i)) == PS_OK) { - *pvalue = i; - return true; - } else { - return false; - } + jboolean i; + if (ps_pdread(ph, (psaddr_t) addr, &i, sizeof(i)) == PS_OK) { + *pvalue = i; + return true; + } else { + return false; + } } static bool read_pointer(struct ps_prochandle* ph, uintptr_t addr, uintptr_t* pvalue) { - uintptr_t uip; - if (ps_pdread(ph, (psaddr_t) addr, &uip, sizeof(uip)) == PS_OK) { - *pvalue = uip; - return true; - } else { - return false; - } + uintptr_t uip; + if (ps_pdread(ph, (psaddr_t) addr, (char *)&uip, sizeof(uip)) == PS_OK) { + *pvalue = uip; + return true; + } else { + return false; + } } // used to read strings from debuggee static bool read_string(struct ps_prochandle* ph, uintptr_t addr, char* buf, size_t size) { - size_t i = 0; - char c = ' '; + size_t i = 0; + char c = ' '; - while (c != '\0') { - if (ps_pdread(ph, (psaddr_t) addr, &c, sizeof(char)) != PS_OK) - return false; - if (i < size - 1) - buf[i] = c; - else // smaller buffer - return false; - i++; addr++; - } + while (c != '\0') { + if (ps_pdread(ph, (psaddr_t) addr, &c, sizeof(char)) != PS_OK) { + return false; + } + if (i < size - 1) { + buf[i] = c; + } else { + // smaller buffer + return false; + } + i++; addr++; + } - buf[i] = '\0'; - return true; + buf[i] = '\0'; + return true; } #define USE_SHARED_SPACES_SYM "UseSharedSpaces" // mangled name of Arguments::SharedArchivePath #define SHARED_ARCHIVE_PATH_SYM "_ZN9Arguments17SharedArchivePathE" +#define LIBJVM_NAME "/libjvm.so" static bool init_classsharing_workaround(struct ps_prochandle* ph) { - lib_info* lib = ph->libs; - while (lib != NULL) { - // we are iterating over shared objects from the core dump. look for - // libjvm.so. - const char *jvm_name = 0; - if ((jvm_name = strstr(lib->name, "/libjvm.so")) != 0) { - char classes_jsa[PATH_MAX]; - struct FileMapHeader header; - size_t n = 0; - int fd = -1, m = 0; - uintptr_t base = 0, useSharedSpacesAddr = 0; - uintptr_t sharedArchivePathAddrAddr = 0, sharedArchivePathAddr = 0; - jboolean useSharedSpaces = 0; - map_info* mi = 0; + lib_info* lib = ph->libs; + while (lib != NULL) { + // we are iterating over shared objects from the core dump. look for + // libjvm.so. + const char *jvm_name = 0; + if ((jvm_name = strstr(lib->name, LIBJVM_NAME)) != 0) { + char classes_jsa[PATH_MAX]; + struct FileMapHeader header; + int fd = -1; + int m = 0; + size_t n = 0; + uintptr_t base = 0, useSharedSpacesAddr = 0; + uintptr_t sharedArchivePathAddrAddr = 0, sharedArchivePathAddr = 0; + jboolean useSharedSpaces = 0; + map_info* mi = 0; - memset(classes_jsa, 0, sizeof(classes_jsa)); - jvm_name = lib->name; - useSharedSpacesAddr = lookup_symbol(ph, jvm_name, USE_SHARED_SPACES_SYM); - if (useSharedSpacesAddr == 0) { - print_debug("can't lookup 'UseSharedSpaces' flag\n"); - return false; - } - - // Hotspot vm types are not exported to build this library. So - // using equivalent type jboolean to read the value of - // UseSharedSpaces which is same as hotspot type "bool". - if (read_jboolean(ph, useSharedSpacesAddr, &useSharedSpaces) != true) { - print_debug("can't read the value of 'UseSharedSpaces' flag\n"); - return false; - } - - if ((int)useSharedSpaces == 0) { - print_debug("UseSharedSpaces is false, assuming -Xshare:off!\n"); - return true; - } - - sharedArchivePathAddrAddr = lookup_symbol(ph, jvm_name, SHARED_ARCHIVE_PATH_SYM); - if (sharedArchivePathAddrAddr == 0) { - print_debug("can't lookup shared archive path symbol\n"); - return false; - } - - if (read_pointer(ph, sharedArchivePathAddrAddr, &sharedArchivePathAddr) != true) { - print_debug("can't read shared archive path pointer\n"); - return false; - } - - if (read_string(ph, sharedArchivePathAddr, classes_jsa, sizeof(classes_jsa)) != true) { - print_debug("can't read shared archive path value\n"); - return false; - } - - print_debug("looking for %s\n", classes_jsa); - // open the class sharing archive file - fd = pathmap_open(classes_jsa); - if (fd < 0) { - print_debug("can't open %s!\n", classes_jsa); - ph->core->classes_jsa_fd = -1; - return false; - } else { - print_debug("opened %s\n", classes_jsa); - } - - // read FileMapHeader from the file - memset(&header, 0, sizeof(struct FileMapHeader)); - if ((n = read(fd, &header, sizeof(struct FileMapHeader))) - != sizeof(struct FileMapHeader)) { - print_debug("can't read shared archive file map header from %s\n", classes_jsa); - close(fd); - return false; - } - - // check file magic - if (header._magic != 0xf00baba2) { - print_debug("%s has bad shared archive file magic number 0x%x, expecing 0xf00baba2\n", - classes_jsa, header._magic); - close(fd); - return false; - } - - // check version - if (header._version != CURRENT_ARCHIVE_VERSION) { - print_debug("%s has wrong shared archive file version %d, expecting %d\n", - classes_jsa, header._version, CURRENT_ARCHIVE_VERSION); - close(fd); - return false; - } - - ph->core->classes_jsa_fd = fd; - // add read-only maps from classes.jsa to the list of maps - for (m = 0; m < NUM_SHARED_MAPS; m++) { - if (header._space[m]._read_only) { - base = (uintptr_t) header._space[m]._base; - // no need to worry about the fractional pages at-the-end. - // possible fractional pages are handled by core_read_data. - add_class_share_map_info(ph, (off_t) header._space[m]._file_offset, - base, (size_t) header._space[m]._used); - print_debug("added a share archive map at 0x%lx\n", base); - } - } - return true; + memset(classes_jsa, 0, sizeof(classes_jsa)); + jvm_name = lib->name; + useSharedSpacesAddr = lookup_symbol(ph, jvm_name, USE_SHARED_SPACES_SYM); + if (useSharedSpacesAddr == 0) { + print_debug("can't lookup 'UseSharedSpaces' flag\n"); + return false; } - lib = lib->next; + + // Hotspot vm types are not exported to build this library. So + // using equivalent type jboolean to read the value of + // UseSharedSpaces which is same as hotspot type "bool". + if (read_jboolean(ph, useSharedSpacesAddr, &useSharedSpaces) != true) { + print_debug("can't read the value of 'UseSharedSpaces' flag\n"); + return false; + } + + if ((int)useSharedSpaces == 0) { + print_debug("UseSharedSpaces is false, assuming -Xshare:off!\n"); + return true; + } + + sharedArchivePathAddrAddr = lookup_symbol(ph, jvm_name, SHARED_ARCHIVE_PATH_SYM); + if (sharedArchivePathAddrAddr == 0) { + print_debug("can't lookup shared archive path symbol\n"); + return false; + } + + if (read_pointer(ph, sharedArchivePathAddrAddr, &sharedArchivePathAddr) != true) { + print_debug("can't read shared archive path pointer\n"); + return false; + } + + if (read_string(ph, sharedArchivePathAddr, classes_jsa, sizeof(classes_jsa)) != true) { + print_debug("can't read shared archive path value\n"); + return false; + } + + print_debug("looking for %s\n", classes_jsa); + // open the class sharing archive file + fd = pathmap_open(classes_jsa); + if (fd < 0) { + print_debug("can't open %s!\n", classes_jsa); + ph->core->classes_jsa_fd = -1; + return false; + } else { + print_debug("opened %s\n", classes_jsa); + } + + // read FileMapHeader from the file + memset(&header, 0, sizeof(struct FileMapHeader)); + if ((n = read(fd, &header, sizeof(struct FileMapHeader))) + != sizeof(struct FileMapHeader)) { + print_debug("can't read shared archive file map header from %s\n", classes_jsa); + close(fd); + return false; + } + + // check file magic + if (header._magic != 0xf00baba2) { + print_debug("%s has bad shared archive file magic number 0x%x, expecing 0xf00baba2\n", + classes_jsa, header._magic); + close(fd); + return false; + } + + // check version + if (header._version != CURRENT_ARCHIVE_VERSION) { + print_debug("%s has wrong shared archive file version %d, expecting %d\n", + classes_jsa, header._version, CURRENT_ARCHIVE_VERSION); + close(fd); + return false; + } + + ph->core->classes_jsa_fd = fd; + // add read-only maps from classes.jsa to the list of maps + for (m = 0; m < NUM_SHARED_MAPS; m++) { + if (header._space[m]._read_only) { + base = (uintptr_t) header._space[m]._base; + // no need to worry about the fractional pages at-the-end. + // possible fractional pages are handled by core_read_data. + add_class_share_map_info(ph, (off_t) header._space[m]._file_offset, + base, (size_t) header._space[m]._used); + print_debug("added a share archive map at 0x%lx\n", base); + } + } + return true; } - return true; + lib = lib->next; + } + return true; } @@ -396,54 +404,58 @@ static bool init_classsharing_workaround(struct ps_prochandle* ph) { // callback for sorting the array of map_info pointers. static int core_cmp_mapping(const void *lhsp, const void *rhsp) { - const map_info *lhs = *((const map_info **)lhsp); - const map_info *rhs = *((const map_info **)rhsp); + const map_info *lhs = *((const map_info **)lhsp); + const map_info *rhs = *((const map_info **)rhsp); - if (lhs->vaddr == rhs->vaddr) - return (0); + if (lhs->vaddr == rhs->vaddr) { + return (0); + } - return (lhs->vaddr < rhs->vaddr ? -1 : 1); + return (lhs->vaddr < rhs->vaddr ? -1 : 1); } // we sort map_info by starting virtual address so that we can do // binary search to read from an address. static bool sort_map_array(struct ps_prochandle* ph) { - size_t num_maps = ph->core->num_maps; - map_info* map = ph->core->maps; - int i = 0; + size_t num_maps = ph->core->num_maps; + map_info* map = ph->core->maps; + int i = 0; - // allocate map_array - map_info** array; - if ( (array = (map_info**) malloc(sizeof(map_info*) * num_maps)) == NULL) { - print_debug("can't allocate memory for map array\n"); - return false; - } + // allocate map_array + map_info** array; + if ( (array = (map_info**) malloc(sizeof(map_info*) * num_maps)) == NULL) { + print_debug("can't allocate memory for map array\n"); + return false; + } - // add maps to array - while (map) { - array[i] = map; - i++; - map = map->next; - } + // add maps to array + while (map) { + array[i] = map; + i++; + map = map->next; + } - // sort is called twice. If this is second time, clear map array - if (ph->core->map_array) free(ph->core->map_array); - ph->core->map_array = array; - // sort the map_info array by base virtual address. - qsort(ph->core->map_array, ph->core->num_maps, sizeof (map_info*), - core_cmp_mapping); + // sort is called twice. If this is second time, clear map array + if (ph->core->map_array) { + free(ph->core->map_array); + } - // print map - if (is_debug()) { - int j = 0; - print_debug("---- sorted virtual address map ----\n"); - for (j = 0; j < ph->core->num_maps; j++) { - print_debug("base = 0x%lx\tsize = %zu\n", ph->core->map_array[j]->vaddr, - ph->core->map_array[j]->memsz); - } - } + ph->core->map_array = array; + // sort the map_info array by base virtual address. + qsort(ph->core->map_array, ph->core->num_maps, sizeof (map_info*), + core_cmp_mapping); - return true; + // print map + if (is_debug()) { + int j = 0; + print_debug("---- sorted virtual address map ----\n"); + for (j = 0; j < ph->core->num_maps; j++) { + print_debug("base = 0x%lx\tsize = %zu\n", ph->core->map_array[j]->vaddr, + ph->core->map_array[j]->memsz); + } + } + + return true; } #ifndef MIN @@ -460,16 +472,18 @@ static bool core_read_data(struct ps_prochandle* ph, uintptr_t addr, char *buf, off_t off; int fd; - if (mp == NULL) + if (mp == NULL) { break; /* No mapping for this address */ + } fd = mp->fd; mapoff = addr - mp->vaddr; len = MIN(resid, mp->memsz - mapoff); off = mp->offset + mapoff; - if ((len = pread(fd, buf, len, off)) <= 0) + if ((len = pread(fd, buf, len, off)) <= 0) { break; + } resid -= len; addr += len; @@ -625,8 +639,9 @@ static bool core_handle_note(struct ps_prochandle* ph, ELF_PHDR* note_phdr) { notep->n_type, notep->n_descsz); if (notep->n_type == NT_PRSTATUS) { - if (core_handle_prstatus(ph, descdata, notep->n_descsz) != true) - return false; + if (core_handle_prstatus(ph, descdata, notep->n_descsz) != true) { + return false; + } } p = descdata + ROUNDUP(notep->n_descsz, 4); } @@ -654,7 +669,7 @@ static bool read_core_segments(struct ps_prochandle* ph, ELF_EHDR* core_ehdr) { * contains a set of saved /proc structures), and PT_LOAD (which * represents a memory mapping from the process's address space). * - * Difference b/w Solaris PT_NOTE and Linux PT_NOTE: + * Difference b/w Solaris PT_NOTE and Linux/BSD PT_NOTE: * * In Solaris there are two PT_NOTE segments the first PT_NOTE (if present) * contains /proc structs in the pre-2.6 unstructured /proc format. the last @@ -674,7 +689,9 @@ static bool read_core_segments(struct ps_prochandle* ph, ELF_EHDR* core_ehdr) { for (core_php = phbuf, i = 0; i < core_ehdr->e_phnum; i++) { switch (core_php->p_type) { case PT_NOTE: - if (core_handle_note(ph, core_php) != true) goto err; + if (core_handle_note(ph, core_php) != true) { + goto err; + } break; case PT_LOAD: { @@ -698,29 +715,61 @@ err: // read segments of a shared object static bool read_lib_segments(struct ps_prochandle* ph, int lib_fd, ELF_EHDR* lib_ehdr, uintptr_t lib_base) { - int i = 0; - ELF_PHDR* phbuf; - ELF_PHDR* lib_php = NULL; + int i = 0; + ELF_PHDR* phbuf; + ELF_PHDR* lib_php = NULL; - if ((phbuf = read_program_header_table(lib_fd, lib_ehdr)) == NULL) - return false; + int page_size = sysconf(_SC_PAGE_SIZE); - // we want to process only PT_LOAD segments that are not writable. - // i.e., text segments. The read/write/exec (data) segments would - // have been already added from core file segments. - for (lib_php = phbuf, i = 0; i < lib_ehdr->e_phnum; i++) { - if ((lib_php->p_type == PT_LOAD) && !(lib_php->p_flags & PF_W) && (lib_php->p_filesz != 0)) { - if (add_map_info(ph, lib_fd, lib_php->p_offset, lib_php->p_vaddr + lib_base, lib_php->p_filesz) == NULL) - goto err; + if ((phbuf = read_program_header_table(lib_fd, lib_ehdr)) == NULL) { + return false; + } + + // we want to process only PT_LOAD segments that are not writable. + // i.e., text segments. The read/write/exec (data) segments would + // have been already added from core file segments. + for (lib_php = phbuf, i = 0; i < lib_ehdr->e_phnum; i++) { + if ((lib_php->p_type == PT_LOAD) && !(lib_php->p_flags & PF_W) && (lib_php->p_filesz != 0)) { + + uintptr_t target_vaddr = lib_php->p_vaddr + lib_base; + map_info *existing_map = core_lookup(ph, target_vaddr); + + if (existing_map == NULL){ + if (add_map_info(ph, lib_fd, lib_php->p_offset, + target_vaddr, lib_php->p_memsz) == NULL) { + goto err; + } + } else { + // Coredump stores value of p_memsz elf field + // rounded up to page boundary. + + if ((existing_map->memsz != page_size) && + (existing_map->fd != lib_fd) && + (ROUNDUP(existing_map->memsz, page_size) != ROUNDUP(lib_php->p_memsz, page_size))) { + + print_debug("address conflict @ 0x%lx (existing map size = %ld, size = %ld, flags = %d)\n", + target_vaddr, existing_map->memsz, lib_php->p_memsz, lib_php->p_flags); + goto err; + } + + /* replace PT_LOAD segment with library segment */ + print_debug("overwrote with new address mapping (memsz %ld -> %ld)\n", + existing_map->memsz, ROUNDUP(lib_php->p_memsz, page_size)); + + existing_map->fd = lib_fd; + existing_map->offset = lib_php->p_offset; + existing_map->memsz = ROUNDUP(lib_php->p_memsz, page_size); } - lib_php++; - } + } - free(phbuf); - return true; + lib_php++; + } + + free(phbuf); + return true; err: - free(phbuf); - return false; + free(phbuf); + return false; } // process segments from interpreter (ld.so or ld-linux.so) @@ -803,60 +852,62 @@ err: // read shared library info from runtime linker's data structures. // This work is done by librtlb_db in Solaris static bool read_shared_lib_info(struct ps_prochandle* ph) { - uintptr_t addr = ph->core->dynamic_addr; - uintptr_t debug_base; - uintptr_t first_link_map_addr; - uintptr_t ld_base_addr; - uintptr_t link_map_addr; - uintptr_t lib_base_diff; - uintptr_t lib_base; - uintptr_t lib_name_addr; - char lib_name[BUF_SIZE]; - ELF_DYN dyn; - ELF_EHDR elf_ehdr; - int lib_fd; + uintptr_t addr = ph->core->dynamic_addr; + uintptr_t debug_base; + uintptr_t first_link_map_addr; + uintptr_t ld_base_addr; + uintptr_t link_map_addr; + uintptr_t lib_base_diff; + uintptr_t lib_base; + uintptr_t lib_name_addr; + char lib_name[BUF_SIZE]; + ELF_DYN dyn; + ELF_EHDR elf_ehdr; + int lib_fd; - // _DYNAMIC has information of the form - // [tag] [data] [tag] [data] ..... - // Both tag and data are pointer sized. - // We look for dynamic info with DT_DEBUG. This has shared object info. - // refer to struct r_debug in link.h + // _DYNAMIC has information of the form + // [tag] [data] [tag] [data] ..... + // Both tag and data are pointer sized. + // We look for dynamic info with DT_DEBUG. This has shared object info. + // refer to struct r_debug in link.h - dyn.d_tag = DT_NULL; - while (dyn.d_tag != DT_DEBUG) { - if (ps_pdread(ph, (psaddr_t) addr, &dyn, sizeof(ELF_DYN)) != PS_OK) { - print_debug("can't read debug info from _DYNAMIC\n"); - return false; - } - addr += sizeof(ELF_DYN); - } + dyn.d_tag = DT_NULL; + while (dyn.d_tag != DT_DEBUG) { + if (ps_pdread(ph, (psaddr_t) addr, &dyn, sizeof(ELF_DYN)) != PS_OK) { + print_debug("can't read debug info from _DYNAMIC\n"); + return false; + } + addr += sizeof(ELF_DYN); + } - // we have got Dyn entry with DT_DEBUG - debug_base = dyn.d_un.d_ptr; - // at debug_base we have struct r_debug. This has first link map in r_map field - if (ps_pdread(ph, (psaddr_t) debug_base + FIRST_LINK_MAP_OFFSET, + // we have got Dyn entry with DT_DEBUG + debug_base = dyn.d_un.d_ptr; + // at debug_base we have struct r_debug. This has first link map in r_map field + if (ps_pdread(ph, (psaddr_t) debug_base + FIRST_LINK_MAP_OFFSET, &first_link_map_addr, sizeof(uintptr_t)) != PS_OK) { - print_debug("can't read first link map address\n"); - return false; - } + print_debug("can't read first link map address\n"); + return false; + } - // read ld_base address from struct r_debug - if (ps_pdread(ph, (psaddr_t) debug_base + LD_BASE_OFFSET, &ld_base_addr, + // read ld_base address from struct r_debug + if (ps_pdread(ph, (psaddr_t) debug_base + LD_BASE_OFFSET, &ld_base_addr, sizeof(uintptr_t)) != PS_OK) { - print_debug("can't read ld base address\n"); - return false; - } - ph->core->ld_base_addr = ld_base_addr; + print_debug("can't read ld base address\n"); + return false; + } + ph->core->ld_base_addr = ld_base_addr; - print_debug("interpreter base address is 0x%lx\n", ld_base_addr); + print_debug("interpreter base address is 0x%lx\n", ld_base_addr); - // now read segments from interp (i.e ld.so or ld-linux.so) - if (read_interp_segments(ph) != true) + // now read segments from interp (i.e ld.so or ld-linux.so or ld-elf.so) + if (read_interp_segments(ph) != true) { return false; + } - // after adding interpreter (ld.so) mappings sort again - if (sort_map_array(ph) != true) - return false; + // after adding interpreter (ld.so) mappings sort again + if (sort_map_array(ph) != true) { + return false; + } print_debug("first link map is at 0x%lx\n", first_link_map_addr); @@ -921,95 +972,102 @@ static bool read_shared_lib_info(struct ps_prochandle* ph) { } } - // read next link_map address - if (ps_pdread(ph, (psaddr_t) link_map_addr + LINK_MAP_NEXT_OFFSET, - &link_map_addr, sizeof(uintptr_t)) != PS_OK) { - print_debug("can't read next link in link_map\n"); - return false; - } - } + // read next link_map address + if (ps_pdread(ph, (psaddr_t) link_map_addr + LINK_MAP_NEXT_OFFSET, + &link_map_addr, sizeof(uintptr_t)) != PS_OK) { + print_debug("can't read next link in link_map\n"); + return false; + } + } - return true; + return true; } // the one and only one exposed stuff from this file struct ps_prochandle* Pgrab_core(const char* exec_file, const char* core_file) { - ELF_EHDR core_ehdr; - ELF_EHDR exec_ehdr; - ELF_EHDR lib_ehdr; + ELF_EHDR core_ehdr; + ELF_EHDR exec_ehdr; + ELF_EHDR lib_ehdr; - struct ps_prochandle* ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle)); - if (ph == NULL) { - print_debug("can't allocate ps_prochandle\n"); - return NULL; - } + struct ps_prochandle* ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle)); + if (ph == NULL) { + print_debug("can't allocate ps_prochandle\n"); + return NULL; + } - if ((ph->core = (struct core_data*) calloc(1, sizeof(struct core_data))) == NULL) { - free(ph); - print_debug("can't allocate ps_prochandle\n"); - return NULL; - } + if ((ph->core = (struct core_data*) calloc(1, sizeof(struct core_data))) == NULL) { + free(ph); + print_debug("can't allocate ps_prochandle\n"); + return NULL; + } - // initialize ph - ph->ops = &core_ops; - ph->core->core_fd = -1; - ph->core->exec_fd = -1; - ph->core->interp_fd = -1; + // initialize ph + ph->ops = &core_ops; + ph->core->core_fd = -1; + ph->core->exec_fd = -1; + ph->core->interp_fd = -1; - // open the core file - if ((ph->core->core_fd = open(core_file, O_RDONLY)) < 0) { - print_debug("can't open core file\n"); - goto err; - } + // open the core file + if ((ph->core->core_fd = open(core_file, O_RDONLY)) < 0) { + print_debug("can't open core file\n"); + goto err; + } - // read core file ELF header - if (read_elf_header(ph->core->core_fd, &core_ehdr) != true || core_ehdr.e_type != ET_CORE) { - print_debug("core file is not a valid ELF ET_CORE file\n"); - goto err; - } + // read core file ELF header + if (read_elf_header(ph->core->core_fd, &core_ehdr) != true || core_ehdr.e_type != ET_CORE) { + print_debug("core file is not a valid ELF ET_CORE file\n"); + goto err; + } - if ((ph->core->exec_fd = open(exec_file, O_RDONLY)) < 0) { - print_debug("can't open executable file\n"); - goto err; - } + if ((ph->core->exec_fd = open(exec_file, O_RDONLY)) < 0) { + print_debug("can't open executable file\n"); + goto err; + } - if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || exec_ehdr.e_type != ET_EXEC) { - print_debug("executable file is not a valid ELF ET_EXEC file\n"); - goto err; - } + if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || exec_ehdr.e_type != ET_EXEC) { + print_debug("executable file is not a valid ELF ET_EXEC file\n"); + goto err; + } - // process core file segments - if (read_core_segments(ph, &core_ehdr) != true) - goto err; + // process core file segments + if (read_core_segments(ph, &core_ehdr) != true) { + goto err; + } - // process exec file segments - if (read_exec_segments(ph, &exec_ehdr) != true) - goto err; + // process exec file segments + if (read_exec_segments(ph, &exec_ehdr) != true) { + goto err; + } - // exec file is also treated like a shared object for symbol search - if (add_lib_info_fd(ph, exec_file, ph->core->exec_fd, - (uintptr_t)0 + find_base_address(ph->core->exec_fd, &exec_ehdr)) == NULL) - goto err; + // exec file is also treated like a shared object for symbol search + if (add_lib_info_fd(ph, exec_file, ph->core->exec_fd, + (uintptr_t)0 + find_base_address(ph->core->exec_fd, &exec_ehdr)) == NULL) { + goto err; + } - // allocate and sort maps into map_array, we need to do this - // here because read_shared_lib_info needs to read from debuggee - // address space - if (sort_map_array(ph) != true) - goto err; + // allocate and sort maps into map_array, we need to do this + // here because read_shared_lib_info needs to read from debuggee + // address space + if (sort_map_array(ph) != true) { + goto err; + } - if (read_shared_lib_info(ph) != true) - goto err; + if (read_shared_lib_info(ph) != true) { + goto err; + } - // sort again because we have added more mappings from shared objects - if (sort_map_array(ph) != true) - goto err; + // sort again because we have added more mappings from shared objects + if (sort_map_array(ph) != true) { + goto err; + } - if (init_classsharing_workaround(ph) != true) - goto err; + if (init_classsharing_workaround(ph) != true) { + goto err; + } - return ph; + return ph; err: - Prelease(ph); - return NULL; + Prelease(ph); + return NULL; } diff --git a/hotspot/agent/src/os/linux/ps_proc.c b/hotspot/agent/src/os/linux/ps_proc.c index 61f08692ca8..61923a25529 100644 --- a/hotspot/agent/src/os/linux/ps_proc.c +++ b/hotspot/agent/src/os/linux/ps_proc.c @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include "libproc_impl.h" diff --git a/hotspot/agent/src/os/linux/salibelf.c b/hotspot/agent/src/os/linux/salibelf.c index 9634da8be56..4c860a0fe08 100644 --- a/hotspot/agent/src/os/linux/salibelf.c +++ b/hotspot/agent/src/os/linux/salibelf.c @@ -25,6 +25,7 @@ #include "salibelf.h" #include #include +#include extern void print_debug(const char*,...); diff --git a/hotspot/agent/src/os/linux/symtab.c b/hotspot/agent/src/os/linux/symtab.c index bea59e37823..f9fc33f14ec 100644 --- a/hotspot/agent/src/os/linux/symtab.c +++ b/hotspot/agent/src/os/linux/symtab.c @@ -305,7 +305,7 @@ static struct symtab* build_symtab_from_build_id(Elf64_Nhdr *note) unsigned char *bytes = (unsigned char*)(note+1) + note->n_namesz; - unsigned char *filename + char *filename = (build_id_to_debug_filename (note->n_descsz, bytes)); fd = pathmap_open(filename); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java index f6a279dee88..9d351cb0917 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java @@ -67,6 +67,13 @@ public class Disassembler { String libname = "hsdis"; String arch = System.getProperty("os.arch"); if (os.lastIndexOf("Windows", 0) != -1) { + if (arch.equals("x86")) { + libname += "-i386"; + } else if (arch.equals("amd64")) { + libname += "-amd64"; + } else { + libname += "-" + arch; + } path.append(sep + "bin" + sep); libname += ".dll"; } else if (os.lastIndexOf("SunOS", 0) != -1) { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1HeapRegionTable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1HeapRegionTable.java new file mode 100644 index 00000000000..11657ce31da --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1HeapRegionTable.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package sun.jvm.hotspot.gc_implementation.g1; + +import java.util.Iterator; +import java.util.Observable; +import java.util.Observer; + +import sun.jvm.hotspot.debugger.Address; +import sun.jvm.hotspot.runtime.VM; +import sun.jvm.hotspot.runtime.VMObject; +import sun.jvm.hotspot.runtime.VMObjectFactory; +import sun.jvm.hotspot.types.AddressField; +import sun.jvm.hotspot.types.CIntegerField; +import sun.jvm.hotspot.types.Type; +import sun.jvm.hotspot.types.TypeDataBase; + +// Mirror class for G1HeapRegionTable. It's essentially an index -> HeapRegion map. + +public class G1HeapRegionTable extends VMObject { + // HeapRegion** _base; + static private AddressField baseField; + // uint _length; + static private CIntegerField lengthField; + // HeapRegion** _biased_base + static private AddressField biasedBaseField; + // size_t _bias + static private CIntegerField biasField; + // uint _shift_by + static private CIntegerField shiftByField; + + static { + VM.registerVMInitializedObserver(new Observer() { + public void update(Observable o, Object data) { + initialize(VM.getVM().getTypeDataBase()); + } + }); + } + + static private synchronized void initialize(TypeDataBase db) { + Type type = db.lookupType("G1HeapRegionTable"); + + baseField = type.getAddressField("_base"); + lengthField = type.getCIntegerField("_length"); + biasedBaseField = type.getAddressField("_biased_base"); + biasField = type.getCIntegerField("_bias"); + shiftByField = type.getCIntegerField("_shift_by"); + } + + private HeapRegion at(long index) { + Address arrayAddr = baseField.getValue(addr); + // Offset of &_base[index] + long offset = index * VM.getVM().getAddressSize(); + Address regionAddr = arrayAddr.getAddressAt(offset); + return (HeapRegion) VMObjectFactory.newObject(HeapRegion.class, + regionAddr); + } + + public long length() { + return lengthField.getValue(addr); + } + + public long bias() { + return biasField.getValue(addr); + } + + public long shiftBy() { + return shiftByField.getValue(addr); + } + + private class HeapRegionIterator implements Iterator { + private long index; + private long length; + + @Override + public boolean hasNext() { return index < length; } + + @Override + public HeapRegion next() { return at(index++); } + + @Override + public void remove() { /* not supported */ } + + HeapRegionIterator(Address addr) { + index = 0; + length = length(); + } + } + + public Iterator heapRegionIterator() { + return new HeapRegionIterator(addr); + } + + public G1HeapRegionTable(Address addr) { + super(addr); + } +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSeq.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSeq.java index 5bd7f443de6..f8b47abeddc 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSeq.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSeq.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,13 +37,11 @@ import sun.jvm.hotspot.types.CIntegerField; import sun.jvm.hotspot.types.Type; import sun.jvm.hotspot.types.TypeDataBase; -// Mirror class for HeapRegionSeq. It's essentially an index -> HeapRegion map. +// Mirror class for HeapRegionSeq. It essentially encapsulates the G1HeapRegionTable. public class HeapRegionSeq extends VMObject { - // HeapRegion** _regions; - static private AddressField regionsField; - // uint _length; - static private CIntegerField lengthField; + // G1HeapRegionTable _regions + static private long regionsFieldOffset; static { VM.registerVMInitializedObserver(new Observer() { @@ -56,44 +54,21 @@ public class HeapRegionSeq extends VMObject { static private synchronized void initialize(TypeDataBase db) { Type type = db.lookupType("HeapRegionSeq"); - regionsField = type.getAddressField("_regions"); - lengthField = type.getCIntegerField("_length"); + regionsFieldOffset = type.getField("_regions").getOffset(); } - private HeapRegion at(long index) { - Address arrayAddr = regionsField.getValue(addr); - // Offset of &_region[index] - long offset = index * VM.getVM().getAddressSize(); - Address regionAddr = arrayAddr.getAddressAt(offset); - return (HeapRegion) VMObjectFactory.newObject(HeapRegion.class, - regionAddr); + private G1HeapRegionTable regions() { + Address regionsAddr = addr.addOffsetTo(regionsFieldOffset); + return (G1HeapRegionTable) VMObjectFactory.newObject(G1HeapRegionTable.class, + regionsAddr); } public long length() { - return lengthField.getValue(addr); - } - - private class HeapRegionIterator implements Iterator { - private long index; - private long length; - - @Override - public boolean hasNext() { return index < length; } - - @Override - public HeapRegion next() { return at(index++); } - - @Override - public void remove() { /* not supported */ } - - HeapRegionIterator(Address addr) { - index = 0; - length = length(); - } + return regions().length(); } public Iterator heapRegionIterator() { - return new HeapRegionIterator(addr); + return regions().heapRegionIterator(); } public HeapRegionSeq(Address addr) { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java new file mode 100644 index 00000000000..2c9e736ec4a --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 sun.jvm.hotspot.memory; + +import java.util.*; +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.oops.*; +import sun.jvm.hotspot.runtime.*; +import sun.jvm.hotspot.types.*; + +public class ProtectionDomainCacheEntry extends VMObject { + private static sun.jvm.hotspot.types.OopField protectionDomainField; + + static { + VM.registerVMInitializedObserver(new Observer() { + public void update(Observable o, Object data) { + initialize(VM.getVM().getTypeDataBase()); + } + }); + } + + private static synchronized void initialize(TypeDataBase db) { + Type type = db.lookupType("ProtectionDomainCacheEntry"); + protectionDomainField = type.getOopField("_literal"); + } + + public ProtectionDomainCacheEntry(Address addr) { + super(addr); + } + + public Oop protectionDomain() { + return VM.getVM().getObjectHeap().newOop(protectionDomainField.getValue(addr)); + } +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java index de2da04f952..27aa4e9f43b 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ import sun.jvm.hotspot.types.*; public class ProtectionDomainEntry extends VMObject { private static AddressField nextField; - private static sun.jvm.hotspot.types.OopField protectionDomainField; + private static AddressField pdCacheField; static { VM.registerVMInitializedObserver(new Observer() { @@ -46,7 +46,7 @@ public class ProtectionDomainEntry extends VMObject { Type type = db.lookupType("ProtectionDomainEntry"); nextField = type.getAddressField("_next"); - protectionDomainField = type.getOopField("_protection_domain"); + pdCacheField = type.getAddressField("_pd_cache"); } public ProtectionDomainEntry(Address addr) { @@ -54,10 +54,12 @@ public class ProtectionDomainEntry extends VMObject { } public ProtectionDomainEntry next() { - return (ProtectionDomainEntry) VMObjectFactory.newObject(ProtectionDomainEntry.class, addr); + return (ProtectionDomainEntry) VMObjectFactory.newObject(ProtectionDomainEntry.class, nextField.getValue(addr)); } public Oop protectionDomain() { - return VM.getVM().getObjectHeap().newOop(protectionDomainField.getValue(addr)); + ProtectionDomainCacheEntry pd_cache = (ProtectionDomainCacheEntry) + VMObjectFactory.newObject(ProtectionDomainCacheEntry.class, pdCacheField.getValue(addr)); + return pd_cache.protectionDomain(); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java index 1c0a676810a..3069cf6b377 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java @@ -44,12 +44,10 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable { private static synchronized void initialize(TypeDataBase db) { Type type = db.lookupType("SymbolTable"); theTableField = type.getAddressField("_the_table"); - symbolTableSize = db.lookupIntConstant("SymbolTable::symbol_table_size").intValue(); } // Fields private static AddressField theTableField; - private static int symbolTableSize; // Accessors public static SymbolTable getTheTable() { @@ -57,10 +55,6 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable { return (SymbolTable) VMObjectFactory.newObject(SymbolTable.class, tmp); } - public static int getSymbolTableSize() { - return symbolTableSize; - } - public SymbolTable(Address addr) { super(addr); } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java index 3d0a370cd66..585581fefe4 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java @@ -51,6 +51,7 @@ public class ConstMethod extends VMObject { private static int HAS_GENERIC_SIGNATURE; private static int HAS_METHOD_ANNOTATIONS; private static int HAS_PARAMETER_ANNOTATIONS; + private static int HAS_METHOD_PARAMETERS; private static int HAS_DEFAULT_ANNOTATIONS; private static int HAS_TYPE_ANNOTATIONS; @@ -70,6 +71,7 @@ public class ConstMethod extends VMObject { HAS_GENERIC_SIGNATURE = db.lookupIntConstant("ConstMethod::_has_generic_signature").intValue(); HAS_METHOD_ANNOTATIONS = db.lookupIntConstant("ConstMethod::_has_method_annotations").intValue(); HAS_PARAMETER_ANNOTATIONS = db.lookupIntConstant("ConstMethod::_has_parameter_annotations").intValue(); + HAS_METHOD_PARAMETERS = db.lookupIntConstant("ConstMethod::_has_method_parameters").intValue(); HAS_DEFAULT_ANNOTATIONS = db.lookupIntConstant("ConstMethod::_has_default_annotations").intValue(); HAS_TYPE_ANNOTATIONS = db.lookupIntConstant("ConstMethod::_has_type_annotations").intValue(); @@ -85,6 +87,9 @@ public class ConstMethod extends VMObject { // start of byte code bytecodeOffset = type.getSize(); + type = db.lookupType("MethodParametersElement"); + methodParametersElementSize = type.getSize(); + type = db.lookupType("CheckedExceptionElement"); checkedExceptionElementSize = type.getSize(); @@ -113,7 +118,7 @@ public class ConstMethod extends VMObject { // start of bytecode private static long bytecodeOffset; - + private static long methodParametersElementSize; private static long checkedExceptionElementSize; private static long localVariableTableElementSize; private static long exceptionTableElementSize; @@ -387,6 +392,10 @@ public class ConstMethod extends VMObject { return ret; } + private boolean hasMethodParameters() { + return (getFlags() & HAS_METHOD_PARAMETERS) != 0; + } + private boolean hasGenericSignature() { return (getFlags() & HAS_GENERIC_SIGNATURE) != 0; } @@ -442,11 +451,41 @@ public class ConstMethod extends VMObject { return offsetOfLastU2Element(); } - private long offsetOfCheckedExceptionsLength() { + private long offsetOfMethodParametersLength() { + if (Assert.ASSERTS_ENABLED) { + Assert.that(hasMethodParameters(), "should only be called if table is present"); + } return hasGenericSignature() ? offsetOfLastU2Element() - sizeofShort : offsetOfLastU2Element(); } + private int getMethodParametersLength() { + if (hasMethodParameters()) + return (int) getAddress().getCIntegerAt(offsetOfMethodParametersLength(), 2, true); + else + return 0; + } + + // Offset of start of checked exceptions + private long offsetOfMethodParameters() { + long offset = offsetOfMethodParametersLength(); + long length = getMethodParametersLength(); + if (Assert.ASSERTS_ENABLED) { + Assert.that(length > 0, "should only be called if method parameter information is present"); + } + offset -= length * methodParametersElementSize; + return offset; + } + + private long offsetOfCheckedExceptionsLength() { + if (hasMethodParameters()) + return offsetOfMethodParameters() - sizeofShort; + else { + return hasGenericSignature() ? offsetOfLastU2Element() - sizeofShort : + offsetOfLastU2Element(); + } + } + private int getCheckedExceptionsLength() { if (hasCheckedExceptions()) { return (int) getAddress().getCIntegerAt(offsetOfCheckedExceptionsLength(), 2, true); @@ -496,6 +535,8 @@ public class ConstMethod extends VMObject { return offsetOfExceptionTable() - sizeofShort; } else if (hasCheckedExceptions()) { return offsetOfCheckedExceptions() - sizeofShort; + } else if (hasMethodParameters()) { + return offsetOfMethodParameters() - sizeofShort; } else { return hasGenericSignature() ? offsetOfLastU2Element() - sizeofShort : offsetOfLastU2Element(); @@ -526,6 +567,8 @@ public class ConstMethod extends VMObject { } if (hasCheckedExceptions()) { return offsetOfCheckedExceptions() - sizeofShort; + } else if (hasMethodParameters()) { + return offsetOfMethodParameters() - sizeofShort; } else { return hasGenericSignature() ? offsetOfLastU2Element() - sizeofShort : offsetOfLastU2Element(); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java index 319d2430af2..8088a49993c 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java @@ -134,15 +134,13 @@ public class VM { private String type; private String name; private Address addr; - private String kind; - private int origin; + private int flags; - private Flag(String type, String name, Address addr, String kind, int origin) { + private Flag(String type, String name, Address addr, int flags) { this.type = type; this.name = name; this.addr = addr; - this.kind = kind; - this.origin = origin; + this.flags = flags; } public String getType() { @@ -157,12 +155,8 @@ public class VM { return addr; } - public String getKind() { - return kind; - } - public int getOrigin() { - return origin; + return flags & 0xF; // XXX can we get the mask bits from somewhere? } public boolean isBool() { @@ -173,8 +167,7 @@ public class VM { if (Assert.ASSERTS_ENABLED) { Assert.that(isBool(), "not a bool flag!"); } - return addr.getCIntegerAt(0, boolType.getSize(), boolType.isUnsigned()) - != 0; + return addr.getCIntegerAt(0, boolType.getSize(), boolType.isUnsigned()) != 0; } public boolean isIntx() { @@ -843,11 +836,10 @@ public class VM { Address flagAddr = flagType.getAddressField("flags").getValue(); - AddressField typeFld = flagType.getAddressField("type"); - AddressField nameFld = flagType.getAddressField("name"); - AddressField addrFld = flagType.getAddressField("addr"); - AddressField kindFld = flagType.getAddressField("kind"); - CIntField originFld = new CIntField(flagType.getCIntegerField("origin"), 0); + AddressField typeFld = flagType.getAddressField("_type"); + AddressField nameFld = flagType.getAddressField("_name"); + AddressField addrFld = flagType.getAddressField("_addr"); + CIntField flagsFld = new CIntField(flagType.getCIntegerField("_flags"), 0); long flagSize = flagType.getSize(); // sizeof(Flag) @@ -856,9 +848,8 @@ public class VM { String type = CStringUtilities.getString(typeFld.getValue(flagAddr)); String name = CStringUtilities.getString(nameFld.getValue(flagAddr)); Address addr = addrFld.getValue(flagAddr); - String kind = CStringUtilities.getString(kindFld.getValue(flagAddr)); - int origin = (int)originFld.getValue(flagAddr); - commandLineFlags[f] = new Flag(type, name, addr, kind, origin); + int flags = (int)flagsFld.getValue(flagAddr); + commandLineFlags[f] = new Flag(type, name, addr, flags); flagAddr = flagAddr.addOffsetTo(flagSize); } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java index eeda376b1d6..d2ea2db855d 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java @@ -51,8 +51,7 @@ public class ClassLoaderStats extends Tool { public static void main(String[] args) { ClassLoaderStats cls = new ClassLoaderStats(); - cls.start(args); - cls.stop(); + cls.execute(args); } private static class ClassData { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java index ed707b9ee8a..2a8ca2cfb7a 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java @@ -54,8 +54,7 @@ public class FinalizerInfo extends Tool { public static void main(String[] args) { FinalizerInfo finfo = new FinalizerInfo(); - finfo.start(args); - finfo.stop(); + finfo.execute(args); } public void run() { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java index c8db6d6b044..37fa4c83c26 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java @@ -54,7 +54,6 @@ public class FlagDumper extends Tool { public static void main(String[] args) { FlagDumper fd = new FlagDumper(); - fd.start(args); - fd.stop(); + fd.execute(args); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java index c5af0ed005d..e2da202acb9 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java @@ -80,8 +80,7 @@ public class HeapDumper extends Tool { } HeapDumper dumper = new HeapDumper(file); - dumper.start(args); - dumper.stop(); + dumper.execute(args); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java index daab682aaef..f87457c3c3e 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java @@ -46,8 +46,7 @@ public class HeapSummary extends Tool { public static void main(String[] args) { HeapSummary hs = new HeapSummary(); - hs.start(args); - hs.stop(); + hs.execute(args); } public void run() { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java index f2452420744..6f9cd0f41d2 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java @@ -134,8 +134,7 @@ public class JInfo extends Tool { } JInfo jinfo = new JInfo(mode); - jinfo.start(args); - jinfo.stop(); + jinfo.execute(args); } private void printVMFlags() { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java index f6f3c0741c0..847eac19468 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java @@ -136,7 +136,9 @@ public class JMap extends Tool { mode = MODE_HEAP_GRAPH_GXL; } else { System.err.println("unknown heap format:" + format); - return; + + // Exit with error status + System.exit(1); } } else { copyArgs = false; @@ -153,8 +155,7 @@ public class JMap extends Tool { } JMap jmap = new JMap(mode); - jmap.start(args); - jmap.stop(); + jmap.execute(args); } public boolean writeHeapHprofBin(String fileName) { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java index 9301f1059fd..c2e5ed52f84 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java @@ -64,7 +64,6 @@ public class JSnap extends Tool { public static void main(String[] args) { JSnap js = new JSnap(); - js.start(args); - js.stop(); + js.execute(args); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java index 7cbe8f4d945..52fb6654e70 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java @@ -89,8 +89,7 @@ public class JStack extends Tool { } JStack jstack = new JStack(mixedMode, concurrentLocks); - jstack.start(args); - jstack.stop(); + jstack.execute(args); } private boolean mixedMode; diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java index 168202eec2c..6c6c555badf 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java @@ -61,7 +61,6 @@ public class ObjectHistogram extends Tool { public static void main(String[] args) { ObjectHistogram oh = new ObjectHistogram(); - oh.start(args); - oh.stop(); + oh.execute(args); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java index 2a234130991..e18aa76cfa6 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java @@ -69,7 +69,6 @@ public class PMap extends Tool { public static void main(String[] args) throws Exception { PMap t = new PMap(); - t.start(args); - t.stop(); + t.execute(args); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java index 7f10612b317..c4e7b5c7b74 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java @@ -182,8 +182,7 @@ public class PStack extends Tool { public static void main(String[] args) throws Exception { PStack t = new PStack(); - t.start(args); - t.stop(); + t.execute(args); } // -- Internals only below this point diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java index eb0cc88d116..bbb0b081b2d 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java @@ -137,8 +137,7 @@ public class StackTrace extends Tool { public static void main(String[] args) { StackTrace st = new StackTrace(); - st.start(args); - st.stop(); + st.execute(args); } private boolean verbose; diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java index d601fef4401..01465574006 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java @@ -58,7 +58,6 @@ public class SysPropsDumper extends Tool { public static void main(String[] args) { SysPropsDumper pd = new SysPropsDumper(); - pd.start(args); - pd.stop(); + pd.execute(args); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java index 3021801c9dd..19cfb349da8 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java @@ -26,6 +26,7 @@ package sun.jvm.hotspot.tools; import java.io.PrintStream; import java.util.Hashtable; + import sun.jvm.hotspot.*; import sun.jvm.hotspot.runtime.*; import sun.jvm.hotspot.debugger.*; @@ -105,26 +106,44 @@ public abstract class Tool implements Runnable { public static void main(String[] args) { obj = new ; - obj.start(args); + obj.execute(args); } */ - protected void stop() { + protected void execute(String[] args) { + int returnStatus = 1; + + try { + returnStatus = start(args); + } finally { + stop(); + } + + // Exit with 0 or 1 + System.exit(returnStatus); + } + + public void stop() { if (agent != null) { agent.detach(); } } - protected void start(String[] args) { + private int start(String[] args) { + if ((args.length < 1) || (args.length > 2)) { usage(); - return; + return 1; } // Attempt to handle -h or -help or some invalid flag - if (args[0].startsWith("-")) { + if (args[0].startsWith("-h")) { usage(); + return 0; + } else if (args[0].startsWith("-")) { + usage(); + return 1; } PrintStream err = System.err; @@ -154,6 +173,7 @@ public abstract class Tool implements Runnable { default: usage(); + return 1; } agent = new HotSpotAgent(); @@ -191,15 +211,16 @@ public abstract class Tool implements Runnable { break; } if (e.getMessage() != null) { - err.print(e.getMessage()); + err.println(e.getMessage()); e.printStackTrace(); } err.println(); - return; + return 1; } err.println("Debugger attached successfully."); startInternal(); + return 0; } // When using an existing JVMDebugger. diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java index afd7f9865b5..98300c1d6c4 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java @@ -177,7 +177,6 @@ public class ClassDump extends Tool { public static void main(String[] args) { ClassDump cd = new ClassDump(); - cd.start(args); - cd.stop(); + cd.execute(args); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java index 09874af178e..db6dc339394 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java @@ -42,8 +42,7 @@ public class JSDB extends Tool { public static void main(String[] args) { JSDB jsdb = new JSDB(); - jsdb.start(args); - jsdb.stop(); + jsdb.execute(args); } public void run() { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java index b3054b90bd0..67f5ed1e920 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java @@ -40,8 +40,7 @@ import sun.jvm.hotspot.utilities.soql.*; public class SOQL extends Tool { public static void main(String[] args) { SOQL soql = new SOQL(); - soql.start(args); - soql.stop(); + soql.execute(args); } public SOQL() { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java index a2d271c58b4..382d2477b52 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java @@ -59,6 +59,7 @@ public abstract class AbstractHeapGraphWriter implements HeapGraphWriter { public boolean doObj(Oop oop) { try { + writeHeapRecordPrologue(); if (oop instanceof TypeArray) { writePrimitiveArray((TypeArray)oop); } else if (oop instanceof ObjArray) { @@ -97,6 +98,7 @@ public abstract class AbstractHeapGraphWriter implements HeapGraphWriter { // not-a-Java-visible oop writeInternalObject(oop); } + writeHeapRecordEpilogue(); } catch (IOException exp) { throw new RuntimeException(exp); } @@ -416,6 +418,12 @@ public abstract class AbstractHeapGraphWriter implements HeapGraphWriter { protected void writeHeapFooter() throws IOException { } + protected void writeHeapRecordPrologue() throws IOException { + } + + protected void writeHeapRecordEpilogue() throws IOException { + } + // HeapVisitor, OopVisitor methods can't throw any non-runtime // exception. But, derived class write methods (which are called // from visitor callbacks) may throw IOException. Hence, we throw diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java index 65299721f17..6f66723db99 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java @@ -44,7 +44,7 @@ import sun.jvm.hotspot.runtime.*; * WARNING: This format is still under development, and is subject to * change without notice. * - * header "JAVA PROFILE 1.0.1" (0-terminated) + * header "JAVA PROFILE 1.0.1" or "JAVA PROFILE 1.0.2" (0-terminated) * u4 size of identifiers. Identifiers are used to represent * UTF8 strings, objects, stack traces, etc. They usually * have the same size as host pointers. For example, on @@ -292,11 +292,34 @@ import sun.jvm.hotspot.runtime.*; * 0x00000002: cpu sampling on/off * u2 stack trace depth * + * + * When the header is "JAVA PROFILE 1.0.2" a heap dump can optionally + * be generated as a sequence of heap dump segments. This sequence is + * terminated by an end record. The additional tags allowed by format + * "JAVA PROFILE 1.0.2" are: + * + * HPROF_HEAP_DUMP_SEGMENT denote a heap dump segment + * + * [heap dump sub-records]* + * The same sub-record types allowed by HPROF_HEAP_DUMP + * + * HPROF_HEAP_DUMP_END denotes the end of a heap dump + * */ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { + + // The heap size threshold used to determine if segmented format + // ("JAVA PROFILE 1.0.2") should be used. + private static final long HPROF_SEGMENTED_HEAP_DUMP_THRESHOLD = 2L * 0x40000000; + + // The approximate size of a heap segment. Used to calculate when to create + // a new segment. + private static final long HPROF_SEGMENTED_HEAP_DUMP_SEGMENT_SIZE = 1L * 0x40000000; + // hprof binary file header - private static final String HPROF_HEADER = "JAVA PROFILE 1.0.1"; + private static final String HPROF_HEADER_1_0_1 = "JAVA PROFILE 1.0.1"; + private static final String HPROF_HEADER_1_0_2 = "JAVA PROFILE 1.0.2"; // constants in enum HprofTag private static final int HPROF_UTF8 = 0x01; @@ -312,6 +335,10 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { private static final int HPROF_CPU_SAMPLES = 0x0D; private static final int HPROF_CONTROL_SETTINGS = 0x0E; + // 1.0.2 record types + private static final int HPROF_HEAP_DUMP_SEGMENT = 0x1C; + private static final int HPROF_HEAP_DUMP_END = 0x2C; + // Heap dump constants // constants in enum HprofGcTag private static final int HPROF_GC_ROOT_UNKNOWN = 0xFF; @@ -352,11 +379,9 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { private static final int JVM_SIGNATURE_ARRAY = '['; private static final int JVM_SIGNATURE_CLASS = 'L'; - public synchronized void write(String fileName) throws IOException { // open file stream and create buffered data output stream - FileOutputStream fos = new FileOutputStream(fileName); - FileChannel chn = fos.getChannel(); + fos = new FileOutputStream(fileName); out = new DataOutputStream(new BufferedOutputStream(fos)); VM vm = VM.getVM(); @@ -385,6 +410,9 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { FLOAT_SIZE = objectHeap.getFloatSize(); DOUBLE_SIZE = objectHeap.getDoubleSize(); + // Check weather we should dump the heap as segments + useSegmentedHeapDump = vm.getUniverse().heap().used() > HPROF_SEGMENTED_HEAP_DUMP_THRESHOLD; + // hprof bin format header writeFileHeader(); @@ -394,38 +422,87 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { // hprof UTF-8 symbols section writeSymbols(); + // HPROF_LOAD_CLASS records for all classes writeClasses(); - // write heap data now - out.writeByte((byte)HPROF_HEAP_DUMP); - out.writeInt(0); // relative timestamp - - // remember position of dump length, we will fixup - // length later - hprof format requires length. - out.flush(); - long dumpStart = chn.position(); - - // write dummy length of 0 and we'll fix it later. - out.writeInt(0); - // write CLASS_DUMP records writeClassDumpRecords(); // this will write heap data into the buffer stream super.write(); + // flush buffer stream. + out.flush(); + + // Fill in final length + fillInHeapRecordLength(); + + if (useSegmentedHeapDump) { + // Write heap segment-end record + out.writeByte((byte) HPROF_HEAP_DUMP_END); + out.writeInt(0); + out.writeInt(0); + } + // flush buffer stream and throw it. out.flush(); out = null; + // close the file stream + fos.close(); + } + + @Override + protected void writeHeapRecordPrologue() throws IOException { + if (currentSegmentStart == 0) { + // write heap data header, depending on heap size use segmented heap + // format + out.writeByte((byte) (useSegmentedHeapDump ? HPROF_HEAP_DUMP_SEGMENT + : HPROF_HEAP_DUMP)); + out.writeInt(0); + + // remember position of dump length, we will fixup + // length later - hprof format requires length. + out.flush(); + currentSegmentStart = fos.getChannel().position(); + + // write dummy length of 0 and we'll fix it later. + out.writeInt(0); + } + } + + @Override + protected void writeHeapRecordEpilogue() throws IOException { + if (useSegmentedHeapDump) { + out.flush(); + if ((fos.getChannel().position() - currentSegmentStart - 4) >= HPROF_SEGMENTED_HEAP_DUMP_SEGMENT_SIZE) { + fillInHeapRecordLength(); + currentSegmentStart = 0; + } + } + } + + private void fillInHeapRecordLength() throws IOException { + // now get current position to calculate length - long dumpEnd = chn.position(); + long dumpEnd = fos.getChannel().position(); + // calculate length of heap data - int dumpLen = (int) (dumpEnd - dumpStart - 4); + long dumpLenLong = (dumpEnd - currentSegmentStart - 4L); + + // Check length boundary, overflow could happen but is _very_ unlikely + if(dumpLenLong >= (4L * 0x40000000)){ + throw new RuntimeException("Heap segment size overflow."); + } + + // Save the current position + long currentPosition = fos.getChannel().position(); // seek the position to write length - chn.position(dumpStart); + fos.getChannel().position(currentSegmentStart); + + int dumpLen = (int) dumpLenLong; // write length as integer fos.write((dumpLen >>> 24) & 0xFF); @@ -433,8 +510,8 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { fos.write((dumpLen >>> 8) & 0xFF); fos.write((dumpLen >>> 0) & 0xFF); - // close the file stream - fos.close(); + //Reset to previous current position + fos.getChannel().position(currentPosition); } private void writeClassDumpRecords() throws IOException { @@ -443,7 +520,9 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { sysDict.allClassesDo(new SystemDictionary.ClassVisitor() { public void visit(Klass k) { try { + writeHeapRecordPrologue(); writeClassDumpRecord(k); + writeHeapRecordEpilogue(); } catch (IOException e) { throw new RuntimeException(e); } @@ -884,7 +963,12 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { // writes hprof binary file header private void writeFileHeader() throws IOException { // version string - out.writeBytes(HPROF_HEADER); + if(useSegmentedHeapDump) { + out.writeBytes(HPROF_HEADER_1_0_2); + } + else { + out.writeBytes(HPROF_HEADER_1_0_1); + } out.writeByte((byte)'\0'); // write identifier size. we use pointers as identifiers. @@ -976,6 +1060,7 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { private static final int EMPTY_FRAME_DEPTH = -1; private DataOutputStream out; + private FileOutputStream fos; private Debugger dbg; private ObjectHeap objectHeap; private SymbolTable symTbl; @@ -983,6 +1068,10 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { // oopSize of the debuggee private int OBJ_ID_SIZE; + // Added for hprof file format 1.0.2 support + private boolean useSegmentedHeapDump; + private long currentSegmentStart; + private long BOOLEAN_BASE_OFFSET; private long BYTE_BASE_OFFSET; private long CHAR_BASE_OFFSET; @@ -1005,6 +1094,7 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { private static class ClassData { int instSize; List fields; + ClassData(int instSize, List fields) { this.instSize = instSize; this.fields = fields; diff --git a/hotspot/make/Makefile b/hotspot/make/Makefile index 2975088cb49..581a5daae12 100644 --- a/hotspot/make/Makefile +++ b/hotspot/make/Makefile @@ -334,6 +334,11 @@ $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C2_BUILD_DIR)/%.diz $(install-file) $(EXPORT_SERVER_DIR)/64/%.diz: $(C2_BUILD_DIR)/%.diz $(install-file) +# MacOS X +$(EXPORT_JRE_LIB_ARCH_DIR)/%.dSYM: $(C2_BUILD_DIR)/%.dSYM + $(install-dir) +$(EXPORT_SERVER_DIR)/%.dSYM: $(C2_BUILD_DIR)/%.dSYM + $(install-dir) endif # Client (C1) @@ -379,6 +384,11 @@ $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C1_BUILD_DIR)/%.diz $(install-file) $(EXPORT_CLIENT_DIR)/64/%.diz: $(C1_BUILD_DIR)/%.diz $(install-file) +# MacOS X +$(EXPORT_JRE_LIB_ARCH_DIR)/%.dSYM: $(C1_BUILD_DIR)/%.dSYM + $(install-dir) +$(EXPORT_CLIENT_DIR)/%.dSYM: $(C1_BUILD_DIR)/%.dSYM + $(install-dir) endif # Minimal1 @@ -424,6 +434,7 @@ $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz $(install-file) $(EXPORT_MINIMAL_DIR)/64/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz $(install-file) +# MacOS X does not support Minimal1 config endif # Zero @@ -446,6 +457,11 @@ $(EXPORT_SERVER_DIR)/%.debuginfo: $(ZERO_BUILD_DIR)/%.debuginfo $(install-file) $(EXPORT_SERVER_DIR)/%.diz: $(ZERO_BUILD_DIR)/%.diz $(install-file) +# MacOS X +$(EXPORT_JRE_LIB_ARCH_DIR)/%.dSYM: $(ZERO_BUILD_DIR)/%.dSYM + $(install-dir) +$(EXPORT_SERVER_DIR)/%.dSYM: $(ZERO_BUILD_DIR)/%.dSYM + $(install-dir) endif # Shark @@ -468,6 +484,11 @@ $(EXPORT_SERVER_DIR)/%.debuginfo: $(SHARK_BUILD_DIR)/%.debuginfo $(install-file) $(EXPORT_SERVER_DIR)/%.diz: $(SHARK_BUILD_DIR)/%.diz $(install-file) +# MacOS X +$(EXPORT_JRE_LIB_ARCH_DIR)/%.dSYM: $(SHARK_BUILD_DIR)/%.dSYM + $(install-dir) +$(EXPORT_SERVER_DIR)/%.dSYM: $(SHARK_BUILD_DIR)/%.dSYM + $(install-dir) endif $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/code/% diff --git a/hotspot/make/bsd/Makefile b/hotspot/make/bsd/Makefile index d9058c24e25..2bec290e306 100644 --- a/hotspot/make/bsd/Makefile +++ b/hotspot/make/bsd/Makefile @@ -204,6 +204,7 @@ TARGETS_MINIMAL1 = $(addsuffix minimal1,$(TARGETS)) BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) LIBRARY_SUFFIX=$(LIBRARY_SUFFIX) BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) +BUILDTREE_VARS += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS) OBJCOPY=$(OBJCOPY) STRIP_POLICY=$(STRIP_POLICY) ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES) ZIPEXE=$(ZIPEXE) BUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS) @@ -337,9 +338,11 @@ treeminimal1: $(SUBDIRS_MINIMAL1) # Doc target. This is the same for all build options. # Hence create a docs directory beside ...$(ARCH)_[...] +# We specify 'BUILD_FLAVOR=product' so that the proper +# ENABLE_FULL_DEBUG_SYMBOLS value is used. docs: checks $(QUIETLY) mkdir -p $(SUBDIR_DOCS) - $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs + $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) BUILD_FLAVOR=product jvmtidocs # Synonyms for win32-like targets. compiler2: debug product diff --git a/hotspot/make/bsd/makefiles/buildtree.make b/hotspot/make/bsd/makefiles/buildtree.make index ca9d19e0d23..88b141e94c5 100644 --- a/hotspot/make/bsd/makefiles/buildtree.make +++ b/hotspot/make/bsd/makefiles/buildtree.make @@ -261,6 +261,16 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst echo "$(call gamma-path,commonsrc,os/posix/vm)"; \ [ -n "$(CFLAGS_BROWSE)" ] && \ echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \ + [ -n "$(ENABLE_FULL_DEBUG_SYMBOLS)" ] && \ + echo && echo "ENABLE_FULL_DEBUG_SYMBOLS = $(ENABLE_FULL_DEBUG_SYMBOLS)"; \ + [ -n "$(OBJCOPY)" ] && \ + echo && echo "OBJCOPY = $(OBJCOPY)"; \ + [ -n "$(STRIP_POLICY)" ] && \ + echo && echo "STRIP_POLICY = $(STRIP_POLICY)"; \ + [ -n "$(ZIP_DEBUGINFO_FILES)" ] && \ + echo && echo "ZIP_DEBUGINFO_FILES = $(ZIP_DEBUGINFO_FILES)"; \ + [ -n "$(ZIPEXE)" ] && \ + echo && echo "ZIPEXE = $(ZIPEXE)"; \ [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \ echo && \ echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \ diff --git a/hotspot/make/bsd/makefiles/defs.make b/hotspot/make/bsd/makefiles/defs.make index 14d3d4aa2ca..7cd21cc1753 100644 --- a/hotspot/make/bsd/makefiles/defs.make +++ b/hotspot/make/bsd/makefiles/defs.make @@ -136,10 +136,127 @@ ifeq ($(JVM_VARIANTS),) endif endif +OS_VENDOR:=$(shell uname -s) + +# determine if HotSpot is being built in JDK6 or earlier version +JDK6_OR_EARLIER=0 +ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1" + # if the longer variable names (newer build style) are set, then check those + ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1" + JDK6_OR_EARLIER=1 + endif +else + # the longer variables aren't set so check the shorter variable names + ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1" + JDK6_OR_EARLIER=1 + endif +endif + +ifeq ($(JDK6_OR_EARLIER),0) + # Full Debug Symbols is supported on JDK7 or newer. + # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product + # builds is enabled with debug info files ZIP'ed to save space. For + # BUILD_FLAVOR != product builds, FDS is always enabled, after all a + # debug build without debug info isn't very useful. + # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled. + # + # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be + # disabled for a BUILD_FLAVOR == product build. + # + # Note: Use of a different variable name for the FDS override option + # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS + # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass + # in options via environment variables, use of distinct variables + # prevents strange behaviours. For example, in a BUILD_FLAVOR != + # product build, the FULL_DEBUG_SYMBOLS environment variable will be + # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If + # the same variable name is used, then different values can be picked + # up by different parts of the build. Just to be clear, we only need + # two variable names because the incoming option value can be + # overridden in some situations, e.g., a BUILD_FLAVOR != product + # build. + + # Due to the multiple sub-make processes that occur this logic gets + # executed multiple times. We reduce the noise by at least checking that + # BUILD_FLAVOR has been set. + ifneq ($(BUILD_FLAVOR),) + ifeq ($(BUILD_FLAVOR), product) + FULL_DEBUG_SYMBOLS ?= 1 + ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS) + else + # debug variants always get Full Debug Symbols (if available) + ENABLE_FULL_DEBUG_SYMBOLS = 1 + endif + _JUNK_ := $(shell \ + echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") + # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(OS_VENDOR), Darwin) + # MacOS X doesn't use OBJCOPY or STRIP_POLICY + OBJCOPY= + STRIP_POLICY= + ZIP_DEBUGINFO_FILES ?= 1 + else + # Default OBJCOPY comes from GNU Binutils on BSD + ifeq ($(CROSS_COMPILE_ARCH),) + DEF_OBJCOPY=/usr/bin/objcopy + else + # Assume objcopy is part of the cross-compilation toolset + ifneq ($(ALT_COMPILER_PATH),) + DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy + endif + endif + OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) + ifneq ($(ALT_OBJCOPY),) + _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") + OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) + endif + + ifeq ($(OBJCOPY),) + _JUNK_ := $(shell \ + echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo" \ + "files. You may need to set ALT_OBJCOPY.") + ENABLE_FULL_DEBUG_SYMBOLS=0 + _JUNK_ := $(shell \ + echo >&2 "INFO:" \ + "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") + else + _JUNK_ := $(shell \ + echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo" \ + "files.") + + # Library stripping policies for .debuginfo configs: + # all_strip - strips everything from the library + # min_strip - strips most stuff from the library; leaves + # minimum symbols + # no_strip - does not strip the library at all + # + # Oracle security policy requires "all_strip". A waiver was + # granted on 2011.09.01 that permits using "min_strip" in the + # Java JDK and Java JRE. + # + # Currently, STRIP_POLICY is only used when Full Debug Symbols + # is enabled. + # + STRIP_POLICY ?= min_strip + + _JUNK_ := $(shell \ + echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)") + + ZIP_DEBUGINFO_FILES ?= 1 + endif + + _JUNK_ := $(shell \ + echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)") + endif + endif # ENABLE_FULL_DEBUG_SYMBOLS=1 + endif # BUILD_FLAVOR +endif # JDK_6_OR_EARLIER + JDK_INCLUDE_SUBDIR=bsd # Library suffix -OS_VENDOR:=$(shell uname -s) ifeq ($(OS_VENDOR),Darwin) LIBRARY_SUFFIX=dylib else @@ -150,6 +267,19 @@ EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html # client and server subdirectories have symbolic links to ../libjsig.so EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) + +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz + else + ifeq ($(OS_VENDOR), Darwin) + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX).dSYM + else + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo + endif + endif +endif + EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal @@ -157,34 +287,76 @@ EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true) EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX) + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz + else + ifeq ($(OS_VENDOR), Darwin) + EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX).dSYM + else + EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo + endif + endif + endif endif ifeq ($(JVM_VARIANT_CLIENT),true) EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX) + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz + else + ifeq ($(OS_VENDOR), Darwin) + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX).dSYM + else + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo + endif + endif + endif endif ifeq ($(JVM_VARIANT_MINIMAL1),true) EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX) - - ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) - ifeq ($(ZIP_DEBUGINFO_FILES),1) - EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.diz - else - EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.debuginfo - endif - endif endif # Serviceability Binaries # No SA Support for PPC, IA64, ARM or zero ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ $(EXPORT_LIB_DIR)/sa-jdi.jar + +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz + else + ifeq ($(OS_VENDOR), Darwin) + ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM + else + ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo + endif + endif +endif + ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ $(EXPORT_LIB_DIR)/sa-jdi.jar ADD_SA_BINARIES/universal = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ $(EXPORT_LIB_DIR)/sa-jdi.jar + +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz + else + ifeq ($(OS_VENDOR), Darwin) + ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM + else + ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo + endif + endif +endif + ADD_SA_BINARIES/ppc = ADD_SA_BINARIES/ia64 = ADD_SA_BINARIES/arm = @@ -225,6 +397,19 @@ ifeq ($(OS_VENDOR), Darwin) # Files to simply copy in place UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/Xusage.txt UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/Xusage.txt + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/libjvm.diz + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/libjvm.diz + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libjsig.diz + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libsaproc.diz + else + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/libjvm.$(LIBRARY_SUFFIX).dSYM + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/libjvm.$(LIBRARY_SUFFIX).dSYM + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libjsig.$(LIBRARY_SUFFIX).dSYM + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM + endif + endif endif endif diff --git a/hotspot/make/bsd/makefiles/dtrace.make b/hotspot/make/bsd/makefiles/dtrace.make index 1c53841b56c..9374062d115 100644 --- a/hotspot/make/bsd/makefiles/dtrace.make +++ b/hotspot/make/bsd/makefiles/dtrace.make @@ -39,9 +39,15 @@ DtraceOutDir = $(GENERATED)/dtracefiles JVM_DB = libjvm_db LIBJVM_DB = libjvm_db.dylib +LIBJVM_DB_DEBUGINFO = libjvm_db.dylib.dSYM +LIBJVM_DB_DIZ = libjvm_db.diz + JVM_DTRACE = jvm_dtrace LIBJVM_DTRACE = libjvm_dtrace.dylib +LIBJVM_DTRACE_DEBUGINFO = libjvm_dtrace.dylib.dSYM +LIBJVM_DTRACE_DIZ = libjvm_dtrace.diz + JVMOFFS = JvmOffsets JVMOFFS.o = $(JVMOFFS).o GENOFFS = generate$(JVMOFFS) @@ -76,21 +82,87 @@ ISA = $(subst i386,i486,$(BUILDARCH)) # Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so ifneq ("${ISA}","${BUILDARCH}") -XLIBJVM_DB = 64/$(LIBJVM_DB) -XLIBJVM_DTRACE = 64/$(LIBJVM_DTRACE) +XLIBJVM_DIR = 64 +XLIBJVM_DB = $(XLIBJVM_DIR)/$(LIBJVM_DB) +XLIBJVM_DTRACE = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE) XARCH = $(subst sparcv9,v9,$(shell echo $(ISA))) +XLIBJVM_DB_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DB_DEBUGINFO) +XLIBJVM_DB_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DB_DIZ) +XLIBJVM_DTRACE_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DEBUGINFO) +XLIBJVM_DTRACE_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DIZ) + $(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE) @echo Making $@ - $(QUIETLY) mkdir -p 64/ ; \ + $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \ $(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. -I$(GENERATED) \ $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c #-lc +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(OS_VENDOR), Darwin) + $(DSYMUTIL) $@ + 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 -r -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) ) + $(RM) -r $(XLIBJVM_DB_DEBUGINFO) + endif + else + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO) + # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) + # is not in the link name: + $(QUIETLY) ( cd $(XLIBJVM_DIR) && $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) ) + ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else + ifeq ($(STRIP_POLICY),min_strip) + $(QUIETLY) $(STRIP) -x $@ + # implied else here is no stripping at all + endif + endif + 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) ) + $(RM) $(XLIBJVM_DB_DEBUGINFO) + endif + endif +endif $(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) @echo Making $@ - $(QUIETLY) mkdir -p 64/ ; \ + $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \ $(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. \ $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c #-lc -lthread -ldoor +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(OS_VENDOR), Darwin) + $(DSYMUTIL) $@ + 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 -r -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) ) + $(RM) -r $(XLIBJVM_DTRACE_DEBUGINFO) + endif + else + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO) + # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) + # is not in the link name: + ( cd $(XLIBJVM_DIR) && $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) ) + ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else + ifeq ($(STRIP_POLICY),min_strip) + $(QUIETLY) $(STRIP) -x $@ + # implied else here is no stripping at all + endif + endif + 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) ) + $(RM) $(XLIBJVM_DTRACE_DEBUGINFO) + endif + endif +endif endif # ifneq ("${ISA}","${BUILDARCH}") @@ -134,11 +206,59 @@ $(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_D @echo Making $@ $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \ $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -Wall # -lc +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(OS_VENDOR), Darwin) + $(DSYMUTIL) $@ + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -r -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) + $(RM) -r $(LIBJVM_DB_DEBUGINFO) + endif + else + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@ + ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else + ifeq ($(STRIP_POLICY),min_strip) + $(QUIETLY) $(STRIP) -x $@ + # implied else here is no stripping at all + endif + endif + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) + $(RM) $(LIBJVM_DB_DEBUGINFO) + endif + endif +endif $(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 +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(OS_VENDOR), Darwin) + $(DSYMUTIL) $@ + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -r -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) + $(RM) -r $(LIBJVM_DTRACE_DEBUGINFO) + endif + else + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@ + ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else + ifeq ($(STRIP_POLICY),min_strip) + $(QUIETLY) $(STRIP) -x $@ + # implied else here is no stripping at all + endif + endif + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) + $(RM) $(LIBJVM_DTRACE_DEBUGINFO) + endif + endif +endif #$(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \ # $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d diff --git a/hotspot/make/bsd/makefiles/fastdebug.make b/hotspot/make/bsd/makefiles/fastdebug.make index f2f5dcfb8f2..d1019f07d3f 100644 --- a/hotspot/make/bsd/makefiles/fastdebug.make +++ b/hotspot/make/bsd/makefiles/fastdebug.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -59,5 +59,5 @@ CFLAGS$(HOTSPARC_GENERIC) += $(OPT_CFLAGS/BYFILE) MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug VERSION = fastdebug -SYSDEFS += -DASSERT +SYSDEFS += -DASSERT -DCHECK_UNHANDLED_OOPS PICFLAGS = DEFAULT diff --git a/hotspot/make/bsd/makefiles/gcc.make b/hotspot/make/bsd/makefiles/gcc.make index 0277bb66aa3..840148e6321 100644 --- a/hotspot/make/bsd/makefiles/gcc.make +++ b/hotspot/make/bsd/makefiles/gcc.make @@ -83,6 +83,11 @@ ifeq ($(SPEC),) AS = $(CC) -c endif +ifeq ($(OS_VENDOR), Darwin) + ifeq ($(DSYMUTIL),) + DSYMUTIL=dsymutil + endif +endif ifeq ($(USE_CLANG), true) CC_VER_MAJOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f1) @@ -247,7 +252,7 @@ endif ifeq ($(USE_CLANG), true) # However we need to clean the code up before we can unrestrictedly enable this option with Clang - WARNINGS_ARE_ERRORS += -Wno-unused-value -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses + WARNINGS_ARE_ERRORS += -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-compare # Not yet supported by clang in Xcode 4.6.2 # WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare @@ -262,7 +267,7 @@ ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& # conversions which might affect the values. Only enable it in earlier versions. WARNING_FLAGS = -Wunused-function ifeq ($(USE_CLANG),) - WARNINGS_FLAGS += -Wconversion + WARNING_FLAGS += -Wconversion endif endif @@ -434,6 +439,36 @@ else ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),) DEBUG_CFLAGS += -gstabs endif + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + FASTDEBUG_CFLAGS/ia64 = -g + FASTDEBUG_CFLAGS/amd64 = -g + FASTDEBUG_CFLAGS/arm = -g + FASTDEBUG_CFLAGS/ppc = -g + FASTDEBUG_CFLAGS += $(FASTDEBUG_CFLAGS/$(BUILDARCH)) + ifeq ($(FASTDEBUG_CFLAGS/$(BUILDARCH)),) + ifeq ($(USE_CLANG), true) + # Clang doesn't understand -gstabs + FASTDEBUG_CFLAGS += -g + else + FASTDEBUG_CFLAGS += -gstabs + endif + endif + + OPT_CFLAGS/ia64 = -g + OPT_CFLAGS/amd64 = -g + OPT_CFLAGS/arm = -g + OPT_CFLAGS/ppc = -g + OPT_CFLAGS += $(OPT_CFLAGS/$(BUILDARCH)) + ifeq ($(OPT_CFLAGS/$(BUILDARCH)),) + ifeq ($(USE_CLANG), true) + # Clang doesn't understand -gstabs + OPT_CFLAGS += -g + else + OPT_CFLAGS += -gstabs + endif + endif + endif endif # If we are building HEADLESS, pass on to VM diff --git a/hotspot/make/bsd/makefiles/jsig.make b/hotspot/make/bsd/makefiles/jsig.make index 481ff72f0b5..b4802fb5069 100644 --- a/hotspot/make/bsd/makefiles/jsig.make +++ b/hotspot/make/bsd/makefiles/jsig.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -29,13 +29,21 @@ JSIG = jsig ifeq ($(OS_VENDOR), Darwin) LIBJSIG = lib$(JSIG).dylib + + LIBJSIG_DEBUGINFO = lib$(JSIG).dylib.dSYM + LIBJSIG_DIZ = lib$(JSIG).diz else LIBJSIG = lib$(JSIG).so + + LIBJSIG_DEBUGINFO = lib$(JSIG).debuginfo + LIBJSIG_DIZ = lib$(JSIG).diz endif JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm -DEST_JSIG = $(JDK_LIBDIR)/$(LIBJSIG) +DEST_JSIG = $(JDK_LIBDIR)/$(LIBJSIG) +DEST_JSIG_DEBUGINFO = $(JDK_LIBDIR)/$(LIBJSIG_DEBUGINFO) +DEST_JSIG_DIZ = $(JDK_LIBDIR)/$(LIBJSIG_DIZ) LIBJSIG_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jsig @@ -55,9 +63,42 @@ $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE) @echo Making signal interposition lib... $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $< +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(OS_VENDOR), Darwin) + $(DSYMUTIL) $@ + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -r -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO) + $(RM) -r $(LIBJSIG_DEBUGINFO) + endif + else + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@ + ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else + ifeq ($(STRIP_POLICY),min_strip) + $(QUIETLY) $(STRIP) -g $@ + # implied else here is no stripping at all + endif + endif + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO) + $(RM) $(LIBJSIG_DEBUGINFO) + endif + endif +endif install_jsig: $(LIBJSIG) @echo "Copying $(LIBJSIG) to $(DEST_JSIG)" +ifeq ($(OS_VENDOR), Darwin) + $(QUIETLY) test -d $(LIBJSIG_DEBUGINFO) && \ + cp -f -r $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO) +else + $(QUIETLY) test -f $(LIBJSIG_DEBUGINFO) && \ + cp -f $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO) +endif + $(QUIETLY) test -f $(LIBJSIG_DIZ) && \ + cp -f $(LIBJSIG_DIZ) $(DEST_JSIG_DIZ) $(QUIETLY) cp -f $(LIBJSIG) $(DEST_JSIG) && echo "Done" .PHONY: install_jsig diff --git a/hotspot/make/bsd/makefiles/product.make b/hotspot/make/bsd/makefiles/product.make index 0d6fb0e86d0..55515469311 100644 --- a/hotspot/make/bsd/makefiles/product.make +++ b/hotspot/make/bsd/makefiles/product.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -43,15 +43,17 @@ MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-product SYSDEFS += -DPRODUCT VERSION = optimized -# use -g to strip library as -x will discard its symbol table; -x is fine for -# executables. -ifdef CROSS_COMPILE_ARCH - STRIP = $(ALT_COMPILER_PATH)/strip -else - STRIP = strip -endif -STRIP_LIBJVM = $(STRIP) -g $@ || exit 1; -STRIP_AOUT = $(STRIP) -x $@ || exit 1; +ifneq ($(OS_VENDOR), Darwin) + # use -g to strip library as -x will discard its symbol table; -x is fine for + # executables. + ifdef CROSS_COMPILE_ARCH + STRIP = $(ALT_COMPILER_PATH)/strip + else + STRIP = strip + endif + STRIP_LIBJVM = $(STRIP) -g $@ || exit 1; + STRIP_AOUT = $(STRIP) -x $@ || exit 1; -# Don't strip in VM build; JDK build will strip libraries later -# LINK_LIB.CXX/POST_HOOK += $(STRIP_$(LINK_INTO)) + # Don't strip in VM build; JDK build will strip libraries later + # LINK_LIB.CXX/POST_HOOK += $(STRIP_$(LINK_INTO)) +endif diff --git a/hotspot/make/bsd/makefiles/saproc.make b/hotspot/make/bsd/makefiles/saproc.make index 62e31a63dc0..8cb38dbca47 100644 --- a/hotspot/make/bsd/makefiles/saproc.make +++ b/hotspot/make/bsd/makefiles/saproc.make @@ -28,9 +28,15 @@ SAPROC = saproc ifeq ($(OS_VENDOR), Darwin) - LIBSAPROC = lib$(SAPROC).dylib + LIBSAPROC = lib$(SAPROC).dylib + + LIBSAPROC_DEBUGINFO = lib$(SAPROC).dylib.dSYM + LIBSAPROC_DIZ = lib$(SAPROC).diz else - LIBSAPROC = lib$(SAPROC).so + LIBSAPROC = lib$(SAPROC).so + + LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo + LIBSAPROC_DIZ = lib$(SAPROC).diz endif AGENT_DIR = $(GAMMADIR)/agent @@ -70,7 +76,9 @@ endif SAMAPFILE = $(SASRCDIR)/mapfile -DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC) +DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC) +DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO) +DEST_SAPROC_DIZ = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ) # DEBUG_BINARIES overrides everything, use full -g debug information ifeq ($(DEBUG_BINARIES), true) @@ -117,11 +125,42 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) $(SA_DEBUG_CFLAGS) \ -o $@ \ $(SALIBS) +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(OS_VENDOR), Darwin) + $(DSYMUTIL) $@ + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -r -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) + $(RM) -r $(LIBSAPROC_DEBUGINFO) + endif + else + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@ + ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else + ifeq ($(STRIP_POLICY),min_strip) + $(QUIETLY) $(STRIP) -g $@ + # implied else here is no stripping at all + endif + endif + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) + $(RM) $(LIBSAPROC_DEBUGINFO) + endif + endif +endif install_saproc: $(BUILDLIBSAPROC) - $(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \ - echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \ - cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \ - fi + @echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)" +ifeq ($(OS_VENDOR), Darwin) + $(QUIETLY) test -d $(LIBSAPROC_DEBUGINFO) && \ + cp -f -r $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO) +else + $(QUIETLY) test -f $(LIBSAPROC_DEBUGINFO) && \ + cp -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO) +endif + $(QUIETLY) test -f $(LIBSAPROC_DIZ) && \ + cp -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ) + $(QUIETLY) cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done" .PHONY: install_saproc diff --git a/hotspot/make/bsd/makefiles/universal.gmk b/hotspot/make/bsd/makefiles/universal.gmk index 0cc92758af9..d1136a86806 100644 --- a/hotspot/make/bsd/makefiles/universal.gmk +++ b/hotspot/make/bsd/makefiles/universal.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -19,7 +19,7 @@ # 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. -# +# # # macosx universal builds @@ -35,15 +35,15 @@ universal_debug: all_product_universal: # $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_PRODUCT_TARGETS) $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_PRODUCT_TARGETS) - $(QUIETLY) $(MAKE) EXPORT_SUBDIR= universalize + $(QUIETLY) $(MAKE) BUILD_FLAVOR=product EXPORT_SUBDIR= universalize all_fastdebug_universal: # $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_FASTDEBUG_TARGETS) $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_FASTDEBUG_TARGETS) - $(QUIETLY) $(MAKE) EXPORT_SUBDIR=/fastdebug universalize + $(QUIETLY) $(MAKE) BUILD_FLAVOR=fastdebug EXPORT_SUBDIR=/fastdebug universalize all_debug_universal: # $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_DEBUG_TARGETS) $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_DEBUG_TARGETS) - $(QUIETLY) $(MAKE) EXPORT_SUBDIR=/debug universalize + $(QUIETLY) $(MAKE) BUILD_FLAVOR=debug EXPORT_SUBDIR=/debug universalize # Consolidate architecture builds into a single Universal binary @@ -57,18 +57,18 @@ $(UNIVERSAL_LIPO_LIST): if [ -n "$${BUILT_LIPO_FILES}" ]; then \ $(MKDIR) -p $(shell dirname $@); \ lipo -create -output $@ $${BUILT_LIPO_FILES}; \ - fi + fi # Copy built non-universal binaries in place +# - copies directories; including empty dirs +# - copies files, symlinks, other non-directory files $(UNIVERSAL_COPY_LIST): - BUILT_COPY_FILES="`find $(EXPORT_JRE_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@) 2>/dev/null`"; \ + BUILT_COPY_FILES="`find $(EXPORT_JRE_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@) -prune 2>/dev/null`"; \ if [ -n "$${BUILT_COPY_FILES}" ]; then \ for i in $${BUILT_COPY_FILES}; do \ - if [ -f $${i} ]; then \ - $(MKDIR) -p $(shell dirname $@); \ - $(CP) $${i} $@; \ - fi; \ + $(MKDIR) -p $(shell dirname $@); \ + $(CP) -R $${i} $@; \ done; \ fi diff --git a/hotspot/make/bsd/makefiles/vm.make b/hotspot/make/bsd/makefiles/vm.make index ba2eb0756a3..3e8ea764066 100644 --- a/hotspot/make/bsd/makefiles/vm.make +++ b/hotspot/make/bsd/makefiles/vm.make @@ -60,10 +60,16 @@ Src_Dirs_I += $(GENERATED) # The order is important for the precompiled headers to work. INCLUDES += $(PRECOMPILED_HEADER_DIR:%=-I%) $(Src_Dirs_I:%=-I%) -ifeq (${VERSION}, debug) +# SYMFLAG is used by {jsig,saproc}.make +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + # always build with debug info when we can create .dSYM/.debuginfo files SYMFLAG = -g else - SYMFLAG = + ifeq (${VERSION}, debug) + SYMFLAG = -g + else + SYMFLAG = + endif endif # HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined @@ -147,8 +153,14 @@ ifeq ($(OS_VENDOR), Darwin) ifeq (${VERSION}, $(filter ${VERSION}, debug fastdebug)) CFLAGS += -DALLOW_OPERATOR_NEW_USAGE endif + + LIBJVM_DEBUGINFO = lib$(JVM).dylib.dSYM + LIBJVM_DIZ = lib$(JVM).diz else LIBJVM = lib$(JVM).so + + LIBJVM_DEBUGINFO = lib$(JVM).debuginfo + LIBJVM_DIZ = lib$(JVM).diz endif SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt @@ -322,10 +334,47 @@ $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT) rm -f $@.1; ln -s $@ $@.1; \ } -DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM) +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(OS_VENDOR), Darwin) + $(DSYMUTIL) $@ + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -r -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO) + $(RM) -r $(LIBJVM_DEBUGINFO) + endif + else + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@ + ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else + ifeq ($(STRIP_POLICY),min_strip) + $(QUIETLY) $(STRIP) -g $@ + # implied else here is no stripping at all + endif + endif + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO) + $(RM) $(LIBJVM_DEBUGINFO) + endif + endif +endif + +DEST_SUBDIR = $(JDK_LIBDIR)/$(VM_SUBDIR) +DEST_JVM = $(DEST_SUBDIR)/$(LIBJVM) +DEST_JVM_DEBUGINFO = $(DEST_SUBDIR)/$(LIBJVM_DEBUGINFO) +DEST_JVM_DIZ = $(DEST_SUBDIR)/$(LIBJVM_DIZ) install_jvm: $(LIBJVM) @echo "Copying $(LIBJVM) to $(DEST_JVM)" +ifeq ($(OS_VENDOR), Darwin) + $(QUIETLY) test -d $(LIBJVM_DEBUGINFO) && \ + cp -f -r $(LIBJVM_DEBUGINFO) $(DEST_JVM_DEBUGINFO) +else + $(QUIETLY) test -f $(LIBJVM_DEBUGINFO) && \ + cp -f $(LIBJVM_DEBUGINFO) $(DEST_JVM_DEBUGINFO) +endif + $(QUIETLY) test -f $(LIBJVM_DIZ) && \ + cp -f $(LIBJVM_DIZ) $(DEST_JVM_DIZ) $(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done" #---------------------------------------------------------------------- @@ -340,11 +389,8 @@ include $(MAKEFILES_DIR)/saproc.make #---------------------------------------------------------------------- ifeq ($(OS_VENDOR), Darwin) -$(LIBJVM).dSYM: $(LIBJVM) - dsymutil $(LIBJVM) - # no libjvm_db for macosx -build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(BUILDLIBSAPROC) dtraceCheck $(LIBJVM).dSYM +build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(BUILDLIBSAPROC) dtraceCheck echo "Doing vm.make build:" else build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) diff --git a/hotspot/make/defs.make b/hotspot/make/defs.make index 5ebf167e290..ede0425bcb6 100644 --- a/hotspot/make/defs.make +++ b/hotspot/make/defs.make @@ -77,6 +77,16 @@ define install-file @$(RM) $@ $(CP) $< $@ endef + +# MacOS X strongly discourages 'cp -r' and provides 'cp -R' instead. +# May need to have a MacOS X specific definition of install-dir +# sometime in the future. +define install-dir +@$(MKDIR) -p $(@D) +@$(RM) -r $@ +$(CP) -r $< $@ +endef + define prep-target @$(MKDIR) -p $(@D) @$(RM) $@ diff --git a/hotspot/make/excludeSrc.make b/hotspot/make/excludeSrc.make index c3a9b4dea0e..a95dc1b114c 100644 --- a/hotspot/make/excludeSrc.make +++ b/hotspot/make/excludeSrc.make @@ -88,7 +88,7 @@ ifeq ($(INCLUDE_ALL_GCS), false) g1ErgoVerbose.cpp g1GCPhaseTimes.cpp g1HRPrinter.cpp g1HotCardCache.cpp g1Log.cpp \ g1MMUTracker.cpp g1MarkSweep.cpp g1MemoryPool.cpp g1MonitoringSupport.cpp \ g1RemSet.cpp g1RemSetSummary.cpp g1SATBCardTableModRefBS.cpp g1_globals.cpp heapRegion.cpp \ - heapRegionRemSet.cpp heapRegionSeq.cpp heapRegionSet.cpp heapRegionSets.cpp \ + g1BiasedArray.cpp heapRegionRemSet.cpp heapRegionSeq.cpp heapRegionSet.cpp heapRegionSets.cpp \ ptrQueue.cpp satbQueue.cpp sparsePRT.cpp survRateGroup.cpp vm_operations_g1.cpp \ adjoiningGenerations.cpp adjoiningVirtualSpaces.cpp asPSOldGen.cpp asPSYoungGen.cpp \ cardTableExtension.cpp gcTaskManager.cpp gcTaskThread.cpp objectStartArray.cpp \ diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version index fa4d6554e16..ef45285a489 100644 --- a/hotspot/make/hotspot_version +++ b/hotspot/make/hotspot_version @@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013 HS_MAJOR_VER=25 HS_MINOR_VER=0 -HS_BUILD_NUMBER=51 +HS_BUILD_NUMBER=58 JDK_MAJOR_VER=1 JDK_MINOR_VER=8 diff --git a/hotspot/make/jprt.properties b/hotspot/make/jprt.properties index f322e7024ae..9109ded6f98 100644 --- a/hotspot/make/jprt.properties +++ b/hotspot/make/jprt.properties @@ -24,12 +24,7 @@ # Properties for jprt -# All build result bundles are full jdks, so the 64bit testing does not -# need the 32bit sibling bundle installed. -# Note: If the hotspot/make/Makefile changed to only bundle the 64bit files -# when bundling 64bit, and stripped out the 64bit files from any 32bit -# bundles, then this setting would be need to be "true". - +# All build result bundles are full jdks. jprt.need.sibling.build=false # At submit time, the release supplied will be in jprt.submit.release @@ -52,21 +47,11 @@ jprt.sync.push=false # sparc etc. # Define the Solaris platforms we want for the various releases -jprt.my.solaris.sparc.jdk8=solaris_sparc_5.10 -jprt.my.solaris.sparc.jdk7=solaris_sparc_5.10 -jprt.my.solaris.sparc.jdk7u8=${jprt.my.solaris.sparc.jdk7} -jprt.my.solaris.sparc=${jprt.my.solaris.sparc.${jprt.tools.default.release}} - jprt.my.solaris.sparcv9.jdk8=solaris_sparcv9_5.10 jprt.my.solaris.sparcv9.jdk7=solaris_sparcv9_5.10 jprt.my.solaris.sparcv9.jdk7u8=${jprt.my.solaris.sparcv9.jdk7} jprt.my.solaris.sparcv9=${jprt.my.solaris.sparcv9.${jprt.tools.default.release}} -jprt.my.solaris.i586.jdk8=solaris_i586_5.10 -jprt.my.solaris.i586.jdk7=solaris_i586_5.10 -jprt.my.solaris.i586.jdk7u8=${jprt.my.solaris.i586.jdk7} -jprt.my.solaris.i586=${jprt.my.solaris.i586.${jprt.tools.default.release}} - jprt.my.solaris.x64.jdk8=solaris_x64_5.10 jprt.my.solaris.x64.jdk7=solaris_x64_5.10 jprt.my.solaris.x64.jdk7u8=${jprt.my.solaris.x64.jdk7} @@ -133,9 +118,7 @@ jprt.my.windows.x64=${jprt.my.windows.x64.${jprt.tools.default.release}} # Standard list of jprt build targets for this source tree jprt.build.targets.standard= \ - ${jprt.my.solaris.sparc}-{product|fastdebug}, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug|optimized}, \ - ${jprt.my.solaris.i586}-{product|fastdebug}, \ ${jprt.my.solaris.x64}-{product|fastdebug}, \ ${jprt.my.linux.i586}-{product|fastdebug}, \ ${jprt.my.linux.x64}-{product|fastdebug|optimized}, \ @@ -145,7 +128,6 @@ jprt.build.targets.standard= \ ${jprt.my.linux.armvh}-{product|fastdebug} jprt.build.targets.open= \ - ${jprt.my.solaris.i586}-{productOpen}, \ ${jprt.my.solaris.x64}-{debugOpen}, \ ${jprt.my.linux.x64}-{productOpen} @@ -168,31 +150,6 @@ jprt.build.targets=${jprt.build.targets.${jprt.tools.default.release}} # Subset lists of test targets for this source tree -jprt.my.solaris.sparc.test.targets= \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jvm98, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-c2-jvm98_nontiered, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-scimark, \ - ${jprt.my.solaris.sparc}-product-{c1|c2}-runThese, \ - ${jprt.my.solaris.sparc}-fastdebug-c1-runThese_Xshare, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_G1, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParOldGC, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_SerialGC, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_ParallelGC, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_ParNewGC, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_CMS, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_G1, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_ParOldGC, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-c2-jbb_default_nontiered, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_SerialGC, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_ParallelGC, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_CMS, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_G1, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_ParOldGC - jprt.my.solaris.sparcv9.test.targets= \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98_nontiered, \ @@ -242,37 +199,6 @@ jprt.my.solaris.x64.test.targets= \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_G1, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParOldGC -jprt.my.solaris.i586.test.targets= \ - ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-jvm98, \ - ${jprt.my.solaris.i586}-{product|fastdebug}-c2-jvm98_nontiered, \ - ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-scimark, \ - ${jprt.my.solaris.i586}-product-{c1|c2}-runThese_Xcomp, \ - ${jprt.my.solaris.i586}-fastdebug-c1-runThese_Xcomp, \ - ${jprt.my.solaris.i586}-fastdebug-c1-runThese_Xshare, \ - ${jprt.my.solaris.i586}-product-c1-GCBasher_SerialGC, \ - ${jprt.my.solaris.i586}-product-c1-GCBasher_ParallelGC, \ - ${jprt.my.solaris.i586}-product-c1-GCBasher_ParNewGC, \ - ${jprt.my.solaris.i586}-product-c1-GCBasher_CMS, \ - ${jprt.my.solaris.i586}-product-c1-GCBasher_G1, \ - ${jprt.my.solaris.i586}-product-c1-GCBasher_ParOldGC, \ - ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_SerialGC, \ - ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_ParallelGC, \ - ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_ParNewGC, \ - ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_CMS, \ - ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_G1, \ - ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_ParOldGC, \ - ${jprt.my.solaris.i586}-product-c1-GCOld_SerialGC, \ - ${jprt.my.solaris.i586}-product-c1-GCOld_ParallelGC, \ - ${jprt.my.solaris.i586}-product-c1-GCOld_ParNewGC, \ - ${jprt.my.solaris.i586}-product-c1-GCOld_CMS, \ - ${jprt.my.solaris.i586}-product-c1-GCOld_G1, \ - ${jprt.my.solaris.i586}-product-c1-GCOld_ParOldGC, \ - ${jprt.my.solaris.i586}-fastdebug-c2-jbb_default_nontiered, \ - ${jprt.my.solaris.i586}-fastdebug-c2-jbb_ParallelGC, \ - ${jprt.my.solaris.i586}-fastdebug-c2-jbb_CMS, \ - ${jprt.my.solaris.i586}-fastdebug-c2-jbb_G1, \ - ${jprt.my.solaris.i586}-fastdebug-c2-jbb_ParOldGC - jprt.my.linux.i586.test.targets = \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-jvm98, \ ${jprt.my.linux.i586}-{product|fastdebug}-c2-jvm98_nontiered, \ @@ -395,7 +321,6 @@ jprt.my.windows.x64.test.targets = \ # Some basic "smoke" tests for OpenJDK builds jprt.test.targets.open = \ ${jprt.my.solaris.x64}-{productOpen|fastdebugOpen}-c2-jvm98, \ - ${jprt.my.solaris.i586}-{productOpen|fastdebugOpen}-c2-jvm98, \ ${jprt.my.linux.x64}-{productOpen|fastdebugOpen}-c2-jvm98 # Testing for actual embedded builds is different to standard @@ -407,9 +332,7 @@ jprt.my.linux.i586.test.targets.embedded = \ jprt.test.targets.standard = \ ${jprt.my.linux.i586.test.targets.embedded}, \ - ${jprt.my.solaris.sparc.test.targets}, \ ${jprt.my.solaris.sparcv9.test.targets}, \ - ${jprt.my.solaris.i586.test.targets}, \ ${jprt.my.solaris.x64.test.targets}, \ ${jprt.my.linux.i586.test.targets}, \ ${jprt.my.linux.x64.test.targets}, \ @@ -420,15 +343,12 @@ jprt.test.targets.standard = \ jprt.test.targets.embedded= \ ${jprt.my.linux.i586.test.targets.embedded}, \ - ${jprt.my.solaris.sparc.test.targets}, \ ${jprt.my.solaris.sparcv9.test.targets}, \ - ${jprt.my.solaris.i586.test.targets}, \ ${jprt.my.solaris.x64.test.targets}, \ ${jprt.my.linux.x64.test.targets}, \ ${jprt.my.windows.i586.test.targets}, \ ${jprt.my.windows.x64.test.targets} - jprt.test.targets.jdk8=${jprt.test.targets.standard} jprt.test.targets.jdk7=${jprt.test.targets.standard} jprt.test.targets.jdk7u8=${jprt.test.targets.jdk7} @@ -439,15 +359,11 @@ jprt.test.targets=${jprt.test.targets.${jprt.tools.default.release}} #jprt.make.rule.test.targets=*-product-*-packtest jprt.make.rule.test.targets.standard.client = \ - ${jprt.my.solaris.sparc}-*-c1-clienttest, \ - ${jprt.my.solaris.i586}-*-c1-clienttest, \ ${jprt.my.linux.i586}-*-c1-clienttest, \ ${jprt.my.windows.i586}-*-c1-clienttest jprt.make.rule.test.targets.standard.server = \ - ${jprt.my.solaris.sparc}-*-c2-servertest, \ ${jprt.my.solaris.sparcv9}-*-c2-servertest, \ - ${jprt.my.solaris.i586}-*-c2-servertest, \ ${jprt.my.solaris.x64}-*-c2-servertest, \ ${jprt.my.linux.i586}-*-c2-servertest, \ ${jprt.my.linux.x64}-*-c2-servertest, \ @@ -456,9 +372,7 @@ jprt.make.rule.test.targets.standard.server = \ ${jprt.my.windows.x64}-*-c2-servertest jprt.make.rule.test.targets.standard.internalvmtests = \ - ${jprt.my.solaris.sparc}-fastdebug-c2-internalvmtests, \ ${jprt.my.solaris.sparcv9}-fastdebug-c2-internalvmtests, \ - ${jprt.my.solaris.i586}-fastdebug-c2-internalvmtests, \ ${jprt.my.solaris.x64}-fastdebug-c2-internalvmtests, \ ${jprt.my.linux.i586}-fastdebug-c2-internalvmtests, \ ${jprt.my.linux.x64}-fastdebug-c2-internalvmtests, \ @@ -467,16 +381,12 @@ jprt.make.rule.test.targets.standard.internalvmtests = \ ${jprt.my.windows.x64}-fastdebug-c2-internalvmtests jprt.make.rule.test.targets.standard.wbapi = \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-c2-wbapitest, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-wbapitest, \ - ${jprt.my.solaris.i586}-{product|fastdebug}-c2-wbapitest, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-wbapitest, \ ${jprt.my.linux.i586}-{product|fastdebug}-c2-wbapitest, \ ${jprt.my.linux.x64}-{product|fastdebug}-c2-wbapitest, \ ${jprt.my.windows.i586}-{product|fastdebug}-c2-wbapitest, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-wbapitest, \ - ${jprt.my.solaris.sparc}-{product|fastdebug}-c1-wbapitest, \ - ${jprt.my.solaris.i586}-{product|fastdebug}-c1-wbapitest, \ ${jprt.my.linux.i586}-{product|fastdebug}-c1-wbapitest, \ ${jprt.my.windows.i586}-{product|fastdebug}-c1-wbapitest diff --git a/hotspot/make/linux/makefiles/fastdebug.make b/hotspot/make/linux/makefiles/fastdebug.make index abefd2b4ca0..c71e147fe4e 100644 --- a/hotspot/make/linux/makefiles/fastdebug.make +++ b/hotspot/make/linux/makefiles/fastdebug.make @@ -59,5 +59,5 @@ CFLAGS$(HOTSPARC_GENERIC) += $(OPT_CFLAGS/BYFILE) MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-debug VERSION = optimized -SYSDEFS += -DASSERT +SYSDEFS += -DASSERT -DCHECK_UNHANDLED_OOPS PICFLAGS = DEFAULT diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make index a62ea4b52ee..bc4a24c7787 100644 --- a/hotspot/make/linux/makefiles/gcc.make +++ b/hotspot/make/linux/makefiles/gcc.make @@ -208,7 +208,7 @@ WARNINGS_ARE_ERRORS = -Werror ifeq ($(USE_CLANG), true) # However we need to clean the code up before we can unrestrictedly enable this option with Clang - WARNINGS_ARE_ERRORS += -Wno-unused-value -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses + WARNINGS_ARE_ERRORS += -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body diff --git a/hotspot/make/windows/makefiles/compile.make b/hotspot/make/windows/makefiles/compile.make index 6f8dcce3406..9da2742335e 100644 --- a/hotspot/make/windows/makefiles/compile.make +++ b/hotspot/make/windows/makefiles/compile.make @@ -44,6 +44,7 @@ CXX=cl.exe # /GS Inserts security stack checks in some functions (VS2005 default) # /Oi Use intrinsics (in /O2) # /Od Disable all optimizations +# /MP Use multiple cores for compilation # # NOTE: Normally following any of the above with a '-' will turn off that flag # @@ -180,6 +181,7 @@ DEBUG_OPT_OPTION = /Od PRODUCT_OPT_OPTION = /O2 /Oy- FASTDEBUG_OPT_OPTION = /O2 /Oy- DEBUG_OPT_OPTION = /Od +SAFESEH_FLAG = /SAFESEH !endif !if "$(COMPILER_NAME)" == "VS2005" @@ -198,6 +200,7 @@ LD_FLAGS = /manifest $(LD_FLAGS) $(BUFFEROVERFLOWLIB) !if "x$(MT)" == "x" MT=mt.exe !endif +SAFESEH_FLAG = /SAFESEH !endif !if "$(COMPILER_NAME)" == "VS2008" @@ -206,11 +209,13 @@ FASTDEBUG_OPT_OPTION = /O2 /Oy- DEBUG_OPT_OPTION = /Od GX_OPTION = /EHsc LD_FLAGS = /manifest $(LD_FLAGS) +MP_FLAG = /MP # Manifest Tool - used in VS2005 and later to adjust manifests stored # as resources inside build artifacts. !if "x$(MT)" == "x" MT=mt.exe !endif +SAFESEH_FLAG = /SAFESEH !endif !if "$(COMPILER_NAME)" == "VS2010" @@ -219,6 +224,7 @@ FASTDEBUG_OPT_OPTION = /O2 /Oy- DEBUG_OPT_OPTION = /Od GX_OPTION = /EHsc LD_FLAGS = /manifest $(LD_FLAGS) +MP_FLAG = /MP # Manifest Tool - used in VS2005 and later to adjust manifests stored # as resources inside build artifacts. !if "x$(MT)" == "x" @@ -235,16 +241,21 @@ FASTDEBUG_OPT_OPTION = /O2 /Oy- DEBUG_OPT_OPTION = /Od GX_OPTION = /EHsc LD_FLAGS = /manifest $(LD_FLAGS) +MP_FLAG = /MP # Manifest Tool - used in VS2005 and later to adjust manifests stored # as resources inside build artifacts. !if "x$(MT)" == "x" MT=mt.exe !endif +SAFESEH_FLAG = /SAFESEH +!endif + !if "$(BUILDARCH)" == "i486" -LD_FLAGS = /SAFESEH $(LD_FLAGS) -!endif +LD_FLAGS = $(SAFESEH_FLAG) $(LD_FLAGS) !endif +CXX_FLAGS = $(CXX_FLAGS) $(MP_FLAG) + # If NO_OPTIMIZATIONS is defined in the environment, turn everything off !ifdef NO_OPTIMIZATIONS PRODUCT_OPT_OPTION = $(DEBUG_OPT_OPTION) diff --git a/hotspot/make/windows/makefiles/fastdebug.make b/hotspot/make/windows/makefiles/fastdebug.make index a85e129cf6e..e3138d0cb2f 100644 --- a/hotspot/make/windows/makefiles/fastdebug.make +++ b/hotspot/make/windows/makefiles/fastdebug.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/makefiles/sa.make b/hotspot/make/windows/makefiles/sa.make index 9363f0e5e6f..5b5cc2d723c 100644 --- a/hotspot/make/windows/makefiles/sa.make +++ b/hotspot/make/windows/makefiles/sa.make @@ -102,11 +102,19 @@ SA_CFLAGS = $(SA_CFLAGS) -ZI !if "$(MT)" != "" SA_LD_FLAGS = -manifest $(SA_LD_FLAGS) !endif -SASRCFILE = $(AGENT_DIR)/src/os/win32/windbg/sawindbg.cpp + +SASRCFILES = $(AGENT_DIR)/src/os/win32/windbg/sawindbg.cpp \ + $(AGENT_DIR)/src/share/native/sadis.c + SA_LFLAGS = $(SA_LD_FLAGS) -nologo -subsystem:console -machine:$(MACHINE) !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1" SA_LFLAGS = $(SA_LFLAGS) -map -debug !endif +!if "$(BUILDARCH)" == "i486" +SA_LFLAGS = $(SAFESEH_FLAG) $(SA_LFLAGS) +!endif + +SA_CFLAGS = $(SA_CFLAGS) $(MP_FLAG) # Note that we do not keep sawindbj.obj around as it would then # get included in the dumpbin command in build_vm_def.sh @@ -114,16 +122,16 @@ SA_LFLAGS = $(SA_LFLAGS) -map -debug # In VS2005 or VS2008 the link command creates a .manifest file that we want # to insert into the linked artifact so we do not need to track it separately. # Use ";#2" for .dll and ";#1" for .exe in the MT command below: -$(SAWINDBG): $(SASRCFILE) +$(SAWINDBG): $(SASRCFILES) set INCLUDE=$(SA_INCLUDE)$(INCLUDE) $(CXX) @<< -I"$(BootStrapDir)/include" -I"$(BootStrapDir)/include/win32" -I"$(GENERATED)" $(SA_CFLAGS) - $(SASRCFILE) + $(SASRCFILES) -out:$*.obj << set LIB=$(SA_LIB)$(LIB) - $(LD) -out:$@ -DLL $*.obj dbgeng.lib $(SA_LFLAGS) + $(LD) -out:$@ -DLL sawindbg.obj sadis.obj dbgeng.lib $(SA_LFLAGS) !if "$(MT)" != "" $(MT) -manifest $(@F).manifest -outputresource:$(@F);#2 !endif diff --git a/hotspot/make/windows/makefiles/trace.make b/hotspot/make/windows/makefiles/trace.make index 02948c0a8d0..58fee24653c 100644 --- a/hotspot/make/windows/makefiles/trace.make +++ b/hotspot/make/windows/makefiles/trace.make @@ -40,8 +40,7 @@ TraceGeneratedNames = \ traceEventIds.hpp \ traceTypes.hpp - -!if "$(OPENJDK)" != "true" +!if EXISTS($(TraceAltSrcDir)) TraceGeneratedNames = $(TraceGeneratedNames) \ traceRequestables.hpp \ traceEventControl.hpp \ @@ -56,7 +55,7 @@ TraceGeneratedFiles = \ $(TraceOutDir)/traceEventIds.hpp \ $(TraceOutDir)/traceTypes.hpp -!if "$(OPENJDK)" != "true" +!if EXISTS($(TraceAltSrcDir)) TraceGeneratedFiles = $(TraceGeneratedFiles) \ $(TraceOutDir)/traceRequestables.hpp \ $(TraceOutDir)/traceEventControl.hpp \ @@ -68,7 +67,7 @@ XSLT = $(QUIETLY) $(REMOTE) $(RUN_JAVA) -classpath $(JvmtiOutDir) jvmtiGen XML_DEPS = $(TraceSrcDir)/trace.xml $(TraceSrcDir)/tracetypes.xml \ $(TraceSrcDir)/trace.dtd $(TraceSrcDir)/xinclude.mod -!if "$(OPENJDK)" != "true" +!if EXISTS($(TraceAltSrcDir)) XML_DEPS = $(XML_DEPS) $(TraceAltSrcDir)/traceevents.xml !endif @@ -87,7 +86,7 @@ $(TraceOutDir)/traceTypes.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceType @echo Generating $@ @$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceSrcDir)/traceTypes.xsl -OUT $(TraceOutDir)/traceTypes.hpp -!if "$(OPENJDK)" == "true" +!if !EXISTS($(TraceAltSrcDir)) $(TraceOutDir)/traceEventClasses.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceEventClasses.xsl $(XML_DEPS) @echo Generating OpenJDK $@ diff --git a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp index 97ec2239549..e6e7212ed4a 100644 --- a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp @@ -53,6 +53,8 @@ LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool outgoing) { opr = as_long_opr(reg); } else if (type == T_OBJECT || type == T_ARRAY) { opr = as_oop_opr(reg); + } else if (type == T_METADATA) { + opr = as_metadata_opr(reg); } else { opr = as_opr(reg); } diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp index cb4c04a388b..22ab05f7c9f 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp @@ -2565,7 +2565,7 @@ void LIR_Assembler::type_profile_helper(Register mdo, int mdo_offset_bias, Address receiver_addr(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) - mdo_offset_bias); __ ld_ptr(receiver_addr, tmp1); - __ verify_oop(tmp1); + __ verify_klass_ptr(tmp1); __ cmp_and_brx_short(recv, tmp1, Assembler::notEqual, Assembler::pt, next_test); Address data_addr(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i)) - mdo_offset_bias); @@ -3100,6 +3100,10 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { } } +void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) { + fatal("Type profiling not implemented on this platform"); +} + void LIR_Assembler::align_backward_branch_target() { __ align(OptoLoopAlignment); } diff --git a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp index bc633103586..742cacc226b 100644 --- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp @@ -37,6 +37,9 @@ #include "runtime/vframeArray.hpp" #include "utilities/macros.hpp" #include "vmreg_sparc.inline.hpp" +#if INCLUDE_ALL_GCS +#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" +#endif // Implementation of StubAssembler @@ -401,7 +404,9 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { if (id == fast_new_instance_init_check_id) { // make sure the klass is initialized __ ldub(G5_klass, in_bytes(InstanceKlass::init_state_offset()), G3_t1); - __ cmp_and_br_short(G3_t1, InstanceKlass::fully_initialized, Assembler::notEqual, Assembler::pn, slow_path); + __ cmp(G3_t1, InstanceKlass::fully_initialized); + __ br(Assembler::notEqual, false, Assembler::pn, slow_path); + __ delayed()->nop(); } #ifdef ASSERT // assert object can be fast path allocated @@ -512,7 +517,9 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // check that array length is small enough for fast path __ set(C1_MacroAssembler::max_array_allocation_length, G3_t1); - __ cmp_and_br_short(G4_length, G3_t1, Assembler::greaterUnsigned, Assembler::pn, slow_path); + __ cmp(G4_length, G3_t1); + __ br(Assembler::greaterUnsigned, false, Assembler::pn, slow_path); + __ delayed()->nop(); // if we got here then the TLAB allocation failed, so try // refilling the TLAB or allocating directly from eden. @@ -912,7 +919,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { Register tmp2 = G3_scratch; jbyte* byte_map_base = ((CardTableModRefBS*)bs)->byte_map_base; - Label not_already_dirty, restart, refill; + Label not_already_dirty, restart, refill, young_card; #ifdef _LP64 __ srlx(addr, CardTableModRefBS::card_shift, addr); @@ -924,9 +931,15 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ set(rs, cardtable); // cardtable := __ ldub(addr, cardtable, tmp); // tmp := [addr + cardtable] + __ cmp_and_br_short(tmp, G1SATBCardTableModRefBS::g1_young_card_val(), Assembler::equal, Assembler::pt, young_card); + + __ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad)); + __ ldub(addr, cardtable, tmp); // tmp := [addr + cardtable] + assert(CardTableModRefBS::dirty_card_val() == 0, "otherwise check this code"); __ cmp_and_br_short(tmp, G0, Assembler::notEqual, Assembler::pt, not_already_dirty); + __ bind(young_card); // We didn't take the branch, so we're already dirty: return. // Use return-from-leaf __ retl(); @@ -1067,6 +1080,25 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) { __ verify_not_null_oop(Oexception); +#ifdef ASSERT + // check that fields in JavaThread for exception oop and issuing pc are + // empty before writing to them + Label oop_empty; + Register scratch = I7; // We can use I7 here because it's overwritten later anyway. + __ ld_ptr(Address(G2_thread, JavaThread::exception_oop_offset()), scratch); + __ br_null(scratch, false, Assembler::pt, oop_empty); + __ delayed()->nop(); + __ stop("exception oop already set"); + __ bind(oop_empty); + + Label pc_empty; + __ ld_ptr(Address(G2_thread, JavaThread::exception_pc_offset()), scratch); + __ br_null(scratch, false, Assembler::pt, pc_empty); + __ delayed()->nop(); + __ stop("exception pc already set"); + __ bind(pc_empty); +#endif + // save the exception and issuing pc in the thread __ st_ptr(Oexception, G2_thread, in_bytes(JavaThread::exception_oop_offset())); __ st_ptr(Oissuing_pc, G2_thread, in_bytes(JavaThread::exception_pc_offset())); diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp index 5750e5f587f..371b6aa7f71 100644 --- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp @@ -365,7 +365,7 @@ address CppInterpreterGenerator::generate_stack_to_native_abi_converter(BasicTyp return entry; } -address CppInterpreter::return_entry(TosState state, int length) { +address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { // make it look good in the debugger return CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation) + frame::pc_return_offset; } diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp index ac9746679b3..6ce05bdfce1 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp @@ -764,7 +764,7 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) #ifdef CC_INTERP *oop_result = istate->_oop_temp; #else - oop obj = (oop) at(interpreter_frame_oop_temp_offset); + oop obj = cast_to_oop(at(interpreter_frame_oop_temp_offset)); assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check"); *oop_result = obj; #endif // CC_INTERP @@ -788,7 +788,7 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) switch(type) { case T_OBJECT: case T_ARRAY: { - oop obj = (oop)*tos_addr; + oop obj = cast_to_oop(*tos_addr); assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check"); *oop_result = obj; break; diff --git a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp index acffc90f2cf..ecc6eb61524 100644 --- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp @@ -76,6 +76,8 @@ define_pd_global(bool, UseMembar, false); // GC Ergo Flags define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread +define_pd_global(uintx, TypeProfileLevel, 0); + #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) \ \ product(intx, UseVIS, 99, \ diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index 9f1f2e53371..7d1957212ce 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -3333,7 +3333,8 @@ void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case if (CMSIncrementalMode || !Universe::heap()->supports_inline_contig_alloc()) { // No allocation in the shared eden. - ba_short(slow_case); + ba(slow_case); + delayed()->nop(); } ld_ptr(G2_thread, in_bytes(JavaThread::tlab_top_offset()), top); @@ -3358,7 +3359,8 @@ void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case add(t2, 1, t2); stw(t2, G2_thread, in_bytes(JavaThread::tlab_slow_allocations_offset())); } - ba_short(try_eden); + ba(try_eden); + delayed()->nop(); bind(discard_tlab); if (TLABStats) { @@ -3420,7 +3422,8 @@ void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case sub(top, ThreadLocalAllocBuffer::alignment_reserve_in_bytes(), top); st_ptr(top, G2_thread, in_bytes(JavaThread::tlab_end_offset())); verify_tlab(); - ba_short(retry); + ba(retry); + delayed()->nop(); } void MacroAssembler::incr_allocated_bytes(RegisterOrConstant size_in_bytes, @@ -3523,8 +3526,12 @@ void MacroAssembler::bang_stack_size(Register Rsize, Register Rtsp, delayed()->sub(Rtsp, Roffset, Rtsp); // Bang down shadow pages too. - // The -1 because we already subtracted 1 page. - for (int i = 0; i< StackShadowPages-1; i++) { + // At this point, (tmp-0) is the last address touched, so don't + // touch it again. (It was touched as (tmp-pagesize) but then tmp + // was post-decremented.) Skip this address by starting at i=1, and + // touch a few more pages below. N.B. It is important to touch all + // the way down to and including i=StackShadowPages. + for (int i = 1; i <= StackShadowPages; i++) { set((-i*offset)+STACK_BIAS, Rscratch); st(G0, Rtsp, Rscratch); } @@ -3752,7 +3759,7 @@ static void generate_dirty_card_log_enqueue(jbyte* byte_map_base) { #define __ masm. address start = __ pc(); - Label not_already_dirty, restart, refill; + Label not_already_dirty, restart, refill, young_card; #ifdef _LP64 __ srlx(O0, CardTableModRefBS::card_shift, O0); @@ -3763,9 +3770,15 @@ static void generate_dirty_card_log_enqueue(jbyte* byte_map_base) { __ set(addrlit, O1); // O1 := __ ldub(O0, O1, O2); // O2 := [O0 + O1] + __ cmp_and_br_short(O2, G1SATBCardTableModRefBS::g1_young_card_val(), Assembler::equal, Assembler::pt, young_card); + + __ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad)); + __ ldub(O0, O1, O2); // O2 := [O0 + O1] + assert(CardTableModRefBS::dirty_card_val() == 0, "otherwise check this code"); __ cmp_and_br_short(O2, G0, Assembler::notEqual, Assembler::pt, not_already_dirty); + __ bind(young_card); // We didn't take the branch, so we're already dirty: return. // Use return-from-leaf __ retl(); @@ -4090,15 +4103,19 @@ void MacroAssembler::decode_heap_oop_not_null(Register src, Register dst) { void MacroAssembler::encode_klass_not_null(Register r) { assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - assert(r != G6_heapbase, "bad register choice"); - set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); - sub(r, G6_heapbase, r); - if (Universe::narrow_klass_shift() != 0) { - assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); - srlx(r, LogKlassAlignmentInBytes, r); + if (Universe::narrow_klass_base() != NULL) { + assert(r != G6_heapbase, "bad register choice"); + set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); + sub(r, G6_heapbase, r); + if (Universe::narrow_klass_shift() != 0) { + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); + srlx(r, LogKlassAlignmentInBytes, r); + } + reinit_heapbase(); + } else { + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + srlx(r, Universe::narrow_klass_shift(), r); } - reinit_heapbase(); } void MacroAssembler::encode_klass_not_null(Register src, Register dst) { @@ -4106,11 +4123,16 @@ void MacroAssembler::encode_klass_not_null(Register src, Register dst) { encode_klass_not_null(src); } else { assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - set((intptr_t)Universe::narrow_klass_base(), dst); - sub(src, dst, dst); - if (Universe::narrow_klass_shift() != 0) { - srlx(dst, LogKlassAlignmentInBytes, dst); + if (Universe::narrow_klass_base() != NULL) { + set((intptr_t)Universe::narrow_klass_base(), dst); + sub(src, dst, dst); + if (Universe::narrow_klass_shift() != 0) { + srlx(dst, LogKlassAlignmentInBytes, dst); + } + } else { + // shift src into dst + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + srlx(src, Universe::narrow_klass_shift(), dst); } } } @@ -4120,14 +4142,16 @@ void MacroAssembler::encode_klass_not_null(Register src, Register dst) { // the instructions they generate change, then this method needs to be updated. int MacroAssembler::instr_size_for_decode_klass_not_null() { assert (UseCompressedClassPointers, "only for compressed klass ptrs"); - // set + add + set - int num_instrs = insts_for_internal_set((intptr_t)Universe::narrow_klass_base()) + 1 + - insts_for_internal_set((intptr_t)Universe::narrow_ptrs_base()); - if (Universe::narrow_klass_shift() == 0) { - return num_instrs * BytesPerInstWord; - } else { // sllx - return (num_instrs + 1) * BytesPerInstWord; + int num_instrs = 1; // shift src,dst or add + if (Universe::narrow_klass_base() != NULL) { + // set + add + set + num_instrs += insts_for_internal_set((intptr_t)Universe::narrow_klass_base()) + + insts_for_internal_set((intptr_t)Universe::narrow_ptrs_base()); + if (Universe::narrow_klass_shift() != 0) { + num_instrs += 1; // sllx + } } + return num_instrs * BytesPerInstWord; } // !!! If the instructions that get generated here change then function @@ -4136,13 +4160,17 @@ void MacroAssembler::decode_klass_not_null(Register r) { // Do not add assert code to this unless you change vtableStubs_sparc.cpp // pd_code_size_limit. assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - assert(r != G6_heapbase, "bad register choice"); - set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); - if (Universe::narrow_klass_shift() != 0) - sllx(r, LogKlassAlignmentInBytes, r); - add(r, G6_heapbase, r); - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + assert(r != G6_heapbase, "bad register choice"); + set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); + if (Universe::narrow_klass_shift() != 0) + sllx(r, LogKlassAlignmentInBytes, r); + add(r, G6_heapbase, r); + reinit_heapbase(); + } else { + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + sllx(r, Universe::narrow_klass_shift(), r); + } } void MacroAssembler::decode_klass_not_null(Register src, Register dst) { @@ -4152,16 +4180,21 @@ void MacroAssembler::decode_klass_not_null(Register src, Register dst) { // Do not add assert code to this unless you change vtableStubs_sparc.cpp // pd_code_size_limit. assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - if (Universe::narrow_klass_shift() != 0) { - assert((src != G6_heapbase) && (dst != G6_heapbase), "bad register choice"); - set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); - sllx(src, LogKlassAlignmentInBytes, dst); - add(dst, G6_heapbase, dst); - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + if (Universe::narrow_klass_shift() != 0) { + assert((src != G6_heapbase) && (dst != G6_heapbase), "bad register choice"); + set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); + sllx(src, LogKlassAlignmentInBytes, dst); + add(dst, G6_heapbase, dst); + reinit_heapbase(); + } else { + set((intptr_t)Universe::narrow_klass_base(), dst); + add(src, dst, dst); + } } else { - set((intptr_t)Universe::narrow_klass_base(), dst); - add(src, dst, dst); + // shift/mov src into dst. + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + sllx(src, Universe::narrow_klass_shift(), dst); } } } diff --git a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp index 546cfaf08f1..af6d6289644 100644 --- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -121,6 +121,7 @@ void MethodHandles::verify_ref_kind(MacroAssembler* _masm, int ref_kind, Registe void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register target, Register temp, bool for_compiler_entry) { + Label L_no_such_method; assert(method == G5_method, "interpreter calling convention"); assert_different_registers(method, target, temp); @@ -133,6 +134,9 @@ void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register meth const Address interp_only(G2_thread, JavaThread::interp_only_mode_offset()); __ ld(interp_only, temp); __ cmp_and_br_short(temp, 0, Assembler::zero, Assembler::pt, run_compiled_code); + // Null method test is replicated below in compiled case, + // it might be able to address across the verify_thread() + __ br_null_short(G5_method, Assembler::pn, L_no_such_method); __ ld_ptr(G5_method, in_bytes(Method::interpreter_entry_offset()), target); __ jmp(target, 0); __ delayed()->nop(); @@ -141,11 +145,19 @@ void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register meth // it doesn't matter, since this is interpreter code. } + // Compiled case, either static or fall-through from runtime conditional + __ br_null_short(G5_method, Assembler::pn, L_no_such_method); + const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() : Method::from_interpreted_offset(); __ ld_ptr(G5_method, in_bytes(entry_offset), target); __ jmp(target, 0); __ delayed()->nop(); + + __ bind(L_no_such_method); + AddressLiteral ame(StubRoutines::throw_AbstractMethodError_entry()); + __ jump_to(ame, temp); + __ delayed()->nop(); } void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm, diff --git a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp index 81f29d2671b..f5ac37cf6fa 100644 --- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -358,7 +358,7 @@ void NativeMovConstReg::set_data(intptr_t x) { oop_Relocation *r = iter.oop_reloc(); if (oop_addr == NULL) { oop_addr = r->oop_addr(); - *oop_addr = (oop)x; + *oop_addr = cast_to_oop(x); } else { assert(oop_addr == r->oop_addr(), "must be only one set-oop here"); } @@ -478,7 +478,7 @@ void NativeMovConstRegPatching::set_data(int x) { oop_Relocation *r = iter.oop_reloc(); if (oop_addr == NULL) { oop_addr = r->oop_addr(); - *oop_addr = (oop)x; + *oop_addr = cast_to_oop(x); } else { assert(oop_addr == r->oop_addr(), "must be only one set-oop here"); } diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp index 3149dbd76d2..62ff0f23b2b 100644 --- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp @@ -3581,6 +3581,7 @@ void SharedRuntime::generate_deopt_blob() { // the pending exception will be picked up the interpreter. __ ld_ptr(G2_thread, in_bytes(JavaThread::exception_oop_offset()), Oexception); __ st_ptr(G0, G2_thread, in_bytes(JavaThread::exception_oop_offset())); + __ st_ptr(G0, G2_thread, in_bytes(JavaThread::exception_pc_offset())); __ bind(noException); // deallocate the deoptimization frame taking care to preserve the return values diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad index 58c113a0c1a..9d3856245f2 100644 --- a/hotspot/src/cpu/sparc/vm/sparc.ad +++ b/hotspot/src/cpu/sparc/vm/sparc.ad @@ -1660,12 +1660,16 @@ void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream *st ) const { if (UseCompressedClassPointers) { assert(Universe::heap() != NULL, "java heap should be initialized"); st->print_cr("\tLDUW [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check - compressed klass"); - st->print_cr("\tSET Universe::narrow_klass_base,R_G6_heap_base"); - if (Universe::narrow_klass_shift() != 0) { - st->print_cr("\tSLL R_G5,3,R_G5"); + if (Universe::narrow_klass_base() != 0) { + st->print_cr("\tSET Universe::narrow_klass_base,R_G6_heap_base"); + if (Universe::narrow_klass_shift() != 0) { + st->print_cr("\tSLL R_G5,Universe::narrow_klass_shift,R_G5"); + } + st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5"); + st->print_cr("\tSET Universe::narrow_ptrs_base,R_G6_heap_base"); + } else { + st->print_cr("\tSLL R_G5,Universe::narrow_klass_shift,R_G5"); } - st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5"); - st->print_cr("\tSET Universe::narrow_ptrs_base,R_G6_heap_base"); } else { st->print_cr("\tLDX [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check"); } @@ -2018,6 +2022,19 @@ const RegMask Matcher::method_handle_invoke_SP_save_mask() { return L7_REGP_mask(); } +const RegMask Matcher::mathExactI_result_proj_mask() { + return G1_REGI_mask(); +} + +const RegMask Matcher::mathExactL_result_proj_mask() { + return G1_REGL_mask(); +} + +const RegMask Matcher::mathExactI_flags_proj_mask() { + return INT_FLAGS_mask(); +} + + %} @@ -2899,6 +2916,9 @@ enc_class Fast_Unlock(iRegP oop, iRegP box, o7RegP scratch, iRegP scratch2) %{ __ bind(LSkip2); } + // We have no guarantee that on 64 bit the higher half of limit_reg is 0 + __ signx(limit_reg); + __ subcc(limit_reg, 1 * sizeof(jchar), chr1_reg); __ br(Assembler::equal, true, Assembler::pn, Ldone); __ delayed()->mov(O7, result_reg); // result is difference in lengths @@ -2956,6 +2976,9 @@ enc_class enc_String_Equals(o0RegP str1, o1RegP str2, g3RegI cnt, notemp_iRegI r Register chr1_reg = result_reg; Register chr2_reg = tmp1_reg; + // We have no guarantee that on 64 bit the higher half of limit_reg is 0 + __ signx(limit_reg); + //check for alignment and position the pointers to the ends __ or3(str1_reg, str2_reg, chr1_reg); __ andcc(chr1_reg, 0x3, chr1_reg); @@ -4245,12 +4268,16 @@ operand cmpOp() %{ greater_equal(0xB); less_equal(0x2); greater(0xA); + overflow(0x7); + no_overflow(0xF); %} %} // Comparison Op, unsigned operand cmpOpU() %{ match(Bool); + predicate(n->as_Bool()->_test._test != BoolTest::overflow && + n->as_Bool()->_test._test != BoolTest::no_overflow); format %{ "u" %} interface(COND_INTER) %{ @@ -4260,12 +4287,16 @@ operand cmpOpU() %{ greater_equal(0xD); less_equal(0x4); greater(0xC); + overflow(0x7); + no_overflow(0xF); %} %} // Comparison Op, pointer (same as unsigned) operand cmpOpP() %{ match(Bool); + predicate(n->as_Bool()->_test._test != BoolTest::overflow && + n->as_Bool()->_test._test != BoolTest::no_overflow); format %{ "p" %} interface(COND_INTER) %{ @@ -4275,12 +4306,16 @@ operand cmpOpP() %{ greater_equal(0xD); less_equal(0x4); greater(0xC); + overflow(0x7); + no_overflow(0xF); %} %} // Comparison Op, branch-register encoding operand cmpOp_reg() %{ match(Bool); + predicate(n->as_Bool()->_test._test != BoolTest::overflow && + n->as_Bool()->_test._test != BoolTest::no_overflow); format %{ "" %} interface(COND_INTER) %{ @@ -4290,12 +4325,16 @@ operand cmpOp_reg() %{ greater_equal(0x7); less_equal (0x2); greater (0x6); + overflow(0x7); // not supported + no_overflow(0xF); // not supported %} %} // Comparison Code, floating, unordered same as less operand cmpOpF() %{ match(Bool); + predicate(n->as_Bool()->_test._test != BoolTest::overflow && + n->as_Bool()->_test._test != BoolTest::no_overflow); format %{ "fl" %} interface(COND_INTER) %{ @@ -4305,12 +4344,17 @@ operand cmpOpF() %{ greater_equal(0xB); less_equal(0xE); greater(0x6); + + overflow(0x7); // not supported + no_overflow(0xF); // not supported %} %} // Used by long compare operand cmpOp_commute() %{ match(Bool); + predicate(n->as_Bool()->_test._test != BoolTest::overflow && + n->as_Bool()->_test._test != BoolTest::no_overflow); format %{ "" %} interface(COND_INTER) %{ @@ -4320,6 +4364,8 @@ operand cmpOp_commute() %{ greater_equal(0x2); less_equal(0xB); greater(0x3); + overflow(0x7); + no_overflow(0xF); %} %} diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp index b6f8a5a5d1a..40847f8c2df 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp @@ -153,13 +153,9 @@ address TemplateInterpreterGenerator::generate_StackOverflowError_handler() { } -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { - TosState incoming_state = state; - - Label cont; - address compiled_entry = __ pc(); - +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { address entry = __ pc(); + #if !defined(_LP64) && defined(COMPILER2) // All return values are where we want them, except for Longs. C2 returns // longs in G1 in the 32-bit build whereas the interpreter wants them in O0/O1. @@ -170,14 +166,12 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, // do this here. Unfortunately if we did a rethrow we'd see an machepilog node // first which would move g1 -> O0/O1 and destroy the exception we were throwing. - if (incoming_state == ltos) { + if (state == ltos) { __ srl (G1, 0, O1); __ srlx(G1, 32, O0); } #endif // !_LP64 && COMPILER2 - __ bind(cont); - // The callee returns with the stack possibly adjusted by adapter transition // We remove that possible adjustment here. // All interpreter local registers are untouched. Any result is passed back @@ -186,28 +180,17 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, __ mov(Llast_SP, SP); // Remove any adapter added stack space. - Label L_got_cache, L_giant_index; const Register cache = G3_scratch; - const Register size = G1_scratch; - if (EnableInvokeDynamic) { - __ ldub(Address(Lbcp, 0), G1_scratch); // Load current bytecode. - __ cmp_and_br_short(G1_scratch, Bytecodes::_invokedynamic, Assembler::equal, Assembler::pn, L_giant_index); - } - __ get_cache_and_index_at_bcp(cache, G1_scratch, 1); - __ bind(L_got_cache); - __ ld_ptr(cache, ConstantPoolCache::base_offset() + - ConstantPoolCacheEntry::flags_offset(), size); - __ and3(size, 0xFF, size); // argument size in words - __ sll(size, Interpreter::logStackElementSize, size); // each argument size in bytes - __ add(Lesp, size, Lesp); // pop arguments - __ dispatch_next(state, step); + const Register index = G1_scratch; + __ get_cache_and_index_at_bcp(cache, index, 1, index_size); - // out of the main line of code... - if (EnableInvokeDynamic) { - __ bind(L_giant_index); - __ get_cache_and_index_at_bcp(cache, G1_scratch, 1, sizeof(u4)); - __ ba_short(L_got_cache); - } + const Register flags = cache; + __ ld_ptr(cache, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset(), flags); + const Register parameter_size = flags; + __ and3(flags, ConstantPoolCacheEntry::parameter_size_mask, parameter_size); // argument size in words + __ sll(parameter_size, Interpreter::logStackElementSize, parameter_size); // each argument size in bytes + __ add(Lesp, parameter_size, Lesp); // pop arguments + __ dispatch_next(state, step); return entry; } diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index c3e8b298d6e..92098113cca 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -2932,9 +2932,7 @@ void TemplateTable::prepare_invoke(int byte_no, ConstantPoolCacheEntry::verify_tos_state_shift(); // load return address { - const address table_addr = (is_invokeinterface || is_invokedynamic) ? - (address)Interpreter::return_5_addrs_by_index_table() : - (address)Interpreter::return_3_addrs_by_index_table(); + const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); AddressLiteral table(table_addr); __ set(table, temp); __ sll(ra, LogBytesPerWord, ra); @@ -2984,7 +2982,7 @@ void TemplateTable::invokevirtual(int byte_no) { __ verify_oop(O0_recv); // get return address - AddressLiteral table(Interpreter::return_3_addrs_by_index_table()); + AddressLiteral table(Interpreter::invoke_return_entry_table()); __ set(table, Rtemp); __ srl(Rret, ConstantPoolCacheEntry::tos_state_shift, Rret); // get return type // Make sure we don't need to mask Rret after the above shift @@ -3026,7 +3024,7 @@ void TemplateTable::invokevfinal_helper(Register Rscratch, Register Rret) { __ profile_final_call(O4); // get return address - AddressLiteral table(Interpreter::return_3_addrs_by_index_table()); + AddressLiteral table(Interpreter::invoke_return_entry_table()); __ set(table, Rtemp); __ srl(Rret, ConstantPoolCacheEntry::tos_state_shift, Rret); // get return type // Make sure we don't need to mask Rret after the above shift diff --git a/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp b/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp index ce19d4d7e7b..cdbb57fbecd 100644 --- a/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp @@ -52,6 +52,11 @@ extern "C" void bad_compiled_vtable_index(JavaThread* thread, oopDesc* receiver, VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { const int sparc_code_length = VtableStub::pd_code_size_limit(true); VtableStub* s = new(sparc_code_length) VtableStub(true, vtable_index); + // Can be NULL if there is no free space in the code cache. + if (s == NULL) { + return NULL; + } + ResourceMark rm; CodeBuffer cb(s->entry_point(), sparc_code_length); MacroAssembler* masm = new MacroAssembler(&cb); @@ -125,6 +130,11 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { VtableStub* VtableStubs::create_itable_stub(int itable_index) { const int sparc_code_length = VtableStub::pd_code_size_limit(false); VtableStub* s = new(sparc_code_length) VtableStub(false, itable_index); + // Can be NULL if there is no free space in the code cache. + if (s == NULL) { + return NULL; + } + ResourceMark rm; CodeBuffer cb(s->entry_point(), sparc_code_length); MacroAssembler* masm = new MacroAssembler(&cb); diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp index 761b5c3259f..49cc9ed65cf 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp @@ -1405,6 +1405,15 @@ void Assembler::imull(Register dst, Register src, int value) { } } +void Assembler::imull(Register dst, Address src) { + InstructionMark im(this); + prefix(src, dst); + emit_int8(0x0F); + emit_int8((unsigned char) 0xAF); + emit_operand(dst, src); +} + + void Assembler::incl(Address dst) { // Don't use it directly. Use MacroAssembler::increment() instead. InstructionMark im(this); @@ -4769,7 +4778,7 @@ void Assembler::adcq(Register dst, Address src) { } void Assembler::adcq(Register dst, Register src) { - (int) prefixq_and_encode(dst->encoding(), src->encoding()); + (void) prefixq_and_encode(dst->encoding(), src->encoding()); emit_arith(0x13, 0xC0, dst, src); } @@ -4824,7 +4833,7 @@ void Assembler::andq(Register dst, Address src) { } void Assembler::andq(Register dst, Register src) { - (int) prefixq_and_encode(dst->encoding(), src->encoding()); + (void) prefixq_and_encode(dst->encoding(), src->encoding()); emit_arith(0x23, 0xC0, dst, src); } @@ -5024,6 +5033,14 @@ void Assembler::imulq(Register dst, Register src, int value) { } } +void Assembler::imulq(Register dst, Address src) { + InstructionMark im(this); + prefixq(src, dst); + emit_int8(0x0F); + emit_int8((unsigned char) 0xAF); + emit_operand(dst, src); +} + void Assembler::incl(Register dst) { // Don't use it directly. Use MacroAssembler::incrementl() instead. // Use two-byte form (one-byte from is a REX prefix in 64-bit mode) diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.hpp index 31481b5808f..1ad66bd6a95 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp @@ -1162,9 +1162,13 @@ private: void imull(Register dst, Register src); void imull(Register dst, Register src, int value); + void imull(Register dst, Address src); void imulq(Register dst, Register src); void imulq(Register dst, Register src, int value); +#ifdef _LP64 + void imulq(Register dst, Address src); +#endif // jcc is the generic conditional branch generator to run- diff --git a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp index 237c617ce3d..56129cc2d2e 100644 --- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp +++ b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp @@ -40,11 +40,8 @@ #include "runtime/synchronizer.hpp" #include "runtime/vframeArray.hpp" #include "utilities/debug.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "interp_masm_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "interp_masm_x86_64.hpp" +#ifdef TARGET_ARCH_x86 +# include "interp_masm_x86.hpp" #endif #ifdef CC_INTERP diff --git a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp index bd3ad930b70..8ef1bea5d83 100644 --- a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp @@ -52,6 +52,8 @@ LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool) { #endif // _LP64 } else if (type == T_OBJECT || type == T_ARRAY) { opr = as_oop_opr(reg); + } else if (type == T_METADATA) { + opr = as_metadata_opr(reg); } else { opr = as_opr(reg); } diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index 94c2c39d26f..af13192330b 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -432,15 +432,16 @@ int LIR_Assembler::emit_unwind_handler() { int offset = code_offset(); // Fetch the exception from TLS and clear out exception related thread state - __ get_thread(rsi); - __ movptr(rax, Address(rsi, JavaThread::exception_oop_offset())); - __ movptr(Address(rsi, JavaThread::exception_oop_offset()), (intptr_t)NULL_WORD); - __ movptr(Address(rsi, JavaThread::exception_pc_offset()), (intptr_t)NULL_WORD); + Register thread = NOT_LP64(rsi) LP64_ONLY(r15_thread); + NOT_LP64(__ get_thread(rsi)); + __ movptr(rax, Address(thread, JavaThread::exception_oop_offset())); + __ movptr(Address(thread, JavaThread::exception_oop_offset()), (intptr_t)NULL_WORD); + __ movptr(Address(thread, JavaThread::exception_pc_offset()), (intptr_t)NULL_WORD); __ bind(_unwind_handler_entry); __ verify_not_null_oop(rax); if (method()->is_synchronized() || compilation()->env()->dtrace_method_probes()) { - __ mov(rsi, rax); // Preserve the exception + __ mov(rbx, rax); // Preserve the exception (rbx is always callee-saved) } // Preform needed unlocking @@ -448,19 +449,24 @@ int LIR_Assembler::emit_unwind_handler() { if (method()->is_synchronized()) { monitor_address(0, FrameMap::rax_opr); stub = new MonitorExitStub(FrameMap::rax_opr, true, 0); - __ unlock_object(rdi, rbx, rax, *stub->entry()); + __ unlock_object(rdi, rsi, rax, *stub->entry()); __ bind(*stub->continuation()); } if (compilation()->env()->dtrace_method_probes()) { +#ifdef _LP64 + __ mov(rdi, r15_thread); + __ mov_metadata(rsi, method()->constant_encoding()); +#else __ get_thread(rax); __ movptr(Address(rsp, 0), rax); __ mov_metadata(Address(rsp, sizeof(void*)), method()->constant_encoding()); +#endif __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit))); } if (method()->is_synchronized() || compilation()->env()->dtrace_method_probes()) { - __ mov(rax, rsi); // Restore the exception + __ mov(rax, rbx); // Restore the exception } // remove the activation and dispatch to the unwind handler @@ -1206,6 +1212,10 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch LIR_Address* addr = src->as_address_ptr(); Address from_addr = as_Address(addr); + if (addr->base()->type() == T_OBJECT) { + __ verify_oop(addr->base()->as_pointer_register()); + } + switch (type) { case T_BOOLEAN: // fall through case T_BYTE: // fall through @@ -3632,6 +3642,161 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { } } +void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) { + Register obj = op->obj()->as_register(); + Register tmp = op->tmp()->as_pointer_register(); + Address mdo_addr = as_Address(op->mdp()->as_address_ptr()); + ciKlass* exact_klass = op->exact_klass(); + intptr_t current_klass = op->current_klass(); + bool not_null = op->not_null(); + bool no_conflict = op->no_conflict(); + + Label update, next, none; + + bool do_null = !not_null; + bool exact_klass_set = exact_klass != NULL && ciTypeEntries::valid_ciklass(current_klass) == exact_klass; + bool do_update = !TypeEntries::is_type_unknown(current_klass) && !exact_klass_set; + + assert(do_null || do_update, "why are we here?"); + assert(!TypeEntries::was_null_seen(current_klass) || do_update, "why are we here?"); + + __ verify_oop(obj); + + if (tmp != obj) { + __ mov(tmp, obj); + } + if (do_null) { + __ testptr(tmp, tmp); + __ jccb(Assembler::notZero, update); + if (!TypeEntries::was_null_seen(current_klass)) { + __ orptr(mdo_addr, TypeEntries::null_seen); + } + if (do_update) { +#ifndef ASSERT + __ jmpb(next); + } +#else + __ jmp(next); + } + } else { + __ testptr(tmp, tmp); + __ jccb(Assembler::notZero, update); + __ stop("unexpect null obj"); +#endif + } + + __ bind(update); + + if (do_update) { +#ifdef ASSERT + if (exact_klass != NULL) { + Label ok; + __ load_klass(tmp, tmp); + __ push(tmp); + __ mov_metadata(tmp, exact_klass->constant_encoding()); + __ cmpptr(tmp, Address(rsp, 0)); + __ jccb(Assembler::equal, ok); + __ stop("exact klass and actual klass differ"); + __ bind(ok); + __ pop(tmp); + } +#endif + if (!no_conflict) { + if (exact_klass == NULL || TypeEntries::is_type_none(current_klass)) { + if (exact_klass != NULL) { + __ mov_metadata(tmp, exact_klass->constant_encoding()); + } else { + __ load_klass(tmp, tmp); + } + + __ xorptr(tmp, mdo_addr); + __ testptr(tmp, TypeEntries::type_klass_mask); + // klass seen before, nothing to do. The unknown bit may have been + // set already but no need to check. + __ jccb(Assembler::zero, next); + + __ testptr(tmp, TypeEntries::type_unknown); + __ jccb(Assembler::notZero, next); // already unknown. Nothing to do anymore. + + if (TypeEntries::is_type_none(current_klass)) { + __ cmpptr(mdo_addr, 0); + __ jccb(Assembler::equal, none); + __ cmpptr(mdo_addr, TypeEntries::null_seen); + __ jccb(Assembler::equal, none); + // There is a chance that the checks above (re-reading profiling + // data from memory) fail if another thread has just set the + // profiling to this obj's klass + __ xorptr(tmp, mdo_addr); + __ testptr(tmp, TypeEntries::type_klass_mask); + __ jccb(Assembler::zero, next); + } + } else { + assert(ciTypeEntries::valid_ciklass(current_klass) != NULL && + ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "conflict only"); + + __ movptr(tmp, mdo_addr); + __ testptr(tmp, TypeEntries::type_unknown); + __ jccb(Assembler::notZero, next); // already unknown. Nothing to do anymore. + } + + // different than before. Cannot keep accurate profile. + __ orptr(mdo_addr, TypeEntries::type_unknown); + + if (TypeEntries::is_type_none(current_klass)) { + __ jmpb(next); + + __ bind(none); + // first time here. Set profile type. + __ movptr(mdo_addr, tmp); + } + } else { + // There's a single possible klass at this profile point + assert(exact_klass != NULL, "should be"); + if (TypeEntries::is_type_none(current_klass)) { + __ mov_metadata(tmp, exact_klass->constant_encoding()); + __ xorptr(tmp, mdo_addr); + __ testptr(tmp, TypeEntries::type_klass_mask); +#ifdef ASSERT + __ jcc(Assembler::zero, next); + + { + Label ok; + __ push(tmp); + __ cmpptr(mdo_addr, 0); + __ jcc(Assembler::equal, ok); + __ cmpptr(mdo_addr, TypeEntries::null_seen); + __ jcc(Assembler::equal, ok); + // may have been set by another thread + __ mov_metadata(tmp, exact_klass->constant_encoding()); + __ xorptr(tmp, mdo_addr); + __ testptr(tmp, TypeEntries::type_mask); + __ jcc(Assembler::zero, ok); + + __ stop("unexpected profiling mismatch"); + __ bind(ok); + __ pop(tmp); + } +#else + __ jccb(Assembler::zero, next); +#endif + // first time here. Set profile type. + __ movptr(mdo_addr, tmp); + } else { + assert(ciTypeEntries::valid_ciklass(current_klass) != NULL && + ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "inconsistent"); + + __ movptr(tmp, mdo_addr); + __ testptr(tmp, TypeEntries::type_unknown); + __ jccb(Assembler::notZero, next); // already unknown. Nothing to do anymore. + + __ orptr(mdo_addr, TypeEntries::type_unknown); + } + } + + __ bind(next); + } +} + void LIR_Assembler::emit_delay(LIR_OpDelay*) { Unimplemented(); } diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp index 308befddc77..4a30d597b3e 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @@ -1468,19 +1468,18 @@ void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { addr = new LIR_Address(src.result(), offset, type); } - if (data != dst) { - __ move(data, dst); - data = dst; - } + // Because we want a 2-arg form of xchg and xadd + __ move(data, dst); + if (x->is_add()) { - __ xadd(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr); + __ xadd(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr); } else { if (is_obj) { // Do the pre-write barrier, if any. pre_barrier(LIR_OprFact::address(addr), LIR_OprFact::illegalOpr /* pre_val */, true /* do_load */, false /* patch */, NULL); } - __ xchg(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr); + __ xchg(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr); if (is_obj) { // Seems to be a precise address post_barrier(LIR_OprFact::address(addr), data); diff --git a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp index e4066e6b4db..f2210f0d35d 100644 --- a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp @@ -38,6 +38,9 @@ #include "runtime/vframeArray.hpp" #include "utilities/macros.hpp" #include "vmreg_x86.inline.hpp" +#if INCLUDE_ALL_GCS +#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" +#endif // Implementation of StubAssembler @@ -1753,13 +1756,17 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ leal(card_addr, __ as_Address(ArrayAddress(cardtable, index))); #endif - __ cmpb(Address(card_addr, 0), 0); + __ cmpb(Address(card_addr, 0), (int)G1SATBCardTableModRefBS::g1_young_card_val()); + __ jcc(Assembler::equal, done); + + __ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad)); + __ cmpb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val()); __ jcc(Assembler::equal, done); // storing region crossing non-NULL, card is clean. // dirty card and log. - __ movb(Address(card_addr, 0), 0); + __ movb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val()); __ cmpl(queue_index, 0); __ jcc(Assembler::equal, runtime); diff --git a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp index 1eef095b9a5..e669f5b6638 100644 --- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp +++ b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp @@ -367,7 +367,7 @@ address CppInterpreterGenerator::generate_stack_to_native_abi_converter(BasicTyp return entry; } -address CppInterpreter::return_entry(TosState state, int length) { +address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { // make it look good in the debugger return CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation); } diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp index c2a7c8b49e3..f0de7a44e76 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.cpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp @@ -639,7 +639,7 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) #ifdef CC_INTERP obj = istate->_oop_temp; #else - obj = (oop) at(interpreter_frame_oop_temp_offset); + obj = cast_to_oop(at(interpreter_frame_oop_temp_offset)); #endif // CC_INTERP } else { oop* obj_p = (oop*)tos_addr; diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp index c47f7d1c193..b194ffbcfbe 100644 --- a/hotspot/src/cpu/x86/vm/globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp @@ -79,6 +79,8 @@ define_pd_global(bool, UseMembar, false); // GC Ergo Flags define_pd_global(uintx, CMSYoungGenPerWorker, 64*M); // default max size of CMS young gen, per GC worker thread +define_pd_global(uintx, TypeProfileLevel, 111); + #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) \ \ develop(bool, IEEEPrecision, true, \ diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp new file mode 100644 index 00000000000..f47c0b1bb0c --- /dev/null +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp @@ -0,0 +1,229 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "interp_masm_x86.hpp" +#include "interpreter/interpreter.hpp" +#include "oops/methodData.hpp" + +#ifndef CC_INTERP +void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& mdo_addr) { + Label update, next, none; + + verify_oop(obj); + + testptr(obj, obj); + jccb(Assembler::notZero, update); + orptr(mdo_addr, TypeEntries::null_seen); + jmpb(next); + + bind(update); + load_klass(obj, obj); + + xorptr(obj, mdo_addr); + testptr(obj, TypeEntries::type_klass_mask); + jccb(Assembler::zero, next); // klass seen before, nothing to + // do. The unknown bit may have been + // set already but no need to check. + + testptr(obj, TypeEntries::type_unknown); + jccb(Assembler::notZero, next); // already unknown. Nothing to do anymore. + + cmpptr(mdo_addr, 0); + jccb(Assembler::equal, none); + cmpptr(mdo_addr, TypeEntries::null_seen); + jccb(Assembler::equal, none); + // There is a chance that the checks above (re-reading profiling + // data from memory) fail if another thread has just set the + // profiling to this obj's klass + xorptr(obj, mdo_addr); + testptr(obj, TypeEntries::type_klass_mask); + jccb(Assembler::zero, next); + + // different than before. Cannot keep accurate profile. + orptr(mdo_addr, TypeEntries::type_unknown); + jmpb(next); + + bind(none); + // first time here. Set profile type. + movptr(mdo_addr, obj); + + bind(next); +} + +void InterpreterMacroAssembler::profile_arguments_type(Register mdp, Register callee, Register tmp, bool is_virtual) { + if (!ProfileInterpreter) { + return; + } + + if (MethodData::profile_arguments() || MethodData::profile_return()) { + Label profile_continue; + + test_method_data_pointer(mdp, profile_continue); + + int off_to_start = is_virtual ? in_bytes(VirtualCallData::virtual_call_data_size()) : in_bytes(CounterData::counter_data_size()); + + cmpb(Address(mdp, in_bytes(DataLayout::tag_offset()) - off_to_start), is_virtual ? DataLayout::virtual_call_type_data_tag : DataLayout::call_type_data_tag); + jcc(Assembler::notEqual, profile_continue); + + if (MethodData::profile_arguments()) { + Label done; + int off_to_args = in_bytes(TypeEntriesAtCall::args_data_offset()); + addptr(mdp, off_to_args); + + for (int i = 0; i < TypeProfileArgsLimit; i++) { + if (i > 0 || MethodData::profile_return()) { + // If return value type is profiled we may have no argument to profile + movptr(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::cell_count_offset())-off_to_args)); + subl(tmp, i*TypeStackSlotEntries::per_arg_count()); + cmpl(tmp, TypeStackSlotEntries::per_arg_count()); + jcc(Assembler::less, done); + } + movptr(tmp, Address(callee, Method::const_offset())); + load_unsigned_short(tmp, Address(tmp, ConstMethod::size_of_parameters_offset())); + // stack offset o (zero based) from the start of the argument + // list, for n arguments translates into offset n - o - 1 from + // the end of the argument list + subptr(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::stack_slot_offset(i))-off_to_args)); + subl(tmp, 1); + Address arg_addr = argument_address(tmp); + movptr(tmp, arg_addr); + + Address mdo_arg_addr(mdp, in_bytes(TypeEntriesAtCall::argument_type_offset(i))-off_to_args); + profile_obj_type(tmp, mdo_arg_addr); + + int to_add = in_bytes(TypeStackSlotEntries::per_arg_size()); + addptr(mdp, to_add); + off_to_args += to_add; + } + + if (MethodData::profile_return()) { + movptr(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::cell_count_offset())-off_to_args)); + subl(tmp, TypeProfileArgsLimit*TypeStackSlotEntries::per_arg_count()); + } + + bind(done); + + if (MethodData::profile_return()) { + // We're right after the type profile for the last + // argument. tmp is the number of cell left in the + // CallTypeData/VirtualCallTypeData to reach its end. Non null + // if there's a return to profile. + assert(ReturnTypeEntry::static_cell_count() < TypeStackSlotEntries::per_arg_count(), "can't move past ret type"); + shll(tmp, exact_log2(DataLayout::cell_size)); + addptr(mdp, tmp); + } + movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp); + } else { + assert(MethodData::profile_return(), "either profile call args or call ret"); + update_mdp_by_constant(mdp, in_bytes(ReturnTypeEntry::size())); + } + + // mdp points right after the end of the + // CallTypeData/VirtualCallTypeData, right after the cells for the + // return value type if there's one + + bind(profile_continue); + } +} + +void InterpreterMacroAssembler::profile_return_type(Register mdp, Register ret, Register tmp) { + assert_different_registers(mdp, ret, tmp, _bcp_register); + if (ProfileInterpreter && MethodData::profile_return()) { + Label profile_continue, done; + + test_method_data_pointer(mdp, profile_continue); + + if (MethodData::profile_return_jsr292_only()) { + // If we don't profile all invoke bytecodes we must make sure + // it's a bytecode we indeed profile. We can't go back to the + // begining of the ProfileData we intend to update to check its + // type because we're right after it and we don't known its + // length + Label do_profile; + cmpb(Address(_bcp_register, 0), Bytecodes::_invokedynamic); + jcc(Assembler::equal, do_profile); + cmpb(Address(_bcp_register, 0), Bytecodes::_invokehandle); + jcc(Assembler::equal, do_profile); + get_method(tmp); + cmpb(Address(tmp, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_compiledLambdaForm); + jcc(Assembler::notEqual, profile_continue); + + bind(do_profile); + } + + Address mdo_ret_addr(mdp, -in_bytes(ReturnTypeEntry::size())); + mov(tmp, ret); + profile_obj_type(tmp, mdo_ret_addr); + + bind(profile_continue); + } +} + +void InterpreterMacroAssembler::profile_parameters_type(Register mdp, Register tmp1, Register tmp2) { + if (ProfileInterpreter && MethodData::profile_parameters()) { + Label profile_continue, done; + + test_method_data_pointer(mdp, profile_continue); + + // Load the offset of the area within the MDO used for + // parameters. If it's negative we're not profiling any parameters + movl(tmp1, Address(mdp, in_bytes(MethodData::parameters_type_data_di_offset()) - in_bytes(MethodData::data_offset()))); + testl(tmp1, tmp1); + jcc(Assembler::negative, profile_continue); + + // Compute a pointer to the area for parameters from the offset + // and move the pointer to the slot for the last + // parameters. Collect profiling from last parameter down. + // mdo start + parameters offset + array length - 1 + addptr(mdp, tmp1); + movptr(tmp1, Address(mdp, in_bytes(ArrayData::array_len_offset()))); + decrement(tmp1, TypeStackSlotEntries::per_arg_count()); + + Label loop; + bind(loop); + + int off_base = in_bytes(ParametersTypeData::stack_slot_offset(0)); + int type_base = in_bytes(ParametersTypeData::type_offset(0)); + Address::ScaleFactor per_arg_scale = Address::times(DataLayout::cell_size); + Address arg_off(mdp, tmp1, per_arg_scale, off_base); + Address arg_type(mdp, tmp1, per_arg_scale, type_base); + + // load offset on the stack from the slot for this parameter + movptr(tmp2, arg_off); + negptr(tmp2); + // read the parameter from the local area + movptr(tmp2, Address(_locals_register, tmp2, Interpreter::stackElementScale())); + + // profile the parameter + profile_obj_type(tmp2, arg_type); + + // go to next parameter + decrement(tmp1, TypeStackSlotEntries::per_arg_count()); + jcc(Assembler::positive, loop); + + bind(profile_continue); + } +} +#endif diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86.hpp new file mode 100644 index 00000000000..2ac4d026654 --- /dev/null +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.hpp @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef CPU_X86_VM_INTERP_MASM_X86_HPP +#define CPU_X86_VM_INTERP_MASM_X86_HPP + +#include "asm/macroAssembler.hpp" +#include "asm/macroAssembler.inline.hpp" +#include "interpreter/invocationCounter.hpp" +#include "runtime/frame.hpp" + +// This file specializes the assember with interpreter-specific macros + + +class InterpreterMacroAssembler: public MacroAssembler { + +#ifdef TARGET_ARCH_MODEL_x86_32 +# include "interp_masm_x86_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_x86_64 +# include "interp_masm_x86_64.hpp" +#endif + + private: + + Register _locals_register; // register that contains the pointer to the locals + Register _bcp_register; // register that contains the bcp + + public: +#ifndef CC_INTERP + void profile_obj_type(Register obj, const Address& mdo_addr); + void profile_arguments_type(Register mdp, Register callee, Register tmp, bool is_virtual); + void profile_return_type(Register mdp, Register ret, Register tmp); + void profile_parameters_type(Register mdp, Register tmp1, Register tmp2); +#endif /* !CC_INTERP */ + +}; + +#endif // CPU_X86_VM_INTERP_MASM_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp index 0e7f483a649..b6f2438db83 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp @@ -23,7 +23,7 @@ */ #include "precompiled.hpp" -#include "interp_masm_x86_32.hpp" +#include "interp_masm_x86.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "oops/arrayOop.hpp" @@ -196,7 +196,7 @@ void InterpreterMacroAssembler::check_and_handle_earlyret(Register java_thread) void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset) { assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode"); - movl(reg, Address(rsi, bcp_offset)); + load_unsigned_short(reg, Address(rsi, bcp_offset)); bswapl(reg); shrl(reg, 16); } @@ -1046,7 +1046,6 @@ void InterpreterMacroAssembler::profile_not_taken_branch(Register mdp) { } } - void InterpreterMacroAssembler::profile_call(Register mdp) { if (ProfileInterpreter) { Label profile_continue; diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp index 49a41f61d54..19ff288bfee 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp @@ -22,18 +22,6 @@ * */ -#ifndef CPU_X86_VM_INTERP_MASM_X86_32_HPP -#define CPU_X86_VM_INTERP_MASM_X86_32_HPP - -#include "asm/macroAssembler.hpp" -#include "asm/macroAssembler.inline.hpp" -#include "interpreter/invocationCounter.hpp" -#include "runtime/frame.hpp" - -// This file specializes the assember with interpreter-specific macros - - -class InterpreterMacroAssembler: public MacroAssembler { #ifndef CC_INTERP protected: // Interpreter specific version of call_VM_base @@ -59,7 +47,7 @@ class InterpreterMacroAssembler: public MacroAssembler { #endif /* CC_INTERP */ public: - InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code) {} + InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code), _locals_register(rdi), _bcp_register(rsi) {} void load_earlyret_value(TosState state); @@ -233,7 +221,3 @@ class InterpreterMacroAssembler: public MacroAssembler { // support for jvmti void notify_method_entry(); void notify_method_exit(TosState state, NotifyMethodExitMode mode); - -}; - -#endif // CPU_X86_VM_INTERP_MASM_X86_32_HPP diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp index 88d57d046a5..520c872a604 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp @@ -23,7 +23,7 @@ */ #include "precompiled.hpp" -#include "interp_masm_x86_64.hpp" +#include "interp_masm_x86.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "oops/arrayOop.hpp" @@ -192,7 +192,7 @@ void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp( Register reg, int bcp_offset) { assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode"); - movl(reg, Address(r13, bcp_offset)); + load_unsigned_short(reg, Address(r13, bcp_offset)); bswapl(reg); shrl(reg, 16); } @@ -1067,7 +1067,6 @@ void InterpreterMacroAssembler::profile_not_taken_branch(Register mdp) { } } - void InterpreterMacroAssembler::profile_call(Register mdp) { if (ProfileInterpreter) { Label profile_continue; diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp index 8bfc44fe4bc..36bd779ef9b 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp @@ -22,18 +22,6 @@ * */ -#ifndef CPU_X86_VM_INTERP_MASM_X86_64_HPP -#define CPU_X86_VM_INTERP_MASM_X86_64_HPP - -#include "asm/macroAssembler.hpp" -#include "asm/macroAssembler.inline.hpp" -#include "interpreter/invocationCounter.hpp" -#include "runtime/frame.hpp" - -// This file specializes the assember with interpreter-specific macros - - -class InterpreterMacroAssembler: public MacroAssembler { #ifndef CC_INTERP protected: // Interpreter specific version of call_VM_base @@ -55,7 +43,7 @@ class InterpreterMacroAssembler: public MacroAssembler { #endif // CC_INTERP public: - InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code) {} + InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code), _locals_register(r14), _bcp_register(r13) {} void load_earlyret_value(TosState state); @@ -250,6 +238,3 @@ class InterpreterMacroAssembler: public MacroAssembler { // support for jvmti/dtrace void notify_method_entry(); void notify_method_exit(TosState state, NotifyMethodExitMode mode); -}; - -#endif // CPU_X86_VM_INTERP_MASM_X86_64_HPP diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index fed50ef4286..5059a386371 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -1381,8 +1381,12 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) { jcc(Assembler::greater, loop); // Bang down shadow pages too. - // The -1 because we already subtracted 1 page. - for (int i = 0; i< StackShadowPages-1; i++) { + // At this point, (tmp-0) is the last address touched, so don't + // touch it again. (It was touched as (tmp-pagesize) but then tmp + // was post-decremented.) Skip this address by starting at i=1, and + // touch a few more pages below. N.B. It is important to touch all + // the way down to and including i=StackShadowPages. + for (int i = 1; i <= StackShadowPages; i++) { // this could be any sized move but this is can be a debugging crumb // so the bigger the better. movptr(Address(tmp, (-i*os::vm_page_size())), size ); @@ -3389,13 +3393,18 @@ void MacroAssembler::g1_write_barrier_post(Register store_addr, const Register card_addr = tmp; lea(card_addr, as_Address(ArrayAddress(cardtable, index))); #endif - cmpb(Address(card_addr, 0), 0); + cmpb(Address(card_addr, 0), (int)G1SATBCardTableModRefBS::g1_young_card_val()); jcc(Assembler::equal, done); + membar(Assembler::Membar_mask_bits(Assembler::StoreLoad)); + cmpb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val()); + jcc(Assembler::equal, done); + + // storing a region crossing, non-NULL oop, card is clean. // dirty card and log. - movb(Address(card_addr, 0), 0); + movb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val()); cmpl(queue_index, 0); jcc(Assembler::equal, runtime); @@ -5044,25 +5053,32 @@ void MacroAssembler::decode_heap_oop_not_null(Register dst, Register src) { } void MacroAssembler::encode_klass_not_null(Register r) { - assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); - // Use r12 as a scratch register in which to temporarily load the narrow_klass_base. - assert(r != r12_heapbase, "Encoding a klass in r12"); - mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); - subq(r, r12_heapbase); + if (Universe::narrow_klass_base() != NULL) { + // Use r12 as a scratch register in which to temporarily load the narrow_klass_base. + assert(r != r12_heapbase, "Encoding a klass in r12"); + mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); + subq(r, r12_heapbase); + } if (Universe::narrow_klass_shift() != 0) { assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); shrq(r, LogKlassAlignmentInBytes); } - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + reinit_heapbase(); + } } void MacroAssembler::encode_klass_not_null(Register dst, Register src) { if (dst == src) { encode_klass_not_null(src); } else { - mov64(dst, (int64_t)Universe::narrow_klass_base()); - negq(dst); - addq(dst, src); + if (Universe::narrow_klass_base() != NULL) { + mov64(dst, (int64_t)Universe::narrow_klass_base()); + negq(dst); + addq(dst, src); + } else { + movptr(dst, src); + } if (Universe::narrow_klass_shift() != 0) { assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); shrq(dst, LogKlassAlignmentInBytes); @@ -5076,15 +5092,19 @@ void MacroAssembler::encode_klass_not_null(Register dst, Register src) { // generate change, then this method needs to be updated. int MacroAssembler::instr_size_for_decode_klass_not_null() { assert (UseCompressedClassPointers, "only for compressed klass ptrs"); - // mov64 + addq + shlq? + mov64 (for reinit_heapbase()). - return (Universe::narrow_klass_shift() == 0 ? 20 : 24); + if (Universe::narrow_klass_base() != NULL) { + // mov64 + addq + shlq? + mov64 (for reinit_heapbase()). + return (Universe::narrow_klass_shift() == 0 ? 20 : 24); + } else { + // longest load decode klass function, mov64, leaq + return 16; + } } // !!! If the instructions that get generated here change then function // instr_size_for_decode_klass_not_null() needs to get updated. void MacroAssembler::decode_klass_not_null(Register r) { // Note: it will change flags - assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); assert (UseCompressedClassPointers, "should only be used for compressed headers"); assert(r != r12_heapbase, "Decoding a klass in r12"); // Cannot assert, unverified entry point counts instructions (see .ad file) @@ -5095,14 +5115,15 @@ void MacroAssembler::decode_klass_not_null(Register r) { shlq(r, LogKlassAlignmentInBytes); } // Use r12 as a scratch register in which to temporarily load the narrow_klass_base. - mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); - addq(r, r12_heapbase); - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); + addq(r, r12_heapbase); + reinit_heapbase(); + } } void MacroAssembler::decode_klass_not_null(Register dst, Register src) { // Note: it will change flags - assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); assert (UseCompressedClassPointers, "should only be used for compressed headers"); if (dst == src) { decode_klass_not_null(dst); @@ -5110,7 +5131,6 @@ void MacroAssembler::decode_klass_not_null(Register dst, Register src) { // Cannot assert, unverified entry point counts instructions (see .ad file) // vtableStubs also counts instructions in pd_code_size_limit. // Also do not verify_oop as this is called by verify_oop. - mov64(dst, (int64_t)Universe::narrow_klass_base()); if (Universe::narrow_klass_shift() != 0) { assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp index 293b3b73a37..198fc98e86a 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp @@ -773,6 +773,7 @@ class MacroAssembler: public Assembler { void orptr(Register dst, Address src) { LP64_ONLY(orq(dst, src)) NOT_LP64(orl(dst, src)); } void orptr(Register dst, Register src) { LP64_ONLY(orq(dst, src)) NOT_LP64(orl(dst, src)); } void orptr(Register dst, int32_t src) { LP64_ONLY(orq(dst, src)) NOT_LP64(orl(dst, src)); } + void orptr(Address dst, int32_t imm32) { LP64_ONLY(orq(dst, imm32)) NOT_LP64(orl(dst, imm32)); } void testptr(Register src, int32_t imm32) { LP64_ONLY(testq(src, imm32)) NOT_LP64(testl(src, imm32)); } void testptr(Register src1, Register src2); diff --git a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp index 30c9199436d..3c12385fdbb 100644 --- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp +++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -114,6 +114,11 @@ void MethodHandles::verify_ref_kind(MacroAssembler* _masm, int ref_kind, Registe void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register temp, bool for_compiler_entry) { assert(method == rbx, "interpreter calling convention"); + + Label L_no_such_method; + __ testptr(rbx, rbx); + __ jcc(Assembler::zero, L_no_such_method); + __ verify_method_ptr(method); if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) { @@ -138,6 +143,9 @@ void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register meth const ByteSize entry_offset = for_compiler_entry ? Method::from_compiled_offset() : Method::from_interpreted_offset(); __ jmp(Address(method, entry_offset)); + + __ bind(L_no_such_method); + __ jump(RuntimeAddress(StubRoutines::throw_AbstractMethodError_entry())); } void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm, @@ -475,7 +483,7 @@ void trace_method_handle_stub(const char* adaptername, const char* mh_reg_name = has_mh ? "rcx_mh" : "rcx"; tty->print_cr("MH %s %s="PTR_FORMAT" sp="PTR_FORMAT, adaptername, mh_reg_name, - mh, entry_sp); + (void *)mh, entry_sp); if (Verbose) { tty->print_cr("Registers:"); diff --git a/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp b/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp index 7165872c239..f8a9407933b 100644 --- a/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp +++ b/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp @@ -26,11 +26,8 @@ #include "asm/assembler.hpp" #include "asm/register.hpp" #include "register_x86.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "interp_masm_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "interp_masm_x86_64.hpp" +#ifdef TARGET_ARCH_x86 +# include "interp_masm_x86.hpp" #endif REGISTER_DEFINITION(Register, noreg); diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp index a632fbab313..ed2cef16e58 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp @@ -34,9 +34,9 @@ // Run with +PrintInterpreter to get the VM to print out the size. // Max size with JVMTI #ifdef AMD64 - const static int InterpreterCodeSize = 208 * 1024; + const static int InterpreterCodeSize = 256 * 1024; #else - const static int InterpreterCodeSize = 176 * 1024; + const static int InterpreterCodeSize = 224 * 1024; #endif // AMD64 #endif // CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp index 52e459900c7..c7fc0472677 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp @@ -150,13 +150,12 @@ address TemplateInterpreterGenerator::generate_continuation_for(TosState state) } -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { - TosState incoming_state = state; +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { address entry = __ pc(); #ifdef COMPILER2 // The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases - if ((incoming_state == ftos && UseSSE < 1) || (incoming_state == dtos && UseSSE < 2)) { + if ((state == ftos && UseSSE < 1) || (state == dtos && UseSSE < 2)) { for (int i = 1; i < 8; i++) { __ ffree(i); } @@ -164,7 +163,7 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, __ empty_FPU_stack(); } #endif - if ((incoming_state == ftos && UseSSE < 1) || (incoming_state == dtos && UseSSE < 2)) { + if ((state == ftos && UseSSE < 1) || (state == dtos && UseSSE < 2)) { __ MacroAssembler::verify_FPU(1, "generate_return_entry_for compiled"); } else { __ MacroAssembler::verify_FPU(0, "generate_return_entry_for compiled"); @@ -172,12 +171,12 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, // In SSE mode, interpreter returns FP results in xmm0 but they need // to end up back on the FPU so it can operate on them. - if (incoming_state == ftos && UseSSE >= 1) { + if (state == ftos && UseSSE >= 1) { __ subptr(rsp, wordSize); __ movflt(Address(rsp, 0), xmm0); __ fld_s(Address(rsp, 0)); __ addptr(rsp, wordSize); - } else if (incoming_state == dtos && UseSSE >= 2) { + } else if (state == dtos && UseSSE >= 2) { __ subptr(rsp, 2*wordSize); __ movdbl(Address(rsp, 0), xmm0); __ fld_d(Address(rsp, 0)); @@ -194,26 +193,21 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, __ restore_bcp(); __ restore_locals(); - Label L_got_cache, L_giant_index; - if (EnableInvokeDynamic) { - __ cmpb(Address(rsi, 0), Bytecodes::_invokedynamic); - __ jcc(Assembler::equal, L_giant_index); + if (state == atos) { + Register mdp = rbx; + Register tmp = rcx; + __ profile_return_type(mdp, rax, tmp); } - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u2)); - __ bind(L_got_cache); - __ movl(rbx, Address(rbx, rcx, - Address::times_ptr, ConstantPoolCache::base_offset() + - ConstantPoolCacheEntry::flags_offset())); - __ andptr(rbx, 0xFF); - __ lea(rsp, Address(rsp, rbx, Interpreter::stackElementScale())); - __ dispatch_next(state, step); - // out of the main line of code... - if (EnableInvokeDynamic) { - __ bind(L_giant_index); - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u4)); - __ jmp(L_got_cache); - } + const Register cache = rbx; + const Register index = rcx; + __ get_cache_and_index_at_bcp(cache, index, 1, index_size); + + const Register flags = cache; + __ movl(flags, Address(cache, index, Address::times_ptr, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset())); + __ andl(flags, ConstantPoolCacheEntry::parameter_size_mask); + __ lea(rsp, Address(rsp, flags, Interpreter::stackElementScale())); + __ dispatch_next(state, step); return entry; } @@ -1484,6 +1478,7 @@ address InterpreterGenerator::generate_normal_entry(bool synchronized) { in_bytes(JavaThread::do_not_unlock_if_synchronized_offset())); __ movbool(do_not_unlock_if_synchronized, true); + __ profile_parameters_type(rax, rcx, rdx); // increment invocation count & check for overflow Label invocation_counter_overflow; Label profile_method; diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp index 6648bcd08bf..ef1aa8409b9 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp @@ -166,7 +166,7 @@ address TemplateInterpreterGenerator::generate_continuation_for(TosState state) } -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { address entry = __ pc(); // Restore stack bottom in case i2c adjusted stack @@ -177,27 +177,21 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, __ restore_bcp(); __ restore_locals(); - Label L_got_cache, L_giant_index; - if (EnableInvokeDynamic) { - __ cmpb(Address(r13, 0), Bytecodes::_invokedynamic); - __ jcc(Assembler::equal, L_giant_index); + if (state == atos) { + Register mdp = rbx; + Register tmp = rcx; + __ profile_return_type(mdp, rax, tmp); } - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u2)); - __ bind(L_got_cache); - __ movl(rbx, Address(rbx, rcx, - Address::times_ptr, - in_bytes(ConstantPoolCache::base_offset()) + - 3 * wordSize)); - __ andl(rbx, 0xFF); - __ lea(rsp, Address(rsp, rbx, Address::times_8)); - __ dispatch_next(state, step); - // out of the main line of code... - if (EnableInvokeDynamic) { - __ bind(L_giant_index); - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u4)); - __ jmp(L_got_cache); - } + const Register cache = rbx; + const Register index = rcx; + __ get_cache_and_index_at_bcp(cache, index, 1, index_size); + + const Register flags = cache; + __ movl(flags, Address(cache, index, Address::times_ptr, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset())); + __ andl(flags, ConstantPoolCacheEntry::parameter_size_mask); + __ lea(rsp, Address(rsp, flags, Interpreter::stackElementScale())); + __ dispatch_next(state, step); return entry; } @@ -1491,6 +1485,7 @@ address InterpreterGenerator::generate_normal_entry(bool synchronized) { in_bytes(JavaThread::do_not_unlock_if_synchronized_offset())); __ movbool(do_not_unlock_if_synchronized, true); + __ profile_parameters_type(rax, rcx, rdx); // increment invocation count & check for overflow Label invocation_counter_overflow; Label profile_method; diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp index 6c6cc4f9474..3c2ec9f426d 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp @@ -558,7 +558,7 @@ void TemplateTable::aload() { void TemplateTable::locals_index_wide(Register reg) { - __ movl(reg, at_bcp(2)); + __ load_unsigned_short(reg, at_bcp(2)); __ bswapl(reg); __ shrl(reg, 16); __ negptr(reg); @@ -1552,7 +1552,11 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { InvocationCounter::counter_offset(); // Load up EDX with the branch displacement - __ movl(rdx, at_bcp(1)); + if (is_wide) { + __ movl(rdx, at_bcp(1)); + } else { + __ load_signed_short(rdx, at_bcp(1)); + } __ bswapl(rdx); if (!is_wide) __ sarl(rdx, 16); LP64_ONLY(__ movslq(rdx, rdx)); @@ -2925,9 +2929,7 @@ void TemplateTable::prepare_invoke(int byte_no, ConstantPoolCacheEntry::verify_tos_state_shift(); // load return address { - const address table_addr = (is_invokeinterface || is_invokedynamic) ? - (address)Interpreter::return_5_addrs_by_index_table() : - (address)Interpreter::return_3_addrs_by_index_table(); + const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); ExternalAddress table(table_addr); __ movptr(flags, ArrayAddress(table, Address(noreg, flags, Address::times_ptr))); } @@ -2970,6 +2972,7 @@ void TemplateTable::invokevirtual_helper(Register index, // profile this call __ profile_final_call(rax); + __ profile_arguments_type(rax, method, rsi, true); __ jump_from_interpreted(method, rax); @@ -2984,6 +2987,7 @@ void TemplateTable::invokevirtual_helper(Register index, // get target Method* & entry point __ lookup_virtual_method(rax, index, method); + __ profile_arguments_type(rdx, method, rsi, true); __ jump_from_interpreted(method, rdx); } @@ -3013,6 +3017,7 @@ void TemplateTable::invokespecial(int byte_no) { __ null_check(rcx); // do the call __ profile_call(rax); + __ profile_arguments_type(rax, rbx, rsi, false); __ jump_from_interpreted(rbx, rax); } @@ -3023,6 +3028,7 @@ void TemplateTable::invokestatic(int byte_no) { prepare_invoke(byte_no, rbx); // get f1 Method* // do the call __ profile_call(rax); + __ profile_arguments_type(rax, rbx, rsi, false); __ jump_from_interpreted(rbx, rax); } @@ -3082,6 +3088,8 @@ void TemplateTable::invokeinterface(int byte_no) { __ testptr(rbx, rbx); __ jcc(Assembler::zero, no_such_method); + __ profile_arguments_type(rdx, rbx, rsi, true); + // do the call // rcx: receiver // rbx,: Method* @@ -3138,6 +3146,7 @@ void TemplateTable::invokehandle(int byte_no) { // FIXME: profile the LambdaForm also __ profile_final_call(rax); + __ profile_arguments_type(rdx, rbx_method, rsi, true); __ jump_from_interpreted(rbx_method, rdx); } @@ -3171,6 +3180,7 @@ void TemplateTable::invokedynamic(int byte_no) { // %%% should make a type profile for any invokedynamic that takes a ref argument // profile this call __ profile_call(rsi); + __ profile_arguments_type(rdx, rbx, rsi, false); __ verify_oop(rax_callsite); diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp index e97c5386c7a..544019c7179 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp @@ -568,7 +568,7 @@ void TemplateTable::aload() { } void TemplateTable::locals_index_wide(Register reg) { - __ movl(reg, at_bcp(2)); + __ load_unsigned_short(reg, at_bcp(2)); __ bswapl(reg); __ shrl(reg, 16); __ negptr(reg); @@ -1575,7 +1575,11 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { InvocationCounter::counter_offset(); // Load up edx with the branch displacement - __ movl(rdx, at_bcp(1)); + if (is_wide) { + __ movl(rdx, at_bcp(1)); + } else { + __ load_signed_short(rdx, at_bcp(1)); + } __ bswapl(rdx); if (!is_wide) { @@ -2980,9 +2984,7 @@ void TemplateTable::prepare_invoke(int byte_no, ConstantPoolCacheEntry::verify_tos_state_shift(); // load return address { - const address table_addr = (is_invokeinterface || is_invokedynamic) ? - (address)Interpreter::return_5_addrs_by_index_table() : - (address)Interpreter::return_3_addrs_by_index_table(); + const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); ExternalAddress table(table_addr); __ lea(rscratch1, table); __ movptr(flags, Address(rscratch1, flags, Address::times_ptr)); @@ -3026,6 +3028,7 @@ void TemplateTable::invokevirtual_helper(Register index, // profile this call __ profile_final_call(rax); + __ profile_arguments_type(rax, method, r13, true); __ jump_from_interpreted(method, rax); @@ -3040,6 +3043,7 @@ void TemplateTable::invokevirtual_helper(Register index, // get target Method* & entry point __ lookup_virtual_method(rax, index, method); + __ profile_arguments_type(rdx, method, r13, true); __ jump_from_interpreted(method, rdx); } @@ -3069,6 +3073,7 @@ void TemplateTable::invokespecial(int byte_no) { __ null_check(rcx); // do the call __ profile_call(rax); + __ profile_arguments_type(rax, rbx, r13, false); __ jump_from_interpreted(rbx, rax); } @@ -3079,6 +3084,7 @@ void TemplateTable::invokestatic(int byte_no) { prepare_invoke(byte_no, rbx); // get f1 Method* // do the call __ profile_call(rax); + __ profile_arguments_type(rax, rbx, r13, false); __ jump_from_interpreted(rbx, rax); } @@ -3136,6 +3142,8 @@ void TemplateTable::invokeinterface(int byte_no) { __ testptr(rbx, rbx); __ jcc(Assembler::zero, no_such_method); + __ profile_arguments_type(rdx, rbx, r13, true); + // do the call // rcx: receiver // rbx,: Method* @@ -3193,6 +3201,7 @@ void TemplateTable::invokehandle(int byte_no) { // FIXME: profile the LambdaForm also __ profile_final_call(rax); + __ profile_arguments_type(rdx, rbx_method, r13, true); __ jump_from_interpreted(rbx_method, rdx); } @@ -3226,6 +3235,7 @@ void TemplateTable::invokedynamic(int byte_no) { // %%% should make a type profile for any invokedynamic that takes a ref argument // profile this call __ profile_call(r13); + __ profile_arguments_type(rdx, rbx_method, r13, false); __ verify_oop(rax_callsite); diff --git a/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp b/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp index c470004ebc8..3e7b4243510 100644 --- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp @@ -25,7 +25,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" #include "code/vtableStubs.hpp" -#include "interp_masm_x86_32.hpp" +#include "interp_masm_x86.hpp" #include "memory/resourceArea.hpp" #include "oops/instanceKlass.hpp" #include "oops/klassVtable.hpp" @@ -58,6 +58,11 @@ extern "C" void bad_compiled_vtable_index(JavaThread* thread, oop receiver, int VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { const int i486_code_length = VtableStub::pd_code_size_limit(true); VtableStub* s = new(i486_code_length) VtableStub(true, vtable_index); + // Can be NULL if there is no free space in the code cache. + if (s == NULL) { + return NULL; + } + ResourceMark rm; CodeBuffer cb(s->entry_point(), i486_code_length); MacroAssembler* masm = new MacroAssembler(&cb); @@ -132,6 +137,11 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) { // add code here, bump the code stub size returned by pd_code_size_limit! const int i486_code_length = VtableStub::pd_code_size_limit(false); VtableStub* s = new(i486_code_length) VtableStub(false, itable_index); + // Can be NULL if there is no free space in the code cache. + if (s == NULL) { + return NULL; + } + ResourceMark rm; CodeBuffer cb(s->entry_point(), i486_code_length); MacroAssembler* masm = new MacroAssembler(&cb); diff --git a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp index 5f5f94f41a5..4fc385f9737 100644 --- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp @@ -25,7 +25,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" #include "code/vtableStubs.hpp" -#include "interp_masm_x86_64.hpp" +#include "interp_masm_x86.hpp" #include "memory/resourceArea.hpp" #include "oops/instanceKlass.hpp" #include "oops/klassVtable.hpp" @@ -49,6 +49,11 @@ extern "C" void bad_compiled_vtable_index(JavaThread* thread, VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { const int amd64_code_length = VtableStub::pd_code_size_limit(true); VtableStub* s = new(amd64_code_length) VtableStub(true, vtable_index); + // Can be NULL if there is no free space in the code cache. + if (s == NULL) { + return NULL; + } + ResourceMark rm; CodeBuffer cb(s->entry_point(), amd64_code_length); MacroAssembler* masm = new MacroAssembler(&cb); @@ -126,6 +131,11 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) { // returned by pd_code_size_limit! const int amd64_code_length = VtableStub::pd_code_size_limit(false); VtableStub* s = new(amd64_code_length) VtableStub(false, itable_index); + // Can be NULL if there is no free space in the code cache. + if (s == NULL) { + return NULL; + } + ResourceMark rm; CodeBuffer cb(s->entry_point(), amd64_code_length); MacroAssembler* masm = new MacroAssembler(&cb); diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index 316ebe2911d..2aa9e5f5793 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -351,7 +351,7 @@ void emit_d32_reloc(CodeBuffer &cbuf, int d32, RelocationHolder const& rspec, int format) { #ifdef ASSERT if (rspec.reloc()->type() == relocInfo::oop_type && d32 != 0 && d32 != (int)Universe::non_oop_word()) { - assert(oop(d32)->is_oop() && (ScavengeRootsInCode || !oop(d32)->is_scavengable()), "cannot embed scavengable oops in code"); + assert(cast_to_oop(d32)->is_oop() && (ScavengeRootsInCode || !cast_to_oop(d32)->is_scavengable()), "cannot embed scavengable oops in code"); } #endif cbuf.relocate(cbuf.insts_mark(), rspec, format); @@ -1534,6 +1534,19 @@ const RegMask Matcher::method_handle_invoke_SP_save_mask() { return EBP_REG_mask(); } +const RegMask Matcher::mathExactI_result_proj_mask() { + return EAX_REG_mask(); +} + +const RegMask Matcher::mathExactL_result_proj_mask() { + ShouldNotReachHere(); + return RegMask(); +} + +const RegMask Matcher::mathExactI_flags_proj_mask() { + return INT_FLAGS_mask(); +} + // Returns true if the high 32 bits of the value is known to be zero. bool is_operand_hi32_zero(Node* n) { int opc = n->Opcode(); @@ -4922,6 +4935,8 @@ operand cmpOp() %{ greater_equal(0xD, "ge"); less_equal(0xE, "le"); greater(0xF, "g"); + overflow(0x0, "o"); + no_overflow(0x1, "no"); %} %} @@ -4939,6 +4954,8 @@ operand cmpOpU() %{ greater_equal(0x3, "nb"); less_equal(0x6, "be"); greater(0x7, "nbe"); + overflow(0x0, "o"); + no_overflow(0x1, "no"); %} %} @@ -4957,6 +4974,8 @@ operand cmpOpUCF() %{ greater_equal(0x3, "nb"); less_equal(0x6, "be"); greater(0x7, "nbe"); + overflow(0x0, "o"); + no_overflow(0x1, "no"); %} %} @@ -4974,6 +4993,8 @@ operand cmpOpUCF2() %{ greater_equal(0x3, "nb"); less_equal(0x6, "be"); greater(0x7, "nbe"); + overflow(0x0, "o"); + no_overflow(0x1, "no"); %} %} @@ -4981,6 +5002,8 @@ operand cmpOpUCF2() %{ operand cmpOp_fcmov() %{ match(Bool); + predicate(n->as_Bool()->_test._test != BoolTest::overflow && + n->as_Bool()->_test._test != BoolTest::no_overflow); format %{ "" %} interface(COND_INTER) %{ equal (0x0C8); @@ -4989,6 +5012,8 @@ operand cmpOp_fcmov() %{ greater_equal(0x1C0); less_equal (0x0D0); greater (0x1D0); + overflow(0x0, "o"); // not really supported by the instruction + no_overflow(0x1, "no"); // not really supported by the instruction %} %} @@ -5004,6 +5029,8 @@ operand cmpOp_commute() %{ greater_equal(0xE, "le"); less_equal(0xD, "ge"); greater(0xC, "l"); + overflow(0x0, "o"); + no_overflow(0x1, "no"); %} %} @@ -7496,6 +7523,45 @@ instruct cmovL_regUCF(cmpOpUCF cop, eFlagsRegUCF cr, eRegL dst, eRegL src) %{ //----------Arithmetic Instructions-------------------------------------------- //----------Addition Instructions---------------------------------------------- + +instruct addExactI_eReg(eAXRegI dst, rRegI src, eFlagsReg cr) +%{ + match(AddExactI dst src); + effect(DEF cr); + + format %{ "ADD $dst, $src\t# addExact int" %} + ins_encode %{ + __ addl($dst$$Register, $src$$Register); + %} + ins_pipe(ialu_reg_reg); +%} + +instruct addExactI_eReg_imm(eAXRegI dst, immI src, eFlagsReg cr) +%{ + match(AddExactI dst src); + effect(DEF cr); + + format %{ "ADD $dst, $src\t# addExact int" %} + ins_encode %{ + __ addl($dst$$Register, $src$$constant); + %} + ins_pipe(ialu_reg_reg); +%} + +instruct addExactI_eReg_mem(eAXRegI dst, memory src, eFlagsReg cr) +%{ + match(AddExactI dst (LoadI src)); + effect(DEF cr); + + ins_cost(125); + format %{ "ADD $dst,$src\t# addExact int" %} + ins_encode %{ + __ addl($dst$$Register, $src$$Address); + %} + ins_pipe( ialu_reg_mem ); +%} + + // Integer Addition Instructions instruct addI_eReg(rRegI dst, rRegI src, eFlagsReg cr) %{ match(Set dst (AddI dst src)); @@ -7804,6 +7870,44 @@ instruct xchgP( memory mem, pRegP newval) %{ %} //----------Subtraction Instructions------------------------------------------- + +instruct subExactI_eReg(eAXRegI dst, rRegI src, eFlagsReg cr) +%{ + match(SubExactI dst src); + effect(DEF cr); + + format %{ "SUB $dst, $src\t# subExact int" %} + ins_encode %{ + __ subl($dst$$Register, $src$$Register); + %} + ins_pipe(ialu_reg_reg); +%} + +instruct subExactI_eReg_imm(eAXRegI dst, immI src, eFlagsReg cr) +%{ + match(SubExactI dst src); + effect(DEF cr); + + format %{ "SUB $dst, $src\t# subExact int" %} + ins_encode %{ + __ subl($dst$$Register, $src$$constant); + %} + ins_pipe(ialu_reg_reg); +%} + +instruct subExactI_eReg_mem(eAXRegI dst, memory src, eFlagsReg cr) +%{ + match(SubExactI dst (LoadI src)); + effect(DEF cr); + + ins_cost(125); + format %{ "SUB $dst,$src\t# subExact int" %} + ins_encode %{ + __ subl($dst$$Register, $src$$Address); + %} + ins_pipe( ialu_reg_mem ); +%} + // Integer Subtraction Instructions instruct subI_eReg(rRegI dst, rRegI src, eFlagsReg cr) %{ match(Set dst (SubI dst src)); @@ -7872,6 +7976,16 @@ instruct negI_eReg(rRegI dst, immI0 zero, eFlagsReg cr) %{ ins_pipe( ialu_reg ); %} +instruct negExactI_eReg(eAXRegI dst, eFlagsReg cr) %{ + match(NegExactI dst); + effect(DEF cr); + + format %{ "NEG $dst\t# negExact int"%} + ins_encode %{ + __ negl($dst$$Register); + %} + ins_pipe(ialu_reg); +%} //----------Multiplication/Division Instructions------------------------------- // Integer Multiplication Instructions @@ -8084,6 +8198,46 @@ instruct mulL_eReg_con(eADXRegL dst, immL_127 src, rRegI tmp, eFlagsReg cr) %{ ins_pipe( pipe_slow ); %} +instruct mulExactI_eReg(eAXRegI dst, rRegI src, eFlagsReg cr) +%{ + match(MulExactI dst src); + effect(DEF cr); + + ins_cost(300); + format %{ "IMUL $dst, $src\t# mulExact int" %} + ins_encode %{ + __ imull($dst$$Register, $src$$Register); + %} + ins_pipe(ialu_reg_reg_alu0); +%} + +instruct mulExactI_eReg_imm(eAXRegI dst, rRegI src, immI imm, eFlagsReg cr) +%{ + match(MulExactI src imm); + effect(DEF cr); + + ins_cost(300); + format %{ "IMUL $dst, $src, $imm\t# mulExact int" %} + ins_encode %{ + __ imull($dst$$Register, $src$$Register, $imm$$constant); + %} + ins_pipe(ialu_reg_reg_alu0); +%} + +instruct mulExactI_eReg_mem(eAXRegI dst, memory src, eFlagsReg cr) +%{ + match(MulExactI dst (LoadI src)); + effect(DEF cr); + + ins_cost(350); + format %{ "IMUL $dst, $src\t# mulExact int" %} + ins_encode %{ + __ imull($dst$$Register, $src$$Address); + %} + ins_pipe(ialu_reg_mem_alu0); +%} + + // Integer DIV with Register instruct divI_eReg(eAXRegI rax, eDXRegI rdx, eCXRegI div, eFlagsReg cr) %{ match(Set rax (DivI rax div)); diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index ed13b3da1d1..182a7012ac8 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -529,7 +529,7 @@ void emit_d32_reloc(CodeBuffer& cbuf, int d32, RelocationHolder const& rspec, in if (rspec.reloc()->type() == relocInfo::oop_type && d32 != 0 && d32 != (intptr_t) Universe::non_oop_word()) { assert(Universe::heap()->is_in_reserved((address)(intptr_t)d32), "should be real oop"); - assert(oop((intptr_t)d32)->is_oop() && (ScavengeRootsInCode || !oop((intptr_t)d32)->is_scavengable()), "cannot embed scavengable oops in code"); + assert(cast_to_oop((intptr_t)d32)->is_oop() && (ScavengeRootsInCode || !cast_to_oop((intptr_t)d32)->is_scavengable()), "cannot embed scavengable oops in code"); } #endif cbuf.relocate(cbuf.insts_mark(), rspec, format); @@ -556,7 +556,7 @@ void emit_d64_reloc(CodeBuffer& cbuf, int64_t d64, RelocationHolder const& rspec if (rspec.reloc()->type() == relocInfo::oop_type && d64 != 0 && d64 != (int64_t) Universe::non_oop_word()) { assert(Universe::heap()->is_in_reserved((address)d64), "should be real oop"); - assert(oop(d64)->is_oop() && (ScavengeRootsInCode || !oop(d64)->is_scavengable()), + assert(cast_to_oop(d64)->is_oop() && (ScavengeRootsInCode || !cast_to_oop(d64)->is_scavengable()), "cannot embed scavengable oops in code"); } #endif @@ -1649,6 +1649,18 @@ const RegMask Matcher::method_handle_invoke_SP_save_mask() { return PTR_RBP_REG_mask(); } +const RegMask Matcher::mathExactI_result_proj_mask() { + return INT_RAX_REG_mask(); +} + +const RegMask Matcher::mathExactL_result_proj_mask() { + return LONG_RAX_REG_mask(); +} + +const RegMask Matcher::mathExactI_flags_proj_mask() { + return INT_FLAGS_mask(); +} + %} //----------ENCODING BLOCK----------------------------------------------------- @@ -4133,6 +4145,8 @@ operand cmpOp() greater_equal(0xD, "ge"); less_equal(0xE, "le"); greater(0xF, "g"); + overflow(0x0, "o"); + no_overflow(0x1, "no"); %} %} @@ -4151,6 +4165,8 @@ operand cmpOpU() greater_equal(0x3, "nb"); less_equal(0x6, "be"); greater(0x7, "nbe"); + overflow(0x0, "o"); + no_overflow(0x1, "no"); %} %} @@ -4170,6 +4186,8 @@ operand cmpOpUCF() %{ greater_equal(0x3, "nb"); less_equal(0x6, "be"); greater(0x7, "nbe"); + overflow(0x0, "o"); + no_overflow(0x1, "no"); %} %} @@ -4187,6 +4205,8 @@ operand cmpOpUCF2() %{ greater_equal(0x3, "nb"); less_equal(0x6, "be"); greater(0x7, "nbe"); + overflow(0x0, "o"); + no_overflow(0x1, "no"); %} %} @@ -6922,6 +6942,82 @@ instruct cmovD_regUCF(cmpOpUCF cop, rFlagsRegUCF cr, regD dst, regD src) %{ //----------Arithmetic Instructions-------------------------------------------- //----------Addition Instructions---------------------------------------------- +instruct addExactI_rReg(rax_RegI dst, rRegI src, rFlagsReg cr) +%{ + match(AddExactI dst src); + effect(DEF cr); + + format %{ "addl $dst, $src\t# addExact int" %} + ins_encode %{ + __ addl($dst$$Register, $src$$Register); + %} + ins_pipe(ialu_reg_reg); +%} + +instruct addExactI_rReg_imm(rax_RegI dst, immI src, rFlagsReg cr) +%{ + match(AddExactI dst src); + effect(DEF cr); + + format %{ "addl $dst, $src\t# addExact int" %} + ins_encode %{ + __ addl($dst$$Register, $src$$constant); + %} + ins_pipe(ialu_reg_reg); +%} + +instruct addExactI_rReg_mem(rax_RegI dst, memory src, rFlagsReg cr) +%{ + match(AddExactI dst (LoadI src)); + effect(DEF cr); + + ins_cost(125); // XXX + format %{ "addl $dst, $src\t# addExact int" %} + ins_encode %{ + __ addl($dst$$Register, $src$$Address); + %} + + ins_pipe(ialu_reg_mem); +%} + +instruct addExactL_rReg(rax_RegL dst, rRegL src, rFlagsReg cr) +%{ + match(AddExactL dst src); + effect(DEF cr); + + format %{ "addq $dst, $src\t# addExact long" %} + ins_encode %{ + __ addq($dst$$Register, $src$$Register); + %} + ins_pipe(ialu_reg_reg); +%} + +instruct addExactL_rReg_imm(rax_RegL dst, immL32 src, rFlagsReg cr) +%{ + match(AddExactL dst src); + effect(DEF cr); + + format %{ "addq $dst, $src\t# addExact long" %} + ins_encode %{ + __ addq($dst$$Register, $src$$constant); + %} + ins_pipe(ialu_reg_reg); +%} + +instruct addExactL_rReg_mem(rax_RegL dst, memory src, rFlagsReg cr) +%{ + match(AddExactL dst (LoadL src)); + effect(DEF cr); + + ins_cost(125); // XXX + format %{ "addq $dst, $src\t# addExact long" %} + ins_encode %{ + __ addq($dst$$Register, $src$$Address); + %} + + ins_pipe(ialu_reg_mem); +%} + instruct addI_rReg(rRegI dst, rRegI src, rFlagsReg cr) %{ match(Set dst (AddI dst src)); @@ -7534,6 +7630,80 @@ instruct subI_mem_imm(memory dst, immI src, rFlagsReg cr) ins_pipe(ialu_mem_imm); %} +instruct subExactI_rReg(rax_RegI dst, rRegI src, rFlagsReg cr) +%{ + match(SubExactI dst src); + effect(DEF cr); + + format %{ "subl $dst, $src\t# subExact int" %} + ins_encode %{ + __ subl($dst$$Register, $src$$Register); + %} + ins_pipe(ialu_reg_reg); +%} + +instruct subExactI_rReg_imm(rax_RegI dst, immI src, rFlagsReg cr) +%{ + match(SubExactI dst src); + effect(DEF cr); + + format %{ "subl $dst, $src\t# subExact int" %} + ins_encode %{ + __ subl($dst$$Register, $src$$constant); + %} + ins_pipe(ialu_reg_reg); +%} + +instruct subExactI_rReg_mem(rax_RegI dst, memory src, rFlagsReg cr) +%{ + match(SubExactI dst (LoadI src)); + effect(DEF cr); + + ins_cost(125); + format %{ "subl $dst, $src\t# subExact int" %} + ins_encode %{ + __ subl($dst$$Register, $src$$Address); + %} + ins_pipe(ialu_reg_mem); +%} + +instruct subExactL_rReg(rax_RegL dst, rRegL src, rFlagsReg cr) +%{ + match(SubExactL dst src); + effect(DEF cr); + + format %{ "subq $dst, $src\t# subExact long" %} + ins_encode %{ + __ subq($dst$$Register, $src$$Register); + %} + ins_pipe(ialu_reg_reg); +%} + +instruct subExactL_rReg_imm(rax_RegL dst, immL32 src, rFlagsReg cr) +%{ + match(SubExactL dst (LoadL src)); + effect(DEF cr); + + format %{ "subq $dst, $src\t# subExact long" %} + ins_encode %{ + __ subq($dst$$Register, $src$$constant); + %} + ins_pipe(ialu_reg_reg); +%} + +instruct subExactL_rReg_mem(rax_RegI dst, memory src, rFlagsReg cr) +%{ + match(SubExactI dst src); + effect(DEF cr); + + ins_cost(125); + format %{ "subq $dst, $src\t# subExact long" %} + ins_encode %{ + __ subq($dst$$Register, $src$$Address); + %} + ins_pipe(ialu_reg_mem); +%} + instruct subL_rReg(rRegL dst, rRegL src, rFlagsReg cr) %{ match(Set dst (SubL dst src)); @@ -7650,6 +7820,30 @@ instruct negL_mem(memory dst, immL0 zero, rFlagsReg cr) ins_pipe(ialu_reg); %} +instruct negExactI_rReg(rax_RegI dst, rFlagsReg cr) +%{ + match(NegExactI dst); + effect(KILL cr); + + format %{ "negl $dst\t# negExact int" %} + ins_encode %{ + __ negl($dst$$Register); + %} + ins_pipe(ialu_reg); +%} + +instruct negExactL_rReg(rax_RegL dst, rFlagsReg cr) +%{ + match(NegExactL dst); + effect(KILL cr); + + format %{ "negq $dst\t# negExact long" %} + ins_encode %{ + __ negq($dst$$Register); + %} + ins_pipe(ialu_reg); +%} + //----------Multiplication/Division Instructions------------------------------- // Integer Multiplication Instructions @@ -7767,6 +7961,86 @@ instruct mulHiL_rReg(rdx_RegL dst, no_rax_RegL src, rax_RegL rax, rFlagsReg cr) ins_pipe(ialu_reg_reg_alu0); %} + +instruct mulExactI_rReg(rax_RegI dst, rRegI src, rFlagsReg cr) +%{ + match(MulExactI dst src); + effect(DEF cr); + + ins_cost(300); + format %{ "imull $dst, $src\t# mulExact int" %} + ins_encode %{ + __ imull($dst$$Register, $src$$Register); + %} + ins_pipe(ialu_reg_reg_alu0); +%} + + +instruct mulExactI_rReg_imm(rax_RegI dst, rRegI src, immI imm, rFlagsReg cr) +%{ + match(MulExactI src imm); + effect(DEF cr); + + ins_cost(300); + format %{ "imull $dst, $src, $imm\t# mulExact int" %} + ins_encode %{ + __ imull($dst$$Register, $src$$Register, $imm$$constant); + %} + ins_pipe(ialu_reg_reg_alu0); +%} + +instruct mulExactI_rReg_mem(rax_RegI dst, memory src, rFlagsReg cr) +%{ + match(MulExactI dst (LoadI src)); + effect(DEF cr); + + ins_cost(350); + format %{ "imull $dst, $src\t# mulExact int" %} + ins_encode %{ + __ imull($dst$$Register, $src$$Address); + %} + ins_pipe(ialu_reg_mem_alu0); +%} + +instruct mulExactL_rReg(rax_RegL dst, rRegL src, rFlagsReg cr) +%{ + match(MulExactL dst src); + effect(DEF cr); + + ins_cost(300); + format %{ "imulq $dst, $src\t# mulExact long" %} + ins_encode %{ + __ imulq($dst$$Register, $src$$Register); + %} + ins_pipe(ialu_reg_reg_alu0); +%} + +instruct mulExactL_rReg_imm(rax_RegL dst, rRegL src, immL32 imm, rFlagsReg cr) +%{ + match(MulExactL src imm); + effect(DEF cr); + + ins_cost(300); + format %{ "imulq $dst, $src, $imm\t# mulExact long" %} + ins_encode %{ + __ imulq($dst$$Register, $src$$Register, $imm$$constant); + %} + ins_pipe(ialu_reg_reg_alu0); +%} + +instruct mulExactL_rReg_mem(rax_RegL dst, memory src, rFlagsReg cr) +%{ + match(MulExactL dst (LoadL src)); + effect(DEF cr); + + ins_cost(350); + format %{ "imulq $dst, $src\t# mulExact long" %} + ins_encode %{ + __ imulq($dst$$Register, $src$$Address); + %} + ins_pipe(ialu_reg_mem_alu0); +%} + instruct divI_rReg(rax_RegI rax, rdx_RegI rdx, no_rax_rdx_RegI div, rFlagsReg cr) %{ diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp index 42e88a7374b..27c9af71f17 100644 --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp @@ -1006,7 +1006,7 @@ void BytecodeInterpreter::layout_interpreterState(interpreterState istate, istate->set_stack_limit(stack_base - method->max_stack() - 1); } -address CppInterpreter::return_entry(TosState state, int length) { +address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { ShouldNotCallThis(); return NULL; } diff --git a/hotspot/src/cpu/zero/vm/globals_zero.hpp b/hotspot/src/cpu/zero/vm/globals_zero.hpp index 71b566fceb0..9a304c7f3fb 100644 --- a/hotspot/src/cpu/zero/vm/globals_zero.hpp +++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp @@ -57,6 +57,8 @@ define_pd_global(bool, UseMembar, true); // GC Ergo Flags define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread +define_pd_global(uintx, TypeProfileLevel, 0); + #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) #endif // CPU_ZERO_VM_GLOBALS_ZERO_HPP diff --git a/hotspot/src/os/bsd/vm/osThread_bsd.hpp b/hotspot/src/os/bsd/vm/osThread_bsd.hpp index fe903eb58d2..f4553821267 100644 --- a/hotspot/src/os/bsd/vm/osThread_bsd.hpp +++ b/hotspot/src/os/bsd/vm/osThread_bsd.hpp @@ -42,7 +42,7 @@ #ifdef __APPLE__ typedef thread_t thread_id_t; #else - typedef pthread_t thread_id_t; + typedef pid_t thread_id_t; #endif // _pthread_id is the pthread id, which is used by library calls diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index 58c961b43eb..1bea78444a8 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -100,6 +100,7 @@ # include # include # include +# include #if defined(__FreeBSD__) || defined(__NetBSD__) # include @@ -152,14 +153,27 @@ sigset_t SR_sigset; // utility functions static int SR_initialize(); +static void unpackTime(timespec* absTime, bool isAbsolute, jlong time); julong os::available_memory() { return Bsd::available_memory(); } +// available here means free julong os::Bsd::available_memory() { - // XXXBSD: this is just a stopgap implementation - return physical_memory() >> 2; + uint64_t available = physical_memory() >> 2; +#ifdef __APPLE__ + mach_msg_type_number_t count = HOST_VM_INFO64_COUNT; + vm_statistics64_data_t vmstat; + kern_return_t kerr = host_statistics64(mach_host_self(), HOST_VM_INFO64, + (host_info64_t)&vmstat, &count); + assert(kerr == KERN_SUCCESS, + "host_statistics64 failed - check mach_host_self() and count"); + if (kerr == KERN_SUCCESS) { + available = vmstat.free_count * os::vm_page_size(); + } +#endif + return available; } julong os::physical_memory() { @@ -247,7 +261,17 @@ void os::Bsd::initialize_system_info() { * since it returns a 64 bit value) */ mib[0] = CTL_HW; + +#if defined (HW_MEMSIZE) // Apple mib[1] = HW_MEMSIZE; +#elif defined(HW_PHYSMEM) // Most of BSD + mib[1] = HW_PHYSMEM; +#elif defined(HW_REALMEM) // Old FreeBSD + mib[1] = HW_REALMEM; +#else + #error No ways to get physmem +#endif + len = sizeof(mem_val); if (sysctl(mib, 2, &mem_val, &len, NULL, 0) != -1) { assert(len == sizeof(mem_val), "unexpected data size"); @@ -679,18 +703,12 @@ static void *java_start(Thread *thread) { return NULL; } -#ifdef __APPLE__ - // thread_id is mach thread on macos, which pthreads graciously caches and provides for us - mach_port_t thread_id = ::pthread_mach_thread_np(::pthread_self()); - guarantee(thread_id != 0, "thread id missing from pthreads"); - osthread->set_thread_id(thread_id); + osthread->set_thread_id(os::Bsd::gettid()); - uint64_t unique_thread_id = locate_unique_thread_id(thread_id); +#ifdef __APPLE__ + uint64_t unique_thread_id = locate_unique_thread_id(osthread->thread_id()); guarantee(unique_thread_id != 0, "unique thread id was not found"); osthread->set_unique_thread_id(unique_thread_id); -#else - // thread_id is pthread_id on BSD - osthread->set_thread_id(::pthread_self()); #endif // initialize signal mask for this thread os::Bsd::hotspot_sigmask(thread); @@ -847,18 +865,13 @@ bool os::create_attached_thread(JavaThread* thread) { return false; } + osthread->set_thread_id(os::Bsd::gettid()); + // Store pthread info into the OSThread #ifdef __APPLE__ - // thread_id is mach thread on macos, which pthreads graciously caches and provides for us - mach_port_t thread_id = ::pthread_mach_thread_np(::pthread_self()); - guarantee(thread_id != 0, "just checking"); - osthread->set_thread_id(thread_id); - - uint64_t unique_thread_id = locate_unique_thread_id(thread_id); + uint64_t unique_thread_id = locate_unique_thread_id(osthread->thread_id()); guarantee(unique_thread_id != 0, "just checking"); osthread->set_unique_thread_id(unique_thread_id); -#else - osthread->set_thread_id(::pthread_self()); #endif osthread->set_pthread_id(::pthread_self()); @@ -932,17 +945,15 @@ extern "C" Thread* get_thread() { // Used by VMSelfDestructTimer and the MemProfiler. double os::elapsedTime() { - return (double)(os::elapsed_counter()) * 0.000001; + return ((double)os::elapsed_counter()) / os::elapsed_frequency(); } jlong os::elapsed_counter() { - timeval time; - int status = gettimeofday(&time, NULL); - return jlong(time.tv_sec) * 1000 * 1000 + jlong(time.tv_usec) - initial_time_count; + return javaTimeNanos() - initial_time_count; } jlong os::elapsed_frequency() { - return (1000 * 1000); + return NANOSECS_PER_SEC; // nanosecond resolution } bool os::supports_vtime() { return true; } @@ -1125,6 +1136,30 @@ size_t os::lasterror(char *buf, size_t len) { return n; } +// Information of current thread in variety of formats +pid_t os::Bsd::gettid() { + int retval = -1; + +#ifdef __APPLE__ //XNU kernel + // despite the fact mach port is actually not a thread id use it + // instead of syscall(SYS_thread_selfid) as it certainly fits to u4 + retval = ::pthread_mach_thread_np(::pthread_self()); + guarantee(retval != 0, "just checking"); + return retval; + +#elif __FreeBSD__ + retval = syscall(SYS_thr_self); +#elif __OpenBSD__ + retval = syscall(SYS_getthrid); +#elif __NetBSD__ + retval = (pid_t) syscall(SYS__lwp_self); +#endif + + if (retval == -1) { + return getpid(); + } +} + intx os::current_thread_id() { #ifdef __APPLE__ return (intx)::pthread_mach_thread_np(::pthread_self()); @@ -1132,6 +1167,7 @@ intx os::current_thread_id() { return (intx)::pthread_self(); #endif } + int os::current_process_id() { // Under the old bsd thread library, bsd gives each thread @@ -1904,7 +1940,7 @@ class Semaphore : public StackObj { bool timedwait(unsigned int sec, int nsec); private: jlong currenttime() const; - semaphore_t _semaphore; + os_semaphore_t _semaphore; }; Semaphore::Semaphore() : _semaphore(0) { @@ -1972,7 +2008,7 @@ bool Semaphore::trywait() { bool Semaphore::timedwait(unsigned int sec, int nsec) { struct timespec ts; - jlong endtime = unpackTime(&ts, false, (sec * NANOSECS_PER_SEC) + nsec); + unpackTime(&ts, false, (sec * NANOSECS_PER_SEC) + nsec); while (1) { int result = sem_timedwait(&_semaphore, &ts); @@ -3544,7 +3580,7 @@ void os::init(void) { Bsd::_main_thread = pthread_self(); Bsd::clock_init(); - initial_time_count = os::elapsed_counter(); + initial_time_count = javaTimeNanos(); #ifdef __APPLE__ // XXXDARWIN @@ -4708,6 +4744,10 @@ int os::fork_and_exec(char* cmd) { // as libawt.so, and renamed libawt_xawt.so // bool os::is_headless_jre() { +#ifdef __APPLE__ + // We no longer build headless-only on Mac OS X + return false; +#else struct stat statbuf; char buf[MAXPATHLEN]; char libmawtpath[MAXPATHLEN]; @@ -4739,6 +4779,7 @@ bool os::is_headless_jre() { if (::stat(libmawtpath, &statbuf) == 0) return false; return true; +#endif } // Get the default path to the core file diff --git a/hotspot/src/os/bsd/vm/os_bsd.hpp b/hotspot/src/os/bsd/vm/os_bsd.hpp index f18bb88637f..a906a30e97f 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.hpp +++ b/hotspot/src/os/bsd/vm/os_bsd.hpp @@ -84,6 +84,7 @@ class Bsd { static void hotspot_sigmask(Thread* thread); static bool is_initial_thread(void); + static pid_t gettid(); static int page_size(void) { return _page_size; } static void set_page_size(int val) { _page_size = val; } diff --git a/hotspot/src/os/linux/vm/globals_linux.hpp b/hotspot/src/os/linux/vm/globals_linux.hpp index 4dfccc3f6ee..83424f2b21a 100644 --- a/hotspot/src/os/linux/vm/globals_linux.hpp +++ b/hotspot/src/os/linux/vm/globals_linux.hpp @@ -53,7 +53,7 @@ // Defines Linux-specific default values. The flags are available on all // platforms, but they may have different default values on other platforms. // -define_pd_global(bool, UseLargePages, true); +define_pd_global(bool, UseLargePages, false); define_pd_global(bool, UseLargePagesIndividualAllocation, false); define_pd_global(bool, UseOSErrorReporting, false); define_pd_global(bool, UseThreadPriorities, true) ; diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 6c794793cfe..1bb32901540 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -1333,17 +1333,15 @@ void os::Linux::capture_initial_stack(size_t max_size) { // Used by VMSelfDestructTimer and the MemProfiler. double os::elapsedTime() { - return (double)(os::elapsed_counter()) * 0.000001; + return ((double)os::elapsed_counter()) / os::elapsed_frequency(); // nanosecond resolution } jlong os::elapsed_counter() { - timeval time; - int status = gettimeofday(&time, NULL); - return jlong(time.tv_sec) * 1000 * 1000 + jlong(time.tv_usec) - initial_time_count; + return javaTimeNanos() - initial_time_count; } jlong os::elapsed_frequency() { - return (1000 * 1000); + return NANOSECS_PER_SEC; // nanosecond resolution } bool os::supports_vtime() { return true; } @@ -3361,13 +3359,15 @@ bool os::Linux::setup_large_page_type(size_t page_size) { if (FLAG_IS_DEFAULT(UseHugeTLBFS) && FLAG_IS_DEFAULT(UseSHM) && FLAG_IS_DEFAULT(UseTransparentHugePages)) { - // If UseLargePages is specified on the command line try all methods, - // if it's default, then try only UseTransparentHugePages. - if (FLAG_IS_DEFAULT(UseLargePages)) { - UseTransparentHugePages = true; - } else { - UseHugeTLBFS = UseTransparentHugePages = UseSHM = true; - } + + // The type of large pages has not been specified by the user. + + // Try UseHugeTLBFS and then UseSHM. + UseHugeTLBFS = UseSHM = true; + + // Don't try UseTransparentHugePages since there are known + // performance issues with it turned on. This might change in the future. + UseTransparentHugePages = false; } if (UseTransparentHugePages) { @@ -3393,9 +3393,19 @@ bool os::Linux::setup_large_page_type(size_t page_size) { } void os::large_page_init() { - if (!UseLargePages) { - UseHugeTLBFS = false; + if (!UseLargePages && + !UseTransparentHugePages && + !UseHugeTLBFS && + !UseSHM) { + // Not using large pages. + return; + } + + if (!FLAG_IS_DEFAULT(UseLargePages) && !UseLargePages) { + // The user explicitly turned off large pages. + // Ignore the rest of the large pages flags. UseTransparentHugePages = false; + UseHugeTLBFS = false; UseSHM = false; return; } @@ -4738,7 +4748,7 @@ void os::init(void) { Linux::_main_thread = pthread_self(); Linux::clock_init(); - initial_time_count = os::elapsed_counter(); + initial_time_count = javaTimeNanos(); // pthread_condattr initialization for monotonic clock int status; @@ -4839,6 +4849,10 @@ jint os::init_2(void) Linux::capture_initial_stack(JavaThread::stack_size_at_create()); +#if defined(IA32) + workaround_expand_exec_shield_cs_limit(); +#endif + Linux::libpthread_init(); if (PrintMiscellaneous && (Verbose || WizardMode)) { tty->print_cr("[HotSpot is running with %s, %s(%s)]\n", diff --git a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp index ad3ebb2ead9..a1d7075af55 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp @@ -79,6 +79,15 @@ # include #endif +// needed by current_stack_region() workaround for Mavericks +#if defined(__APPLE__) +# include +# include +# include +# define DEFAULT_MAIN_THREAD_STACK_PAGES 2048 +# define OS_X_10_9_0_KERNEL_MAJOR_VERSION 13 +#endif + #ifdef AMD64 #define SPELL_REG_SP "rsp" #define SPELL_REG_FP "rbp" @@ -828,6 +837,21 @@ static void current_stack_region(address * bottom, size_t * size) { pthread_t self = pthread_self(); void *stacktop = pthread_get_stackaddr_np(self); *size = pthread_get_stacksize_np(self); + // workaround for OS X 10.9.0 (Mavericks) + // pthread_get_stacksize_np returns 128 pages even though the actual size is 2048 pages + if (pthread_main_np() == 1) { + if ((*size) < (DEFAULT_MAIN_THREAD_STACK_PAGES * (size_t)getpagesize())) { + char kern_osrelease[256]; + size_t kern_osrelease_size = sizeof(kern_osrelease); + int ret = sysctlbyname("kern.osrelease", kern_osrelease, &kern_osrelease_size, NULL, 0); + if (ret == 0) { + // get the major number, atoi will ignore the minor amd micro portions of the version string + if (atoi(kern_osrelease) >= OS_X_10_9_0_KERNEL_MAJOR_VERSION) { + *size = (DEFAULT_MAIN_THREAD_STACK_PAGES*getpagesize()); + } + } + } + } *bottom = (address) stacktop - *size; #elif defined(__OpenBSD__) stack_t ss; diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp index 8878c0ea353..9a7605e696b 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp @@ -876,3 +876,46 @@ void os::verify_stack_alignment() { #endif } #endif + + +/* + * IA32 only: execute code at a high address in case buggy NX emulation is present. I.e. avoid CS limit + * updates (JDK-8023956). + */ +void os::workaround_expand_exec_shield_cs_limit() { +#if defined(IA32) + size_t page_size = os::vm_page_size(); + /* + * Take the highest VA the OS will give us and exec + * + * Although using -(pagesz) as mmap hint works on newer kernel as you would + * think, older variants affected by this work-around don't (search forward only). + * + * On the affected distributions, we understand the memory layout to be: + * + * TASK_LIMIT= 3G, main stack base close to TASK_LIMT. + * + * A few pages south main stack will do it. + * + * If we are embedded in an app other than launcher (initial != main stack), + * we don't have much control or understanding of the address space, just let it slide. + */ + char* hint = (char*) (Linux::initial_thread_stack_bottom() - + ((StackYellowPages + StackRedPages + 1) * page_size)); + char* codebuf = os::reserve_memory(page_size, hint); + if ( (codebuf == NULL) || (!os::commit_memory(codebuf, page_size, true)) ) { + return; // No matter, we tried, best effort. + } + if (PrintMiscellaneous && (Verbose || WizardMode)) { + tty->print_cr("[CS limit NX emulation work-around, exec code at: %p]", codebuf); + } + + // Some code to exec: the 'ret' instruction + codebuf[0] = 0xC3; + + // Call the code in the codebuf + __asm__ volatile("call *%0" : : "r"(codebuf)); + + // keep the page mapped so CS limit isn't reduced. +#endif +} diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp index 1d3fd350c68..fbca6909bb5 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp @@ -36,4 +36,17 @@ // Note: Currently only used in 64 bit Windows implementations static bool register_code_area(char *low, char *high) { return true; } + /* + * Work-around for broken NX emulation using CS limit, Red Hat patch "Exec-Shield" + * (IA32 only). + * + * Map and execute at a high VA to prevent CS lazy updates race with SMP MM + * invalidation.Further code generation by the JVM will no longer cause CS limit + * updates. + * + * Affects IA32: RHEL 5 & 6, Ubuntu 10.04 (LTS), 10.10, 11.04, 11.10, 12.04. + * @see JDK-8023956 + */ + static void workaround_expand_exec_shield_cs_limit(); + #endif // OS_CPU_LINUX_X86_VM_OS_LINUX_X86_HPP diff --git a/hotspot/src/share/vm/adlc/adlparse.cpp b/hotspot/src/share/vm/adlc/adlparse.cpp index 04fb735c38c..8704c68da69 100644 --- a/hotspot/src/share/vm/adlc/adlparse.cpp +++ b/hotspot/src/share/vm/adlc/adlparse.cpp @@ -3395,12 +3395,16 @@ Interface *ADLParser::cond_interface_parse(void) { char *greater_equal; char *less_equal; char *greater; + char *overflow; + char *no_overflow; const char *equal_format = "eq"; const char *not_equal_format = "ne"; const char *less_format = "lt"; const char *greater_equal_format = "ge"; const char *less_equal_format = "le"; const char *greater_format = "gt"; + const char *overflow_format = "o"; + const char *no_overflow_format = "no"; if (_curchar != '%') { parse_err(SYNERR, "Missing '%%{' for 'cond_interface' block.\n"); @@ -3437,6 +3441,12 @@ Interface *ADLParser::cond_interface_parse(void) { else if ( strcmp(field,"greater") == 0 ) { greater = interface_field_parse(&greater_format); } + else if ( strcmp(field,"overflow") == 0 ) { + overflow = interface_field_parse(&overflow_format); + } + else if ( strcmp(field,"no_overflow") == 0 ) { + no_overflow = interface_field_parse(&no_overflow_format); + } else { parse_err(SYNERR, "Expected keyword, base|index|scale|disp, or '%%}' ending interface.\n"); return NULL; @@ -3455,7 +3465,9 @@ Interface *ADLParser::cond_interface_parse(void) { less, less_format, greater_equal, greater_equal_format, less_equal, less_equal_format, - greater, greater_format); + greater, greater_format, + overflow, overflow_format, + no_overflow, no_overflow_format); return inter; } diff --git a/hotspot/src/share/vm/adlc/archDesc.cpp b/hotspot/src/share/vm/adlc/archDesc.cpp index 412a728228a..fd60e25acb7 100644 --- a/hotspot/src/share/vm/adlc/archDesc.cpp +++ b/hotspot/src/share/vm/adlc/archDesc.cpp @@ -1192,6 +1192,15 @@ void ArchDesc::buildMustCloneMap(FILE *fp_hpp, FILE *fp_cpp) { || strcmp(idealName,"CmpF") == 0 || strcmp(idealName,"FastLock") == 0 || strcmp(idealName,"FastUnlock") == 0 + || strcmp(idealName,"AddExactI") == 0 + || strcmp(idealName,"AddExactL") == 0 + || strcmp(idealName,"SubExactI") == 0 + || strcmp(idealName,"SubExactL") == 0 + || strcmp(idealName,"MulExactI") == 0 + || strcmp(idealName,"MulExactL") == 0 + || strcmp(idealName,"NegExactI") == 0 + || strcmp(idealName,"NegExactL") == 0 + || strcmp(idealName,"FlagsProj") == 0 || strcmp(idealName,"Bool") == 0 || strcmp(idealName,"Binary") == 0 ) { // Removed ConI from the must_clone list. CPUs that cannot use diff --git a/hotspot/src/share/vm/adlc/formssel.cpp b/hotspot/src/share/vm/adlc/formssel.cpp index 3d4a562e432..cfa9f5b6222 100644 --- a/hotspot/src/share/vm/adlc/formssel.cpp +++ b/hotspot/src/share/vm/adlc/formssel.cpp @@ -536,12 +536,6 @@ bool InstructForm::rematerialize(FormDict &globals, RegisterForm *registers ) { if( data_type != Form::none ) rematerialize = true; - // Ugly: until a better fix is implemented, disable rematerialization for - // negD nodes because they are proved to be problematic. - if (is_ideal_negD()) { - return false; - } - // Constants if( _components.count() == 1 && _components[0]->is(Component::USE_DEF) ) rematerialize = true; @@ -2757,14 +2751,18 @@ CondInterface::CondInterface(const char* equal, const char* equal_format const char* less, const char* less_format, const char* greater_equal, const char* greater_equal_format, const char* less_equal, const char* less_equal_format, - const char* greater, const char* greater_format) + const char* greater, const char* greater_format, + const char* overflow, const char* overflow_format, + const char* no_overflow, const char* no_overflow_format) : Interface("COND_INTER"), _equal(equal), _equal_format(equal_format), _not_equal(not_equal), _not_equal_format(not_equal_format), _less(less), _less_format(less_format), _greater_equal(greater_equal), _greater_equal_format(greater_equal_format), _less_equal(less_equal), _less_equal_format(less_equal_format), - _greater(greater), _greater_format(greater_format) { + _greater(greater), _greater_format(greater_format), + _overflow(overflow), _overflow_format(overflow_format), + _no_overflow(no_overflow), _no_overflow_format(no_overflow_format) { } CondInterface::~CondInterface() { // not owner of any character arrays @@ -2777,12 +2775,14 @@ void CondInterface::dump() { // Write info to output files void CondInterface::output(FILE *fp) { Interface::output(fp); - if ( _equal != NULL ) fprintf(fp," equal == %s\n", _equal); - if ( _not_equal != NULL ) fprintf(fp," not_equal == %s\n", _not_equal); - if ( _less != NULL ) fprintf(fp," less == %s\n", _less); - if ( _greater_equal != NULL ) fprintf(fp," greater_equal == %s\n", _greater_equal); - if ( _less_equal != NULL ) fprintf(fp," less_equal == %s\n", _less_equal); - if ( _greater != NULL ) fprintf(fp," greater == %s\n", _greater); + if ( _equal != NULL ) fprintf(fp," equal == %s\n", _equal); + if ( _not_equal != NULL ) fprintf(fp," not_equal == %s\n", _not_equal); + if ( _less != NULL ) fprintf(fp," less == %s\n", _less); + if ( _greater_equal != NULL ) fprintf(fp," greater_equal == %s\n", _greater_equal); + if ( _less_equal != NULL ) fprintf(fp," less_equal == %s\n", _less_equal); + if ( _greater != NULL ) fprintf(fp," greater == %s\n", _greater); + if ( _overflow != NULL ) fprintf(fp," overflow == %s\n", _overflow); + if ( _no_overflow != NULL ) fprintf(fp," no_overflow == %s\n", _no_overflow); // fprintf(fp,"\n"); } diff --git a/hotspot/src/share/vm/adlc/formssel.hpp b/hotspot/src/share/vm/adlc/formssel.hpp index fa3e9ff8f48..3bc22b8e269 100644 --- a/hotspot/src/share/vm/adlc/formssel.hpp +++ b/hotspot/src/share/vm/adlc/formssel.hpp @@ -798,12 +798,16 @@ public: const char *_greater_equal; const char *_less_equal; const char *_greater; + const char *_overflow; + const char *_no_overflow; const char *_equal_format; const char *_not_equal_format; const char *_less_format; const char *_greater_equal_format; const char *_less_equal_format; const char *_greater_format; + const char *_overflow_format; + const char *_no_overflow_format; // Public Methods CondInterface(const char* equal, const char* equal_format, @@ -811,7 +815,9 @@ public: const char* less, const char* less_format, const char* greater_equal, const char* greater_equal_format, const char* less_equal, const char* less_equal_format, - const char* greater, const char* greater_format); + const char* greater, const char* greater_format, + const char* overflow, const char* overflow_format, + const char* no_overflow, const char* no_overflow_format); ~CondInterface(); void dump(); diff --git a/hotspot/src/share/vm/adlc/output_h.cpp b/hotspot/src/share/vm/adlc/output_h.cpp index 3fdaf39e8f1..0b01d06dc31 100644 --- a/hotspot/src/share/vm/adlc/output_h.cpp +++ b/hotspot/src/share/vm/adlc/output_h.cpp @@ -388,6 +388,8 @@ static void defineCCodeDump(OperandForm* oper, FILE *fp, int i) { fprintf(fp, " else if( _c%d == BoolTest::ge ) st->print(\"%s\");\n",i,cond->_greater_equal_format); fprintf(fp, " else if( _c%d == BoolTest::lt ) st->print(\"%s\");\n",i,cond->_less_format); fprintf(fp, " else if( _c%d == BoolTest::gt ) st->print(\"%s\");\n",i,cond->_greater_format); + fprintf(fp, " else if( _c%d == BoolTest::overflow ) st->print(\"%s\");\n",i,cond->_overflow_format); + fprintf(fp, " else if( _c%d == BoolTest::no_overflow ) st->print(\"%s\");\n",i,cond->_no_overflow_format); } // Output code that dumps constant values, increment "i" if type is constant @@ -1208,6 +1210,8 @@ void ArchDesc::declareClasses(FILE *fp) { fprintf(fp," case BoolTest::ne : return not_equal();\n"); fprintf(fp," case BoolTest::le : return less_equal();\n"); fprintf(fp," case BoolTest::ge : return greater_equal();\n"); + fprintf(fp," case BoolTest::overflow : return overflow();\n"); + fprintf(fp," case BoolTest::no_overflow: return no_overflow();\n"); fprintf(fp," default : ShouldNotReachHere(); return 0;\n"); fprintf(fp," }\n"); fprintf(fp," };\n"); @@ -1373,6 +1377,14 @@ void ArchDesc::declareClasses(FILE *fp) { if( greater != NULL ) { define_oper_interface(fp, *oper, _globalNames, "greater", greater); } + const char *overflow = cInterface->_overflow; + if( overflow != NULL ) { + define_oper_interface(fp, *oper, _globalNames, "overflow", overflow); + } + const char *no_overflow = cInterface->_no_overflow; + if( no_overflow != NULL ) { + define_oper_interface(fp, *oper, _globalNames, "no_overflow", no_overflow); + } } // end Conditional Interface // Check if it is a Constant Interface else if (oper->_interface->is_ConstInterface() != NULL ) { diff --git a/hotspot/src/share/vm/asm/assembler.cpp b/hotspot/src/share/vm/asm/assembler.cpp index b56e2828636..ae3034bc969 100644 --- a/hotspot/src/share/vm/asm/assembler.cpp +++ b/hotspot/src/share/vm/asm/assembler.cpp @@ -122,7 +122,7 @@ void AbstractAssembler::bind(Label& L) { void AbstractAssembler::generate_stack_overflow_check( int frame_size_in_bytes) { if (UseStackBanging) { // Each code entry causes one stack bang n pages down the stack where n - // is configurable by StackBangPages. The setting depends on the maximum + // is configurable by StackShadowPages. The setting depends on the maximum // depth of VM call stack or native before going back into java code, // since only java code can raise a stack overflow exception using the // stack banging mechanism. The VM and native code does not detect stack diff --git a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp index b80b199c9c2..f98edc6f563 100644 --- a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp +++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp @@ -935,6 +935,7 @@ void Canonicalizer::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {} void Canonicalizer::do_UnsafePrefetchRead (UnsafePrefetchRead* x) {} void Canonicalizer::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {} void Canonicalizer::do_ProfileCall(ProfileCall* x) {} +void Canonicalizer::do_ProfileReturnType(ProfileReturnType* x) {} void Canonicalizer::do_ProfileInvoke(ProfileInvoke* x) {} void Canonicalizer::do_RuntimeCall(RuntimeCall* x) {} void Canonicalizer::do_RangeCheckPredicate(RangeCheckPredicate* x) {} diff --git a/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp b/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp index 9e34ac79a31..43ce4a41c14 100644 --- a/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp +++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp @@ -104,6 +104,7 @@ class Canonicalizer: InstructionVisitor { virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x); virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x); virtual void do_ProfileCall (ProfileCall* x); + virtual void do_ProfileReturnType (ProfileReturnType* x); virtual void do_ProfileInvoke (ProfileInvoke* x); virtual void do_RuntimeCall (RuntimeCall* x); virtual void do_MemBar (MemBar* x); diff --git a/hotspot/src/share/vm/c1/c1_Compilation.cpp b/hotspot/src/share/vm/c1/c1_Compilation.cpp index 1cdcab542fa..574fda19401 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.cpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp @@ -601,6 +601,17 @@ void Compilation::bailout(const char* msg) { } } +ciKlass* Compilation::cha_exact_type(ciType* type) { + if (type != NULL && type->is_loaded() && type->is_instance_klass()) { + ciInstanceKlass* ik = type->as_instance_klass(); + assert(ik->exact_klass() == NULL, "no cha for final klass"); + if (DeoptC1 && UseCHA && !(ik->has_subklass() || ik->is_interface())) { + dependency_recorder()->assert_leaf_type(ik); + return ik; + } + } + return NULL; +} void Compilation::print_timers() { // tty->print_cr(" Native methods : %6.3f s, Average : %2.3f", CompileBroker::_t_native_compilation.seconds(), CompileBroker::_t_native_compilation.seconds() / CompileBroker::_total_native_compile_count); diff --git a/hotspot/src/share/vm/c1/c1_Compilation.hpp b/hotspot/src/share/vm/c1/c1_Compilation.hpp index f98ae97f309..679ff609a84 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.hpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.hpp @@ -238,7 +238,18 @@ class Compilation: public StackObj { return env()->comp_level() == CompLevel_full_profile && C1UpdateMethodData && C1ProfileCheckcasts; } - + bool profile_parameters() { + return env()->comp_level() == CompLevel_full_profile && + C1UpdateMethodData && MethodData::profile_parameters(); + } + bool profile_arguments() { + return env()->comp_level() == CompLevel_full_profile && + C1UpdateMethodData && MethodData::profile_arguments(); + } + bool profile_return() { + return env()->comp_level() == CompLevel_full_profile && + C1UpdateMethodData && MethodData::profile_return(); + } // will compilation make optimistic assumptions that might lead to // deoptimization and that the runtime will account for? bool is_optimistic() const { @@ -246,6 +257,8 @@ class Compilation: public StackObj { (RangeCheckElimination || UseLoopInvariantCodeMotion) && method()->method_data()->trap_count(Deoptimization::Reason_none) == 0; } + + ciKlass* cha_exact_type(ciType* type); }; diff --git a/hotspot/src/share/vm/c1/c1_Compiler.cpp b/hotspot/src/share/vm/c1/c1_Compiler.cpp index ecace4dad07..0fb723c8a95 100644 --- a/hotspot/src/share/vm/c1/c1_Compiler.cpp +++ b/hotspot/src/share/vm/c1/c1_Compiler.cpp @@ -42,26 +42,16 @@ #include "runtime/interfaceSupport.hpp" #include "runtime/sharedRuntime.hpp" -volatile int Compiler::_runtimes = uninitialized; -Compiler::Compiler() { -} +Compiler::Compiler () {} - -Compiler::~Compiler() { - Unimplemented(); -} - - -void Compiler::initialize_all() { +void Compiler::init_c1_runtime() { BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob(); Arena* arena = new (mtCompiler) Arena(); Runtime1::initialize(buffer_blob); FrameMap::initialize(); // initialize data structures ValueType::initialize(arena); - // Instruction::initialize(); - // BlockBegin::initialize(); GraphBuilder::initialize(); // note: to use more than one instance of LinearScan at a time this function call has to // be moved somewhere outside of this constructor: @@ -70,32 +60,33 @@ void Compiler::initialize_all() { void Compiler::initialize() { - if (_runtimes != initialized) { - initialize_runtimes( initialize_all, &_runtimes); + // Buffer blob must be allocated per C1 compiler thread at startup + BufferBlob* buffer_blob = init_buffer_blob(); + + if (should_perform_init()) { + if (buffer_blob == NULL) { + // When we come here we are in state 'initializing'; entire C1 compilation + // can be shut down. + set_state(failed); + } else { + init_c1_runtime(); + set_state(initialized); + } } - mark_initialized(); } - -BufferBlob* Compiler::get_buffer_blob(ciEnv* env) { +BufferBlob* Compiler::init_buffer_blob() { // Allocate buffer blob once at startup since allocation for each // compilation seems to be too expensive (at least on Intel win32). - BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob(); - if (buffer_blob != NULL) { - return buffer_blob; - } + assert (CompilerThread::current()->get_buffer_blob() == NULL, "Should initialize only once"); // setup CodeBuffer. Preallocate a BufferBlob of size // NMethodSizeLimit plus some extra space for constants. int code_buffer_size = Compilation::desired_max_code_buffer_size() + Compilation::desired_max_constant_size(); - buffer_blob = BufferBlob::create("Compiler1 temporary CodeBuffer", - code_buffer_size); - if (buffer_blob == NULL) { - CompileBroker::handle_full_code_cache(); - env->record_failure("CodeCache is full"); - } else { + BufferBlob* buffer_blob = BufferBlob::create("C1 temporary CodeBuffer", code_buffer_size); + if (buffer_blob != NULL) { CompilerThread::current()->set_buffer_blob(buffer_blob); } @@ -104,15 +95,8 @@ BufferBlob* Compiler::get_buffer_blob(ciEnv* env) { void Compiler::compile_method(ciEnv* env, ciMethod* method, int entry_bci) { - BufferBlob* buffer_blob = Compiler::get_buffer_blob(env); - if (buffer_blob == NULL) { - return; - } - - if (!is_initialized()) { - initialize(); - } - + BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob(); + assert(buffer_blob != NULL, "Must exist"); // invoke compilation { // We are nested here because we need for the destructor diff --git a/hotspot/src/share/vm/c1/c1_Compiler.hpp b/hotspot/src/share/vm/c1/c1_Compiler.hpp index 6e209d0034f..fe95c8cd780 100644 --- a/hotspot/src/share/vm/c1/c1_Compiler.hpp +++ b/hotspot/src/share/vm/c1/c1_Compiler.hpp @@ -30,11 +30,9 @@ // There is one instance of the Compiler per CompilerThread. class Compiler: public AbstractCompiler { - private: - - // Tracks whether runtime has been initialized - static volatile int _runtimes; + static void init_c1_runtime(); + BufferBlob* init_buffer_blob(); public: // Creation @@ -46,19 +44,12 @@ class Compiler: public AbstractCompiler { virtual bool is_c1() { return true; }; - BufferBlob* get_buffer_blob(ciEnv* env); - // Missing feature tests virtual bool supports_native() { return true; } virtual bool supports_osr () { return true; } - // Customization - virtual bool needs_adapters () { return false; } - virtual bool needs_stubs () { return false; } - // Initialization virtual void initialize(); - static void initialize_all(); // Compilation entry point for methods virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci); diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index b7ea6eebb26..26bb8d0227e 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -1466,9 +1466,22 @@ void GraphBuilder::method_return(Value x) { // State at end of inlined method is the state of the caller // without the method parameters on stack, including the // return value, if any, of the inlined method on operand stack. + int invoke_bci = state()->caller_state()->bci(); set_state(state()->caller_state()->copy_for_parsing()); if (x != NULL) { state()->push(x->type(), x); + if (profile_return() && x->type()->is_object_kind()) { + ciMethod* caller = state()->scope()->method(); + ciMethodData* md = caller->method_data_or_null(); + ciProfileData* data = md->bci_to_data(invoke_bci); + if (data->is_CallTypeData() || data->is_VirtualCallTypeData()) { + bool has_return = data->is_CallTypeData() ? ((ciCallTypeData*)data)->has_return() : ((ciVirtualCallTypeData*)data)->has_return(); + // May not be true in case of an inlined call through a method handle intrinsic. + if (has_return) { + profile_return_type(x, method(), caller, invoke_bci); + } + } + } } Goto* goto_callee = new Goto(continuation(), false); @@ -1658,6 +1671,50 @@ Dependencies* GraphBuilder::dependency_recorder() const { return compilation()->dependency_recorder(); } +// How many arguments do we want to profile? +Values* GraphBuilder::args_list_for_profiling(ciMethod* target, int& start, bool may_have_receiver) { + int n = 0; + bool has_receiver = may_have_receiver && Bytecodes::has_receiver(method()->java_code_at_bci(bci())); + start = has_receiver ? 1 : 0; + if (profile_arguments()) { + ciProfileData* data = method()->method_data()->bci_to_data(bci()); + if (data->is_CallTypeData() || data->is_VirtualCallTypeData()) { + n = data->is_CallTypeData() ? data->as_CallTypeData()->number_of_arguments() : data->as_VirtualCallTypeData()->number_of_arguments(); + } + } + // If we are inlining then we need to collect arguments to profile parameters for the target + if (profile_parameters() && target != NULL) { + if (target->method_data() != NULL && target->method_data()->parameters_type_data() != NULL) { + // The receiver is profiled on method entry so it's included in + // the number of parameters but here we're only interested in + // actual arguments. + n = MAX2(n, target->method_data()->parameters_type_data()->number_of_parameters() - start); + } + } + if (n > 0) { + return new Values(n); + } + return NULL; +} + +// Collect arguments that we want to profile in a list +Values* GraphBuilder::collect_args_for_profiling(Values* args, ciMethod* target, bool may_have_receiver) { + int start = 0; + Values* obj_args = args_list_for_profiling(target, start, may_have_receiver); + if (obj_args == NULL) { + return NULL; + } + int s = obj_args->size(); + for (int i = start, j = 0; j < s; i++) { + if (args->at(i)->type()->is_object_kind()) { + obj_args->push(args->at(i)); + j++; + } + } + assert(s == obj_args->length(), "missed on arg?"); + return obj_args; +} + void GraphBuilder::invoke(Bytecodes::Code code) { bool will_link; @@ -1816,7 +1873,7 @@ void GraphBuilder::invoke(Bytecodes::Code code) { // number of implementors for decl_interface is 0 or 1. If // it's 0 then no class implements decl_interface and there's // no point in inlining. - if (!holder->is_loaded() || decl_interface->nof_implementors() != 1) { + if (!holder->is_loaded() || decl_interface->nof_implementors() != 1 || decl_interface->has_default_methods()) { singleton = NULL; } } @@ -1957,7 +2014,7 @@ void GraphBuilder::invoke(Bytecodes::Code code) { } else if (exact_target != NULL) { target_klass = exact_target->holder(); } - profile_call(target, recv, target_klass); + profile_call(target, recv, target_klass, collect_args_for_profiling(args, NULL, false), false); } } @@ -1972,6 +2029,9 @@ void GraphBuilder::invoke(Bytecodes::Code code) { push(result_type, result); } } + if (profile_return() && result_type->is_object_kind()) { + profile_return_type(result, target); + } } @@ -3509,7 +3569,7 @@ bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) { recv = args->at(0); null_check(recv); } - profile_call(callee, recv, NULL); + profile_call(callee, recv, NULL, collect_args_for_profiling(args, callee, true), true); } } } @@ -3520,6 +3580,10 @@ bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) { Value value = append_split(result); if (result_type != voidType) push(result_type, value); + if (callee != method() && profile_return() && result_type->is_object_kind()) { + profile_return_type(result, callee); + } + // done return true; } @@ -3704,6 +3768,7 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, Bytecode // now perform tests that are based on flag settings if (callee->force_inline()) { + if (inline_level() > MaxForceInlineLevel) INLINE_BAILOUT("MaxForceInlineLevel"); print_inlining(callee, "force inline by annotation"); } else if (callee->should_inline()) { print_inlining(callee, "force inline by CompileOracle"); @@ -3763,7 +3828,28 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, Bytecode compilation()->set_would_profile(true); if (profile_calls()) { - profile_call(callee, recv, holder_known ? callee->holder() : NULL); + int start = 0; + Values* obj_args = args_list_for_profiling(callee, start, has_receiver); + if (obj_args != NULL) { + int s = obj_args->size(); + // if called through method handle invoke, some arguments may have been popped + for (int i = args_base+start, j = 0; j < obj_args->size() && i < state()->stack_size(); ) { + Value v = state()->stack_at_inc(i); + if (v->type()->is_object_kind()) { + obj_args->push(v); + j++; + } + } +#ifdef ASSERT + { + bool ignored_will_link; + ciSignature* declared_signature = NULL; + ciMethod* real_target = method()->get_method_at_bci(bci(), ignored_will_link, &declared_signature); + assert(s == obj_args->length() || real_target->is_method_handle_intrinsic(), "missed on arg?"); + } +#endif + } + profile_call(callee, recv, holder_known ? callee->holder() : NULL, obj_args, true); } } @@ -4219,7 +4305,9 @@ void GraphBuilder::print_inlining(ciMethod* callee, const char* msg, bool succes } } - if (!PrintInlining) return; + if (!PrintInlining && !compilation()->method()->has_option("PrintInlining")) { + return; + } CompileTask::print_inlining(callee, scope()->level(), bci(), msg); if (success && CIPrintMethodCodes) { callee->print_codes(); @@ -4249,8 +4337,23 @@ void GraphBuilder::print_stats() { } #endif // PRODUCT -void GraphBuilder::profile_call(ciMethod* callee, Value recv, ciKlass* known_holder) { - append(new ProfileCall(method(), bci(), callee, recv, known_holder)); +void GraphBuilder::profile_call(ciMethod* callee, Value recv, ciKlass* known_holder, Values* obj_args, bool inlined) { + append(new ProfileCall(method(), bci(), callee, recv, known_holder, obj_args, inlined)); +} + +void GraphBuilder::profile_return_type(Value ret, ciMethod* callee, ciMethod* m, int invoke_bci) { + assert((m == NULL) == (invoke_bci < 0), "invalid method and invalid bci together"); + if (m == NULL) { + m = method(); + } + if (invoke_bci < 0) { + invoke_bci = bci(); + } + ciMethodData* md = m->method_data_or_null(); + ciProfileData* data = md->bci_to_data(invoke_bci); + if (data->is_CallTypeData() || data->is_VirtualCallTypeData()) { + append(new ProfileReturnType(m , invoke_bci, callee, ret)); + } } void GraphBuilder::profile_invocation(ciMethod* callee, ValueStack* state) { diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp index ae5afd4e04d..ce83cb73fe2 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp @@ -374,7 +374,8 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC { void print_inlining(ciMethod* callee, const char* msg = NULL, bool success = true); - void profile_call(ciMethod* callee, Value recv, ciKlass* predicted_holder); + void profile_call(ciMethod* callee, Value recv, ciKlass* predicted_holder, Values* obj_args, bool inlined); + void profile_return_type(Value ret, ciMethod* callee, ciMethod* m = NULL, int bci = -1); void profile_invocation(ciMethod* inlinee, ValueStack* state); // Shortcuts to profiling control. @@ -385,6 +386,12 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC { bool profile_calls() { return _compilation->profile_calls(); } bool profile_inlined_calls() { return _compilation->profile_inlined_calls(); } bool profile_checkcasts() { return _compilation->profile_checkcasts(); } + bool profile_parameters() { return _compilation->profile_parameters(); } + bool profile_arguments() { return _compilation->profile_arguments(); } + bool profile_return() { return _compilation->profile_return(); } + + Values* args_list_for_profiling(ciMethod* target, int& start, bool may_have_receiver); + Values* collect_args_for_profiling(Values* args, ciMethod* target, bool may_have_receiver); public: NOT_PRODUCT(void print_stats();) diff --git a/hotspot/src/share/vm/c1/c1_Instruction.cpp b/hotspot/src/share/vm/c1/c1_Instruction.cpp index a026b4cbea0..e5829611e66 100644 --- a/hotspot/src/share/vm/c1/c1_Instruction.cpp +++ b/hotspot/src/share/vm/c1/c1_Instruction.cpp @@ -104,6 +104,14 @@ void Instruction::state_values_do(ValueVisitor* f) { } } +ciType* Instruction::exact_type() const { + ciType* t = declared_type(); + if (t != NULL && t->is_klass()) { + return t->as_klass()->exact_klass(); + } + return NULL; +} + #ifndef PRODUCT void Instruction::check_state(ValueStack* state) { @@ -135,9 +143,7 @@ void Instruction::print(InstructionPrinter& ip) { // perform constant and interval tests on index value bool AccessIndexed::compute_needs_range_check() { - if (length()) { - Constant* clength = length()->as_Constant(); Constant* cindex = index()->as_Constant(); if (clength && cindex) { @@ -157,34 +163,8 @@ bool AccessIndexed::compute_needs_range_check() { } -ciType* Local::exact_type() const { - ciType* type = declared_type(); - - // for primitive arrays, the declared type is the exact type - if (type->is_type_array_klass()) { - return type; - } else if (type->is_instance_klass()) { - ciInstanceKlass* ik = (ciInstanceKlass*)type; - if (ik->is_loaded() && ik->is_final() && !ik->is_interface()) { - return type; - } - } else if (type->is_obj_array_klass()) { - ciObjArrayKlass* oak = (ciObjArrayKlass*)type; - ciType* base = oak->base_element_type(); - if (base->is_instance_klass()) { - ciInstanceKlass* ik = base->as_instance_klass(); - if (ik->is_loaded() && ik->is_final()) { - return type; - } - } else if (base->is_primitive_type()) { - return type; - } - } - return NULL; -} - ciType* Constant::exact_type() const { - if (type()->is_object()) { + if (type()->is_object() && type()->as_ObjectType()->is_loaded()) { return type()->as_ObjectType()->exact_type(); } return NULL; @@ -192,19 +172,18 @@ ciType* Constant::exact_type() const { ciType* LoadIndexed::exact_type() const { ciType* array_type = array()->exact_type(); - if (array_type == NULL) { - return NULL; - } - assert(array_type->is_array_klass(), "what else?"); - ciArrayKlass* ak = (ciArrayKlass*)array_type; + if (array_type != NULL) { + assert(array_type->is_array_klass(), "what else?"); + ciArrayKlass* ak = (ciArrayKlass*)array_type; - if (ak->element_type()->is_instance_klass()) { - ciInstanceKlass* ik = (ciInstanceKlass*)ak->element_type(); - if (ik->is_loaded() && ik->is_final()) { - return ik; + if (ak->element_type()->is_instance_klass()) { + ciInstanceKlass* ik = (ciInstanceKlass*)ak->element_type(); + if (ik->is_loaded() && ik->is_final()) { + return ik; + } } } - return NULL; + return Instruction::exact_type(); } @@ -224,22 +203,6 @@ ciType* LoadField::declared_type() const { } -ciType* LoadField::exact_type() const { - ciType* type = declared_type(); - // for primitive arrays, the declared type is the exact type - if (type->is_type_array_klass()) { - return type; - } - if (type->is_instance_klass()) { - ciInstanceKlass* ik = (ciInstanceKlass*)type; - if (ik->is_loaded() && ik->is_final()) { - return type; - } - } - return NULL; -} - - ciType* NewTypeArray::exact_type() const { return ciTypeArrayKlass::make(elt_type()); } @@ -264,16 +227,6 @@ ciType* CheckCast::declared_type() const { return klass(); } -ciType* CheckCast::exact_type() const { - if (klass()->is_instance_klass()) { - ciInstanceKlass* ik = (ciInstanceKlass*)klass(); - if (ik->is_loaded() && ik->is_final()) { - return ik; - } - } - return NULL; -} - // Implementation of ArithmeticOp bool ArithmeticOp::is_commutative() const { diff --git a/hotspot/src/share/vm/c1/c1_Instruction.hpp b/hotspot/src/share/vm/c1/c1_Instruction.hpp index 9563b720a10..19490bbc97b 100644 --- a/hotspot/src/share/vm/c1/c1_Instruction.hpp +++ b/hotspot/src/share/vm/c1/c1_Instruction.hpp @@ -107,6 +107,7 @@ class UnsafePrefetch; class UnsafePrefetchRead; class UnsafePrefetchWrite; class ProfileCall; +class ProfileReturnType; class ProfileInvoke; class RuntimeCall; class MemBar; @@ -211,6 +212,7 @@ class InstructionVisitor: public StackObj { virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x) = 0; virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) = 0; virtual void do_ProfileCall (ProfileCall* x) = 0; + virtual void do_ProfileReturnType (ProfileReturnType* x) = 0; virtual void do_ProfileInvoke (ProfileInvoke* x) = 0; virtual void do_RuntimeCall (RuntimeCall* x) = 0; virtual void do_MemBar (MemBar* x) = 0; @@ -322,6 +324,36 @@ class Instruction: public CompilationResourceObj { _type = type; } + // Helper class to keep track of which arguments need a null check + class ArgsNonNullState { + private: + int _nonnull_state; // mask identifying which args are nonnull + public: + ArgsNonNullState() + : _nonnull_state(AllBits) {} + + // Does argument number i needs a null check? + bool arg_needs_null_check(int i) const { + // No data is kept for arguments starting at position 33 so + // conservatively assume that they need a null check. + if (i >= 0 && i < (int)sizeof(_nonnull_state) * BitsPerByte) { + return is_set_nth_bit(_nonnull_state, i); + } + return true; + } + + // Set whether argument number i needs a null check or not + void set_arg_needs_null_check(int i, bool check) { + if (i >= 0 && i < (int)sizeof(_nonnull_state) * BitsPerByte) { + if (check) { + _nonnull_state |= nth_bit(i); + } else { + _nonnull_state &= ~(nth_bit(i)); + } + } + } + }; + public: void* operator new(size_t size) throw() { Compilation* c = Compilation::current(); @@ -566,7 +598,7 @@ class Instruction: public CompilationResourceObj { virtual void other_values_do(ValueVisitor* f) { /* usually no other - override on demand */ } void values_do(ValueVisitor* f) { input_values_do(f); state_values_do(f); other_values_do(f); } - virtual ciType* exact_type() const { return NULL; } + virtual ciType* exact_type() const; virtual ciType* declared_type() const { return NULL; } // hashing @@ -689,7 +721,6 @@ LEAF(Local, Instruction) int java_index() const { return _java_index; } virtual ciType* declared_type() const { return _declared_type; } - virtual ciType* exact_type() const; // generic virtual void input_values_do(ValueVisitor* f) { /* no values */ } @@ -806,7 +837,6 @@ LEAF(LoadField, AccessField) {} ciType* declared_type() const; - ciType* exact_type() const; // generic HASHING2(LoadField, !needs_patching() && !field()->is_volatile(), obj()->subst(), offset()) // cannot be eliminated if needs patching or if volatile @@ -1299,6 +1329,7 @@ BASE(NewArray, StateSplit) virtual bool needs_exception_state() const { return false; } + ciType* exact_type() const { return NULL; } ciType* declared_type() const; // generic @@ -1422,7 +1453,6 @@ LEAF(CheckCast, TypeCheck) } ciType* declared_type() const; - ciType* exact_type() const; }; @@ -1490,7 +1520,7 @@ LEAF(Intrinsic, StateSplit) vmIntrinsics::ID _id; Values* _args; Value _recv; - int _nonnull_state; // mask identifying which args are nonnull + ArgsNonNullState _nonnull_state; public: // preserves_state can be set to true for Intrinsics @@ -1511,7 +1541,6 @@ LEAF(Intrinsic, StateSplit) , _id(id) , _args(args) , _recv(NULL) - , _nonnull_state(AllBits) { assert(args != NULL, "args must exist"); ASSERT_VALUES @@ -1537,21 +1566,12 @@ LEAF(Intrinsic, StateSplit) Value receiver() const { assert(has_receiver(), "must have receiver"); return _recv; } bool preserves_state() const { return check_flag(PreservesStateFlag); } - bool arg_needs_null_check(int i) { - if (i >= 0 && i < (int)sizeof(_nonnull_state) * BitsPerByte) { - return is_set_nth_bit(_nonnull_state, i); - } - return true; + bool arg_needs_null_check(int i) const { + return _nonnull_state.arg_needs_null_check(i); } void set_arg_needs_null_check(int i, bool check) { - if (i >= 0 && i < (int)sizeof(_nonnull_state) * BitsPerByte) { - if (check) { - _nonnull_state |= nth_bit(i); - } else { - _nonnull_state &= ~(nth_bit(i)); - } - } + _nonnull_state.set_arg_needs_null_check(i, check); } // generic @@ -2450,34 +2470,87 @@ LEAF(UnsafePrefetchWrite, UnsafePrefetch) LEAF(ProfileCall, Instruction) private: - ciMethod* _method; - int _bci_of_invoke; - ciMethod* _callee; // the method that is called at the given bci - Value _recv; - ciKlass* _known_holder; + ciMethod* _method; + int _bci_of_invoke; + ciMethod* _callee; // the method that is called at the given bci + Value _recv; + ciKlass* _known_holder; + Values* _obj_args; // arguments for type profiling + ArgsNonNullState _nonnull_state; // Do we know whether some arguments are never null? + bool _inlined; // Are we profiling a call that is inlined public: - ProfileCall(ciMethod* method, int bci, ciMethod* callee, Value recv, ciKlass* known_holder) + ProfileCall(ciMethod* method, int bci, ciMethod* callee, Value recv, ciKlass* known_holder, Values* obj_args, bool inlined) : Instruction(voidType) , _method(method) , _bci_of_invoke(bci) , _callee(callee) , _recv(recv) , _known_holder(known_holder) + , _obj_args(obj_args) + , _inlined(inlined) { // The ProfileCall has side-effects and must occur precisely where located pin(); } - ciMethod* method() { return _method; } - int bci_of_invoke() { return _bci_of_invoke; } - ciMethod* callee() { return _callee; } - Value recv() { return _recv; } - ciKlass* known_holder() { return _known_holder; } + ciMethod* method() const { return _method; } + int bci_of_invoke() const { return _bci_of_invoke; } + ciMethod* callee() const { return _callee; } + Value recv() const { return _recv; } + ciKlass* known_holder() const { return _known_holder; } + int nb_profiled_args() const { return _obj_args == NULL ? 0 : _obj_args->length(); } + Value profiled_arg_at(int i) const { return _obj_args->at(i); } + bool arg_needs_null_check(int i) const { + return _nonnull_state.arg_needs_null_check(i); + } + bool inlined() const { return _inlined; } - virtual void input_values_do(ValueVisitor* f) { if (_recv != NULL) f->visit(&_recv); } + void set_arg_needs_null_check(int i, bool check) { + _nonnull_state.set_arg_needs_null_check(i, check); + } + + virtual void input_values_do(ValueVisitor* f) { + if (_recv != NULL) { + f->visit(&_recv); + } + for (int i = 0; i < nb_profiled_args(); i++) { + f->visit(_obj_args->adr_at(i)); + } + } }; +LEAF(ProfileReturnType, Instruction) + private: + ciMethod* _method; + ciMethod* _callee; + int _bci_of_invoke; + Value _ret; + + public: + ProfileReturnType(ciMethod* method, int bci, ciMethod* callee, Value ret) + : Instruction(voidType) + , _method(method) + , _callee(callee) + , _bci_of_invoke(bci) + , _ret(ret) + { + set_needs_null_check(true); + // The ProfileType has side-effects and must occur precisely where located + pin(); + } + + ciMethod* method() const { return _method; } + ciMethod* callee() const { return _callee; } + int bci_of_invoke() const { return _bci_of_invoke; } + Value ret() const { return _ret; } + + virtual void input_values_do(ValueVisitor* f) { + if (_ret != NULL) { + f->visit(&_ret); + } + } +}; // Call some C runtime function that doesn't safepoint, // optionally passing the current thread as the first argument. diff --git a/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp b/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp index cfca00ab277..7f87e1183b0 100644 --- a/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp +++ b/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp @@ -892,10 +892,24 @@ void InstructionPrinter::do_ProfileCall(ProfileCall* x) { if (x->known_holder() != NULL) { output()->print(", "); print_klass(x->known_holder()); + output()->print(" "); + } + for (int i = 0; i < x->nb_profiled_args(); i++) { + if (i > 0) output()->print(", "); + print_value(x->profiled_arg_at(i)); + if (x->arg_needs_null_check(i)) { + output()->print(" [NC]"); + } } output()->put(')'); } +void InstructionPrinter::do_ProfileReturnType(ProfileReturnType* x) { + output()->print("profile ret type "); + print_value(x->ret()); + output()->print(" %s.%s", x->method()->holder()->name()->as_utf8(), x->method()->name()->as_utf8()); + output()->put(')'); +} void InstructionPrinter::do_ProfileInvoke(ProfileInvoke* x) { output()->print("profile_invoke "); output()->print(" %s.%s", x->inlinee()->holder()->name()->as_utf8(), x->inlinee()->name()->as_utf8()); diff --git a/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp b/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp index 8c80b6c7507..2ad20d3e65a 100644 --- a/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp +++ b/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp @@ -132,6 +132,7 @@ class InstructionPrinter: public InstructionVisitor { virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x); virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x); virtual void do_ProfileCall (ProfileCall* x); + virtual void do_ProfileReturnType (ProfileReturnType* x); virtual void do_ProfileInvoke (ProfileInvoke* x); virtual void do_RuntimeCall (RuntimeCall* x); virtual void do_MemBar (MemBar* x); diff --git a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp index cb0ceab90c0..2634f5f4105 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.cpp +++ b/hotspot/src/share/vm/c1/c1_LIR.cpp @@ -183,10 +183,10 @@ char LIR_OprDesc::type_char(BasicType t) { case T_LONG: case T_OBJECT: case T_ADDRESS: - case T_METADATA: case T_VOID: return ::type2char(t); - + case T_METADATA: + return 'M'; case T_ILLEGAL: return '?'; @@ -1001,6 +1001,17 @@ void LIR_OpVisitState::visit(LIR_Op* op) { assert(opProfileCall->_tmp1->is_valid(), "used"); do_temp(opProfileCall->_tmp1); break; } + +// LIR_OpProfileType: + case lir_profile_type: { + assert(op->as_OpProfileType() != NULL, "must be"); + LIR_OpProfileType* opProfileType = (LIR_OpProfileType*)op; + + do_input(opProfileType->_mdp); do_temp(opProfileType->_mdp); + do_input(opProfileType->_obj); + do_temp(opProfileType->_tmp); + break; + } default: ShouldNotReachHere(); } @@ -1151,6 +1162,10 @@ void LIR_OpProfileCall::emit_code(LIR_Assembler* masm) { masm->emit_profile_call(this); } +void LIR_OpProfileType::emit_code(LIR_Assembler* masm) { + masm->emit_profile_type(this); +} + // LIR_List LIR_List::LIR_List(Compilation* compilation, BlockBegin* block) : _operations(8) @@ -1803,6 +1818,8 @@ const char * LIR_Op::name() const { case lir_cas_int: s = "cas_int"; break; // LIR_OpProfileCall case lir_profile_call: s = "profile_call"; break; + // LIR_OpProfileType + case lir_profile_type: s = "profile_type"; break; // LIR_OpAssert #ifdef ASSERT case lir_assert: s = "assert"; break; @@ -2086,6 +2103,15 @@ void LIR_OpProfileCall::print_instr(outputStream* out) const { tmp1()->print(out); out->print(" "); } +// LIR_OpProfileType +void LIR_OpProfileType::print_instr(outputStream* out) const { + out->print("exact = "); exact_klass()->print_name_on(out); + out->print("current = "); ciTypeEntries::print_ciklass(out, current_klass()); + mdp()->print(out); out->print(" "); + obj()->print(out); out->print(" "); + tmp()->print(out); out->print(" "); +} + #endif // PRODUCT // Implementation of LIR_InsertionBuffer diff --git a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp index d0dca72f386..a339af5098f 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.hpp +++ b/hotspot/src/share/vm/c1/c1_LIR.hpp @@ -882,6 +882,7 @@ class LIR_OpLock; class LIR_OpTypeCheck; class LIR_OpCompareAndSwap; class LIR_OpProfileCall; +class LIR_OpProfileType; #ifdef ASSERT class LIR_OpAssert; #endif @@ -1005,6 +1006,7 @@ enum LIR_Code { , end_opCompareAndSwap , begin_opMDOProfile , lir_profile_call + , lir_profile_type , end_opMDOProfile , begin_opAssert , lir_assert @@ -1145,6 +1147,7 @@ class LIR_Op: public CompilationResourceObj { virtual LIR_OpTypeCheck* as_OpTypeCheck() { return NULL; } virtual LIR_OpCompareAndSwap* as_OpCompareAndSwap() { return NULL; } virtual LIR_OpProfileCall* as_OpProfileCall() { return NULL; } + virtual LIR_OpProfileType* as_OpProfileType() { return NULL; } #ifdef ASSERT virtual LIR_OpAssert* as_OpAssert() { return NULL; } #endif @@ -1925,8 +1928,8 @@ class LIR_OpProfileCall : public LIR_Op { public: // Destroys recv - LIR_OpProfileCall(LIR_Code code, ciMethod* profiled_method, int profiled_bci, ciMethod* profiled_callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* known_holder) - : LIR_Op(code, LIR_OprFact::illegalOpr, NULL) // no result, no info + LIR_OpProfileCall(ciMethod* profiled_method, int profiled_bci, ciMethod* profiled_callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* known_holder) + : LIR_Op(lir_profile_call, LIR_OprFact::illegalOpr, NULL) // no result, no info , _profiled_method(profiled_method) , _profiled_bci(profiled_bci) , _profiled_callee(profiled_callee) @@ -1948,6 +1951,45 @@ class LIR_OpProfileCall : public LIR_Op { virtual void print_instr(outputStream* out) const PRODUCT_RETURN; }; +// LIR_OpProfileType +class LIR_OpProfileType : public LIR_Op { + friend class LIR_OpVisitState; + + private: + LIR_Opr _mdp; + LIR_Opr _obj; + LIR_Opr _tmp; + ciKlass* _exact_klass; // non NULL if we know the klass statically (no need to load it from _obj) + intptr_t _current_klass; // what the profiling currently reports + bool _not_null; // true if we know statically that _obj cannot be null + bool _no_conflict; // true if we're profling parameters, _exact_klass is not NULL and we know + // _exact_klass it the only possible type for this parameter in any context. + + public: + // Destroys recv + LIR_OpProfileType(LIR_Opr mdp, LIR_Opr obj, ciKlass* exact_klass, intptr_t current_klass, LIR_Opr tmp, bool not_null, bool no_conflict) + : LIR_Op(lir_profile_type, LIR_OprFact::illegalOpr, NULL) // no result, no info + , _mdp(mdp) + , _obj(obj) + , _exact_klass(exact_klass) + , _current_klass(current_klass) + , _tmp(tmp) + , _not_null(not_null) + , _no_conflict(no_conflict) { } + + LIR_Opr mdp() const { return _mdp; } + LIR_Opr obj() const { return _obj; } + LIR_Opr tmp() const { return _tmp; } + ciKlass* exact_klass() const { return _exact_klass; } + intptr_t current_klass() const { return _current_klass; } + bool not_null() const { return _not_null; } + bool no_conflict() const { return _no_conflict; } + + virtual void emit_code(LIR_Assembler* masm); + virtual LIR_OpProfileType* as_OpProfileType() { return this; } + virtual void print_instr(outputStream* out) const PRODUCT_RETURN; +}; + class LIR_InsertionBuffer; //--------------------------------LIR_List--------------------------------------------------- @@ -2247,7 +2289,10 @@ class LIR_List: public CompilationResourceObj { ciMethod* profiled_method, int profiled_bci); // MethodData* profiling void profile_call(ciMethod* method, int bci, ciMethod* callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* cha_klass) { - append(new LIR_OpProfileCall(lir_profile_call, method, bci, callee, mdo, recv, t1, cha_klass)); + append(new LIR_OpProfileCall(method, bci, callee, mdo, recv, t1, cha_klass)); + } + void profile_type(LIR_Address* mdp, LIR_Opr obj, ciKlass* exact_klass, intptr_t current_klass, LIR_Opr tmp, bool not_null, bool no_conflict) { + append(new LIR_OpProfileType(LIR_OprFact::address(mdp), obj, exact_klass, current_klass, tmp, not_null, no_conflict)); } void xadd(LIR_Opr src, LIR_Opr add, LIR_Opr res, LIR_Opr tmp) { append(new LIR_Op2(lir_xadd, src, add, res, tmp)); } diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp index 57df2725ee2..68f249a2aed 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp @@ -208,6 +208,7 @@ class LIR_Assembler: public CompilationResourceObj { void emit_call(LIR_OpJavaCall* op); void emit_rtcall(LIR_OpRTCall* op); void emit_profile_call(LIR_OpProfileCall* op); + void emit_profile_type(LIR_OpProfileType* op); void emit_delay(LIR_OpDelay* op); void arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest, CodeEmitInfo* info, bool pop_fpu_stack); diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index dbe3476aad9..e3098911d88 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -1175,7 +1175,7 @@ void LIRGenerator::do_Return(Return* x) { if (compilation()->env()->dtrace_method_probes()) { BasicTypeList signature; signature.append(LP64_ONLY(T_LONG) NOT_LP64(T_INT)); // thread - signature.append(T_OBJECT); // Method* + signature.append(T_METADATA); // Method* LIR_OprList* args = new LIR_OprList(); args->append(getThreadPointer()); LIR_Opr meth = new_register(T_METADATA); @@ -1265,6 +1265,7 @@ void LIRGenerator::do_getClass(Intrinsic* x) { LIRItem rcvr(x->argument_at(0), this); rcvr.load_item(); + LIR_Opr temp = new_register(T_METADATA); LIR_Opr result = rlock_result(x); // need to perform the null check on the rcvr @@ -1272,8 +1273,11 @@ void LIRGenerator::do_getClass(Intrinsic* x) { if (x->needs_null_check()) { info = state_for(x); } - __ move(new LIR_Address(rcvr.result(), oopDesc::klass_offset_in_bytes(), T_ADDRESS), result, info); - __ move_wide(new LIR_Address(result, in_bytes(Klass::java_mirror_offset()), T_OBJECT), result); + + // FIXME T_ADDRESS should actually be T_METADATA but it can't because the + // meaning of these two is mixed up (see JDK-8026837). + __ move(new LIR_Address(rcvr.result(), oopDesc::klass_offset_in_bytes(), T_ADDRESS), temp, info); + __ move_wide(new LIR_Address(temp, in_bytes(Klass::java_mirror_offset()), T_OBJECT), result); } @@ -2571,6 +2575,111 @@ void LIRGenerator::do_Goto(Goto* x) { } +ciKlass* LIRGenerator::profile_arg_type(ciMethodData* md, int md_base_offset, int md_offset, intptr_t profiled_k, Value arg, LIR_Opr& mdp, bool not_null, ciKlass* signature_k) { + ciKlass* result = NULL; + bool do_null = !not_null && !TypeEntries::was_null_seen(profiled_k); + bool do_update = !TypeEntries::is_type_unknown(profiled_k); + // known not to be null or null bit already set and already set to + // unknown: nothing we can do to improve profiling + if (!do_null && !do_update) { + return result; + } + + ciKlass* exact_klass = NULL; + Compilation* comp = Compilation::current(); + if (do_update) { + // try to find exact type, using CHA if possible, so that loading + // the klass from the object can be avoided + ciType* type = arg->exact_type(); + if (type == NULL) { + type = arg->declared_type(); + type = comp->cha_exact_type(type); + } + assert(type == NULL || type->is_klass(), "type should be class"); + exact_klass = (type != NULL && type->is_loaded()) ? (ciKlass*)type : NULL; + + do_update = exact_klass == NULL || ciTypeEntries::valid_ciklass(profiled_k) != exact_klass; + } + + if (!do_null && !do_update) { + return result; + } + + ciKlass* exact_signature_k = NULL; + if (do_update) { + // Is the type from the signature exact (the only one possible)? + exact_signature_k = signature_k->exact_klass(); + if (exact_signature_k == NULL) { + exact_signature_k = comp->cha_exact_type(signature_k); + } else { + result = exact_signature_k; + do_update = false; + // Known statically. No need to emit any code: prevent + // LIR_Assembler::emit_profile_type() from emitting useless code + profiled_k = ciTypeEntries::with_status(result, profiled_k); + } + if (exact_signature_k != NULL && exact_klass != exact_signature_k) { + assert(exact_klass == NULL, "arg and signature disagree?"); + // sometimes the type of the signature is better than the best type + // the compiler has + exact_klass = exact_signature_k; + do_update = exact_klass == NULL || ciTypeEntries::valid_ciklass(profiled_k) != exact_klass; + } + } + + if (!do_null && !do_update) { + return result; + } + + if (mdp == LIR_OprFact::illegalOpr) { + mdp = new_register(T_METADATA); + __ metadata2reg(md->constant_encoding(), mdp); + if (md_base_offset != 0) { + LIR_Address* base_type_address = new LIR_Address(mdp, md_base_offset, T_ADDRESS); + mdp = new_pointer_register(); + __ leal(LIR_OprFact::address(base_type_address), mdp); + } + } + LIRItem value(arg, this); + value.load_item(); + __ profile_type(new LIR_Address(mdp, md_offset, T_METADATA), + value.result(), exact_klass, profiled_k, new_pointer_register(), not_null, exact_signature_k != NULL); + return result; +} + +// profile parameters on entry to the root of the compilation +void LIRGenerator::profile_parameters(Base* x) { + if (compilation()->profile_parameters()) { + CallingConvention* args = compilation()->frame_map()->incoming_arguments(); + ciMethodData* md = scope()->method()->method_data_or_null(); + assert(md != NULL, "Sanity"); + + if (md->parameters_type_data() != NULL) { + ciParametersTypeData* parameters_type_data = md->parameters_type_data(); + ciTypeStackSlotEntries* parameters = parameters_type_data->parameters(); + LIR_Opr mdp = LIR_OprFact::illegalOpr; + for (int java_index = 0, i = 0, j = 0; j < parameters_type_data->number_of_parameters(); i++) { + LIR_Opr src = args->at(i); + assert(!src->is_illegal(), "check"); + BasicType t = src->type(); + if (t == T_OBJECT || t == T_ARRAY) { + intptr_t profiled_k = parameters->type(j); + Local* local = x->state()->local_at(java_index)->as_Local(); + ciKlass* exact = profile_arg_type(md, md->byte_offset_of_slot(parameters_type_data, ParametersTypeData::type_offset(0)), + in_bytes(ParametersTypeData::type_offset(j)) - in_bytes(ParametersTypeData::type_offset(0)), + profiled_k, local, mdp, false, local->declared_type()->as_klass()); + // If the profile is known statically set it once for all and do not emit any code + if (exact != NULL) { + md->set_parameter_type(j, exact); + } + j++; + } + java_index += type2size[t]; + } + } + } +} + void LIRGenerator::do_Base(Base* x) { __ std_entry(LIR_OprFact::illegalOpr); // Emit moves from physical registers / stack slots to virtual registers @@ -2611,7 +2720,7 @@ void LIRGenerator::do_Base(Base* x) { if (compilation()->env()->dtrace_method_probes()) { BasicTypeList signature; signature.append(LP64_ONLY(T_LONG) NOT_LP64(T_INT)); // thread - signature.append(T_OBJECT); // Method* + signature.append(T_METADATA); // Method* LIR_OprList* args = new LIR_OprList(); args->append(getThreadPointer()); LIR_Opr meth = new_register(T_METADATA); @@ -2646,6 +2755,7 @@ void LIRGenerator::do_Base(Base* x) { // increment invocation counters if needed if (!method()->is_accessor()) { // Accessors do not have MDOs, so no counting. + profile_parameters(x); CodeEmitInfo* info = new CodeEmitInfo(scope()->start()->state()->copy(ValueStack::StateBefore, SynchronizationEntryBCI), NULL, false); increment_invocation_counter(info); } @@ -3004,12 +3114,123 @@ void LIRGenerator::do_Intrinsic(Intrinsic* x) { } } +void LIRGenerator::profile_arguments(ProfileCall* x) { + if (compilation()->profile_arguments()) { + int bci = x->bci_of_invoke(); + ciMethodData* md = x->method()->method_data_or_null(); + ciProfileData* data = md->bci_to_data(bci); + if ((data->is_CallTypeData() && data->as_CallTypeData()->has_arguments()) || + (data->is_VirtualCallTypeData() && data->as_VirtualCallTypeData()->has_arguments())) { + ByteSize extra = data->is_CallTypeData() ? CallTypeData::args_data_offset() : VirtualCallTypeData::args_data_offset(); + int base_offset = md->byte_offset_of_slot(data, extra); + LIR_Opr mdp = LIR_OprFact::illegalOpr; + ciTypeStackSlotEntries* args = data->is_CallTypeData() ? ((ciCallTypeData*)data)->args() : ((ciVirtualCallTypeData*)data)->args(); + + Bytecodes::Code bc = x->method()->java_code_at_bci(bci); + int start = 0; + int stop = data->is_CallTypeData() ? ((ciCallTypeData*)data)->number_of_arguments() : ((ciVirtualCallTypeData*)data)->number_of_arguments(); + if (x->nb_profiled_args() < stop) { + // if called through method handle invoke, some arguments may have been popped + stop = x->nb_profiled_args(); + } + ciSignature* sig = x->callee()->signature(); + // method handle call to virtual method + bool has_receiver = x->inlined() && !x->callee()->is_static() && !Bytecodes::has_receiver(bc); + ciSignatureStream sig_stream(sig, has_receiver ? x->callee()->holder() : NULL); + for (int i = 0; i < stop; i++) { + int off = in_bytes(TypeEntriesAtCall::argument_type_offset(i)) - in_bytes(TypeEntriesAtCall::args_data_offset()); + ciKlass* exact = profile_arg_type(md, base_offset, off, + args->type(i), x->profiled_arg_at(i+start), mdp, + !x->arg_needs_null_check(i+start), sig_stream.next_klass()); + if (exact != NULL) { + md->set_argument_type(bci, i, exact); + } + } + } else { +#ifdef ASSERT + Bytecodes::Code code = x->method()->raw_code_at_bci(x->bci_of_invoke()); + int n = x->nb_profiled_args(); + assert(MethodData::profile_parameters() && x->inlined() && + ((code == Bytecodes::_invokedynamic && n <= 1) || (code == Bytecodes::_invokehandle && n <= 2)), + "only at JSR292 bytecodes"); +#endif + } + } +} + +// profile parameters on entry to an inlined method +void LIRGenerator::profile_parameters_at_call(ProfileCall* x) { + if (compilation()->profile_parameters() && x->inlined()) { + ciMethodData* md = x->callee()->method_data_or_null(); + if (md != NULL) { + ciParametersTypeData* parameters_type_data = md->parameters_type_data(); + if (parameters_type_data != NULL) { + ciTypeStackSlotEntries* parameters = parameters_type_data->parameters(); + LIR_Opr mdp = LIR_OprFact::illegalOpr; + bool has_receiver = !x->callee()->is_static(); + ciSignature* sig = x->callee()->signature(); + ciSignatureStream sig_stream(sig, has_receiver ? x->callee()->holder() : NULL); + int i = 0; // to iterate on the Instructions + Value arg = x->recv(); + bool not_null = false; + int bci = x->bci_of_invoke(); + Bytecodes::Code bc = x->method()->java_code_at_bci(bci); + // The first parameter is the receiver so that's what we start + // with if it exists. On exception if method handle call to + // virtual method has receiver in the args list + if (arg == NULL || !Bytecodes::has_receiver(bc)) { + i = 1; + arg = x->profiled_arg_at(0); + not_null = !x->arg_needs_null_check(0); + } + int k = 0; // to iterate on the profile data + for (;;) { + intptr_t profiled_k = parameters->type(k); + ciKlass* exact = profile_arg_type(md, md->byte_offset_of_slot(parameters_type_data, ParametersTypeData::type_offset(0)), + in_bytes(ParametersTypeData::type_offset(k)) - in_bytes(ParametersTypeData::type_offset(0)), + profiled_k, arg, mdp, not_null, sig_stream.next_klass()); + // If the profile is known statically set it once for all and do not emit any code + if (exact != NULL) { + md->set_parameter_type(k, exact); + } + k++; + if (k >= parameters_type_data->number_of_parameters()) { +#ifdef ASSERT + int extra = 0; + if (MethodData::profile_arguments() && TypeProfileParmsLimit != -1 && + x->nb_profiled_args() >= TypeProfileParmsLimit && + x->recv() != NULL && Bytecodes::has_receiver(bc)) { + extra += 1; + } + assert(i == x->nb_profiled_args() - extra || (TypeProfileParmsLimit != -1 && TypeProfileArgsLimit > TypeProfileParmsLimit), "unused parameters?"); +#endif + break; + } + arg = x->profiled_arg_at(i); + not_null = !x->arg_needs_null_check(i); + i++; + } + } + } + } +} + void LIRGenerator::do_ProfileCall(ProfileCall* x) { // Need recv in a temporary register so it interferes with the other temporaries LIR_Opr recv = LIR_OprFact::illegalOpr; LIR_Opr mdo = new_register(T_OBJECT); // tmp is used to hold the counters on SPARC LIR_Opr tmp = new_pointer_register(); + + if (x->nb_profiled_args() > 0) { + profile_arguments(x); + } + + // profile parameters on inlined method entry including receiver + if (x->recv() != NULL || x->nb_profiled_args() > 0) { + profile_parameters_at_call(x); + } + if (x->recv() != NULL) { LIRItem value(x->recv(), this); value.load_item(); @@ -3019,6 +3240,21 @@ void LIRGenerator::do_ProfileCall(ProfileCall* x) { __ profile_call(x->method(), x->bci_of_invoke(), x->callee(), mdo, recv, tmp, x->known_holder()); } +void LIRGenerator::do_ProfileReturnType(ProfileReturnType* x) { + int bci = x->bci_of_invoke(); + ciMethodData* md = x->method()->method_data_or_null(); + ciProfileData* data = md->bci_to_data(bci); + assert(data->is_CallTypeData() || data->is_VirtualCallTypeData(), "wrong profile data type"); + ciReturnTypeEntry* ret = data->is_CallTypeData() ? ((ciCallTypeData*)data)->ret() : ((ciVirtualCallTypeData*)data)->ret(); + LIR_Opr mdp = LIR_OprFact::illegalOpr; + ciKlass* exact = profile_arg_type(md, 0, md->byte_offset_of_slot(data, ret->type_offset()), + ret->type(), x->ret(), mdp, + !x->needs_null_check(), x->callee()->signature()->return_type()->as_klass()); + if (exact != NULL) { + md->set_return_type(bci, exact); + } +} + void LIRGenerator::do_ProfileInvoke(ProfileInvoke* x) { // We can safely ignore accessors here, since c2 will inline them anyway, // accessors are also always mature. @@ -3053,7 +3289,11 @@ void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info, int offset = -1; LIR_Opr counter_holder; if (level == CompLevel_limited_profile) { - address counters_adr = method->ensure_method_counters(); + MethodCounters* counters_adr = method->ensure_method_counters(); + if (counters_adr == NULL) { + bailout("method counters allocation failed"); + return; + } counter_holder = new_pointer_register(); __ move(LIR_OprFact::intptrConst(counters_adr), counter_holder); offset = in_bytes(backedge ? MethodCounters::backedge_counter_offset() : @@ -3091,7 +3331,7 @@ void LIRGenerator::do_RuntimeCall(RuntimeCall* x) { BasicTypeList* signature = new BasicTypeList(x->number_of_arguments()); if (x->pass_thread()) { - signature->append(T_ADDRESS); + signature->append(LP64_ONLY(T_LONG) NOT_LP64(T_INT)); // thread args->append(getThreadPointer()); } diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp index 0a029207308..f0c640da919 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp @@ -434,6 +434,10 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { void do_ThreadIDIntrinsic(Intrinsic* x); void do_ClassIDIntrinsic(Intrinsic* x); #endif + ciKlass* profile_arg_type(ciMethodData* md, int md_first_offset, int md_offset, intptr_t profiled_k, Value arg, LIR_Opr& mdp, bool not_null, ciKlass* signature_k); + void profile_arguments(ProfileCall* x); + void profile_parameters(Base* x); + void profile_parameters_at_call(ProfileCall* x); public: Compilation* compilation() const { return _compilation; } @@ -534,6 +538,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x); virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x); virtual void do_ProfileCall (ProfileCall* x); + virtual void do_ProfileReturnType (ProfileReturnType* x); virtual void do_ProfileInvoke (ProfileInvoke* x); virtual void do_RuntimeCall (RuntimeCall* x); virtual void do_MemBar (MemBar* x); diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp index 65d4c60b670..52dff2642c1 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp @@ -75,9 +75,9 @@ // Map BasicType to spill size in 32-bit words, matching VMReg's notion of words #ifdef _LP64 -static int type2spill_size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 0, 1, -1}; +static int type2spill_size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 0, 2, 1, 2, 1, -1}; #else -static int type2spill_size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, -1}; +static int type2spill_size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, -1, 1, 1, -1}; #endif @@ -1138,8 +1138,10 @@ IntervalUseKind LinearScan::use_kind_of_input_operand(LIR_Op* op, LIR_Opr opr) { } } } - - } else if (opr_type != T_LONG) { + // We want to sometimes use logical operations on pointers, in particular in GC barriers. + // Since 64bit logical operations do not current support operands on stack, we have to make sure + // T_OBJECT doesn't get spilled along with T_LONG. + } else if (opr_type != T_LONG LP64_ONLY(&& opr_type != T_OBJECT)) { // integer instruction (note: long operands must always be in register) switch (op->code()) { case lir_cmp: diff --git a/hotspot/src/share/vm/c1/c1_Optimizer.cpp b/hotspot/src/share/vm/c1/c1_Optimizer.cpp index 90dc2797210..90667b46f39 100644 --- a/hotspot/src/share/vm/c1/c1_Optimizer.cpp +++ b/hotspot/src/share/vm/c1/c1_Optimizer.cpp @@ -531,6 +531,7 @@ public: void do_UnsafePrefetchRead (UnsafePrefetchRead* x); void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x); void do_ProfileCall (ProfileCall* x); + void do_ProfileReturnType (ProfileReturnType* x); void do_ProfileInvoke (ProfileInvoke* x); void do_RuntimeCall (RuntimeCall* x); void do_MemBar (MemBar* x); @@ -657,6 +658,8 @@ class NullCheckEliminator: public ValueVisitor { void handle_Intrinsic (Intrinsic* x); void handle_ExceptionObject (ExceptionObject* x); void handle_Phi (Phi* x); + void handle_ProfileCall (ProfileCall* x); + void handle_ProfileReturnType (ProfileReturnType* x); }; @@ -715,7 +718,9 @@ void NullCheckVisitor::do_UnsafePutObject(UnsafePutObject* x) {} void NullCheckVisitor::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {} void NullCheckVisitor::do_UnsafePrefetchRead (UnsafePrefetchRead* x) {} void NullCheckVisitor::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {} -void NullCheckVisitor::do_ProfileCall (ProfileCall* x) { nce()->clear_last_explicit_null_check(); } +void NullCheckVisitor::do_ProfileCall (ProfileCall* x) { nce()->clear_last_explicit_null_check(); + nce()->handle_ProfileCall(x); } +void NullCheckVisitor::do_ProfileReturnType (ProfileReturnType* x) { nce()->handle_ProfileReturnType(x); } void NullCheckVisitor::do_ProfileInvoke (ProfileInvoke* x) {} void NullCheckVisitor::do_RuntimeCall (RuntimeCall* x) {} void NullCheckVisitor::do_MemBar (MemBar* x) {} @@ -1134,6 +1139,15 @@ void NullCheckEliminator::handle_Phi(Phi* x) { } } +void NullCheckEliminator::handle_ProfileCall(ProfileCall* x) { + for (int i = 0; i < x->nb_profiled_args(); i++) { + x->set_arg_needs_null_check(i, !set_contains(x->profiled_arg_at(i))); + } +} + +void NullCheckEliminator::handle_ProfileReturnType(ProfileReturnType* x) { + x->set_needs_null_check(!set_contains(x->ret())); +} void Optimizer::eliminate_null_checks() { ResourceMark rm; diff --git a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp index ae1a2556881..b022a81374b 100644 --- a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp +++ b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp @@ -162,7 +162,8 @@ public: void do_UnsafePrefetchRead (UnsafePrefetchRead* x) { /* nothing to do */ }; void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { /* nothing to do */ }; void do_ProfileCall (ProfileCall* x) { /* nothing to do */ }; - void do_ProfileInvoke (ProfileInvoke* x) { /* nothing to do */ }; + void do_ProfileReturnType (ProfileReturnType* x) { /* nothing to do */ }; + void do_ProfileInvoke (ProfileInvoke* x) { /* nothing to do */ }; void do_RuntimeCall (RuntimeCall* x) { /* nothing to do */ }; void do_MemBar (MemBar* x) { /* nothing to do */ }; void do_RangeCheckPredicate(RangeCheckPredicate* x) { /* nothing to do */ }; diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index 080eaf67088..e3bac09c5b4 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -542,8 +542,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // exception handler can cause class loading, which might throw an // exception and those fields are expected to be clear during // normal bytecode execution. - thread->set_exception_oop(NULL); - thread->set_exception_pc(NULL); + thread->clear_exception_oop_and_pc(); continuation = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, false, false); // If an exception was thrown during exception dispatch, the exception oop may have changed @@ -1019,7 +1018,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i n_copy->set_data((intx) (load_klass())); } else { assert(mirror() != NULL, "klass not set"); - n_copy->set_data((intx) (mirror())); + n_copy->set_data(cast_from_oop(mirror())); } if (TracePatching) { @@ -1031,7 +1030,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i assert(n_copy->data() == 0 || n_copy->data() == (intptr_t)Universe::non_oop_word(), "illegal init value"); - n_copy->set_data((intx) (appendix())); + n_copy->set_data(cast_from_oop(appendix())); if (TracePatching) { Disassembler::decode(copy_buff, copy_buff + *byte_count, tty); @@ -1078,14 +1077,17 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i // replace instructions // first replace the tail, then the call #ifdef ARM - if(load_klass_or_mirror_patch_id && !VM_Version::supports_movw()) { + if((load_klass_or_mirror_patch_id || + stub_id == Runtime1::load_appendix_patching_id) && + !VM_Version::supports_movw()) { nmethod* nm = CodeCache::find_nmethod(instr_pc); address addr = NULL; assert(nm != NULL, "invalid nmethod_pc"); RelocIterator mds(nm, copy_buff, copy_buff + 1); while (mds.next()) { if (mds.type() == relocInfo::oop_type) { - assert(stub_id == Runtime1::load_mirror_patching_id, "wrong stub id"); + assert(stub_id == Runtime1::load_mirror_patching_id || + stub_id == Runtime1::load_appendix_patching_id, "wrong stub id"); oop_Relocation* r = mds.oop_reloc(); addr = (address)r->oop_addr(); break; diff --git a/hotspot/src/share/vm/c1/c1_ValueMap.hpp b/hotspot/src/share/vm/c1/c1_ValueMap.hpp index 820d1909efa..1404aa0b8a8 100644 --- a/hotspot/src/share/vm/c1/c1_ValueMap.hpp +++ b/hotspot/src/share/vm/c1/c1_ValueMap.hpp @@ -203,6 +203,7 @@ class ValueNumberingVisitor: public InstructionVisitor { void do_UnsafePrefetchRead (UnsafePrefetchRead* x) { /* nothing to do */ } void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { /* nothing to do */ } void do_ProfileCall (ProfileCall* x) { /* nothing to do */ } + void do_ProfileReturnType (ProfileReturnType* x) { /* nothing to do */ } void do_ProfileInvoke (ProfileInvoke* x) { /* nothing to do */ }; void do_RuntimeCall (RuntimeCall* x) { /* nothing to do */ }; void do_MemBar (MemBar* x) { /* nothing to do */ }; diff --git a/hotspot/src/share/vm/c1/c1_globals.hpp b/hotspot/src/share/vm/c1/c1_globals.hpp index 3dceebc9d5b..9cc51ede622 100644 --- a/hotspot/src/share/vm/c1/c1_globals.hpp +++ b/hotspot/src/share/vm/c1/c1_globals.hpp @@ -341,6 +341,8 @@ diagnostic(bool, C1PatchInvokeDynamic, true, \ "Patch invokedynamic appendix not known at compile time") \ \ + develop(intx, MaxForceInlineLevel, 100, \ + "maximum number of nested @ForceInline calls that are inlined") \ \ diff --git a/hotspot/src/share/vm/ci/ciClassList.hpp b/hotspot/src/share/vm/ci/ciClassList.hpp index 71e5dd18c7f..c3131f5ee67 100644 --- a/hotspot/src/share/vm/ci/ciClassList.hpp +++ b/hotspot/src/share/vm/ci/ciClassList.hpp @@ -102,6 +102,7 @@ friend class ciMethodData; \ friend class ciMethodHandle; \ friend class ciMethodType; \ friend class ciReceiverTypeData; \ +friend class ciTypeEntries; \ friend class ciSymbol; \ friend class ciArray; \ friend class ciObjArray; \ diff --git a/hotspot/src/share/vm/ci/ciEnv.cpp b/hotspot/src/share/vm/ci/ciEnv.cpp index 0102b2b21f0..7e61a849b0f 100644 --- a/hotspot/src/share/vm/ci/ciEnv.cpp +++ b/hotspot/src/share/vm/ci/ciEnv.cpp @@ -483,8 +483,7 @@ ciKlass* ciEnv::get_klass_by_index_impl(constantPoolHandle cpool, { // We have to lock the cpool to keep the oop from being resolved // while we are accessing it. - oop cplock = cpool->lock(); - ObjectLocker ol(cplock, THREAD, cplock != NULL); + MonitorLockerEx ml(cpool->lock()); constantTag tag = cpool->tag_at(index); if (tag.is_klass()) { // The klass has been inserted into the constant pool @@ -1154,9 +1153,12 @@ ciInstance* ciEnv::unloaded_ciinstance() { GUARDED_VM_ENTRY(return _factory->get_unloaded_object_constant();) } -void ciEnv::dump_replay_data(outputStream* out) { - VM_ENTRY_MARK; - MutexLocker ml(Compile_lock); +// ------------------------------------------------------------------ +// ciEnv::dump_replay_data* + +// Don't change thread state and acquire any locks. +// Safe to call from VM error reporter. +void ciEnv::dump_replay_data_unsafe(outputStream* out) { ResourceMark rm; #if INCLUDE_JVMTI out->print_cr("JvmtiExport can_access_local_variables %d", _jvmti_can_access_local_variables); @@ -1181,3 +1183,10 @@ void ciEnv::dump_replay_data(outputStream* out) { entry_bci, comp_level); out->flush(); } + +void ciEnv::dump_replay_data(outputStream* out) { + GUARDED_VM_ENTRY( + MutexLocker ml(Compile_lock); + dump_replay_data_unsafe(out); + ) +} diff --git a/hotspot/src/share/vm/ci/ciEnv.hpp b/hotspot/src/share/vm/ci/ciEnv.hpp index 01f417d2f9d..b235f3b148b 100644 --- a/hotspot/src/share/vm/ci/ciEnv.hpp +++ b/hotspot/src/share/vm/ci/ciEnv.hpp @@ -452,6 +452,7 @@ public: // Dump the compilation replay data for the ciEnv to the stream. void dump_replay_data(outputStream* out); + void dump_replay_data_unsafe(outputStream* out); }; #endif // SHARE_VM_CI_CIENV_HPP diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp index c689efa46d6..f4389da46a6 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp @@ -57,6 +57,7 @@ ciInstanceKlass::ciInstanceKlass(KlassHandle h_k) : _init_state = ik->init_state(); _nonstatic_field_size = ik->nonstatic_field_size(); _has_nonstatic_fields = ik->has_nonstatic_fields(); + _has_default_methods = ik->has_default_methods(); _nonstatic_fields = NULL; // initialized lazily by compute_nonstatic_fields: _implementor = NULL; // we will fill these lazily @@ -671,7 +672,6 @@ class StaticFinalFieldPrinter : public FieldClosure { void ciInstanceKlass::dump_replay_data(outputStream* out) { - ASSERT_IN_VM; ResourceMark rm; InstanceKlass* ik = get_instanceKlass(); diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp index 0b244a2972c..34eb84ccfeb 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp @@ -52,6 +52,7 @@ private: bool _has_finalizer; bool _has_subklass; bool _has_nonstatic_fields; + bool _has_default_methods; ciFlags _flags; jint _nonstatic_field_size; @@ -171,6 +172,11 @@ public: } } + bool has_default_methods() { + assert(is_loaded(), "must be loaded"); + return _has_default_methods; + } + ciInstanceKlass* get_canonical_holder(int offset); ciField* get_field_by_offset(int field_offset, bool is_static); ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static); @@ -235,6 +241,13 @@ public: bool is_instance_klass() const { return true; } bool is_java_klass() const { return true; } + virtual ciKlass* exact_klass() { + if (is_loaded() && is_final() && !is_interface()) { + return this; + } + return NULL; + } + // Dump the current state of this klass for compilation replay. virtual void dump_replay_data(outputStream* out); }; diff --git a/hotspot/src/share/vm/ci/ciKlass.cpp b/hotspot/src/share/vm/ci/ciKlass.cpp index ee5e2700ffc..2a4a25acded 100644 --- a/hotspot/src/share/vm/ci/ciKlass.cpp +++ b/hotspot/src/share/vm/ci/ciKlass.cpp @@ -66,7 +66,9 @@ ciKlass::ciKlass(ciSymbol* name, BasicType bt) : ciType(bt) { // ------------------------------------------------------------------ // ciKlass::is_subtype_of bool ciKlass::is_subtype_of(ciKlass* that) { - assert(is_loaded() && that->is_loaded(), "must be loaded"); + assert(this->is_loaded(), err_msg("must be loaded: %s", this->name()->as_quoted_ascii())); + assert(that->is_loaded(), err_msg("must be loaded: %s", that->name()->as_quoted_ascii())); + // Check to see if the klasses are identical. if (this == that) { return true; @@ -83,8 +85,8 @@ bool ciKlass::is_subtype_of(ciKlass* that) { // ------------------------------------------------------------------ // ciKlass::is_subclass_of bool ciKlass::is_subclass_of(ciKlass* that) { - assert(is_loaded() && that->is_loaded(), "must be loaded"); - // Check to see if the klasses are identical. + assert(this->is_loaded(), err_msg("must be loaded: %s", this->name()->as_quoted_ascii())); + assert(that->is_loaded(), err_msg("must be loaded: %s", that->name()->as_quoted_ascii())); VM_ENTRY_MARK; Klass* this_klass = get_Klass(); diff --git a/hotspot/src/share/vm/ci/ciKlass.hpp b/hotspot/src/share/vm/ci/ciKlass.hpp index d378059fcbc..7e03c1ede61 100644 --- a/hotspot/src/share/vm/ci/ciKlass.hpp +++ b/hotspot/src/share/vm/ci/ciKlass.hpp @@ -41,6 +41,7 @@ class ciKlass : public ciType { friend class ciEnv; friend class ciField; friend class ciMethod; + friend class ciMethodData; friend class ciObjArrayKlass; private: @@ -121,6 +122,8 @@ public: // What kind of ciObject is this? bool is_klass() const { return true; } + virtual ciKlass* exact_klass() = 0; + void print_name_on(outputStream* st); }; diff --git a/hotspot/src/share/vm/ci/ciMethod.cpp b/hotspot/src/share/vm/ci/ciMethod.cpp index 486d8c499b6..dd411642ad2 100644 --- a/hotspot/src/share/vm/ci/ciMethod.cpp +++ b/hotspot/src/share/vm/ci/ciMethod.cpp @@ -565,6 +565,116 @@ void ciCallProfile::add_receiver(ciKlass* receiver, int receiver_count) { if (_limit < MorphismLimit) _limit++; } + +void ciMethod::assert_virtual_call_type_ok(int bci) { + assert(java_code_at_bci(bci) == Bytecodes::_invokevirtual || + java_code_at_bci(bci) == Bytecodes::_invokeinterface, err_msg("unexpected bytecode %s", Bytecodes::name(java_code_at_bci(bci)))); +} + +void ciMethod::assert_call_type_ok(int bci) { + assert(java_code_at_bci(bci) == Bytecodes::_invokestatic || + java_code_at_bci(bci) == Bytecodes::_invokespecial || + java_code_at_bci(bci) == Bytecodes::_invokedynamic, err_msg("unexpected bytecode %s", Bytecodes::name(java_code_at_bci(bci)))); +} + +/** + * Check whether profiling provides a type for the argument i to the + * call at bci bci + * + * @param bci bci of the call + * @param i argument number + * @return profiled type + * + * If the profile reports that the argument may be null, return false + * at least for now. + */ +ciKlass* ciMethod::argument_profiled_type(int bci, int i) { + if (MethodData::profile_parameters() && method_data() != NULL && method_data()->is_mature()) { + ciProfileData* data = method_data()->bci_to_data(bci); + if (data != NULL) { + if (data->is_VirtualCallTypeData()) { + assert_virtual_call_type_ok(bci); + ciVirtualCallTypeData* call = (ciVirtualCallTypeData*)data->as_VirtualCallTypeData(); + if (i >= call->number_of_arguments()) { + return NULL; + } + ciKlass* type = call->valid_argument_type(i); + if (type != NULL && !call->argument_maybe_null(i)) { + return type; + } + } else if (data->is_CallTypeData()) { + assert_call_type_ok(bci); + ciCallTypeData* call = (ciCallTypeData*)data->as_CallTypeData(); + if (i >= call->number_of_arguments()) { + return NULL; + } + ciKlass* type = call->valid_argument_type(i); + if (type != NULL && !call->argument_maybe_null(i)) { + return type; + } + } + } + } + return NULL; +} + +/** + * Check whether profiling provides a type for the return value from + * the call at bci bci + * + * @param bci bci of the call + * @return profiled type + * + * If the profile reports that the argument may be null, return false + * at least for now. + */ +ciKlass* ciMethod::return_profiled_type(int bci) { + if (MethodData::profile_return() && method_data() != NULL && method_data()->is_mature()) { + ciProfileData* data = method_data()->bci_to_data(bci); + if (data != NULL) { + if (data->is_VirtualCallTypeData()) { + assert_virtual_call_type_ok(bci); + ciVirtualCallTypeData* call = (ciVirtualCallTypeData*)data->as_VirtualCallTypeData(); + ciKlass* type = call->valid_return_type(); + if (type != NULL && !call->return_maybe_null()) { + return type; + } + } else if (data->is_CallTypeData()) { + assert_call_type_ok(bci); + ciCallTypeData* call = (ciCallTypeData*)data->as_CallTypeData(); + ciKlass* type = call->valid_return_type(); + if (type != NULL && !call->return_maybe_null()) { + return type; + } + } + } + } + return NULL; +} + +/** + * Check whether profiling provides a type for the parameter i + * + * @param i parameter number + * @return profiled type + * + * If the profile reports that the argument may be null, return false + * at least for now. + */ +ciKlass* ciMethod::parameter_profiled_type(int i) { + if (MethodData::profile_parameters() && method_data() != NULL && method_data()->is_mature()) { + ciParametersTypeData* parameters = method_data()->parameters_type_data(); + if (parameters != NULL && i < parameters->number_of_parameters()) { + ciKlass* type = parameters->valid_parameter_type(i); + if (type != NULL && !parameters->parameter_maybe_null(i)) { + return type; + } + } + } + return NULL; +} + + // ------------------------------------------------------------------ // ciMethod::find_monomorphic_target // @@ -846,7 +956,9 @@ bool ciMethod::has_member_arg() const { // Return true if allocation was successful or no MDO is required. bool ciMethod::ensure_method_data(methodHandle h_m) { EXCEPTION_CONTEXT; - if (is_native() || is_abstract() || h_m()->is_accessor()) return true; + if (is_native() || is_abstract() || h_m()->is_accessor()) { + return true; + } if (h_m()->method_data() == NULL) { Method::build_interpreter_method_data(h_m, THREAD); if (HAS_PENDING_EXCEPTION) { @@ -903,22 +1015,21 @@ ciMethodData* ciMethod::method_data() { // NULL otherwise. ciMethodData* ciMethod::method_data_or_null() { ciMethodData *md = method_data(); - if (md->is_empty()) return NULL; + if (md->is_empty()) { + return NULL; + } return md; } // ------------------------------------------------------------------ // ciMethod::ensure_method_counters // -address ciMethod::ensure_method_counters() { +MethodCounters* ciMethod::ensure_method_counters() { check_is_loaded(); VM_ENTRY_MARK; methodHandle mh(THREAD, get_Method()); - MethodCounters *counter = mh->method_counters(); - if (counter == NULL) { - counter = Method::build_method_counters(mh(), CHECK_AND_CLEAR_NULL); - } - return (address)counter; + MethodCounters* method_counters = mh->get_method_counters(CHECK_NULL); + return method_counters; } // ------------------------------------------------------------------ @@ -1247,7 +1358,6 @@ ciMethodBlocks *ciMethod::get_method_blocks() { #undef FETCH_FLAG_FROM_VM void ciMethod::dump_replay_data(outputStream* st) { - ASSERT_IN_VM; ResourceMark rm; Method* method = get_Method(); MethodCounters* mcs = method->method_counters(); diff --git a/hotspot/src/share/vm/ci/ciMethod.hpp b/hotspot/src/share/vm/ci/ciMethod.hpp index ddff0ac9b9a..604babb00dd 100644 --- a/hotspot/src/share/vm/ci/ciMethod.hpp +++ b/hotspot/src/share/vm/ci/ciMethod.hpp @@ -117,6 +117,10 @@ class ciMethod : public ciMetadata { *bcp = code; } + // Check bytecode and profile data collected are compatible + void assert_virtual_call_type_ok(int bci); + void assert_call_type_ok(int bci); + public: // Basic method information. ciFlags flags() const { check_is_loaded(); return _flags; } @@ -230,6 +234,11 @@ class ciMethod : public ciMetadata { ciCallProfile call_profile_at_bci(int bci); int interpreter_call_site_count(int bci); + // Does type profiling provide a useful type at this point? + ciKlass* argument_profiled_type(int bci, int i); + ciKlass* parameter_profiled_type(int i); + ciKlass* return_profiled_type(int bci); + ciField* get_field_at_bci( int bci, bool &will_link); ciMethod* get_method_at_bci(int bci, bool &will_link, ciSignature* *declared_signature); @@ -265,7 +274,7 @@ class ciMethod : public ciMetadata { bool is_klass_loaded(int refinfo_index, bool must_be_resolved) const; bool check_call(int refinfo_index, bool is_static) const; bool ensure_method_data(); // make sure it exists in the VM also - address ensure_method_counters(); + MethodCounters* ensure_method_counters(); int instructions_size(); int scale_count(int count, float prof_factor = 1.); // make MDO count commensurate with IIC diff --git a/hotspot/src/share/vm/ci/ciMethodData.cpp b/hotspot/src/share/vm/ci/ciMethodData.cpp index c30c6c36437..e8b6ee6af5e 100644 --- a/hotspot/src/share/vm/ci/ciMethodData.cpp +++ b/hotspot/src/share/vm/ci/ciMethodData.cpp @@ -53,6 +53,7 @@ ciMethodData::ciMethodData(MethodData* md) : ciMetadata(md) { _hint_di = first_di(); // Initialize the escape information (to "don't know."); _eflags = _arg_local = _arg_stack = _arg_returned = 0; + _parameters = NULL; } // ------------------------------------------------------------------ @@ -74,11 +75,14 @@ ciMethodData::ciMethodData() : ciMetadata(NULL) { _hint_di = first_di(); // Initialize the escape information (to "don't know."); _eflags = _arg_local = _arg_stack = _arg_returned = 0; + _parameters = NULL; } void ciMethodData::load_data() { MethodData* mdo = get_MethodData(); - if (mdo == NULL) return; + if (mdo == NULL) { + return; + } // To do: don't copy the data if it is not "ripe" -- require a minimum # // of invocations. @@ -106,6 +110,12 @@ void ciMethodData::load_data() { ci_data = next_data(ci_data); data = mdo->next_data(data); } + if (mdo->parameters_type_data() != NULL) { + _parameters = data_layout_at(mdo->parameters_type_data_di()); + ciParametersTypeData* parameters = new ciParametersTypeData(_parameters); + parameters->translate_from(mdo->parameters_type_data()); + } + // Note: Extra data are all BitData, and do not need translation. _current_mileage = MethodData::mileage_of(mdo->method()); _invocation_counter = mdo->invocation_count(); @@ -123,7 +133,7 @@ void ciMethodData::load_data() { #endif } -void ciReceiverTypeData::translate_receiver_data_from(ProfileData* data) { +void ciReceiverTypeData::translate_receiver_data_from(const ProfileData* data) { for (uint row = 0; row < row_limit(); row++) { Klass* k = data->as_ReceiverTypeData()->receiver(row); if (k != NULL) { @@ -134,6 +144,18 @@ void ciReceiverTypeData::translate_receiver_data_from(ProfileData* data) { } +void ciTypeStackSlotEntries::translate_type_data_from(const TypeStackSlotEntries* entries) { + for (int i = 0; i < _number_of_entries; i++) { + intptr_t k = entries->type(i); + TypeStackSlotEntries::set_type(i, translate_klass(k)); + } +} + +void ciReturnTypeEntry::translate_type_data_from(const ReturnTypeEntry* ret) { + intptr_t k = ret->type(); + set_type(translate_klass(k)); +} + // Get the data at an arbitrary (sort of) data index. ciProfileData* ciMethodData::data_at(int data_index) { if (out_of_bounds(data_index)) { @@ -164,6 +186,12 @@ ciProfileData* ciMethodData::data_at(int data_index) { return new ciMultiBranchData(data_layout); case DataLayout::arg_info_data_tag: return new ciArgInfoData(data_layout); + case DataLayout::call_type_data_tag: + return new ciCallTypeData(data_layout); + case DataLayout::virtual_call_type_data_tag: + return new ciVirtualCallTypeData(data_layout); + case DataLayout::parameters_type_data_tag: + return new ciParametersTypeData(data_layout); }; } @@ -286,6 +314,42 @@ void ciMethodData::set_would_profile(bool p) { } } +void ciMethodData::set_argument_type(int bci, int i, ciKlass* k) { + VM_ENTRY_MARK; + MethodData* mdo = get_MethodData(); + if (mdo != NULL) { + ProfileData* data = mdo->bci_to_data(bci); + if (data->is_CallTypeData()) { + data->as_CallTypeData()->set_argument_type(i, k->get_Klass()); + } else { + assert(data->is_VirtualCallTypeData(), "no arguments!"); + data->as_VirtualCallTypeData()->set_argument_type(i, k->get_Klass()); + } + } +} + +void ciMethodData::set_parameter_type(int i, ciKlass* k) { + VM_ENTRY_MARK; + MethodData* mdo = get_MethodData(); + if (mdo != NULL) { + mdo->parameters_type_data()->set_type(i, k->get_Klass()); + } +} + +void ciMethodData::set_return_type(int bci, ciKlass* k) { + VM_ENTRY_MARK; + MethodData* mdo = get_MethodData(); + if (mdo != NULL) { + ProfileData* data = mdo->bci_to_data(bci); + if (data->is_CallTypeData()) { + data->as_CallTypeData()->set_return_type(k->get_Klass()); + } else { + assert(data->is_VirtualCallTypeData(), "no arguments!"); + data->as_VirtualCallTypeData()->set_return_type(k->get_Klass()); + } + } +} + bool ciMethodData::has_escape_info() { return eflag_set(MethodData::estimated); } @@ -373,7 +437,6 @@ void ciMethodData::print_impl(outputStream* st) { } void ciMethodData::dump_replay_data(outputStream* out) { - ASSERT_IN_VM; ResourceMark rm; MethodData* mdo = get_MethodData(); Method* method = mdo->method(); @@ -477,7 +540,50 @@ void ciMethodData::print_data_on(outputStream* st) { } } -void ciReceiverTypeData::print_receiver_data_on(outputStream* st) { +void ciTypeEntries::print_ciklass(outputStream* st, intptr_t k) { + if (TypeEntries::is_type_none(k)) { + st->print("none"); + } else if (TypeEntries::is_type_unknown(k)) { + st->print("unknown"); + } else { + valid_ciklass(k)->print_name_on(st); + } + if (TypeEntries::was_null_seen(k)) { + st->print(" (null seen)"); + } +} + +void ciTypeStackSlotEntries::print_data_on(outputStream* st) const { + for (int i = 0; i < _number_of_entries; i++) { + _pd->tab(st); + st->print("%d: stack (%u) ", i, stack_slot(i)); + print_ciklass(st, type(i)); + st->cr(); + } +} + +void ciReturnTypeEntry::print_data_on(outputStream* st) const { + _pd->tab(st); + st->print("ret "); + print_ciklass(st, type()); + st->cr(); +} + +void ciCallTypeData::print_data_on(outputStream* st) const { + print_shared(st, "ciCallTypeData"); + if (has_arguments()) { + tab(st, true); + st->print("argument types"); + args()->print_data_on(st); + } + if (has_return()) { + tab(st, true); + st->print("return type"); + ret()->print_data_on(st); + } +} + +void ciReceiverTypeData::print_receiver_data_on(outputStream* st) const { uint row; int entries = 0; for (row = 0; row < row_limit(); row++) { @@ -493,13 +599,33 @@ void ciReceiverTypeData::print_receiver_data_on(outputStream* st) { } } -void ciReceiverTypeData::print_data_on(outputStream* st) { +void ciReceiverTypeData::print_data_on(outputStream* st) const { print_shared(st, "ciReceiverTypeData"); print_receiver_data_on(st); } -void ciVirtualCallData::print_data_on(outputStream* st) { +void ciVirtualCallData::print_data_on(outputStream* st) const { print_shared(st, "ciVirtualCallData"); rtd_super()->print_receiver_data_on(st); } + +void ciVirtualCallTypeData::print_data_on(outputStream* st) const { + print_shared(st, "ciVirtualCallTypeData"); + rtd_super()->print_receiver_data_on(st); + if (has_arguments()) { + tab(st, true); + st->print("argument types"); + args()->print_data_on(st); + } + if (has_return()) { + tab(st, true); + st->print("return type"); + ret()->print_data_on(st); + } +} + +void ciParametersTypeData::print_data_on(outputStream* st) const { + st->print_cr("Parametertypes"); + parameters()->print_data_on(st); +} #endif diff --git a/hotspot/src/share/vm/ci/ciMethodData.hpp b/hotspot/src/share/vm/ci/ciMethodData.hpp index ea650cbd721..0602f85a125 100644 --- a/hotspot/src/share/vm/ci/ciMethodData.hpp +++ b/hotspot/src/share/vm/ci/ciMethodData.hpp @@ -41,6 +41,9 @@ class ciBranchData; class ciArrayData; class ciMultiBranchData; class ciArgInfoData; +class ciCallTypeData; +class ciVirtualCallTypeData; +class ciParametersTypeData; typedef ProfileData ciProfileData; @@ -59,6 +62,119 @@ public: ciJumpData(DataLayout* layout) : JumpData(layout) {}; }; +class ciTypeEntries { +protected: + static intptr_t translate_klass(intptr_t k) { + Klass* v = TypeEntries::valid_klass(k); + if (v != NULL) { + ciKlass* klass = CURRENT_ENV->get_klass(v); + return with_status(klass, k); + } + return with_status(NULL, k); + } + +public: + static ciKlass* valid_ciklass(intptr_t k) { + if (!TypeEntries::is_type_none(k) && + !TypeEntries::is_type_unknown(k)) { + return (ciKlass*)TypeEntries::klass_part(k); + } else { + return NULL; + } + } + + static intptr_t with_status(ciKlass* k, intptr_t in) { + return TypeEntries::with_status((intptr_t)k, in); + } + +#ifndef PRODUCT + static void print_ciklass(outputStream* st, intptr_t k); +#endif +}; + +class ciTypeStackSlotEntries : public TypeStackSlotEntries, ciTypeEntries { +public: + void translate_type_data_from(const TypeStackSlotEntries* args); + + ciKlass* valid_type(int i) const { + return valid_ciklass(type(i)); + } + + bool maybe_null(int i) const { + return was_null_seen(type(i)); + } + +#ifndef PRODUCT + void print_data_on(outputStream* st) const; +#endif +}; + +class ciReturnTypeEntry : public ReturnTypeEntry, ciTypeEntries { +public: + void translate_type_data_from(const ReturnTypeEntry* ret); + + ciKlass* valid_type() const { + return valid_ciklass(type()); + } + + bool maybe_null() const { + return was_null_seen(type()); + } + +#ifndef PRODUCT + void print_data_on(outputStream* st) const; +#endif +}; + +class ciCallTypeData : public CallTypeData { +public: + ciCallTypeData(DataLayout* layout) : CallTypeData(layout) {} + + ciTypeStackSlotEntries* args() const { return (ciTypeStackSlotEntries*)CallTypeData::args(); } + ciReturnTypeEntry* ret() const { return (ciReturnTypeEntry*)CallTypeData::ret(); } + + void translate_from(const ProfileData* data) { + if (has_arguments()) { + args()->translate_type_data_from(data->as_CallTypeData()->args()); + } + if (has_return()) { + ret()->translate_type_data_from(data->as_CallTypeData()->ret()); + } + } + + intptr_t argument_type(int i) const { + assert(has_arguments(), "no arg type profiling data"); + return args()->type(i); + } + + ciKlass* valid_argument_type(int i) const { + assert(has_arguments(), "no arg type profiling data"); + return args()->valid_type(i); + } + + intptr_t return_type() const { + assert(has_return(), "no ret type profiling data"); + return ret()->type(); + } + + ciKlass* valid_return_type() const { + assert(has_return(), "no ret type profiling data"); + return ret()->valid_type(); + } + + bool argument_maybe_null(int i) const { + return args()->maybe_null(i); + } + + bool return_maybe_null() const { + return ret()->maybe_null(); + } + +#ifndef PRODUCT + void print_data_on(outputStream* st) const; +#endif +}; + class ciReceiverTypeData : public ReceiverTypeData { public: ciReceiverTypeData(DataLayout* layout) : ReceiverTypeData(layout) {}; @@ -69,7 +185,7 @@ public: (intptr_t) recv); } - ciKlass* receiver(uint row) { + ciKlass* receiver(uint row) const { assert((uint)row < row_limit(), "oob"); ciKlass* recv = (ciKlass*)intptr_at(receiver0_offset + row * receiver_type_row_cell_count); assert(recv == NULL || recv->is_klass(), "wrong type"); @@ -77,19 +193,19 @@ public: } // Copy & translate from oop based ReceiverTypeData - virtual void translate_from(ProfileData* data) { + virtual void translate_from(const ProfileData* data) { translate_receiver_data_from(data); } - void translate_receiver_data_from(ProfileData* data); + void translate_receiver_data_from(const ProfileData* data); #ifndef PRODUCT - void print_data_on(outputStream* st); - void print_receiver_data_on(outputStream* st); + void print_data_on(outputStream* st) const; + void print_receiver_data_on(outputStream* st) const; #endif }; class ciVirtualCallData : public VirtualCallData { // Fake multiple inheritance... It's a ciReceiverTypeData also. - ciReceiverTypeData* rtd_super() { return (ciReceiverTypeData*) this; } + ciReceiverTypeData* rtd_super() const { return (ciReceiverTypeData*) this; } public: ciVirtualCallData(DataLayout* layout) : VirtualCallData(layout) {}; @@ -103,11 +219,73 @@ public: } // Copy & translate from oop based VirtualCallData - virtual void translate_from(ProfileData* data) { + virtual void translate_from(const ProfileData* data) { rtd_super()->translate_receiver_data_from(data); } #ifndef PRODUCT - void print_data_on(outputStream* st); + void print_data_on(outputStream* st) const; +#endif +}; + +class ciVirtualCallTypeData : public VirtualCallTypeData { +private: + // Fake multiple inheritance... It's a ciReceiverTypeData also. + ciReceiverTypeData* rtd_super() const { return (ciReceiverTypeData*) this; } +public: + ciVirtualCallTypeData(DataLayout* layout) : VirtualCallTypeData(layout) {} + + void set_receiver(uint row, ciKlass* recv) { + rtd_super()->set_receiver(row, recv); + } + + ciKlass* receiver(uint row) const { + return rtd_super()->receiver(row); + } + + ciTypeStackSlotEntries* args() const { return (ciTypeStackSlotEntries*)VirtualCallTypeData::args(); } + ciReturnTypeEntry* ret() const { return (ciReturnTypeEntry*)VirtualCallTypeData::ret(); } + + // Copy & translate from oop based VirtualCallData + virtual void translate_from(const ProfileData* data) { + rtd_super()->translate_receiver_data_from(data); + if (has_arguments()) { + args()->translate_type_data_from(data->as_VirtualCallTypeData()->args()); + } + if (has_return()) { + ret()->translate_type_data_from(data->as_VirtualCallTypeData()->ret()); + } + } + + intptr_t argument_type(int i) const { + assert(has_arguments(), "no arg type profiling data"); + return args()->type(i); + } + + ciKlass* valid_argument_type(int i) const { + assert(has_arguments(), "no arg type profiling data"); + return args()->valid_type(i); + } + + intptr_t return_type() const { + assert(has_return(), "no ret type profiling data"); + return ret()->type(); + } + + ciKlass* valid_return_type() const { + assert(has_return(), "no ret type profiling data"); + return ret()->valid_type(); + } + + bool argument_maybe_null(int i) const { + return args()->maybe_null(i); + } + + bool return_maybe_null() const { + return ret()->maybe_null(); + } + +#ifndef PRODUCT + void print_data_on(outputStream* st) const; #endif }; @@ -137,6 +315,29 @@ public: ciArgInfoData(DataLayout* layout) : ArgInfoData(layout) {}; }; +class ciParametersTypeData : public ParametersTypeData { +public: + ciParametersTypeData(DataLayout* layout) : ParametersTypeData(layout) {} + + virtual void translate_from(const ProfileData* data) { + parameters()->translate_type_data_from(data->as_ParametersTypeData()->parameters()); + } + + ciTypeStackSlotEntries* parameters() const { return (ciTypeStackSlotEntries*)ParametersTypeData::parameters(); } + + ciKlass* valid_parameter_type(int i) const { + return parameters()->valid_type(i); + } + + bool parameter_maybe_null(int i) const { + return parameters()->maybe_null(i); + } + +#ifndef PRODUCT + void print_data_on(outputStream* st) const; +#endif +}; + // ciMethodData // // This class represents a MethodData* in the HotSpot virtual @@ -182,6 +383,10 @@ private: // Coherent snapshot of original header. MethodData _orig; + // Dedicated area dedicated to parameters. Null if no parameter + // profiling for this method. + DataLayout* _parameters; + ciMethodData(MethodData* md); ciMethodData(); @@ -232,8 +437,6 @@ private: public: bool is_method_data() const { return true; } - void set_mature() { _state = mature_state; } - bool is_empty() { return _state == empty_state; } bool is_mature() { return _state == mature_state; } @@ -249,6 +452,11 @@ public: // Also set the numer of loops and blocks in the method. // Again, this is used to determine if a method is trivial. void set_compilation_stats(short loops, short blocks); + // If the compiler finds a profiled type that is known statically + // for sure, set it in the MethodData + void set_argument_type(int bci, int i, ciKlass* k); + void set_parameter_type(int i, ciKlass* k); + void set_return_type(int bci, ciKlass* k); void load_data(); @@ -312,6 +520,10 @@ public: bool is_arg_returned(int i) const; uint arg_modified(int arg) const; + ciParametersTypeData* parameters_type_data() const { + return _parameters != NULL ? new ciParametersTypeData(_parameters) : NULL; + } + // Code generation helper ByteSize offset_of_slot(ciProfileData* data, ByteSize slot_offset_in_data); int byte_offset_of_slot(ciProfileData* data, ByteSize slot_offset_in_data) { return in_bytes(offset_of_slot(data, slot_offset_in_data)); } diff --git a/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp b/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp index 3ccb54eac9c..91f2ebc42a0 100644 --- a/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp +++ b/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp @@ -179,3 +179,16 @@ ciObjArrayKlass* ciObjArrayKlass::make_impl(ciKlass* element_klass) { ciObjArrayKlass* ciObjArrayKlass::make(ciKlass* element_klass) { GUARDED_VM_ENTRY(return make_impl(element_klass);) } + +ciKlass* ciObjArrayKlass::exact_klass() { + ciType* base = base_element_type(); + if (base->is_instance_klass()) { + ciInstanceKlass* ik = base->as_instance_klass(); + if (ik->exact_klass() != NULL) { + return this; + } + } else if (base->is_primitive_type()) { + return this; + } + return NULL; +} diff --git a/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp b/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp index ffbf8502804..7a45e867438 100644 --- a/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp +++ b/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp @@ -73,6 +73,8 @@ public: bool is_obj_array_klass() const { return true; } static ciObjArrayKlass* make(ciKlass* element_klass); + + virtual ciKlass* exact_klass(); }; #endif // SHARE_VM_CI_CIOBJARRAYKLASS_HPP diff --git a/hotspot/src/share/vm/ci/ciReplay.cpp b/hotspot/src/share/vm/ci/ciReplay.cpp index 837d529ca13..3c8ccf9bb87 100644 --- a/hotspot/src/share/vm/ci/ciReplay.cpp +++ b/hotspot/src/share/vm/ci/ciReplay.cpp @@ -965,14 +965,12 @@ void ciReplay::initialize(ciMethod* m) { tty->cr(); } else { EXCEPTION_CONTEXT; - MethodCounters* mcs = method->method_counters(); // m->_instructions_size = rec->instructions_size; m->_instructions_size = -1; m->_interpreter_invocation_count = rec->interpreter_invocation_count; m->_interpreter_throwout_count = rec->interpreter_throwout_count; - if (mcs == NULL) { - mcs = Method::build_method_counters(method, CHECK_AND_CLEAR); - } + MethodCounters* mcs = method->get_method_counters(CHECK_AND_CLEAR); + guarantee(mcs != NULL, "method counters allocation failed"); mcs->invocation_counter()->_counter = rec->invocation_counter; mcs->backedge_counter()->_counter = rec->backedge_counter; } diff --git a/hotspot/src/share/vm/ci/ciStreams.hpp b/hotspot/src/share/vm/ci/ciStreams.hpp index db46a4a85d3..92a1a4adf88 100644 --- a/hotspot/src/share/vm/ci/ciStreams.hpp +++ b/hotspot/src/share/vm/ci/ciStreams.hpp @@ -277,11 +277,14 @@ public: class ciSignatureStream : public StackObj { private: ciSignature* _sig; - int _pos; + int _pos; + // holder is a method's holder + ciKlass* _holder; public: - ciSignatureStream(ciSignature* signature) { + ciSignatureStream(ciSignature* signature, ciKlass* holder = NULL) { _sig = signature; _pos = 0; + _holder = holder; } bool at_return_type() { return _pos == _sig->count(); } @@ -301,6 +304,23 @@ public: return _sig->type_at(_pos); } } + + // next klass in the signature + ciKlass* next_klass() { + ciKlass* sig_k; + if (_holder != NULL) { + sig_k = _holder; + _holder = NULL; + } else { + while (!type()->is_klass()) { + next(); + } + assert(!at_return_type(), "passed end of signature"); + sig_k = type()->as_klass(); + next(); + } + return sig_k; + } }; diff --git a/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp b/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp index 5a57f74c497..b88aecb9c6c 100644 --- a/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp +++ b/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp @@ -57,6 +57,10 @@ public: // Make an array klass corresponding to the specified primitive type. static ciTypeArrayKlass* make(BasicType type); + + virtual ciKlass* exact_klass() { + return this; + } }; #endif // SHARE_VM_CI_CITYPEARRAYKLASS_HPP diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 70662d3e8b8..1774ac18284 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -1787,7 +1787,7 @@ ClassFileParser::AnnotationCollector::annotation_index(ClassLoaderData* loader_d if (_location != _in_method) break; // only allow for methods if (!privileged) break; // only allow in privileged code return _method_LambdaForm_Hidden; - case vmSymbols::VM_SYMBOL_ENUM_NAME(sun_invoke_Stable_signature): + case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_Stable_signature): if (_location != _in_field) break; // only allow for fields if (!privileged) break; // only allow in privileged code return _field_Stable; @@ -2197,8 +2197,8 @@ methodHandle ClassFileParser::parse_method(bool is_interface, } if (lvt_cnt == max_lvt_cnt) { max_lvt_cnt <<= 1; - REALLOC_RESOURCE_ARRAY(u2, localvariable_table_length, lvt_cnt, max_lvt_cnt); - REALLOC_RESOURCE_ARRAY(u2*, localvariable_table_start, lvt_cnt, max_lvt_cnt); + localvariable_table_length = REALLOC_RESOURCE_ARRAY(u2, localvariable_table_length, lvt_cnt, max_lvt_cnt); + localvariable_table_start = REALLOC_RESOURCE_ARRAY(u2*, localvariable_table_start, lvt_cnt, max_lvt_cnt); } localvariable_table_start[lvt_cnt] = parse_localvariable_table(code_length, @@ -2226,8 +2226,8 @@ methodHandle ClassFileParser::parse_method(bool is_interface, // Parse local variable type table if (lvtt_cnt == max_lvtt_cnt) { max_lvtt_cnt <<= 1; - REALLOC_RESOURCE_ARRAY(u2, localvariable_type_table_length, lvtt_cnt, max_lvtt_cnt); - REALLOC_RESOURCE_ARRAY(u2*, localvariable_type_table_start, lvtt_cnt, max_lvtt_cnt); + localvariable_type_table_length = REALLOC_RESOURCE_ARRAY(u2, localvariable_type_table_length, lvtt_cnt, max_lvtt_cnt); + localvariable_type_table_start = REALLOC_RESOURCE_ARRAY(u2*, localvariable_type_table_start, lvtt_cnt, max_lvtt_cnt); } localvariable_type_table_start[lvtt_cnt] = parse_localvariable_table(code_length, @@ -2545,7 +2545,9 @@ Array* ClassFileParser::parse_methods(bool is_interface, if (method->is_final()) { *has_final_method = true; } - if (is_interface && !method->is_abstract() && !method->is_static()) { + if (is_interface && !(*has_default_methods) + && !method->is_abstract() && !method->is_static() + && !method->is_private()) { // default method *has_default_methods = true; } @@ -4078,8 +4080,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name, // Generate any default methods - default methods are interface methods // that have a default implementation. This is new with Lambda project. - if (has_default_methods && !access_flags.is_interface() && - local_interfaces->length() > 0) { + if (has_default_methods && !access_flags.is_interface() ) { DefaultMethods::generate_default_methods( this_klass(), &all_mirandas, CHECK_(nullHandle)); } @@ -4482,9 +4483,8 @@ void ClassFileParser::check_final_method_override(instanceKlassHandle this_klass for (int index = 0; index < num_methods; index++) { Method* m = methods->at(index); - // skip private, static and methods - if ((!m->is_private()) && - (!m->is_static()) && + // skip static and methods + if ((!m->is_static()) && (m->name() != vmSymbols::object_initializer_name())) { Symbol* name = m->name(); diff --git a/hotspot/src/share/vm/classfile/classLoaderData.cpp b/hotspot/src/share/vm/classfile/classLoaderData.cpp index 1d39afd7f88..e3209ae1868 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.cpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp @@ -131,6 +131,17 @@ void ClassLoaderData::classes_do(void f(Klass * const)) { } } +void ClassLoaderData::loaded_classes_do(KlassClosure* klass_closure) { + // Lock to avoid classes being modified/added/removed during iteration + MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag); + for (Klass* k = _klasses; k != NULL; k = k->next_link()) { + // Do not filter ArrayKlass oops here... + if (k->oop_is_array() || (k->oop_is_instance() && InstanceKlass::cast(k)->is_loaded())) { + klass_closure->do_klass(k); + } + } +} + void ClassLoaderData::classes_do(void f(InstanceKlass*)) { for (Klass* k = _klasses; k != NULL; k = k->next_link()) { if (k->oop_is_instance()) { @@ -261,7 +272,7 @@ void ClassLoaderData::add_class(Klass* k) { k, k->external_name(), k->class_loader_data(), - k->class_loader(), + (void *)k->class_loader(), loader_name()); } } @@ -297,7 +308,7 @@ void ClassLoaderData::unload() { if (TraceClassLoaderData) { ResourceMark rm; tty->print("[ClassLoaderData: unload loader data "PTR_FORMAT, this); - tty->print(" for instance "PTR_FORMAT" of %s", class_loader(), + tty->print(" for instance "PTR_FORMAT" of %s", (void *)class_loader(), loader_name()); if (is_anonymous()) { tty->print(" for anonymous class "PTR_FORMAT " ", _klasses); @@ -458,7 +469,7 @@ const char* ClassLoaderData::loader_name() { void ClassLoaderData::dump(outputStream * const out) { ResourceMark rm; out->print("ClassLoaderData CLD: "PTR_FORMAT", loader: "PTR_FORMAT", loader_klass: "PTR_FORMAT" %s {", - this, class_loader(), + this, (void *)class_loader(), class_loader() != NULL ? class_loader()->klass() : NULL, loader_name()); if (claimed()) out->print(" claimed "); if (is_unloading()) out->print(" unloading "); @@ -553,7 +564,7 @@ ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRA ResourceMark rm; tty->print("[ClassLoaderData: "); tty->print("create class loader data "PTR_FORMAT, cld); - tty->print(" for instance "PTR_FORMAT" of %s", cld->class_loader(), + tty->print(" for instance "PTR_FORMAT" of %s", (void *)cld->class_loader(), cld->loader_name()); tty->print_cr("]"); } @@ -600,6 +611,12 @@ void ClassLoaderDataGraph::classes_do(void f(Klass* const)) { } } +void ClassLoaderDataGraph::loaded_classes_do(KlassClosure* klass_closure) { + for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) { + cld->loaded_classes_do(klass_closure); + } +} + void ClassLoaderDataGraph::classes_unloading_do(void f(Klass* const)) { assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!"); for (ClassLoaderData* cld = _unloading; cld != NULL; cld = cld->next()) { diff --git a/hotspot/src/share/vm/classfile/classLoaderData.hpp b/hotspot/src/share/vm/classfile/classLoaderData.hpp index 6d5747483d4..cee114c75e0 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.hpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp @@ -78,6 +78,7 @@ class ClassLoaderDataGraph : public AllStatic { static void keep_alive_oops_do(OopClosure* blk, KlassClosure* klass_closure, bool must_claim); static void classes_do(KlassClosure* klass_closure); static void classes_do(void f(Klass* const)); + static void loaded_classes_do(KlassClosure* klass_closure); static void classes_unloading_do(void f(Klass* const)); static bool do_unloading(BoolObjectClosure* is_alive); @@ -186,6 +187,7 @@ class ClassLoaderData : public CHeapObj { bool keep_alive() const { return _keep_alive; } bool is_alive(BoolObjectClosure* is_alive_closure) const; void classes_do(void f(Klass*)); + void loaded_classes_do(KlassClosure* klass_closure); void classes_do(void f(InstanceKlass*)); // Deallocate free list during class unloading. diff --git a/hotspot/src/share/vm/classfile/defaultMethods.cpp b/hotspot/src/share/vm/classfile/defaultMethods.cpp index 99a45b55b6d..c05c58748d8 100644 --- a/hotspot/src/share/vm/classfile/defaultMethods.cpp +++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp @@ -325,6 +325,7 @@ class MethodFamily : public ResourceObj { Method* _selected_target; // Filled in later, if a unique target exists Symbol* _exception_message; // If no unique target is found + Symbol* _exception_name; // If no unique target is found bool contains_method(Method* method) { int* lookup = _member_index.get(method); @@ -344,13 +345,12 @@ class MethodFamily : public ResourceObj { } Symbol* generate_no_defaults_message(TRAPS) const; - Symbol* generate_abstract_method_message(Method* method, TRAPS) const; Symbol* generate_conflicts_message(GrowableArray* methods, TRAPS) const; public: MethodFamily() - : _selected_target(NULL), _exception_message(NULL) {} + : _selected_target(NULL), _exception_message(NULL), _exception_name(NULL) {} void set_target_if_empty(Method* m) { if (_selected_target == NULL && !m->is_overpass()) { @@ -383,6 +383,7 @@ class MethodFamily : public ResourceObj { Method* get_selected_target() { return _selected_target; } Symbol* get_exception_message() { return _exception_message; } + Symbol* get_exception_name() { return _exception_name; } // Either sets the target or the exception error message void determine_target(InstanceKlass* root, TRAPS) { @@ -391,28 +392,39 @@ class MethodFamily : public ResourceObj { } GrowableArray qualified_methods; + int num_defaults = 0; + int default_index = -1; for (int i = 0; i < _members.length(); ++i) { Pair entry = _members.at(i); if (entry.second == QUALIFIED) { qualified_methods.append(entry.first); + default_index++; + if (entry.first->is_default_method()) { + num_defaults++; + } } } if (qualified_methods.length() == 0) { _exception_message = generate_no_defaults_message(CHECK); + _exception_name = vmSymbols::java_lang_AbstractMethodError(); } else if (qualified_methods.length() == 1) { + // leave abstract methods alone, they will be found via normal search path Method* method = qualified_methods.at(0); - if (method->is_abstract()) { - _exception_message = generate_abstract_method_message(method, CHECK); - } else { + if (!method->is_abstract()) { _selected_target = qualified_methods.at(0); } + // If only one qualified method is default, select that + } else if (num_defaults == 1) { + _selected_target = qualified_methods.at(default_index); } else { _exception_message = generate_conflicts_message(&qualified_methods,CHECK); + _exception_name = vmSymbols::java_lang_IncompatibleClassChangeError(); + if (TraceDefaultMethods) { + _exception_message->print_value_on(tty); + tty->print_cr(""); + } } - - assert((has_target() ^ throws_exception()) == 1, - "One and only one must be true"); } bool contains_signature(Symbol* query) { @@ -459,8 +471,9 @@ class MethodFamily : public ResourceObj { void print_exception(outputStream* str, int indent) { assert(throws_exception(), "Should be called otherwise"); + assert(_exception_name != NULL, "exception_name should be set"); streamIndentor si(str, indent * 2); - str->indent().print_cr("%s", _exception_message->as_C_string()); + str->indent().print_cr("%s: %s", _exception_name->as_C_string(), _exception_message->as_C_string()); } #endif // ndef PRODUCT }; @@ -469,20 +482,6 @@ Symbol* MethodFamily::generate_no_defaults_message(TRAPS) const { return SymbolTable::new_symbol("No qualifying defaults found", CHECK_NULL); } -Symbol* MethodFamily::generate_abstract_method_message(Method* method, TRAPS) const { - Symbol* klass = method->klass_name(); - Symbol* name = method->name(); - Symbol* sig = method->signature(); - stringStream ss; - ss.print("Method "); - ss.write((const char*)klass->bytes(), klass->utf8_length()); - ss.print("."); - ss.write((const char*)name->bytes(), name->utf8_length()); - ss.write((const char*)sig->bytes(), sig->utf8_length()); - ss.print(" is abstract"); - return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL); -} - Symbol* MethodFamily::generate_conflicts_message(GrowableArray* methods, TRAPS) const { stringStream ss; ss.print("Conflicting default methods:"); @@ -589,6 +588,18 @@ class EmptyVtableSlot : public ResourceObj { #endif // ndef PRODUCT }; +static bool already_in_vtable_slots(GrowableArray* slots, Method* m) { + bool found = false; + for (int j = 0; j < slots->length(); ++j) { + if (slots->at(j)->name() == m->name() && + slots->at(j)->signature() == m->signature() ) { + found = true; + break; + } + } + return found; +} + static GrowableArray* find_empty_vtable_slots( InstanceKlass* klass, GrowableArray* mirandas, TRAPS) { @@ -598,8 +609,10 @@ static GrowableArray* find_empty_vtable_slots( // All miranda methods are obvious candidates for (int i = 0; i < mirandas->length(); ++i) { - EmptyVtableSlot* slot = new EmptyVtableSlot(mirandas->at(i)); - slots->append(slot); + Method* m = mirandas->at(i); + if (!already_in_vtable_slots(slots, m)) { + slots->append(new EmptyVtableSlot(m)); + } } // Also any overpasses in our superclasses, that we haven't implemented. @@ -615,7 +628,26 @@ static GrowableArray* find_empty_vtable_slots( // unless we have a real implementation of it in the current class. Method* impl = klass->lookup_method(m->name(), m->signature()); if (impl == NULL || impl->is_overpass()) { - slots->append(new EmptyVtableSlot(m)); + if (!already_in_vtable_slots(slots, m)) { + slots->append(new EmptyVtableSlot(m)); + } + } + } + } + + // also any default methods in our superclasses + if (super->default_methods() != NULL) { + for (int i = 0; i < super->default_methods()->length(); ++i) { + Method* m = super->default_methods()->at(i); + // m is a method that would have been a miranda if not for the + // default method processing that occurred on behalf of our superclass, + // so it's a method we want to re-examine in this new context. That is, + // unless we have a real implementation of it in the current class. + Method* impl = klass->lookup_method(m->name(), m->signature()); + if (impl == NULL || impl->is_overpass()) { + if (!already_in_vtable_slots(slots, m)) { + slots->append(new EmptyVtableSlot(m)); + } } } } @@ -670,7 +702,10 @@ class FindMethodsByErasedSig : public HierarchyVisitor { InstanceKlass* iklass = current_class(); Method* m = iklass->find_method(_method_name, _method_signature); - if (m != NULL) { + // private interface methods are not candidates for default methods + // invokespecial to private interface methods doesn't use default method logic + // future: take access controls into account for superclass methods + if (m != NULL && !m->is_static() && (!iklass->is_interface() || m->is_public())) { if (_family == NULL) { _family = new StatefulMethodFamily(); } @@ -691,7 +726,7 @@ class FindMethodsByErasedSig : public HierarchyVisitor { -static void create_overpasses( +static void create_defaults_and_exceptions( GrowableArray* slots, InstanceKlass* klass, TRAPS); static void generate_erased_defaults( @@ -712,6 +747,8 @@ static void generate_erased_defaults( static void merge_in_new_methods(InstanceKlass* klass, GrowableArray* new_methods, TRAPS); +static void create_default_methods( InstanceKlass* klass, + GrowableArray* new_methods, TRAPS); // This is the guts of the default methods implementation. This is called just // after the classfile has been parsed if some ancestor has default methods. @@ -773,7 +810,7 @@ void DefaultMethods::generate_default_methods( } #endif // ndef PRODUCT - create_overpasses(empty_slots, klass, CHECK); + create_defaults_and_exceptions(empty_slots, klass, CHECK); #ifndef PRODUCT if (TraceDefaultMethods) { @@ -782,263 +819,9 @@ void DefaultMethods::generate_default_methods( #endif // ndef PRODUCT } -/** - * Interface inheritance rules were used to find a unique default method - * candidate for the resolved class. This - * method is only viable if it would also be in the set of default method - * candidates if we ran a full analysis on the current class. - * - * The only reason that the method would not be in the set of candidates for - * the current class is if that there's another matching method - * which is "more specific" than the found method -- i.e., one could find a - * path in the interface hierarchy in which the matching method appears - * before we get to '_target'. - * - * In order to determine this, we examine all of the implemented - * interfaces. If we find path that leads to the '_target' interface, then - * we examine that path to see if there are any methods that would shadow - * the selected method along that path. - */ -class ShadowChecker : public HierarchyVisitor { - protected: - Thread* THREAD; +static int assemble_method_error( + BytecodeConstantPool* cp, BytecodeBuffer* buffer, Symbol* errorName, Symbol* message, TRAPS) { - InstanceKlass* _target; - - Symbol* _method_name; - InstanceKlass* _method_holder; - bool _found_shadow; - - - public: - - ShadowChecker(Thread* thread, Symbol* name, InstanceKlass* holder, - InstanceKlass* target) - : THREAD(thread), _method_name(name), _method_holder(holder), - _target(target), _found_shadow(false) {} - - void* new_node_data(InstanceKlass* cls) { return NULL; } - void free_node_data(void* data) { return; } - - bool visit() { - InstanceKlass* ik = current_class(); - if (ik == _target && current_depth() == 1) { - return false; // This was the specified super -- no need to search it - } - if (ik == _method_holder || ik == _target) { - // We found a path that should be examined to see if it shadows _method - if (path_has_shadow()) { - _found_shadow = true; - cancel_iteration(); - } - return false; // no need to continue up hierarchy - } - return true; - } - - virtual bool path_has_shadow() = 0; - bool found_shadow() { return _found_shadow; } -}; - -// Used for Invokespecial. -// Invokespecial is allowed to invoke a concrete interface method -// and can be used to disambuiguate among qualified candidates, -// which are methods in immediate superinterfaces, -// but may not be used to invoke a candidate that would be shadowed -// from the perspective of the caller. -// Invokespecial is also used in the overpass generation today -// We re-run the shadowchecker because we can't distinguish this case, -// but it should return the same answer, since the overpass target -// is now the invokespecial caller. -class ErasedShadowChecker : public ShadowChecker { - private: - bool path_has_shadow() { - - for (int i = current_depth() - 1; i > 0; --i) { - InstanceKlass* ik = class_at_depth(i); - - if (ik->is_interface()) { - int end; - int start = ik->find_method_by_name(_method_name, &end); - if (start != -1) { - return true; - } - } - } - return false; - } - public: - - ErasedShadowChecker(Thread* thread, Symbol* name, InstanceKlass* holder, - InstanceKlass* target) - : ShadowChecker(thread, name, holder, target) {} -}; - -// Find the unique qualified candidate from the perspective of the super_class -// which is the resolved_klass, which must be an immediate superinterface -// of klass -Method* find_erased_super_default(InstanceKlass* current_class, InstanceKlass* super_class, Symbol* method_name, Symbol* sig, TRAPS) { - - FindMethodsByErasedSig visitor(method_name, sig); - visitor.run(super_class); // find candidates from resolved_klass - - MethodFamily* family; - visitor.get_discovered_family(&family); - - if (family != NULL) { - family->determine_target(current_class, CHECK_NULL); // get target from current_class - - if (family->has_target()) { - Method* target = family->get_selected_target(); - InstanceKlass* holder = InstanceKlass::cast(target->method_holder()); - - // Verify that the identified method is valid from the context of - // the current class, which is the caller class for invokespecial - // link resolution, i.e. ensure there it is not shadowed. - // You can use invokespecial to disambiguate interface methods, but - // you can not use it to skip over an interface method that would shadow it. - ErasedShadowChecker checker(THREAD, target->name(), holder, super_class); - checker.run(current_class); - - if (checker.found_shadow()) { -#ifndef PRODUCT - if (TraceDefaultMethods) { - tty->print_cr(" Only candidate found was shadowed."); - } -#endif // ndef PRODUCT - THROW_MSG_(vmSymbols::java_lang_AbstractMethodError(), - "Accessible default method not found", NULL); - } else { -#ifndef PRODUCT - if (TraceDefaultMethods) { - family->print_sig_on(tty, target->signature(), 1); - } -#endif // ndef PRODUCT - return target; - } - } else { - assert(family->throws_exception(), "must have target or throw"); - THROW_MSG_(vmSymbols::java_lang_AbstractMethodError(), - family->get_exception_message()->as_C_string(), NULL); - } - } else { - // no method found - ResourceMark rm(THREAD); - THROW_MSG_(vmSymbols::java_lang_NoSuchMethodError(), - Method::name_and_sig_as_C_string(current_class, - method_name, sig), NULL); - } -} -// This is called during linktime when we find an invokespecial call that -// refers to a direct superinterface. It indicates that we should find the -// default method in the hierarchy of that superinterface, and if that method -// would have been a candidate from the point of view of 'this' class, then we -// return that method. -// This logic assumes that the super is a direct superclass of the caller -Method* DefaultMethods::find_super_default( - Klass* cls, Klass* super, Symbol* method_name, Symbol* sig, TRAPS) { - - ResourceMark rm(THREAD); - - assert(cls != NULL && super != NULL, "Need real classes"); - - InstanceKlass* current_class = InstanceKlass::cast(cls); - InstanceKlass* super_class = InstanceKlass::cast(super); - - // Keep entire hierarchy alive for the duration of the computation - KeepAliveRegistrar keepAlive(THREAD); - KeepAliveVisitor loadKeepAlive(&keepAlive); - loadKeepAlive.run(current_class); // get hierarchy from current class - -#ifndef PRODUCT - if (TraceDefaultMethods) { - tty->print_cr("Finding super default method %s.%s%s from %s", - super_class->name()->as_C_string(), - method_name->as_C_string(), sig->as_C_string(), - current_class->name()->as_C_string()); - } -#endif // ndef PRODUCT - - assert(super_class->is_interface(), "only call for default methods"); - - Method* target = NULL; - target = find_erased_super_default(current_class, super_class, - method_name, sig, CHECK_NULL); - -#ifndef PRODUCT - if (target != NULL) { - if (TraceDefaultMethods) { - tty->print(" Returning "); - print_method(tty, target, true); - tty->print_cr(""); - } - } -#endif // ndef PRODUCT - return target; -} - -#ifndef PRODUCT -// Return true is broad type is a covariant return of narrow type -static bool covariant_return_type(BasicType narrow, BasicType broad) { - if (narrow == broad) { - return true; - } - if (broad == T_OBJECT) { - return true; - } - return false; -} -#endif // ndef PRODUCT - -static int assemble_redirect( - BytecodeConstantPool* cp, BytecodeBuffer* buffer, - Symbol* incoming, Method* target, TRAPS) { - - BytecodeAssembler assem(buffer, cp); - - SignatureStream in(incoming, true); - SignatureStream out(target->signature(), true); - u2 parameter_count = 0; - - assem.aload(parameter_count++); // load 'this' - - while (!in.at_return_type()) { - assert(!out.at_return_type(), "Parameter counts do not match"); - BasicType bt = in.type(); - assert(out.type() == bt, "Parameter types are not compatible"); - assem.load(bt, parameter_count); - if (in.is_object() && in.as_symbol(THREAD) != out.as_symbol(THREAD)) { - assem.checkcast(out.as_symbol(THREAD)); - } else if (bt == T_LONG || bt == T_DOUBLE) { - ++parameter_count; // longs and doubles use two slots - } - ++parameter_count; - in.next(); - out.next(); - } - assert(out.at_return_type(), "Parameter counts do not match"); - assert(covariant_return_type(out.type(), in.type()), "Return types are not compatible"); - - if (parameter_count == 1 && (in.type() == T_LONG || in.type() == T_DOUBLE)) { - ++parameter_count; // need room for return value - } - if (target->method_holder()->is_interface()) { - assem.invokespecial(target); - } else { - assem.invokevirtual(target); - } - - if (in.is_object() && in.as_symbol(THREAD) != out.as_symbol(THREAD)) { - assem.checkcast(in.as_symbol(THREAD)); - } - assem._return(in.type()); - return parameter_count; -} - -static int assemble_abstract_method_error( - BytecodeConstantPool* cp, BytecodeBuffer* buffer, Symbol* message, TRAPS) { - - Symbol* errorName = vmSymbols::java_lang_AbstractMethodError(); Symbol* init = vmSymbols::object_initializer_name(); Symbol* sig = vmSymbols::string_void_signature(); @@ -1083,7 +866,6 @@ static Method* new_method( m->set_max_locals(params); m->constMethod()->set_stackmap_data(NULL); m->set_code(code_start); - m->set_force_inline(true); return m; } @@ -1109,18 +891,18 @@ static void switchover_constant_pool(BytecodeConstantPool* bpool, } } -// A "bridge" is a method created by javac to bridge the gap between -// an implementation and a generically-compatible, but different, signature. -// Bridges have actual bytecode implementation in classfiles. -// An "overpass", on the other hand, performs the same function as a bridge -// but does not occur in a classfile; the VM creates overpass itself, -// when it needs a path to get from a call site to an default method, and -// a bridge doesn't exist. -static void create_overpasses( +// Create default_methods list for the current class. +// With the VM only processing erased signatures, the VM only +// creates an overpass in a conflict case or a case with no candidates. +// This allows virtual methods to override the overpass, but ensures +// that a local method search will find the exception rather than an abstract +// or default method that is not a valid candidate. +static void create_defaults_and_exceptions( GrowableArray* slots, InstanceKlass* klass, TRAPS) { GrowableArray overpasses; + GrowableArray defaults; BytecodeConstantPool bpool(klass->constants()); for (int i = 0; i < slots->length(); ++i) { @@ -1128,7 +910,6 @@ static void create_overpasses( if (slot->is_bound()) { MethodFamily* method = slot->get_binding(); - int max_stack = 0; BytecodeBuffer buffer; #ifndef PRODUCT @@ -1138,27 +919,27 @@ static void create_overpasses( tty->print_cr(""); if (method->has_target()) { method->print_selected(tty, 1); - } else { + } else if (method->throws_exception()) { method->print_exception(tty, 1); } } #endif // ndef PRODUCT + if (method->has_target()) { Method* selected = method->get_selected_target(); if (selected->method_holder()->is_interface()) { - max_stack = assemble_redirect( - &bpool, &buffer, slot->signature(), selected, CHECK); + defaults.push(selected); } } else if (method->throws_exception()) { - max_stack = assemble_abstract_method_error( - &bpool, &buffer, method->get_exception_message(), CHECK); - } - if (max_stack != 0) { + int max_stack = assemble_method_error(&bpool, &buffer, + method->get_exception_name(), method->get_exception_message(), CHECK); AccessFlags flags = accessFlags_from( JVM_ACC_PUBLIC | JVM_ACC_SYNTHETIC | JVM_ACC_BRIDGE); - Method* m = new_method(&bpool, &buffer, slot->name(), slot->signature(), + Method* m = new_method(&bpool, &buffer, slot->name(), slot->signature(), flags, max_stack, slot->size_of_parameters(), ConstMethod::OVERPASS, CHECK); + // We push to the methods list: + // overpass methods which are exception throwing methods if (m != NULL) { overpasses.push(m); } @@ -1169,11 +950,31 @@ static void create_overpasses( #ifndef PRODUCT if (TraceDefaultMethods) { tty->print_cr("Created %d overpass methods", overpasses.length()); + tty->print_cr("Created %d default methods", defaults.length()); } #endif // ndef PRODUCT - switchover_constant_pool(&bpool, klass, &overpasses, CHECK); - merge_in_new_methods(klass, &overpasses, CHECK); + if (overpasses.length() > 0) { + switchover_constant_pool(&bpool, klass, &overpasses, CHECK); + merge_in_new_methods(klass, &overpasses, CHECK); + } + if (defaults.length() > 0) { + create_default_methods(klass, &defaults, CHECK); + } +} + +static void create_default_methods( InstanceKlass* klass, + GrowableArray* new_methods, TRAPS) { + + int new_size = new_methods->length(); + Array* total_default_methods = MetadataFactory::new_array( + klass->class_loader_data(), new_size, NULL, CHECK); + for (int index = 0; index < new_size; index++ ) { + total_default_methods->at_put(index, new_methods->at(index)); + } + Method::sort_methods(total_default_methods, false, false); + + klass->set_default_methods(total_default_methods); } static void sort_methods(GrowableArray* methods) { @@ -1281,4 +1082,3 @@ static void merge_in_new_methods(InstanceKlass* klass, MetadataFactory::free_array(cld, original_ordering); } } - diff --git a/hotspot/src/share/vm/classfile/defaultMethods.hpp b/hotspot/src/share/vm/classfile/defaultMethods.hpp index 8a31eee6b45..9c7470aa944 100644 --- a/hotspot/src/share/vm/classfile/defaultMethods.hpp +++ b/hotspot/src/share/vm/classfile/defaultMethods.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,15 +44,5 @@ class DefaultMethods : AllStatic { // the class. static void generate_default_methods( InstanceKlass* klass, GrowableArray* mirandas, TRAPS); - - - // Called during linking when an invokespecial to an direct interface - // method is found. Selects and returns a method if there is a unique - // default method in the 'super_iface' part of the hierarchy which is - // also a candidate default for 'this_klass'. Otherwise throws an AME. - static Method* find_super_default( - Klass* this_klass, Klass* super_iface, - Symbol* method_name, Symbol* method_sig, TRAPS); }; - #endif // SHARE_VM_CLASSFILE_DEFAULTMETHODS_HPP diff --git a/hotspot/src/share/vm/classfile/dictionary.cpp b/hotspot/src/share/vm/classfile/dictionary.cpp index 26e06c8a079..e308791caa7 100644 --- a/hotspot/src/share/vm/classfile/dictionary.cpp +++ b/hotspot/src/share/vm/classfile/dictionary.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/dictionary.hpp" #include "classfile/systemDictionary.hpp" +#include "memory/iterator.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiRedefineClassesTrace.hpp" #include "utilities/hashtable.inline.hpp" @@ -38,17 +39,21 @@ Dictionary::Dictionary(int table_size) : TwoOopHashtable(table_size, sizeof(DictionaryEntry)) { _current_class_index = 0; _current_class_entry = NULL; + _pd_cache_table = new ProtectionDomainCacheTable(defaultProtectionDomainCacheSize); }; - Dictionary::Dictionary(int table_size, HashtableBucket* t, int number_of_entries) : TwoOopHashtable(table_size, sizeof(DictionaryEntry), t, number_of_entries) { _current_class_index = 0; _current_class_entry = NULL; + _pd_cache_table = new ProtectionDomainCacheTable(defaultProtectionDomainCacheSize); }; +ProtectionDomainCacheEntry* Dictionary::cache_get(oop protection_domain) { + return _pd_cache_table->get(protection_domain); +} DictionaryEntry* Dictionary::new_entry(unsigned int hash, Klass* klass, ClassLoaderData* loader_data) { @@ -105,11 +110,12 @@ bool DictionaryEntry::contains_protection_domain(oop protection_domain) const { } -void DictionaryEntry::add_protection_domain(oop protection_domain) { +void DictionaryEntry::add_protection_domain(Dictionary* dict, oop protection_domain) { assert_locked_or_safepoint(SystemDictionary_lock); if (!contains_protection_domain(protection_domain)) { + ProtectionDomainCacheEntry* entry = dict->cache_get(protection_domain); ProtectionDomainEntry* new_head = - new ProtectionDomainEntry(protection_domain, _pd_set); + new ProtectionDomainEntry(entry, _pd_set); // Warning: Preserve store ordering. The SystemDictionary is read // without locks. The new ProtectionDomainEntry must be // complete before other threads can be allowed to see it @@ -193,7 +199,10 @@ bool Dictionary::do_unloading() { void Dictionary::always_strong_oops_do(OopClosure* blk) { - // Follow all system classes and temporary placeholders in dictionary + // Follow all system classes and temporary placeholders in dictionary; only + // protection domain oops contain references into the heap. In a first + // pass over the system dictionary determine which need to be treated as + // strongly reachable and mark them as such. for (int index = 0; index < table_size(); index++) { for (DictionaryEntry *probe = bucket(index); probe != NULL; @@ -201,10 +210,13 @@ void Dictionary::always_strong_oops_do(OopClosure* blk) { Klass* e = probe->klass(); ClassLoaderData* loader_data = probe->loader_data(); if (is_strongly_reachable(loader_data, e)) { - probe->protection_domain_set_oops_do(blk); + probe->set_strongly_reachable(); } } } + // Then iterate over the protection domain cache to apply the closure on the + // previously marked ones. + _pd_cache_table->always_strong_oops_do(blk); } @@ -266,18 +278,12 @@ void Dictionary::classes_do(void f(Klass*, ClassLoaderData*)) { } } - void Dictionary::oops_do(OopClosure* f) { - for (int index = 0; index < table_size(); index++) { - for (DictionaryEntry* probe = bucket(index); - probe != NULL; - probe = probe->next()) { - probe->protection_domain_set_oops_do(f); - } - } + // Only the protection domain oops contain references into the heap. Iterate + // over all of them. + _pd_cache_table->oops_do(f); } - void Dictionary::methods_do(void f(Method*)) { for (int index = 0; index < table_size(); index++) { for (DictionaryEntry* probe = bucket(index); @@ -292,6 +298,11 @@ void Dictionary::methods_do(void f(Method*)) { } } +void Dictionary::unlink(BoolObjectClosure* is_alive) { + // Only the protection domain cache table may contain references to the heap + // that need to be unlinked. + _pd_cache_table->unlink(is_alive); +} Klass* Dictionary::try_get_next_class() { while (true) { @@ -306,7 +317,6 @@ Klass* Dictionary::try_get_next_class() { // never reached } - // Add a loaded class to the system dictionary. // Readers of the SystemDictionary aren't always locked, so _buckets // is volatile. The store of the next field in the constructor is @@ -396,7 +406,7 @@ void Dictionary::add_protection_domain(int index, unsigned int hash, assert(protection_domain() != NULL, "real protection domain should be present"); - entry->add_protection_domain(protection_domain()); + entry->add_protection_domain(this, protection_domain()); assert(entry->contains_protection_domain(protection_domain()), "now protection domain should be present"); @@ -446,6 +456,146 @@ void Dictionary::reorder_dictionary() { } } +ProtectionDomainCacheTable::ProtectionDomainCacheTable(int table_size) + : Hashtable(table_size, sizeof(ProtectionDomainCacheEntry)) +{ +} + +void ProtectionDomainCacheTable::unlink(BoolObjectClosure* is_alive) { + assert(SafepointSynchronize::is_at_safepoint(), "must be"); + for (int i = 0; i < table_size(); ++i) { + ProtectionDomainCacheEntry** p = bucket_addr(i); + ProtectionDomainCacheEntry* entry = bucket(i); + while (entry != NULL) { + if (is_alive->do_object_b(entry->literal())) { + p = entry->next_addr(); + } else { + *p = entry->next(); + free_entry(entry); + } + entry = *p; + } + } +} + +void ProtectionDomainCacheTable::oops_do(OopClosure* f) { + for (int index = 0; index < table_size(); index++) { + for (ProtectionDomainCacheEntry* probe = bucket(index); + probe != NULL; + probe = probe->next()) { + probe->oops_do(f); + } + } +} + +uint ProtectionDomainCacheTable::bucket_size() { + return sizeof(ProtectionDomainCacheEntry); +} + +#ifndef PRODUCT +void ProtectionDomainCacheTable::print() { + tty->print_cr("Protection domain cache table (table_size=%d, classes=%d)", + table_size(), number_of_entries()); + for (int index = 0; index < table_size(); index++) { + for (ProtectionDomainCacheEntry* probe = bucket(index); + probe != NULL; + probe = probe->next()) { + probe->print(); + } + } +} + +void ProtectionDomainCacheEntry::print() { + tty->print_cr("entry "PTR_FORMAT" value "PTR_FORMAT" strongly_reachable %d next "PTR_FORMAT, + this, (void*)literal(), _strongly_reachable, next()); +} +#endif + +void ProtectionDomainCacheTable::verify() { + int element_count = 0; + for (int index = 0; index < table_size(); index++) { + for (ProtectionDomainCacheEntry* probe = bucket(index); + probe != NULL; + probe = probe->next()) { + probe->verify(); + element_count++; + } + } + guarantee(number_of_entries() == element_count, + "Verify of protection domain cache table failed"); + debug_only(verify_lookup_length((double)number_of_entries() / table_size())); +} + +void ProtectionDomainCacheEntry::verify() { + guarantee(literal()->is_oop(), "must be an oop"); +} + +void ProtectionDomainCacheTable::always_strong_oops_do(OopClosure* f) { + // the caller marked the protection domain cache entries that we need to apply + // the closure on. Only process them. + for (int index = 0; index < table_size(); index++) { + for (ProtectionDomainCacheEntry* probe = bucket(index); + probe != NULL; + probe = probe->next()) { + if (probe->is_strongly_reachable()) { + probe->reset_strongly_reachable(); + probe->oops_do(f); + } + } + } +} + +ProtectionDomainCacheEntry* ProtectionDomainCacheTable::get(oop protection_domain) { + unsigned int hash = compute_hash(protection_domain); + int index = hash_to_index(hash); + + ProtectionDomainCacheEntry* entry = find_entry(index, protection_domain); + if (entry == NULL) { + entry = add_entry(index, hash, protection_domain); + } + return entry; +} + +ProtectionDomainCacheEntry* ProtectionDomainCacheTable::find_entry(int index, oop protection_domain) { + for (ProtectionDomainCacheEntry* e = bucket(index); e != NULL; e = e->next()) { + if (e->protection_domain() == protection_domain) { + return e; + } + } + + return NULL; +} + +ProtectionDomainCacheEntry* ProtectionDomainCacheTable::add_entry(int index, unsigned int hash, oop protection_domain) { + assert_locked_or_safepoint(SystemDictionary_lock); + assert(index == index_for(protection_domain), "incorrect index?"); + assert(find_entry(index, protection_domain) == NULL, "no double entry"); + + ProtectionDomainCacheEntry* p = new_entry(hash, protection_domain); + Hashtable::add_entry(index, p); + return p; +} + +void ProtectionDomainCacheTable::free(ProtectionDomainCacheEntry* to_delete) { + unsigned int hash = compute_hash(to_delete->protection_domain()); + int index = hash_to_index(hash); + + ProtectionDomainCacheEntry** p = bucket_addr(index); + ProtectionDomainCacheEntry* entry = bucket(index); + while (true) { + assert(entry != NULL, "sanity"); + + if (entry == to_delete) { + *p = entry->next(); + Hashtable::free_entry(entry); + break; + } else { + p = entry->next_addr(); + entry = *p; + } + } +} + SymbolPropertyTable::SymbolPropertyTable(int table_size) : Hashtable(table_size, sizeof(SymbolPropertyEntry)) { @@ -532,11 +682,13 @@ void Dictionary::print() { tty->cr(); } } + tty->cr(); + _pd_cache_table->print(); + tty->cr(); } #endif - void Dictionary::verify() { guarantee(number_of_entries() >= 0, "Verify of system dictionary failed"); @@ -563,5 +715,7 @@ void Dictionary::verify() { guarantee(number_of_entries() == element_count, "Verify of system dictionary failed"); debug_only(verify_lookup_length((double)number_of_entries() / table_size())); + + _pd_cache_table->verify(); } diff --git a/hotspot/src/share/vm/classfile/dictionary.hpp b/hotspot/src/share/vm/classfile/dictionary.hpp index 53629a015fd..17d916f0629 100644 --- a/hotspot/src/share/vm/classfile/dictionary.hpp +++ b/hotspot/src/share/vm/classfile/dictionary.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,11 +27,14 @@ #include "classfile/systemDictionary.hpp" #include "oops/instanceKlass.hpp" -#include "oops/oop.hpp" +#include "oops/oop.inline.hpp" #include "utilities/hashtable.hpp" class DictionaryEntry; class PSPromotionManager; +class ProtectionDomainCacheTable; +class ProtectionDomainCacheEntry; +class BoolObjectClosure; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // The data structure for the system dictionary (and the shared system @@ -45,6 +48,8 @@ private: // pointer to the current hash table entry. static DictionaryEntry* _current_class_entry; + ProtectionDomainCacheTable* _pd_cache_table; + DictionaryEntry* get_entry(int index, unsigned int hash, Symbol* name, ClassLoaderData* loader_data); @@ -93,6 +98,7 @@ public: void methods_do(void f(Method*)); + void unlink(BoolObjectClosure* is_alive); // Classes loaded by the bootstrap loader are always strongly reachable. // If we're not doing class unloading, all classes are strongly reachable. @@ -118,6 +124,7 @@ public: // Sharing support void reorder_dictionary(); + ProtectionDomainCacheEntry* cache_get(oop protection_domain); #ifndef PRODUCT void print(); @@ -126,21 +133,112 @@ public: }; // The following classes can be in dictionary.cpp, but we need these -// to be in header file so that SA's vmStructs can access. +// to be in header file so that SA's vmStructs can access them. +class ProtectionDomainCacheEntry : public HashtableEntry { + friend class VMStructs; + private: + // Flag indicating whether this protection domain entry is strongly reachable. + // Used during iterating over the system dictionary to remember oops that need + // to be updated. + bool _strongly_reachable; + public: + oop protection_domain() { return literal(); } + + void init() { + _strongly_reachable = false; + } + + ProtectionDomainCacheEntry* next() { + return (ProtectionDomainCacheEntry*)HashtableEntry::next(); + } + + ProtectionDomainCacheEntry** next_addr() { + return (ProtectionDomainCacheEntry**)HashtableEntry::next_addr(); + } + + void oops_do(OopClosure* f) { + f->do_oop(literal_addr()); + } + + void set_strongly_reachable() { _strongly_reachable = true; } + bool is_strongly_reachable() { return _strongly_reachable; } + void reset_strongly_reachable() { _strongly_reachable = false; } + + void print() PRODUCT_RETURN; + void verify(); +}; + +// The ProtectionDomainCacheTable contains all protection domain oops. The system +// dictionary entries reference its entries instead of having references to oops +// directly. +// This is used to speed up system dictionary iteration: the oops in the +// protection domain are the only ones referring the Java heap. So when there is +// need to update these, instead of going over every entry of the system dictionary, +// we only need to iterate over this set. +// The amount of different protection domains used is typically magnitudes smaller +// than the number of system dictionary entries (loaded classes). +class ProtectionDomainCacheTable : public Hashtable { + friend class VMStructs; +private: + ProtectionDomainCacheEntry* bucket(int i) { + return (ProtectionDomainCacheEntry*) Hashtable::bucket(i); + } + + // The following method is not MT-safe and must be done under lock. + ProtectionDomainCacheEntry** bucket_addr(int i) { + return (ProtectionDomainCacheEntry**) Hashtable::bucket_addr(i); + } + + ProtectionDomainCacheEntry* new_entry(unsigned int hash, oop protection_domain) { + ProtectionDomainCacheEntry* entry = (ProtectionDomainCacheEntry*) Hashtable::new_entry(hash, protection_domain); + entry->init(); + return entry; + } + + static unsigned int compute_hash(oop protection_domain) { + return (unsigned int)(protection_domain->identity_hash()); + } + + int index_for(oop protection_domain) { + return hash_to_index(compute_hash(protection_domain)); + } + + ProtectionDomainCacheEntry* add_entry(int index, unsigned int hash, oop protection_domain); + ProtectionDomainCacheEntry* find_entry(int index, oop protection_domain); + +public: + + ProtectionDomainCacheTable(int table_size); + + ProtectionDomainCacheEntry* get(oop protection_domain); + void free(ProtectionDomainCacheEntry* entry); + + void unlink(BoolObjectClosure* cl); + + // GC support + void oops_do(OopClosure* f); + void always_strong_oops_do(OopClosure* f); + + static uint bucket_size(); + + void print() PRODUCT_RETURN; + void verify(); +}; + class ProtectionDomainEntry :public CHeapObj { friend class VMStructs; public: ProtectionDomainEntry* _next; - oop _protection_domain; + ProtectionDomainCacheEntry* _pd_cache; - ProtectionDomainEntry(oop protection_domain, ProtectionDomainEntry* next) { - _protection_domain = protection_domain; - _next = next; + ProtectionDomainEntry(ProtectionDomainCacheEntry* pd_cache, ProtectionDomainEntry* next) { + _pd_cache = pd_cache; + _next = next; } ProtectionDomainEntry* next() { return _next; } - oop protection_domain() { return _protection_domain; } + oop protection_domain() { return _pd_cache->protection_domain(); } }; // An entry in the system dictionary, this describes a class as @@ -151,6 +249,24 @@ class DictionaryEntry : public HashtableEntry { private: // Contains the set of approved protection domains that can access // this system dictionary entry. + // + // This protection domain set is a set of tuples: + // + // (InstanceKlass C, initiating class loader ICL, Protection Domain PD) + // + // [Note that C.protection_domain(), which is stored in the java.lang.Class + // mirror of C, is NOT the same as PD] + // + // If such an entry (C, ICL, PD) exists in the table, it means that + // it is okay for a class Foo to reference C, where + // + // Foo.protection_domain() == PD, and + // Foo's defining class loader == ICL + // + // The usage of the PD set can be seen in SystemDictionary::validate_protection_domain() + // It is essentially a cache to avoid repeated Java up-calls to + // ClassLoader.checkPackageAccess(). + // ProtectionDomainEntry* _pd_set; ClassLoaderData* _loader_data; @@ -158,7 +274,7 @@ class DictionaryEntry : public HashtableEntry { // Tells whether a protection is in the approved set. bool contains_protection_domain(oop protection_domain) const; // Adds a protection domain to the approved set. - void add_protection_domain(oop protection_domain); + void add_protection_domain(Dictionary* dict, oop protection_domain); Klass* klass() const { return (Klass*)literal(); } Klass** klass_addr() { return (Klass**)literal_addr(); } @@ -189,12 +305,11 @@ class DictionaryEntry : public HashtableEntry { : contains_protection_domain(protection_domain()); } - - void protection_domain_set_oops_do(OopClosure* f) { + void set_strongly_reachable() { for (ProtectionDomainEntry* current = _pd_set; current != NULL; current = current->_next) { - f->do_oop(&(current->_protection_domain)); + current->_pd_cache->set_strongly_reachable(); } } @@ -202,7 +317,7 @@ class DictionaryEntry : public HashtableEntry { for (ProtectionDomainEntry* current = _pd_set; current != NULL; current = current->_next) { - current->_protection_domain->verify(); + current->_pd_cache->protection_domain()->verify(); } } @@ -264,7 +379,7 @@ class SymbolPropertyEntry : public HashtableEntry { } if (method_type() != NULL) { if (printed) st->print(" and "); - st->print(INTPTR_FORMAT, method_type()); + st->print(INTPTR_FORMAT, (void *)method_type()); printed = true; } st->print_cr(printed ? "" : "(empty)"); diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp index 8e94d834ad9..06e75ea25d7 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -438,6 +438,29 @@ bool java_lang_String::equals(oop java_string, jchar* chars, int len) { return true; } +bool java_lang_String::equals(oop str1, oop str2) { + assert(str1->klass() == SystemDictionary::String_klass(), + "must be java String"); + assert(str2->klass() == SystemDictionary::String_klass(), + "must be java String"); + typeArrayOop value1 = java_lang_String::value(str1); + int offset1 = java_lang_String::offset(str1); + int length1 = java_lang_String::length(str1); + typeArrayOop value2 = java_lang_String::value(str2); + int offset2 = java_lang_String::offset(str2); + int length2 = java_lang_String::length(str2); + + if (length1 != length2) { + return false; + } + for (int i = 0; i < length1; i++) { + if (value1->char_at(i + offset1) != value2->char_at(i + offset2)) { + return false; + } + } + return true; +} + void java_lang_String::print(Handle java_string, outputStream* st) { oop obj = java_string(); assert(obj->klass() == SystemDictionary::String_klass(), "must be java_string"); @@ -1353,8 +1376,15 @@ char* java_lang_Throwable::print_stack_element_to_buffer(Handle mirror, const char* klass_name = holder->external_name(); int buf_len = (int)strlen(klass_name); - // pushing to the stack trace added one. + // The method id may point to an obsolete method, can't get more stack information Method* method = holder->method_with_idnum(method_id); + if (method == NULL) { + char* buf = NEW_RESOURCE_ARRAY(char, buf_len + 64); + // This is what the java code prints in this case - added Redefined + sprintf(buf, "\tat %s.null (Redefined)", klass_name); + return buf; + } + char* method_name = method->name()->as_C_string(); buf_len += (int)strlen(method_name); @@ -1750,7 +1780,8 @@ oop java_lang_Throwable::get_stack_trace_element(oop throwable, int index, TRAPS return element; } -oop java_lang_StackTraceElement::create(Handle mirror, int method_id, int version, int bci, TRAPS) { +oop java_lang_StackTraceElement::create(Handle mirror, int method_id, + int version, int bci, TRAPS) { // Allocate java.lang.StackTraceElement instance Klass* k = SystemDictionary::StackTraceElement_klass(); assert(k != NULL, "must be loaded in 1.4+"); @@ -1767,8 +1798,16 @@ oop java_lang_StackTraceElement::create(Handle mirror, int method_id, int versio oop classname = StringTable::intern((char*) str, CHECK_0); java_lang_StackTraceElement::set_declaringClass(element(), classname); - // Fill in method name Method* method = holder->method_with_idnum(method_id); + // Method on stack may be obsolete because it was redefined so cannot be + // found by idnum. + if (method == NULL) { + // leave name and fileName null + java_lang_StackTraceElement::set_lineNumber(element(), -1); + return element(); + } + + // Fill in method name oop methodname = StringTable::intern(method->name(), CHECK_0); java_lang_StackTraceElement::set_methodName(element(), methodname); diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp index 8a8e801f387..ffccf2f0e0c 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp @@ -182,6 +182,7 @@ class java_lang_String : AllStatic { static unsigned int hash_string(oop java_string); static bool equals(oop java_string, jchar* chars, int len); + static bool equals(oop str1, oop str2); // Conversion between '.' and '/' formats static Handle externalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '/', '.', THREAD); } diff --git a/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp b/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp index 1f24042f5cb..20404879adb 100644 --- a/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp +++ b/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp @@ -27,6 +27,7 @@ #include "code/codeCache.hpp" #include "compiler/compileBroker.hpp" #include "oops/metadata.hpp" +#include "prims/jvmtiImpl.hpp" #include "runtime/synchronizer.hpp" #include "runtime/thread.hpp" #include "utilities/growableArray.hpp" @@ -48,6 +49,7 @@ MetadataOnStackMark::MetadataOnStackMark() { Threads::metadata_do(Metadata::mark_on_stack); CodeCache::alive_nmethods_do(nmethod::mark_on_stack); CompileBroker::mark_on_stack(); + JvmtiCurrentBreakpoints::metadata_do(Metadata::mark_on_stack); } MetadataOnStackMark::~MetadataOnStackMark() { diff --git a/hotspot/src/share/vm/classfile/symbolTable.cpp b/hotspot/src/share/vm/classfile/symbolTable.cpp index c00e9581759..d9cd2c809df 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.cpp +++ b/hotspot/src/share/vm/classfile/symbolTable.cpp @@ -341,7 +341,7 @@ Symbol* SymbolTable::new_permanent_symbol(const char* name, TRAPS) { Symbol* SymbolTable::basic_add(int index_arg, u1 *name, int len, unsigned int hashValue_arg, bool c_heap, TRAPS) { - assert(!Universe::heap()->is_in_reserved(name) || GC_locker::is_active(), + assert(!Universe::heap()->is_in_reserved(name), "proposed name of symbol must be stable"); // Don't allow symbols to be created which cannot fit in a Symbol*. @@ -685,7 +685,7 @@ oop StringTable::intern(Handle string_or_null, jchar* name, if (found_string != NULL) return found_string; debug_only(StableMemoryChecker smc(name, len * sizeof(name[0]))); - assert(!Universe::heap()->is_in_reserved(name) || GC_locker::is_active(), + assert(!Universe::heap()->is_in_reserved(name), "proposed name of symbol must be stable"); Handle string; @@ -807,6 +807,8 @@ void StringTable::possibly_parallel_oops_do(OopClosure* f) { } } +// This verification is part of Universe::verify() and needs to be quick. +// See StringTable::verify_and_compare() below for exhaustive verification. void StringTable::verify() { for (int i = 0; i < the_table()->table_size(); ++i) { HashtableEntry* p = the_table()->bucket(i); @@ -825,6 +827,162 @@ void StringTable::dump(outputStream* st) { the_table()->dump_table(st, "StringTable"); } +StringTable::VerifyRetTypes StringTable::compare_entries( + int bkt1, int e_cnt1, + HashtableEntry* e_ptr1, + int bkt2, int e_cnt2, + HashtableEntry* e_ptr2) { + // These entries are sanity checked by verify_and_compare_entries() + // before this function is called. + oop str1 = e_ptr1->literal(); + oop str2 = e_ptr2->literal(); + + if (str1 == str2) { + tty->print_cr("ERROR: identical oop values (0x" PTR_FORMAT ") " + "in entry @ bucket[%d][%d] and entry @ bucket[%d][%d]", + (void *)str1, bkt1, e_cnt1, bkt2, e_cnt2); + return _verify_fail_continue; + } + + if (java_lang_String::equals(str1, str2)) { + tty->print_cr("ERROR: identical String values in entry @ " + "bucket[%d][%d] and entry @ bucket[%d][%d]", + bkt1, e_cnt1, bkt2, e_cnt2); + return _verify_fail_continue; + } + + return _verify_pass; +} + +StringTable::VerifyRetTypes StringTable::verify_entry(int bkt, int e_cnt, + HashtableEntry* e_ptr, + StringTable::VerifyMesgModes mesg_mode) { + + VerifyRetTypes ret = _verify_pass; // be optimistic + + oop str = e_ptr->literal(); + if (str == NULL) { + if (mesg_mode == _verify_with_mesgs) { + tty->print_cr("ERROR: NULL oop value in entry @ bucket[%d][%d]", bkt, + e_cnt); + } + // NULL oop means no more verifications are possible + return _verify_fail_done; + } + + if (str->klass() != SystemDictionary::String_klass()) { + if (mesg_mode == _verify_with_mesgs) { + tty->print_cr("ERROR: oop is not a String in entry @ bucket[%d][%d]", + bkt, e_cnt); + } + // not a String means no more verifications are possible + return _verify_fail_done; + } + + unsigned int h = java_lang_String::hash_string(str); + if (e_ptr->hash() != h) { + if (mesg_mode == _verify_with_mesgs) { + tty->print_cr("ERROR: broken hash value in entry @ bucket[%d][%d], " + "bkt_hash=%d, str_hash=%d", bkt, e_cnt, e_ptr->hash(), h); + } + ret = _verify_fail_continue; + } + + if (the_table()->hash_to_index(h) != bkt) { + if (mesg_mode == _verify_with_mesgs) { + tty->print_cr("ERROR: wrong index value for entry @ bucket[%d][%d], " + "str_hash=%d, hash_to_index=%d", bkt, e_cnt, h, + the_table()->hash_to_index(h)); + } + ret = _verify_fail_continue; + } + + return ret; +} + +// See StringTable::verify() above for the quick verification that is +// part of Universe::verify(). This verification is exhaustive and +// reports on every issue that is found. StringTable::verify() only +// reports on the first issue that is found. +// +// StringTable::verify_entry() checks: +// - oop value != NULL (same as verify()) +// - oop value is a String +// - hash(String) == hash in entry (same as verify()) +// - index for hash == index of entry (same as verify()) +// +// StringTable::compare_entries() checks: +// - oops are unique across all entries +// - String values are unique across all entries +// +int StringTable::verify_and_compare_entries() { + assert(StringTable_lock->is_locked(), "sanity check"); + + int fail_cnt = 0; + + // first, verify all the entries individually: + for (int bkt = 0; bkt < the_table()->table_size(); bkt++) { + HashtableEntry* e_ptr = the_table()->bucket(bkt); + for (int e_cnt = 0; e_ptr != NULL; e_ptr = e_ptr->next(), e_cnt++) { + VerifyRetTypes ret = verify_entry(bkt, e_cnt, e_ptr, _verify_with_mesgs); + if (ret != _verify_pass) { + fail_cnt++; + } + } + } + + // Optimization: if the above check did not find any failures, then + // the comparison loop below does not need to call verify_entry() + // before calling compare_entries(). If there were failures, then we + // have to call verify_entry() to see if the entry can be passed to + // compare_entries() safely. When we call verify_entry() in the loop + // below, we do so quietly to void duplicate messages and we don't + // increment fail_cnt because the failures have already been counted. + bool need_entry_verify = (fail_cnt != 0); + + // second, verify all entries relative to each other: + for (int bkt1 = 0; bkt1 < the_table()->table_size(); bkt1++) { + HashtableEntry* e_ptr1 = the_table()->bucket(bkt1); + for (int e_cnt1 = 0; e_ptr1 != NULL; e_ptr1 = e_ptr1->next(), e_cnt1++) { + if (need_entry_verify) { + VerifyRetTypes ret = verify_entry(bkt1, e_cnt1, e_ptr1, + _verify_quietly); + if (ret == _verify_fail_done) { + // cannot use the current entry to compare against other entries + continue; + } + } + + for (int bkt2 = bkt1; bkt2 < the_table()->table_size(); bkt2++) { + HashtableEntry* e_ptr2 = the_table()->bucket(bkt2); + int e_cnt2; + for (e_cnt2 = 0; e_ptr2 != NULL; e_ptr2 = e_ptr2->next(), e_cnt2++) { + if (bkt1 == bkt2 && e_cnt2 <= e_cnt1) { + // skip the entries up to and including the one that + // we're comparing against + continue; + } + + if (need_entry_verify) { + VerifyRetTypes ret = verify_entry(bkt2, e_cnt2, e_ptr2, + _verify_quietly); + if (ret == _verify_fail_done) { + // cannot compare against this entry + continue; + } + } + + // compare two entries, report and count any failures: + if (compare_entries(bkt1, e_cnt1, e_ptr1, bkt2, e_cnt2, e_ptr2) + != _verify_pass) { + fail_cnt++; + } + } + } + } + } + return fail_cnt; +} // Create a new table and using alternate hash code, populate the new table // with the existing strings. Set flag to use the alternate hash code afterwards. diff --git a/hotspot/src/share/vm/classfile/symbolTable.hpp b/hotspot/src/share/vm/classfile/symbolTable.hpp index 7a0031c9ab4..50cde69d8b0 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.hpp +++ b/hotspot/src/share/vm/classfile/symbolTable.hpp @@ -107,18 +107,13 @@ private: add(loader_data, cp, names_count, name, lengths, cp_indices, hashValues, THREAD); } - // Table size - enum { - symbol_table_size = 20011 - }; - Symbol* lookup(int index, const char* name, int len, unsigned int hash); SymbolTable() - : Hashtable(symbol_table_size, sizeof (HashtableEntry)) {} + : Hashtable(SymbolTableSize, sizeof (HashtableEntry)) {} SymbolTable(HashtableBucket* t, int number_of_entries) - : Hashtable(symbol_table_size, sizeof (HashtableEntry), t, + : Hashtable(SymbolTableSize, sizeof (HashtableEntry), t, number_of_entries) {} // Arena for permanent symbols (null class loader) that are never unloaded @@ -136,6 +131,9 @@ public: // The symbol table static SymbolTable* the_table() { return _the_table; } + // Size of one bucket in the string table. Used when checking for rollover. + static uint bucket_size() { return sizeof(HashtableBucket); } + static void create_table() { assert(_the_table == NULL, "One symbol table allowed."); _the_table = new SymbolTable(); @@ -145,8 +143,11 @@ public: static void create_table(HashtableBucket* t, int length, int number_of_entries) { assert(_the_table == NULL, "One symbol table allowed."); - assert(length == symbol_table_size * sizeof(HashtableBucket), - "bad shared symbol size."); + + // If CDS archive used a different symbol table size, use that size instead + // which is better than giving an error. + SymbolTableSize = length/bucket_size(); + _the_table = new SymbolTable(t, number_of_entries); // if CDS give symbol table a default arena size since most symbols // are already allocated in the shared misc section. @@ -311,6 +312,26 @@ public: static void verify(); static void dump(outputStream* st); + enum VerifyMesgModes { + _verify_quietly = 0, + _verify_with_mesgs = 1 + }; + + enum VerifyRetTypes { + _verify_pass = 0, + _verify_fail_continue = 1, + _verify_fail_done = 2 + }; + + static VerifyRetTypes compare_entries(int bkt1, int e_cnt1, + HashtableEntry* e_ptr1, + int bkt2, int e_cnt2, + HashtableEntry* e_ptr2); + static VerifyRetTypes verify_entry(int bkt, int e_cnt, + HashtableEntry* e_ptr, + VerifyMesgModes mesg_mode); + static int verify_and_compare_entries(); + // Sharing static void copy_buckets(char** top, char*end) { the_table()->Hashtable::copy_buckets(top, end); diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp index c0d50ca9a47..b4dfe7475b9 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.cpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp @@ -1697,6 +1697,24 @@ int SystemDictionary::calculate_systemdictionary_size(int classcount) { return newsize; } +#ifdef ASSERT +class VerifySDReachableAndLiveClosure : public OopClosure { +private: + BoolObjectClosure* _is_alive; + + template void do_oop_work(T* p) { + oop obj = oopDesc::load_decode_heap_oop(p); + guarantee(_is_alive->do_object_b(obj), "Oop in system dictionary must be live"); + } + +public: + VerifySDReachableAndLiveClosure(BoolObjectClosure* is_alive) : OopClosure(), _is_alive(is_alive) { } + + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } +}; +#endif + // Assumes classes in the SystemDictionary are only unloaded at a safepoint // Note: anonymous classes are not in the SD. bool SystemDictionary::do_unloading(BoolObjectClosure* is_alive) { @@ -1707,7 +1725,15 @@ bool SystemDictionary::do_unloading(BoolObjectClosure* is_alive) { unloading_occurred = dictionary()->do_unloading(); constraints()->purge_loader_constraints(); resolution_errors()->purge_resolution_errors(); -} + } + // Oops referenced by the system dictionary may get unreachable independently + // of the class loader (eg. cached protection domain oops). So we need to + // explicitly unlink them here instead of in Dictionary::do_unloading. + dictionary()->unlink(is_alive); +#ifdef ASSERT + VerifySDReachableAndLiveClosure cl(is_alive); + dictionary()->oops_do(&cl); +#endif return unloading_occurred; } @@ -2334,6 +2360,11 @@ methodHandle SystemDictionary::find_method_handle_invoker(Symbol* name, objArrayHandle appendix_box = oopFactory::new_objArray(SystemDictionary::Object_klass(), 1, CHECK_(empty)); assert(appendix_box->obj_at(0) == NULL, ""); + // This should not happen. JDK code should take care of that. + if (accessing_klass.is_null() || method_type.is_null()) { + THROW_MSG_(vmSymbols::java_lang_InternalError(), "bad invokehandle", empty); + } + // call java.lang.invoke.MethodHandleNatives::linkMethod(... String, MethodType) -> MemberName JavaCallArguments args; args.push_oop(accessing_klass()->java_mirror()); @@ -2459,6 +2490,9 @@ Handle SystemDictionary::link_method_handle_constant(KlassHandle caller, Handle type; if (signature->utf8_length() > 0 && signature->byte_at(0) == '(') { type = find_method_handle_type(signature, caller, CHECK_(empty)); + } else if (caller.is_null()) { + // This should not happen. JDK code should take care of that. + THROW_MSG_(vmSymbols::java_lang_InternalError(), "bad MH constant", empty); } else { ResourceMark rm(THREAD); SignatureStream ss(signature, false); @@ -2522,6 +2556,11 @@ methodHandle SystemDictionary::find_dynamic_call_site_invoker(KlassHandle caller Handle method_name = java_lang_String::create_from_symbol(name, CHECK_(empty)); Handle method_type = find_method_handle_type(type, caller, CHECK_(empty)); + // This should not happen. JDK code should take care of that. + if (caller.is_null() || method_type.is_null()) { + THROW_MSG_(vmSymbols::java_lang_InternalError(), "bad invokedynamic", empty); + } + objArrayHandle appendix_box = oopFactory::new_objArray(SystemDictionary::Object_klass(), 1, CHECK_(empty)); assert(appendix_box->obj_at(0) == NULL, ""); diff --git a/hotspot/src/share/vm/classfile/systemDictionary.hpp b/hotspot/src/share/vm/classfile/systemDictionary.hpp index 85735a732fa..c6436364533 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.hpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp @@ -173,8 +173,6 @@ class SymbolPropertyTable; /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ do_klass(nio_Buffer_klass, java_nio_Buffer, Opt ) \ \ - do_klass(PostVMInitHook_klass, sun_misc_PostVMInitHook, Opt ) \ - \ /* Preload boxing klasses */ \ do_klass(Boolean_klass, java_lang_Boolean, Pre ) \ do_klass(Character_klass, java_lang_Character, Pre ) \ diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index 7134e7cdb26..4dda936d5ac 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -2439,8 +2439,14 @@ void ClassVerifier::verify_invoke_instructions( && !ref_class_type.equals(current_type()) && !ref_class_type.equals(VerificationType::reference_type( current_class()->super()->name()))) { - bool subtype = ref_class_type.is_assignable_from( - current_type(), this, CHECK_VERIFY(this)); + bool subtype = false; + if (!current_class()->is_anonymous()) { + subtype = ref_class_type.is_assignable_from( + current_type(), this, CHECK_VERIFY(this)); + } else { + subtype = ref_class_type.is_assignable_from(VerificationType::reference_type( + current_class()->host_klass()->name()), this, CHECK_VERIFY(this)); + } if (!subtype) { verify_error(ErrorContext::bad_code(bci), "Bad invokespecial instruction: " @@ -2461,7 +2467,24 @@ void ClassVerifier::verify_invoke_instructions( } else { // other methods // Ensures that target class is assignable to method class. if (opcode == Bytecodes::_invokespecial) { - current_frame->pop_stack(current_type(), CHECK_VERIFY(this)); + if (!current_class()->is_anonymous()) { + current_frame->pop_stack(current_type(), CHECK_VERIFY(this)); + } else { + // anonymous class invokespecial calls: check if the + // objectref is a subtype of the host_klass of the current class + // to allow an anonymous class to reference methods in the host_klass + VerificationType top = current_frame->pop_stack(CHECK_VERIFY(this)); + VerificationType hosttype = + VerificationType::reference_type(current_class()->host_klass()->name()); + bool subtype = hosttype.is_assignable_from(top, this, CHECK_VERIFY(this)); + if (!subtype) { + verify_error( ErrorContext::bad_type(current_frame->offset(), + current_frame->stack_top_ctx(), + TypeOrigin::implicit(top)), + "Bad type on operand stack"); + return; + } + } } else if (opcode == Bytecodes::_invokevirtual) { VerificationType stack_object_type = current_frame->pop_stack(ref_class_type, CHECK_VERIFY(this)); diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index f1758f86654..8ff789f81e5 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -270,7 +270,7 @@ template(java_lang_invoke_LambdaForm, "java/lang/invoke/LambdaForm") \ template(java_lang_invoke_ForceInline_signature, "Ljava/lang/invoke/ForceInline;") \ template(java_lang_invoke_DontInline_signature, "Ljava/lang/invoke/DontInline;") \ - template(sun_invoke_Stable_signature, "Lsun/invoke/Stable;") \ + template(java_lang_invoke_Stable_signature, "Ljava/lang/invoke/Stable;") \ template(java_lang_invoke_LambdaForm_Compiled_signature, "Ljava/lang/invoke/LambdaForm$Compiled;") \ template(java_lang_invoke_LambdaForm_Hidden_signature, "Ljava/lang/invoke/LambdaForm$Hidden;") \ template(java_lang_invoke_MagicLambdaImpl, "java/lang/invoke/MagicLambdaImpl") \ @@ -624,6 +624,7 @@ do_class(java_lang_StrictMath, "java/lang/StrictMath") \ do_signature(double2_double_signature, "(DD)D") \ do_signature(int2_int_signature, "(II)I") \ + do_signature(long2_long_signature, "(JJ)J") \ \ /* here are the math names, all together: */ \ do_name(abs_name,"abs") do_name(sin_name,"sin") do_name(cos_name,"cos") \ @@ -631,6 +632,13 @@ do_name(log_name,"log") do_name(log10_name,"log10") do_name(pow_name,"pow") \ do_name(exp_name,"exp") do_name(min_name,"min") do_name(max_name,"max") \ \ + do_name(addExact_name,"addExact") \ + do_name(decrementExact_name,"decrementExact") \ + do_name(incrementExact_name,"incrementExact") \ + do_name(multiplyExact_name,"multiplyExact") \ + do_name(negateExact_name,"negateExact") \ + do_name(subtractExact_name,"subtractExact") \ + \ do_intrinsic(_dabs, java_lang_Math, abs_name, double_double_signature, F_S) \ do_intrinsic(_dsin, java_lang_Math, sin_name, double_double_signature, F_S) \ do_intrinsic(_dcos, java_lang_Math, cos_name, double_double_signature, F_S) \ @@ -643,6 +651,18 @@ do_intrinsic(_dexp, java_lang_Math, exp_name, double_double_signature, F_S) \ do_intrinsic(_min, java_lang_Math, min_name, int2_int_signature, F_S) \ do_intrinsic(_max, java_lang_Math, max_name, int2_int_signature, F_S) \ + do_intrinsic(_addExactI, java_lang_Math, addExact_name, int2_int_signature, F_S) \ + do_intrinsic(_addExactL, java_lang_Math, addExact_name, long2_long_signature, F_S) \ + do_intrinsic(_decrementExactI, java_lang_Math, decrementExact_name, int_int_signature, F_S) \ + do_intrinsic(_decrementExactL, java_lang_Math, decrementExact_name, long2_long_signature, F_S) \ + do_intrinsic(_incrementExactI, java_lang_Math, incrementExact_name, int_int_signature, F_S) \ + do_intrinsic(_incrementExactL, java_lang_Math, incrementExact_name, long2_long_signature, F_S) \ + do_intrinsic(_multiplyExactI, java_lang_Math, multiplyExact_name, int2_int_signature, F_S) \ + do_intrinsic(_multiplyExactL, java_lang_Math, multiplyExact_name, long2_long_signature, F_S) \ + do_intrinsic(_negateExactI, java_lang_Math, negateExact_name, int_int_signature, F_S) \ + do_intrinsic(_negateExactL, java_lang_Math, negateExact_name, long_long_signature, F_S) \ + do_intrinsic(_subtractExactI, java_lang_Math, subtractExact_name, int2_int_signature, F_S) \ + do_intrinsic(_subtractExactL, java_lang_Math, subtractExact_name, long2_long_signature, F_S) \ \ do_intrinsic(_floatToRawIntBits, java_lang_Float, floatToRawIntBits_name, float_int_signature, F_S) \ do_name( floatToRawIntBits_name, "floatToRawIntBits") \ diff --git a/hotspot/src/share/vm/code/codeBlob.cpp b/hotspot/src/share/vm/code/codeBlob.cpp index e377f893ee1..141bbae007b 100644 --- a/hotspot/src/share/vm/code/codeBlob.cpp +++ b/hotspot/src/share/vm/code/codeBlob.cpp @@ -245,8 +245,8 @@ BufferBlob* BufferBlob::create(const char* name, CodeBuffer* cb) { } -void* BufferBlob::operator new(size_t s, unsigned size) throw() { - void* p = CodeCache::allocate(size); +void* BufferBlob::operator new(size_t s, unsigned size, bool is_critical) throw() { + void* p = CodeCache::allocate(size, is_critical); return p; } @@ -277,7 +277,10 @@ AdapterBlob* AdapterBlob::create(CodeBuffer* cb) { unsigned int size = allocation_size(cb, sizeof(AdapterBlob)); { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - blob = new (size) AdapterBlob(size, cb); + // The parameter 'true' indicates a critical memory allocation. + // This means that CodeCacheMinimumFreeSpace is used, if necessary + const bool is_critical = true; + blob = new (size, is_critical) AdapterBlob(size, cb); } // Track memory usage statistic after releasing CodeCache_lock MemoryService::track_code_cache_memory_usage(); @@ -299,7 +302,10 @@ MethodHandlesAdapterBlob* MethodHandlesAdapterBlob::create(int buffer_size) { size += round_to(buffer_size, oopSize); { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - blob = new (size) MethodHandlesAdapterBlob(size); + // The parameter 'true' indicates a critical memory allocation. + // This means that CodeCacheMinimumFreeSpace is used, if necessary + const bool is_critical = true; + blob = new (size, is_critical) MethodHandlesAdapterBlob(size); } // Track memory usage statistic after releasing CodeCache_lock MemoryService::track_code_cache_memory_usage(); diff --git a/hotspot/src/share/vm/code/codeBlob.hpp b/hotspot/src/share/vm/code/codeBlob.hpp index 6587b2d2e51..db270f135ce 100644 --- a/hotspot/src/share/vm/code/codeBlob.hpp +++ b/hotspot/src/share/vm/code/codeBlob.hpp @@ -209,7 +209,7 @@ class BufferBlob: public CodeBlob { BufferBlob(const char* name, int size); BufferBlob(const char* name, int size, CodeBuffer* cb); - void* operator new(size_t s, unsigned size) throw(); + void* operator new(size_t s, unsigned size, bool is_critical = false) throw(); public: // Creation @@ -253,7 +253,6 @@ public: class MethodHandlesAdapterBlob: public BufferBlob { private: MethodHandlesAdapterBlob(int size) : BufferBlob("MethodHandles adapters", size) {} - MethodHandlesAdapterBlob(int size, CodeBuffer* cb) : BufferBlob("MethodHandles adapters", size, cb) {} public: // Creation diff --git a/hotspot/src/share/vm/code/codeCache.cpp b/hotspot/src/share/vm/code/codeCache.cpp index 65c1e5f2eb5..fcdab3d5af4 100644 --- a/hotspot/src/share/vm/code/codeCache.cpp +++ b/hotspot/src/share/vm/code/codeCache.cpp @@ -124,7 +124,6 @@ int CodeCache::_number_of_nmethods = 0; int CodeCache::_number_of_nmethods_with_dependencies = 0; bool CodeCache::_needs_cache_clean = false; nmethod* CodeCache::_scavenge_root_nmethods = NULL; -nmethod* CodeCache::_saved_nmethods = NULL; int CodeCache::_codemem_full_count = 0; @@ -464,96 +463,11 @@ void CodeCache::verify_perm_nmethods(CodeBlobClosure* f_or_null) { } #endif //PRODUCT -/** - * Remove and return nmethod from the saved code list in order to reanimate it. - */ -nmethod* CodeCache::reanimate_saved_code(Method* m) { - MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - nmethod* saved = _saved_nmethods; - nmethod* prev = NULL; - while (saved != NULL) { - if (saved->is_in_use() && saved->method() == m) { - if (prev != NULL) { - prev->set_saved_nmethod_link(saved->saved_nmethod_link()); - } else { - _saved_nmethods = saved->saved_nmethod_link(); - } - assert(saved->is_speculatively_disconnected(), "shouldn't call for other nmethods"); - saved->set_speculatively_disconnected(false); - saved->set_saved_nmethod_link(NULL); - if (PrintMethodFlushing) { - saved->print_on(tty, " ### nmethod is reconnected"); - } - if (LogCompilation && (xtty != NULL)) { - ttyLocker ttyl; - xtty->begin_elem("nmethod_reconnected compile_id='%3d'", saved->compile_id()); - xtty->method(m); - xtty->stamp(); - xtty->end_elem(); - } - return saved; - } - prev = saved; - saved = saved->saved_nmethod_link(); - } - return NULL; -} - -/** - * Remove nmethod from the saved code list in order to discard it permanently - */ -void CodeCache::remove_saved_code(nmethod* nm) { - // For conc swpr this will be called with CodeCache_lock taken by caller - assert_locked_or_safepoint(CodeCache_lock); - assert(nm->is_speculatively_disconnected(), "shouldn't call for other nmethods"); - nmethod* saved = _saved_nmethods; - nmethod* prev = NULL; - while (saved != NULL) { - if (saved == nm) { - if (prev != NULL) { - prev->set_saved_nmethod_link(saved->saved_nmethod_link()); - } else { - _saved_nmethods = saved->saved_nmethod_link(); - } - if (LogCompilation && (xtty != NULL)) { - ttyLocker ttyl; - xtty->begin_elem("nmethod_removed compile_id='%3d'", nm->compile_id()); - xtty->stamp(); - xtty->end_elem(); - } - return; - } - prev = saved; - saved = saved->saved_nmethod_link(); - } - ShouldNotReachHere(); -} - -void CodeCache::speculatively_disconnect(nmethod* nm) { - assert_locked_or_safepoint(CodeCache_lock); - assert(nm->is_in_use() && !nm->is_speculatively_disconnected(), "should only disconnect live nmethods"); - nm->set_saved_nmethod_link(_saved_nmethods); - _saved_nmethods = nm; - if (PrintMethodFlushing) { - nm->print_on(tty, " ### nmethod is speculatively disconnected"); - } - if (LogCompilation && (xtty != NULL)) { - ttyLocker ttyl; - xtty->begin_elem("nmethod_disconnected compile_id='%3d'", nm->compile_id()); - xtty->method(nm->method()); - xtty->stamp(); - xtty->end_elem(); - } - nm->method()->clear_code(); - nm->set_speculatively_disconnected(true); -} - void CodeCache::gc_prologue() { assert(!nmethod::oops_do_marking_is_active(), "oops_do_marking_epilogue must be called"); } - void CodeCache::gc_epilogue() { assert_locked_or_safepoint(CodeCache_lock); FOR_ALL_ALIVE_BLOBS(cb) { diff --git a/hotspot/src/share/vm/code/codeCache.hpp b/hotspot/src/share/vm/code/codeCache.hpp index 3e8eda6e2b2..e190b11ae7e 100644 --- a/hotspot/src/share/vm/code/codeCache.hpp +++ b/hotspot/src/share/vm/code/codeCache.hpp @@ -57,7 +57,6 @@ class CodeCache : AllStatic { static int _number_of_nmethods_with_dependencies; static bool _needs_cache_clean; static nmethod* _scavenge_root_nmethods; // linked via nm->scavenge_root_link() - static nmethod* _saved_nmethods; // Linked list of speculatively disconnected nmethods. static void verify_if_often() PRODUCT_RETURN; @@ -167,17 +166,12 @@ class CodeCache : AllStatic { static size_t capacity() { return _heap->capacity(); } static size_t max_capacity() { return _heap->max_capacity(); } static size_t unallocated_capacity() { return _heap->unallocated_capacity(); } - static bool needs_flushing() { return unallocated_capacity() < CodeCacheFlushingMinimumFreeSpace; } static double reverse_free_ratio(); static bool needs_cache_clean() { return _needs_cache_clean; } static void set_needs_cache_clean(bool v) { _needs_cache_clean = v; } static void clear_inline_caches(); // clear all inline caches - static nmethod* reanimate_saved_code(Method* m); - static void remove_saved_code(nmethod* nm); - static void speculatively_disconnect(nmethod* nm); - // Deoptimization static int mark_for_deoptimization(DepChange& changes); #ifdef HOTSWAP diff --git a/hotspot/src/share/vm/code/compiledIC.cpp b/hotspot/src/share/vm/code/compiledIC.cpp index b9db323e5b2..489e649fadc 100644 --- a/hotspot/src/share/vm/code/compiledIC.cpp +++ b/hotspot/src/share/vm/code/compiledIC.cpp @@ -160,7 +160,7 @@ address CompiledIC::stub_address() const { // High-level access to an inline cache. Guaranteed to be MT-safe. -void CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS) { +bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS) { assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), ""); assert(!is_optimized(), "cannot set an optimized virtual call to megamorphic"); assert(is_call_to_compiled() || is_call_to_interpreted(), "going directly to megamorphic?"); @@ -170,8 +170,10 @@ void CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecod assert(bytecode == Bytecodes::_invokeinterface, ""); int itable_index = call_info->itable_index(); entry = VtableStubs::find_itable_stub(itable_index); + if (entry == false) { + return false; + } #ifdef ASSERT - assert(entry != NULL, "entry not computed"); int index = call_info->resolved_method()->itable_index(); assert(index == itable_index, "CallInfo pre-computes this"); #endif //ASSERT @@ -184,6 +186,9 @@ void CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecod int vtable_index = call_info->vtable_index(); assert(call_info->resolved_klass()->verify_vtable_index(vtable_index), "sanity check"); entry = VtableStubs::find_vtable_stub(vtable_index); + if (entry == NULL) { + return false; + } InlineCacheBuffer::create_transition_stub(this, NULL, entry); } @@ -200,6 +205,7 @@ void CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecod // race because the IC entry was complete when we safepointed so // cleaning it immediately is harmless. // assert(is_megamorphic(), "sanity check"); + return true; } diff --git a/hotspot/src/share/vm/code/compiledIC.hpp b/hotspot/src/share/vm/code/compiledIC.hpp index 96cb0a582bb..598cbe949e2 100644 --- a/hotspot/src/share/vm/code/compiledIC.hpp +++ b/hotspot/src/share/vm/code/compiledIC.hpp @@ -226,7 +226,10 @@ class CompiledIC: public ResourceObj { // void set_to_clean(); // Can only be called during a safepoint operation void set_to_monomorphic(CompiledICInfo& info); - void set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS); + + // Returns true if successful and false otherwise. The call can fail if memory + // allocation in the code cache fails. + bool set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS); static void compute_monomorphic_entry(methodHandle method, KlassHandle receiver_klass, bool is_optimized, bool static_bound, CompiledICInfo& info, TRAPS); diff --git a/hotspot/src/share/vm/code/dependencies.cpp b/hotspot/src/share/vm/code/dependencies.cpp index df269430ed2..4419bdd986c 100644 --- a/hotspot/src/share/vm/code/dependencies.cpp +++ b/hotspot/src/share/vm/code/dependencies.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -812,8 +812,8 @@ class ClassHierarchyWalker { Klass* k = ctxk; Method* lm = k->lookup_method(m->name(), m->signature()); if (lm == NULL && k->oop_is_instance()) { - // It might be an abstract interface method, devoid of mirandas. - lm = ((InstanceKlass*)k)->lookup_method_in_all_interfaces(m->name(), + // It might be an interface method + lm = ((InstanceKlass*)k)->lookup_method_in_ordered_interfaces(m->name(), m->signature()); } if (lm == m) diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 4f8608f08a0..5d74db0d38b 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -462,7 +462,6 @@ void nmethod::init_defaults() { _state = alive; _marked_for_reclamation = 0; _has_flushed_dependencies = 0; - _speculatively_disconnected = 0; _has_unsafe_access = 0; _has_method_handle_invokes = 0; _lazy_critical_native = 0; @@ -481,7 +480,6 @@ void nmethod::init_defaults() { _osr_link = NULL; _scavenge_root_link = NULL; _scavenge_root_state = 0; - _saved_nmethod_link = NULL; _compiler = NULL; #ifdef HAVE_DTRACE_H @@ -686,6 +684,7 @@ nmethod::nmethod( _osr_entry_point = NULL; _exception_cache = NULL; _pc_desc_cache.reset_to(NULL); + _hotness_counter = NMethodSweeper::hotness_counter_reset_val(); code_buffer->copy_values_to(this); if (ScavengeRootsInCode && detect_scavenge_root_oops()) { @@ -770,6 +769,7 @@ nmethod::nmethod( _osr_entry_point = NULL; _exception_cache = NULL; _pc_desc_cache.reset_to(NULL); + _hotness_counter = NMethodSweeper::hotness_counter_reset_val(); code_buffer->copy_values_to(this); debug_only(verify_scavenge_root_oops()); @@ -842,6 +842,7 @@ nmethod::nmethod( _comp_level = comp_level; _compiler = compiler; _orig_pc_offset = orig_pc_offset; + _hotness_counter = NMethodSweeper::hotness_counter_reset_val(); // Section offsets _consts_offset = content_offset() + code_buffer->total_offset_of(code_buffer->consts()); @@ -1176,7 +1177,7 @@ void nmethod::cleanup_inline_caches() { // This is a private interface with the sweeper. void nmethod::mark_as_seen_on_stack() { - assert(is_not_entrant(), "must be a non-entrant method"); + assert(is_alive(), "Must be an alive method"); // Set the traversal mark to ensure that the sweeper does 2 // cleaning passes before moving to zombie. set_stack_traversal_mark(NMethodSweeper::traversal_count()); @@ -1261,7 +1262,7 @@ void nmethod::make_unloaded(BoolObjectClosure* is_alive, oop cause) { set_osr_link(NULL); //set_scavenge_root_link(NULL); // done by prune_scavenge_root_nmethods - NMethodSweeper::notify(this); + NMethodSweeper::notify(); } void nmethod::invalidate_osr_method() { @@ -1351,6 +1352,15 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) { nmethod_needs_unregister = true; } + // Must happen before state change. Otherwise we have a race condition in + // nmethod::can_not_entrant_be_converted(). I.e., a method can immediately + // transition its state from 'not_entrant' to 'zombie' without having to wait + // for stack scanning. + if (state == not_entrant) { + mark_as_seen_on_stack(); + OrderAccess::storestore(); + } + // Change state _state = state; @@ -1369,11 +1379,6 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) { HandleMark hm; method()->clear_code(); } - - if (state == not_entrant) { - mark_as_seen_on_stack(); - } - } // leave critical region under Patching_lock // When the nmethod becomes zombie it is no longer alive so the @@ -1416,7 +1421,7 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) { } // Make sweeper aware that there is a zombie method that needs to be removed - NMethodSweeper::notify(this); + NMethodSweeper::notify(); return true; } @@ -1451,10 +1456,6 @@ void nmethod::flush() { CodeCache::drop_scavenge_root_nmethod(this); } - if (is_speculatively_disconnected()) { - CodeCache::remove_saved_code(this); - } - #ifdef SHARK ((SharkCompiler *) compiler())->free_compiled_method(insts_begin()); #endif // SHARK @@ -1965,7 +1966,7 @@ public: if (!_detected_scavenge_root) _print_nm->print_on(tty, "new scavenge root"); tty->print_cr(""PTR_FORMAT"[offset=%d] detected scavengable oop "PTR_FORMAT" (found at "PTR_FORMAT")", _print_nm, (int)((intptr_t)p - (intptr_t)_print_nm), - (intptr_t)(*p), (intptr_t)p); + (void *)(*p), (intptr_t)p); (*p)->print(); } #endif //PRODUCT @@ -2345,7 +2346,7 @@ public: _ok = false; } tty->print_cr("*** non-oop "PTR_FORMAT" found at "PTR_FORMAT" (offset %d)", - (intptr_t)(*p), (intptr_t)p, (int)((intptr_t)p - (intptr_t)_nm)); + (void *)(*p), (intptr_t)p, (int)((intptr_t)p - (intptr_t)_nm)); } virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); } }; @@ -2466,7 +2467,7 @@ public: _ok = false; } tty->print_cr("*** scavengable oop "PTR_FORMAT" found at "PTR_FORMAT" (offset %d)", - (intptr_t)(*p), (intptr_t)p, (int)((intptr_t)p - (intptr_t)_nm)); + (void *)(*p), (intptr_t)p, (int)((intptr_t)p - (intptr_t)_nm)); (*p)->print(); } virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); } diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index 4929ea820c0..538bcf77837 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -119,7 +119,6 @@ class nmethod : public CodeBlob { // To support simple linked-list chaining of nmethods: nmethod* _osr_link; // from InstanceKlass::osr_nmethods_head nmethod* _scavenge_root_link; // from CodeCache::scavenge_root_nmethods - nmethod* _saved_nmethod_link; // from CodeCache::speculatively_disconnect static nmethod* volatile _oops_do_mark_nmethods; nmethod* volatile _oops_do_mark_link; @@ -165,7 +164,6 @@ class nmethod : public CodeBlob { // protected by CodeCache_lock bool _has_flushed_dependencies; // Used for maintenance of dependencies (CodeCache_lock) - bool _speculatively_disconnected; // Marked for potential unload bool _marked_for_reclamation; // Used by NMethodSweeper (set only by sweeper) bool _marked_for_deoptimization; // Used for stack deoptimization @@ -180,7 +178,7 @@ class nmethod : public CodeBlob { unsigned int _has_wide_vectors:1; // Preserve wide vectors at safepoints // Protected by Patching_lock - unsigned char _state; // {alive, not_entrant, zombie, unloaded} + volatile unsigned char _state; // {alive, not_entrant, zombie, unloaded} #ifdef ASSERT bool _oops_are_stale; // indicates that it's no longer safe to access oops section @@ -202,11 +200,18 @@ class nmethod : public CodeBlob { // not_entrant method removal. Each mark_sweep pass will update // this mark to current sweep invocation count if it is seen on the - // stack. An not_entrant method can be removed when there is no + // stack. An not_entrant method can be removed when there are no // more activations, i.e., when the _stack_traversal_mark is less than // current sweep traversal index. long _stack_traversal_mark; + // The _hotness_counter indicates the hotness of a method. The higher + // the value the hotter the method. The hotness counter of a nmethod is + // set to [(ReservedCodeCacheSize / (1024 * 1024)) * 2] each time the method + // is active while stack scanning (mark_active_nmethods()). The hotness + // counter is decreased (by 1) while sweeping. + int _hotness_counter; + ExceptionCache *_exception_cache; PcDescCache _pc_desc_cache; @@ -382,6 +387,10 @@ class nmethod : public CodeBlob { int total_size () const; + void dec_hotness_counter() { _hotness_counter--; } + void set_hotness_counter(int val) { _hotness_counter = val; } + int hotness_counter() const { return _hotness_counter; } + // Containment bool consts_contains (address addr) const { return consts_begin () <= addr && addr < consts_end (); } bool insts_contains (address addr) const { return insts_begin () <= addr && addr < insts_end (); } @@ -408,8 +417,8 @@ class nmethod : public CodeBlob { // alive. It is used when an uncommon trap happens. Returns true // if this thread changed the state of the nmethod or false if // another thread performed the transition. - bool make_not_entrant() { return make_not_entrant_or_zombie(not_entrant); } - bool make_zombie() { return make_not_entrant_or_zombie(zombie); } + bool make_not_entrant() { return make_not_entrant_or_zombie(not_entrant); } + bool make_zombie() { return make_not_entrant_or_zombie(zombie); } // used by jvmti to track if the unload event has been reported bool unload_reported() { return _unload_reported; } @@ -437,9 +446,6 @@ class nmethod : public CodeBlob { bool has_method_handle_invokes() const { return _has_method_handle_invokes; } void set_has_method_handle_invokes(bool z) { _has_method_handle_invokes = z; } - bool is_speculatively_disconnected() const { return _speculatively_disconnected; } - void set_speculatively_disconnected(bool z) { _speculatively_disconnected = z; } - bool is_lazy_critical_native() const { return _lazy_critical_native; } void set_lazy_critical_native(bool z) { _lazy_critical_native = z; } @@ -499,9 +505,6 @@ public: nmethod* scavenge_root_link() const { return _scavenge_root_link; } void set_scavenge_root_link(nmethod *n) { _scavenge_root_link = n; } - nmethod* saved_nmethod_link() const { return _saved_nmethod_link; } - void set_saved_nmethod_link(nmethod *n) { _saved_nmethod_link = n; } - public: // Sweeper support diff --git a/hotspot/src/share/vm/code/vtableStubs.cpp b/hotspot/src/share/vm/code/vtableStubs.cpp index 7d9d7efaf67..5af91a3a6ee 100644 --- a/hotspot/src/share/vm/code/vtableStubs.cpp +++ b/hotspot/src/share/vm/code/vtableStubs.cpp @@ -46,12 +46,9 @@ address VtableStub::_chunk = NULL; address VtableStub::_chunk_end = NULL; VMReg VtableStub::_receiver_location = VMRegImpl::Bad(); -static int num_vtable_chunks = 0; - void* VtableStub::operator new(size_t size, int code_size) throw() { assert(size == sizeof(VtableStub), "mismatched size"); - num_vtable_chunks++; // compute real VtableStub size (rounded to nearest word) const int real_size = round_to(code_size + sizeof(VtableStub), wordSize); // malloc them in chunks to minimize header overhead @@ -60,7 +57,7 @@ void* VtableStub::operator new(size_t size, int code_size) throw() { const int bytes = chunk_factor * real_size + pd_code_alignment(); BufferBlob* blob = BufferBlob::create("vtable chunks", bytes); if (blob == NULL) { - vm_exit_out_of_memory(bytes, OOM_MALLOC_ERROR, "CodeCache: no room for vtable chunks"); + return NULL; } _chunk = blob->content_begin(); _chunk_end = _chunk + bytes; @@ -121,6 +118,12 @@ address VtableStubs::find_stub(bool is_vtable_stub, int vtable_index) { } else { s = create_itable_stub(vtable_index); } + + // Creation of vtable or itable can fail if there is not enough free space in the code cache. + if (s == NULL) { + return NULL; + } + enter(is_vtable_stub, vtable_index, s); if (PrintAdapterHandlers) { tty->print_cr("Decoding VtableStub %s[%d]@%d", diff --git a/hotspot/src/share/vm/compiler/abstractCompiler.cpp b/hotspot/src/share/vm/compiler/abstractCompiler.cpp index 942c168e512..3f452a1b53b 100644 --- a/hotspot/src/share/vm/compiler/abstractCompiler.cpp +++ b/hotspot/src/share/vm/compiler/abstractCompiler.cpp @@ -24,41 +24,42 @@ #include "precompiled.hpp" #include "compiler/abstractCompiler.hpp" +#include "compiler/compileBroker.hpp" #include "runtime/mutexLocker.hpp" -void AbstractCompiler::initialize_runtimes(initializer f, volatile int* state) { - if (*state != initialized) { - // We are thread in native here... - CompilerThread* thread = CompilerThread::current(); - bool do_initialization = false; - { - ThreadInVMfromNative tv(thread); - ResetNoHandleMark rnhm; - MutexLocker only_one(CompileThread_lock, thread); - if ( *state == uninitialized) { - do_initialization = true; - *state = initializing; - } else { - while (*state == initializing ) { - CompileThread_lock->wait(); - } +bool AbstractCompiler::should_perform_init() { + if (_compiler_state != initialized) { + MutexLocker only_one(CompileThread_lock); + + if (_compiler_state == uninitialized) { + _compiler_state = initializing; + return true; + } else { + while (_compiler_state == initializing) { + CompileThread_lock->wait(); } } - if (do_initialization) { - // We can not hold any locks here since JVMTI events may call agents - - // Compiler(s) run as native - - (*f)(); - - // To in_vm so we can use the lock - - ThreadInVMfromNative tv(thread); - ResetNoHandleMark rnhm; - MutexLocker only_one(CompileThread_lock, thread); - assert(*state == initializing, "wrong state"); - *state = initialized; - CompileThread_lock->notify_all(); - } } + return false; +} + +bool AbstractCompiler::should_perform_shutdown() { + // Since this method can be called by multiple threads, the lock ensures atomicity of + // decrementing '_num_compiler_threads' and the following operations. + MutexLocker only_one(CompileThread_lock); + _num_compiler_threads--; + assert (CompileBroker::is_compilation_disabled_forever(), "Must be set, otherwise thread waits forever"); + + // Only the last thread will perform shutdown operations + if (_num_compiler_threads == 0) { + return true; + } + return false; +} + +void AbstractCompiler::set_state(int state) { + // Ensure that ste is only set by one thread at a time + MutexLocker only_one(CompileThread_lock); + _compiler_state = state; + CompileThread_lock->notify_all(); } diff --git a/hotspot/src/share/vm/compiler/abstractCompiler.hpp b/hotspot/src/share/vm/compiler/abstractCompiler.hpp index 96453e7d9ba..d150e8e8085 100644 --- a/hotspot/src/share/vm/compiler/abstractCompiler.hpp +++ b/hotspot/src/share/vm/compiler/abstractCompiler.hpp @@ -27,22 +27,25 @@ #include "ci/compilerInterface.hpp" -typedef void (*initializer)(void); - class AbstractCompiler : public CHeapObj { private: - bool _is_initialized; // Mark whether compiler object is initialized + volatile int _num_compiler_threads; protected: + volatile int _compiler_state; // Used for tracking global state of compiler runtime initialization - enum { uninitialized, initializing, initialized }; + enum { uninitialized, initializing, initialized, failed, shut_down }; - // This method will call the initialization method "f" once (per compiler class/subclass) - // and do so without holding any locks - void initialize_runtimes(initializer f, volatile int* state); + // This method returns true for the first compiler thread that reaches that methods. + // This thread will initialize the compiler runtime. + bool should_perform_init(); public: - AbstractCompiler() : _is_initialized(false) {} + AbstractCompiler() : _compiler_state(uninitialized), _num_compiler_threads(0) {} + + // This function determines the compiler thread that will perform the + // shutdown of the corresponding compiler runtime. + bool should_perform_shutdown(); // Name of this compiler virtual const char* name() = 0; @@ -74,17 +77,18 @@ class AbstractCompiler : public CHeapObj { #endif // TIERED // Customization - virtual bool needs_stubs () = 0; + virtual void initialize () = 0; - void mark_initialized() { _is_initialized = true; } - bool is_initialized() { return _is_initialized; } - - virtual void initialize() = 0; + void set_num_compiler_threads(int num) { _num_compiler_threads = num; } + int num_compiler_threads() { return _num_compiler_threads; } + // Get/set state of compiler objects + bool is_initialized() { return _compiler_state == initialized; } + bool is_failed () { return _compiler_state == failed;} + void set_state (int state); + void set_shut_down () { set_state(shut_down); } // Compilation entry point for methods - virtual void compile_method(ciEnv* env, - ciMethod* target, - int entry_bci) { + virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci) { ShouldNotReachHere(); } diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index e8f57b24e19..fb47df28267 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -186,7 +186,7 @@ CompileQueue* CompileBroker::_c2_method_queue = NULL; CompileQueue* CompileBroker::_c1_method_queue = NULL; CompileTask* CompileBroker::_task_free_list = NULL; -GrowableArray* CompileBroker::_method_threads = NULL; +GrowableArray* CompileBroker::_compiler_threads = NULL; class CompilationLog : public StringEventLog { @@ -587,9 +587,6 @@ void CompileTask::log_task_done(CompileLog* log) { -// ------------------------------------------------------------------ -// CompileQueue::add -// // Add a CompileTask to a CompileQueue void CompileQueue::add(CompileTask* task) { assert(lock()->owned_by_self(), "must own lock"); @@ -626,6 +623,16 @@ void CompileQueue::add(CompileTask* task) { lock()->notify_all(); } +void CompileQueue::delete_all() { + assert(lock()->owned_by_self(), "must own lock"); + if (_first != NULL) { + for (CompileTask* task = _first; task != NULL; task = task->next()) { + delete task; + } + _first = NULL; + } +} + // ------------------------------------------------------------------ // CompileQueue::get // @@ -634,22 +641,52 @@ CompileTask* CompileQueue::get() { NMethodSweeper::possibly_sweep(); MutexLocker locker(lock()); - // Wait for an available CompileTask. + // If _first is NULL we have no more compile jobs. There are two reasons for + // having no compile jobs: First, we compiled everything we wanted. Second, + // we ran out of code cache so compilation has been disabled. In the latter + // case we perform code cache sweeps to free memory such that we can re-enable + // compilation. while (_first == NULL) { - // There is no work to be done right now. Wait. - if (UseCodeCacheFlushing && (!CompileBroker::should_compile_new_jobs() || CodeCache::needs_flushing())) { - // During the emergency sweeping periods, wake up and sweep occasionally - bool timedout = lock()->wait(!Mutex::_no_safepoint_check_flag, NmethodSweepCheckInterval*1000); - if (timedout) { + // Exit loop if compilation is disabled forever + if (CompileBroker::is_compilation_disabled_forever()) { + return NULL; + } + + if (UseCodeCacheFlushing && !CompileBroker::should_compile_new_jobs()) { + // Wait a certain amount of time to possibly do another sweep. + // We must wait until stack scanning has happened so that we can + // transition a method's state from 'not_entrant' to 'zombie'. + long wait_time = NmethodSweepCheckInterval * 1000; + if (FLAG_IS_DEFAULT(NmethodSweepCheckInterval)) { + // Only one thread at a time can do sweeping. Scale the + // wait time according to the number of compiler threads. + // As a result, the next sweep is likely to happen every 100ms + // with an arbitrary number of threads that do sweeping. + wait_time = 100 * CICompilerCount; + } + bool timeout = lock()->wait(!Mutex::_no_safepoint_check_flag, wait_time); + if (timeout) { MutexUnlocker ul(lock()); - // When otherwise not busy, run nmethod sweeping NMethodSweeper::possibly_sweep(); } } else { - // During normal operation no need to wake up on timer - lock()->wait(); + // If there are no compilation tasks and we can compile new jobs + // (i.e., there is enough free space in the code cache) there is + // no need to invoke the sweeper. As a result, the hotness of methods + // remains unchanged. This behavior is desired, since we want to keep + // the stable state, i.e., we do not want to evict methods from the + // code cache if it is unnecessary. + // We need a timed wait here, since compiler threads can exit if compilation + // is disabled forever. We use 5 seconds wait time; the exiting of compiler threads + // is not critical and we do not want idle compiler threads to wake up too often. + lock()->wait(!Mutex::_no_safepoint_check_flag, 5*1000); } } + + if (CompileBroker::is_compilation_disabled_forever()) { + return NULL; + } + CompileTask* task = CompilationPolicy::policy()->select_task(this); remove(task); return task; @@ -743,6 +780,10 @@ CompilerCounters::CompilerCounters(const char* thread_name, int instance, TRAPS) void CompileBroker::compilation_init() { _last_method_compiled[0] = '\0'; + // No need to initialize compilation system if we do not use it. + if (!UseCompiler) { + return; + } #ifndef SHARK // Set the interface to the current compiler(s). int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple); @@ -874,10 +915,8 @@ void CompileBroker::compilation_init() { } - -// ------------------------------------------------------------------ -// CompileBroker::make_compiler_thread -CompilerThread* CompileBroker::make_compiler_thread(const char* name, CompileQueue* queue, CompilerCounters* counters, TRAPS) { +CompilerThread* CompileBroker::make_compiler_thread(const char* name, CompileQueue* queue, CompilerCounters* counters, + AbstractCompiler* comp, TRAPS) { CompilerThread* compiler_thread = NULL; Klass* k = @@ -944,6 +983,7 @@ CompilerThread* CompileBroker::make_compiler_thread(const char* name, CompileQue java_lang_Thread::set_daemon(thread_oop()); compiler_thread->set_threadObj(thread_oop()); + compiler_thread->set_compiler(comp); Threads::add(compiler_thread); Thread::start(compiler_thread); } @@ -955,25 +995,24 @@ CompilerThread* CompileBroker::make_compiler_thread(const char* name, CompileQue } -// ------------------------------------------------------------------ -// CompileBroker::init_compiler_threads -// -// Initialize the compilation queue void CompileBroker::init_compiler_threads(int c1_compiler_count, int c2_compiler_count) { EXCEPTION_MARK; #if !defined(ZERO) && !defined(SHARK) assert(c2_compiler_count > 0 || c1_compiler_count > 0, "No compilers?"); #endif // !ZERO && !SHARK + // Initialize the compilation queue if (c2_compiler_count > 0) { _c2_method_queue = new CompileQueue("C2MethodQueue", MethodCompileQueue_lock); + _compilers[1]->set_num_compiler_threads(c2_compiler_count); } if (c1_compiler_count > 0) { _c1_method_queue = new CompileQueue("C1MethodQueue", MethodCompileQueue_lock); + _compilers[0]->set_num_compiler_threads(c1_compiler_count); } int compiler_count = c1_compiler_count + c2_compiler_count; - _method_threads = + _compiler_threads = new (ResourceObj::C_HEAP, mtCompiler) GrowableArray(compiler_count, true); char name_buffer[256]; @@ -981,21 +1020,22 @@ void CompileBroker::init_compiler_threads(int c1_compiler_count, int c2_compiler // Create a name for our thread. sprintf(name_buffer, "C2 CompilerThread%d", i); CompilerCounters* counters = new CompilerCounters("compilerThread", i, CHECK); - CompilerThread* new_thread = make_compiler_thread(name_buffer, _c2_method_queue, counters, CHECK); - _method_threads->append(new_thread); + // Shark and C2 + CompilerThread* new_thread = make_compiler_thread(name_buffer, _c2_method_queue, counters, _compilers[1], CHECK); + _compiler_threads->append(new_thread); } for (int i = c2_compiler_count; i < compiler_count; i++) { // Create a name for our thread. sprintf(name_buffer, "C1 CompilerThread%d", i); CompilerCounters* counters = new CompilerCounters("compilerThread", i, CHECK); - CompilerThread* new_thread = make_compiler_thread(name_buffer, _c1_method_queue, counters, CHECK); - _method_threads->append(new_thread); + // C1 + CompilerThread* new_thread = make_compiler_thread(name_buffer, _c1_method_queue, counters, _compilers[0], CHECK); + _compiler_threads->append(new_thread); } if (UsePerfData) { - PerfDataManager::create_constant(SUN_CI, "threads", PerfData::U_Bytes, - compiler_count, CHECK); + PerfDataManager::create_constant(SUN_CI, "threads", PerfData::U_Bytes, compiler_count, CHECK); } } @@ -1011,27 +1051,6 @@ void CompileBroker::mark_on_stack() { } } -// ------------------------------------------------------------------ -// CompileBroker::is_idle -bool CompileBroker::is_idle() { - if (_c2_method_queue != NULL && !_c2_method_queue->is_empty()) { - return false; - } else if (_c1_method_queue != NULL && !_c1_method_queue->is_empty()) { - return false; - } else { - int num_threads = _method_threads->length(); - for (int i=0; iat(i)->task() != NULL) { - return false; - } - } - - // No pending or active compilations. - return true; - } -} - - // ------------------------------------------------------------------ // CompileBroker::compile_method // @@ -1227,16 +1246,9 @@ nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci, return method_code; } } - if (method->is_not_compilable(comp_level)) return NULL; - - if (UseCodeCacheFlushing) { - nmethod* saved = CodeCache::reanimate_saved_code(method()); - if (saved != NULL) { - method->set_code(method, saved); - return saved; - } + if (method->is_not_compilable(comp_level)) { + return NULL; } - } else { // osr compilation #ifndef TIERED @@ -1289,13 +1301,6 @@ nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci, method->jmethod_id(); } - // If the compiler is shut off due to code cache getting full - // fail out now so blocking compiles dont hang the java thread - if (!should_compile_new_jobs()) { - CompilationPolicy::policy()->delay_compilation(method()); - return NULL; - } - // do the compilation if (method->is_native()) { if (!PreferInterpreterNativeStubs || method->is_method_handle_intrinsic()) { @@ -1305,11 +1310,22 @@ nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci, MutexLocker locker(MethodCompileQueue_lock, THREAD); compile_id = assign_compile_id(method, standard_entry_bci); } + // To properly handle the appendix argument for out-of-line calls we are using a small trampoline that + // pops off the appendix argument and jumps to the target (see gen_special_dispatch in SharedRuntime). + // + // Since normal compiled-to-compiled calls are not able to handle such a thing we MUST generate an adapter + // in this case. If we can't generate one and use it we can not execute the out-of-line method handle calls. (void) AdapterHandlerLibrary::create_native_wrapper(method, compile_id); } else { return NULL; } } else { + // If the compiler is shut off due to code cache getting full + // fail out now so blocking compiles dont hang the java thread + if (!should_compile_new_jobs()) { + CompilationPolicy::policy()->delay_compilation(method()); + return NULL; + } compile_method_base(method, osr_bci, comp_level, hot_method, hot_count, comment, THREAD); } @@ -1541,6 +1557,101 @@ void CompileBroker::wait_for_completion(CompileTask* task) { free_task(task); } +// Initialize compiler thread(s) + compiler object(s). The postcondition +// of this function is that the compiler runtimes are initialized and that +//compiler threads can start compiling. +bool CompileBroker::init_compiler_runtime() { + CompilerThread* thread = CompilerThread::current(); + AbstractCompiler* comp = thread->compiler(); + // Final sanity check - the compiler object must exist + guarantee(comp != NULL, "Compiler object must exist"); + + int system_dictionary_modification_counter; + { + MutexLocker locker(Compile_lock, thread); + system_dictionary_modification_counter = SystemDictionary::number_of_modifications(); + } + + { + // Must switch to native to allocate ci_env + ThreadToNativeFromVM ttn(thread); + ciEnv ci_env(NULL, system_dictionary_modification_counter); + // Cache Jvmti state + ci_env.cache_jvmti_state(); + // Cache DTrace flags + ci_env.cache_dtrace_flags(); + + // Switch back to VM state to do compiler initialization + ThreadInVMfromNative tv(thread); + ResetNoHandleMark rnhm; + + + if (!comp->is_shark()) { + // Perform per-thread and global initializations + comp->initialize(); + } + } + + if (comp->is_failed()) { + disable_compilation_forever(); + // If compiler initialization failed, no compiler thread that is specific to a + // particular compiler runtime will ever start to compile methods. + + shutdown_compiler_runtime(comp, thread); + return false; + } + + // C1 specific check + if (comp->is_c1() && (thread->get_buffer_blob() == NULL)) { + warning("Initialization of %s thread failed (no space to run compilers)", thread->name()); + return false; + } + + return true; +} + +// If C1 and/or C2 initialization failed, we shut down all compilation. +// We do this to keep things simple. This can be changed if it ever turns out to be +// a problem. +void CompileBroker::shutdown_compiler_runtime(AbstractCompiler* comp, CompilerThread* thread) { + // Free buffer blob, if allocated + if (thread->get_buffer_blob() != NULL) { + MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); + CodeCache::free(thread->get_buffer_blob()); + } + + if (comp->should_perform_shutdown()) { + // There are two reasons for shutting down the compiler + // 1) compiler runtime initialization failed + // 2) The code cache is full and the following flag is set: -XX:-UseCodeCacheFlushing + warning("Shutting down compiler %s (no space to run compilers)", comp->name()); + + // Only one thread per compiler runtime object enters here + // Set state to shut down + comp->set_shut_down(); + + MutexLocker mu(MethodCompileQueue_lock, thread); + CompileQueue* queue; + if (_c1_method_queue != NULL) { + _c1_method_queue->delete_all(); + queue = _c1_method_queue; + _c1_method_queue = NULL; + delete _c1_method_queue; + } + + if (_c2_method_queue != NULL) { + _c2_method_queue->delete_all(); + queue = _c2_method_queue; + _c2_method_queue = NULL; + delete _c2_method_queue; + } + + // We could delete compiler runtimes also. However, there are references to + // the compiler runtime(s) (e.g., nmethod::is_compiled_by_c1()) which then + // fail. This can be done later if necessary. + } +} + // ------------------------------------------------------------------ // CompileBroker::compiler_thread_loop // @@ -1548,7 +1659,6 @@ void CompileBroker::wait_for_completion(CompileTask* task) { void CompileBroker::compiler_thread_loop() { CompilerThread* thread = CompilerThread::current(); CompileQueue* queue = thread->queue(); - // For the thread that initializes the ciObjectFactory // this resource mark holds all the shared objects ResourceMark rm; @@ -1577,67 +1687,77 @@ void CompileBroker::compiler_thread_loop() { log->end_elem(); } - while (true) { - { - // We need this HandleMark to avoid leaking VM handles. - HandleMark hm(thread); + // If compiler thread/runtime initialization fails, exit the compiler thread + if (!init_compiler_runtime()) { + return; + } - if (CodeCache::unallocated_capacity() < CodeCacheMinimumFreeSpace) { - // the code cache is really full - handle_full_code_cache(); - } else if (UseCodeCacheFlushing && CodeCache::needs_flushing()) { - // Attempt to start cleaning the code cache while there is still a little headroom - NMethodSweeper::handle_full_code_cache(false); - } + // Poll for new compilation tasks as long as the JVM runs. Compilation + // should only be disabled if something went wrong while initializing the + // compiler runtimes. This, in turn, should not happen. The only known case + // when compiler runtime initialization fails is if there is not enough free + // space in the code cache to generate the necessary stubs, etc. + while (!is_compilation_disabled_forever()) { + // We need this HandleMark to avoid leaking VM handles. + HandleMark hm(thread); - CompileTask* task = queue->get(); + if (CodeCache::unallocated_capacity() < CodeCacheMinimumFreeSpace) { + // the code cache is really full + handle_full_code_cache(); + } - // Give compiler threads an extra quanta. They tend to be bursty and - // this helps the compiler to finish up the job. - if( CompilerThreadHintNoPreempt ) - os::hint_no_preempt(); + CompileTask* task = queue->get(); + if (task == NULL) { + continue; + } - // trace per thread time and compile statistics - CompilerCounters* counters = ((CompilerThread*)thread)->counters(); - PerfTraceTimedEvent(counters->time_counter(), counters->compile_counter()); + // Give compiler threads an extra quanta. They tend to be bursty and + // this helps the compiler to finish up the job. + if( CompilerThreadHintNoPreempt ) + os::hint_no_preempt(); - // Assign the task to the current thread. Mark this compilation - // thread as active for the profiler. - CompileTaskWrapper ctw(task); - nmethodLocker result_handle; // (handle for the nmethod produced by this task) - task->set_code_handle(&result_handle); - methodHandle method(thread, task->method()); + // trace per thread time and compile statistics + CompilerCounters* counters = ((CompilerThread*)thread)->counters(); + PerfTraceTimedEvent(counters->time_counter(), counters->compile_counter()); - // Never compile a method if breakpoints are present in it - if (method()->number_of_breakpoints() == 0) { - // Compile the method. - if ((UseCompiler || AlwaysCompileLoopMethods) && CompileBroker::should_compile_new_jobs()) { + // Assign the task to the current thread. Mark this compilation + // thread as active for the profiler. + CompileTaskWrapper ctw(task); + nmethodLocker result_handle; // (handle for the nmethod produced by this task) + task->set_code_handle(&result_handle); + methodHandle method(thread, task->method()); + + // Never compile a method if breakpoints are present in it + if (method()->number_of_breakpoints() == 0) { + // Compile the method. + if ((UseCompiler || AlwaysCompileLoopMethods) && CompileBroker::should_compile_new_jobs()) { #ifdef COMPILER1 - // Allow repeating compilations for the purpose of benchmarking - // compile speed. This is not useful for customers. - if (CompilationRepeat != 0) { - int compile_count = CompilationRepeat; - while (compile_count > 0) { - invoke_compiler_on_method(task); - nmethod* nm = method->code(); - if (nm != NULL) { - nm->make_zombie(); - method->clear_code(); - } - compile_count--; + // Allow repeating compilations for the purpose of benchmarking + // compile speed. This is not useful for customers. + if (CompilationRepeat != 0) { + int compile_count = CompilationRepeat; + while (compile_count > 0) { + invoke_compiler_on_method(task); + nmethod* nm = method->code(); + if (nm != NULL) { + nm->make_zombie(); + method->clear_code(); } + compile_count--; } -#endif /* COMPILER1 */ - invoke_compiler_on_method(task); - } else { - // After compilation is disabled, remove remaining methods from queue - method->clear_queued_for_compilation(); } +#endif /* COMPILER1 */ + invoke_compiler_on_method(task); + } else { + // After compilation is disabled, remove remaining methods from queue + method->clear_queued_for_compilation(); } } } -} + // Shut down compiler runtime + shutdown_compiler_runtime(thread->compiler(), thread); +} // ------------------------------------------------------------------ // CompileBroker::init_compiler_thread_log @@ -1943,10 +2063,17 @@ void CompileBroker::handle_full_code_cache() { } #endif if (UseCodeCacheFlushing) { - NMethodSweeper::handle_full_code_cache(true); + // Since code cache is full, immediately stop new compiles + if (CompileBroker::set_should_compile_new_jobs(CompileBroker::stop_compilation)) { + NMethodSweeper::log_sweep("disable_compiler"); + + // Switch to 'vm_state'. This ensures that possibly_sweep() can be called + // without having to consider the state in which the current thread is. + ThreadInVMfromUnknown in_vm; + NMethodSweeper::possibly_sweep(); + } } else { - UseCompiler = false; - AlwaysCompileLoopMethods = false; + disable_compilation_forever(); } } codecache_print(/* detailed= */ true); diff --git a/hotspot/src/share/vm/compiler/compileBroker.hpp b/hotspot/src/share/vm/compiler/compileBroker.hpp index f336497a31d..19beeec9fb4 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.hpp +++ b/hotspot/src/share/vm/compiler/compileBroker.hpp @@ -213,8 +213,12 @@ class CompileQueue : public CHeapObj { // Redefine Classes support void mark_on_stack(); - + void delete_all(); void print(); + + ~CompileQueue() { + assert (is_empty(), " Compile Queue must be empty"); + } }; // CompileTaskWrapper @@ -266,7 +270,7 @@ class CompileBroker: AllStatic { static CompileQueue* _c1_method_queue; static CompileTask* _task_free_list; - static GrowableArray* _method_threads; + static GrowableArray* _compiler_threads; // performance counters static PerfCounter* _perf_total_compilation; @@ -311,7 +315,7 @@ class CompileBroker: AllStatic { static int _sum_nmethod_code_size; static long _peak_compilation_time; - static CompilerThread* make_compiler_thread(const char* name, CompileQueue* queue, CompilerCounters* counters, TRAPS); + static CompilerThread* make_compiler_thread(const char* name, CompileQueue* queue, CompilerCounters* counters, AbstractCompiler* comp, TRAPS); static void init_compiler_threads(int c1_compiler_count, int c2_compiler_count); static bool compilation_is_complete (methodHandle method, int osr_bci, int comp_level); static bool compilation_is_prohibited(methodHandle method, int osr_bci, int comp_level); @@ -351,6 +355,9 @@ class CompileBroker: AllStatic { if (is_c1_compile(comp_level)) return _c1_method_queue; return NULL; } + static bool init_compiler_runtime(); + static void shutdown_compiler_runtime(AbstractCompiler* comp, CompilerThread* thread); + public: enum { // The entry bci used for non-OSR compilations. @@ -378,9 +385,7 @@ class CompileBroker: AllStatic { const char* comment, Thread* thread); static void compiler_thread_loop(); - static uint get_compilation_id() { return _compilation_id; } - static bool is_idle(); // Set _should_block. // Call this from the VM, with Threads_lock held and a safepoint requested. @@ -391,8 +396,9 @@ class CompileBroker: AllStatic { enum { // Flags for toggling compiler activity - stop_compilation = 0, - run_compilation = 1 + stop_compilation = 0, + run_compilation = 1, + shutdown_compilaton = 2 }; static bool should_compile_new_jobs() { return UseCompiler && (_should_compile_new_jobs == run_compilation); } @@ -401,6 +407,16 @@ class CompileBroker: AllStatic { jint old = Atomic::cmpxchg(new_state, &_should_compile_new_jobs, 1-new_state); return (old == (1-new_state)); } + + static void disable_compilation_forever() { + UseCompiler = false; + AlwaysCompileLoopMethods = false; + Atomic::xchg(shutdown_compilaton, &_should_compile_new_jobs); + } + + static bool is_compilation_disabled_forever() { + return _should_compile_new_jobs == shutdown_compilaton; + } static void handle_full_code_cache(); // Return total compilation ticks diff --git a/hotspot/src/share/vm/compiler/oopMap.cpp b/hotspot/src/share/vm/compiler/oopMap.cpp index 8e6834c710d..6179099601e 100644 --- a/hotspot/src/share/vm/compiler/oopMap.cpp +++ b/hotspot/src/share/vm/compiler/oopMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -628,7 +628,7 @@ void DerivedPointerTable::clear() { // Returns value of location as an int -intptr_t value_of_loc(oop *pointer) { return (intptr_t)(*pointer); } +intptr_t value_of_loc(oop *pointer) { return cast_from_oop((*pointer)); } void DerivedPointerTable::add(oop *derived_loc, oop *base_loc) { diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp index 2fc6edd34df..bf4ac21e346 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @@ -9065,7 +9065,7 @@ bool CMSCollector::take_from_overflow_list(size_t num, CMSMarkStack* stack) { return !stack->isEmpty(); } -#define BUSY (oop(0x1aff1aff)) +#define BUSY (cast_to_oop(0x1aff1aff)) // (MT-safe) Get a prefix of at most "num" from the list. // The overflow list is chained through the mark word of // each object in the list. We fetch the entire list, @@ -9098,7 +9098,7 @@ bool CMSCollector::par_take_from_overflow_list(size_t num, return false; } // Grab the entire list; we'll put back a suffix - oop prefix = (oop)Atomic::xchg_ptr(BUSY, &_overflow_list); + oop prefix = cast_to_oop(Atomic::xchg_ptr(BUSY, &_overflow_list)); Thread* tid = Thread::current(); // Before "no_of_gc_threads" was introduced CMSOverflowSpinCount was // set to ParallelGCThreads. @@ -9113,7 +9113,7 @@ bool CMSCollector::par_take_from_overflow_list(size_t num, return false; } else if (_overflow_list != BUSY) { // Try and grab the prefix - prefix = (oop)Atomic::xchg_ptr(BUSY, &_overflow_list); + prefix = cast_to_oop(Atomic::xchg_ptr(BUSY, &_overflow_list)); } } // If the list was found to be empty, or we spun long diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp index 77f08f0d3a3..282dd722228 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -2694,7 +2694,7 @@ public: if (print_it) { _out->print_cr(" "PTR_FORMAT"%s", - o, (over_tams) ? " >" : (marked) ? " M" : ""); + (void *)o, (over_tams) ? " >" : (marked) ? " M" : ""); PrintReachableOopClosure oopCl(_out, _vo, _all); o->oop_iterate_no_header(&oopCl); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp index d962842b39a..ea45f2d6466 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp @@ -81,7 +81,7 @@ inline void ConcurrentMark::count_region(MemRegion mr, HeapRegion* hr, size_t* marked_bytes_array, BitMap* task_card_bm) { G1CollectedHeap* g1h = _g1h; - CardTableModRefBS* ct_bs = (CardTableModRefBS*) (g1h->barrier_set()); + CardTableModRefBS* ct_bs = g1h->g1_barrier_set(); HeapWord* start = mr.start(); HeapWord* end = mr.end(); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp index 1f2c6cbdc2f..7823f77e643 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.hpp @@ -55,7 +55,7 @@ private: // then _alloc_region is NULL and this object should not be used to // satisfy allocation requests (it was done this way to force the // correct use of init() and release()). - HeapRegion* _alloc_region; + HeapRegion* volatile _alloc_region; // It keeps track of the distinct number of regions that are used // for allocation in the active interval of this object, i.e., @@ -132,8 +132,9 @@ public: static void setup(G1CollectedHeap* g1h, HeapRegion* dummy_region); HeapRegion* get() const { + HeapRegion * hr = _alloc_region; // Make sure that the dummy region does not escape this class. - return (_alloc_region == _dummy_region) ? NULL : _alloc_region; + return (hr == _dummy_region) ? NULL : hr; } uint count() { return _count; } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.cpp new file mode 100644 index 00000000000..7f5023b422b --- /dev/null +++ b/hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.cpp @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "gc_implementation/g1/g1BiasedArray.hpp" + +#ifndef PRODUCT +void G1BiasedMappedArrayBase::verify_index(idx_t index) const { + guarantee(_base != NULL, "Array not initialized"); + guarantee(index < length(), err_msg("Index out of bounds index: "SIZE_FORMAT" length: "SIZE_FORMAT, index, length())); +} + +void G1BiasedMappedArrayBase::verify_biased_index(idx_t biased_index) const { + guarantee(_biased_base != NULL, "Array not initialized"); + guarantee(biased_index >= bias() && biased_index < (bias() + length()), + err_msg("Biased index out of bounds, index: "SIZE_FORMAT" bias: "SIZE_FORMAT" length: "SIZE_FORMAT, biased_index, bias(), length())); +} + +void G1BiasedMappedArrayBase::verify_biased_index_inclusive_end(idx_t biased_index) const { + guarantee(_biased_base != NULL, "Array not initialized"); + guarantee(biased_index >= bias() && biased_index <= (bias() + length()), + err_msg("Biased index out of inclusive bounds, index: "SIZE_FORMAT" bias: "SIZE_FORMAT" length: "SIZE_FORMAT, biased_index, bias(), length())); +} + +class TestMappedArray : public G1BiasedMappedArray { +protected: + virtual int default_value() const { return 0xBAADBABE; } +public: + static void test_biasedarray() { + const size_t REGION_SIZE_IN_WORDS = 512; + const size_t NUM_REGIONS = 20; + HeapWord* fake_heap = (HeapWord*)LP64_ONLY(0xBAAA00000) NOT_LP64(0xBA000000); // Any value that is non-zero + + TestMappedArray array; + array.initialize(fake_heap, fake_heap + REGION_SIZE_IN_WORDS * NUM_REGIONS, + REGION_SIZE_IN_WORDS * HeapWordSize); + // Check address calculation (bounds) + assert(array.bottom_address_mapped() == fake_heap, + err_msg("bottom mapped address should be "PTR_FORMAT", but is "PTR_FORMAT, fake_heap, array.bottom_address_mapped())); + assert(array.end_address_mapped() == (fake_heap + REGION_SIZE_IN_WORDS * NUM_REGIONS), "must be"); + + int* bottom = array.address_mapped_to(fake_heap); + assert((void*)bottom == (void*) array.base(), "must be"); + int* end = array.address_mapped_to(fake_heap + REGION_SIZE_IN_WORDS * NUM_REGIONS); + assert((void*)end == (void*)(array.base() + array.length()), "must be"); + // The entire array should contain default value elements + for (int* current = bottom; current < end; current++) { + assert(*current == array.default_value(), "must be"); + } + + // Test setting values in the table + + HeapWord* region_start_address = fake_heap + REGION_SIZE_IN_WORDS * (NUM_REGIONS / 2); + HeapWord* region_end_address = fake_heap + (REGION_SIZE_IN_WORDS * (NUM_REGIONS / 2) + REGION_SIZE_IN_WORDS - 1); + + // Set/get by address tests: invert some value; first retrieve one + int actual_value = array.get_by_index(NUM_REGIONS / 2); + array.set_by_index(NUM_REGIONS / 2, ~actual_value); + // Get the same value by address, should correspond to the start of the "region" + int value = array.get_by_address(region_start_address); + assert(value == ~actual_value, "must be"); + // Get the same value by address, at one HeapWord before the start + value = array.get_by_address(region_start_address - 1); + assert(value == array.default_value(), "must be"); + // Get the same value by address, at the end of the "region" + value = array.get_by_address(region_end_address); + assert(value == ~actual_value, "must be"); + // Make sure the next value maps to another index + value = array.get_by_address(region_end_address + 1); + assert(value == array.default_value(), "must be"); + + // Reset the value in the array + array.set_by_address(region_start_address + (region_end_address - region_start_address) / 2, actual_value); + + // The entire array should have the default value again + for (int* current = bottom; current < end; current++) { + assert(*current == array.default_value(), "must be"); + } + + // Set/get by index tests: invert some value + idx_t index = NUM_REGIONS / 2; + actual_value = array.get_by_index(index); + array.set_by_index(index, ~actual_value); + + value = array.get_by_index(index); + assert(value == ~actual_value, "must be"); + + value = array.get_by_index(index - 1); + assert(value == array.default_value(), "must be"); + + value = array.get_by_index(index + 1); + assert(value == array.default_value(), "must be"); + + array.set_by_index(0, 0); + value = array.get_by_index(0); + assert(value == 0, "must be"); + + array.set_by_index(array.length() - 1, 0); + value = array.get_by_index(array.length() - 1); + assert(value == 0, "must be"); + + array.set_by_index(index, 0); + + // The array should have three zeros, and default values otherwise + size_t num_zeros = 0; + for (int* current = bottom; current < end; current++) { + assert(*current == array.default_value() || *current == 0, "must be"); + if (*current == 0) { + num_zeros++; + } + } + assert(num_zeros == 3, "must be"); + } +}; + +void TestG1BiasedArray_test() { + TestMappedArray::test_biasedarray(); +} + +#endif diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp new file mode 100644 index 00000000000..f80c70b4e36 --- /dev/null +++ b/hotspot/src/share/vm/gc_implementation/g1/g1BiasedArray.hpp @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1BIASEDARRAY_HPP +#define SHARE_VM_GC_IMPLEMENTATION_G1_G1BIASEDARRAY_HPP + +#include "utilities/debug.hpp" +#include "memory/allocation.inline.hpp" + +// Implements the common base functionality for arrays that contain provisions +// for accessing its elements using a biased index. +// The element type is defined by the instantiating the template. +class G1BiasedMappedArrayBase VALUE_OBJ_CLASS_SPEC { + friend class VMStructs; +public: + typedef size_t idx_t; +protected: + address _base; // the real base address + size_t _length; // the length of the array + address _biased_base; // base address biased by "bias" elements + size_t _bias; // the bias, i.e. the offset biased_base is located to the right in elements + uint _shift_by; // the amount of bits to shift right when mapping to an index of the array. + +protected: + + G1BiasedMappedArrayBase() : _base(NULL), _length(0), _biased_base(NULL), + _bias(0), _shift_by(0) { } + + // Allocate a new array, generic version. + static address create_new_base_array(size_t length, size_t elem_size) { + assert(length > 0, "just checking"); + assert(elem_size > 0, "just checking"); + return NEW_C_HEAP_ARRAY(u_char, length * elem_size, mtGC); + } + + // Initialize the members of this class. The biased start address of this array + // is the bias (in elements) multiplied by the element size. + void initialize_base(address base, size_t length, size_t bias, size_t elem_size, uint shift_by) { + assert(base != NULL, "just checking"); + assert(length > 0, "just checking"); + assert(shift_by < sizeof(uintptr_t) * 8, err_msg("Shifting by %zd, larger than word size?", shift_by)); + _base = base; + _length = length; + _biased_base = base - (bias * elem_size); + _bias = bias; + _shift_by = shift_by; + } + + // Allocate and initialize this array to cover the heap addresses in the range + // of [bottom, end). + void initialize(HeapWord* bottom, HeapWord* end, size_t target_elem_size_in_bytes, size_t mapping_granularity_in_bytes) { + assert(mapping_granularity_in_bytes > 0, "just checking"); + assert(is_power_of_2(mapping_granularity_in_bytes), + err_msg("mapping granularity must be power of 2, is %zd", mapping_granularity_in_bytes)); + assert((uintptr_t)bottom % mapping_granularity_in_bytes == 0, + err_msg("bottom mapping area address must be a multiple of mapping granularity %zd, is "PTR_FORMAT, + mapping_granularity_in_bytes, bottom)); + assert((uintptr_t)end % mapping_granularity_in_bytes == 0, + err_msg("end mapping area address must be a multiple of mapping granularity %zd, is "PTR_FORMAT, + mapping_granularity_in_bytes, end)); + size_t num_target_elems = (end - bottom) / (mapping_granularity_in_bytes / HeapWordSize); + idx_t bias = (uintptr_t)bottom / mapping_granularity_in_bytes; + address base = create_new_base_array(num_target_elems, target_elem_size_in_bytes); + initialize_base(base, num_target_elems, bias, target_elem_size_in_bytes, log2_intptr(mapping_granularity_in_bytes)); + } + + size_t bias() const { return _bias; } + uint shift_by() const { return _shift_by; } + + void verify_index(idx_t index) const PRODUCT_RETURN; + void verify_biased_index(idx_t biased_index) const PRODUCT_RETURN; + void verify_biased_index_inclusive_end(idx_t biased_index) const PRODUCT_RETURN; + +public: + // Return the length of the array in elements. + size_t length() const { return _length; } +}; + +// Array that provides biased access and mapping from (valid) addresses in the +// heap into this array. +template +class G1BiasedMappedArray : public G1BiasedMappedArrayBase { +public: + typedef G1BiasedMappedArrayBase::idx_t idx_t; + + T* base() const { return (T*)G1BiasedMappedArrayBase::_base; } + // Return the element of the given array at the given index. Assume + // the index is valid. This is a convenience method that does sanity + // checking on the index. + T get_by_index(idx_t index) const { + verify_index(index); + return this->base()[index]; + } + + // Set the element of the given array at the given index to the + // given value. Assume the index is valid. This is a convenience + // method that does sanity checking on the index. + void set_by_index(idx_t index, T value) { + verify_index(index); + this->base()[index] = value; + } + + // The raw biased base pointer. + T* biased_base() const { return (T*)G1BiasedMappedArrayBase::_biased_base; } + + // Return the element of the given array that covers the given word in the + // heap. Assumes the index is valid. + T get_by_address(HeapWord* value) const { + idx_t biased_index = ((uintptr_t)value) >> this->shift_by(); + this->verify_biased_index(biased_index); + return biased_base()[biased_index]; + } + + // Set the value of the array entry that corresponds to the given array. + void set_by_address(HeapWord * address, T value) { + idx_t biased_index = ((uintptr_t)address) >> this->shift_by(); + this->verify_biased_index(biased_index); + biased_base()[biased_index] = value; + } + +protected: + // Returns the address of the element the given address maps to + T* address_mapped_to(HeapWord* address) { + idx_t biased_index = ((uintptr_t)address) >> this->shift_by(); + this->verify_biased_index_inclusive_end(biased_index); + return biased_base() + biased_index; + } + +public: + // Return the smallest address (inclusive) in the heap that this array covers. + HeapWord* bottom_address_mapped() const { + return (HeapWord*) ((uintptr_t)this->bias() << this->shift_by()); + } + + // Return the highest address (exclusive) in the heap that this array covers. + HeapWord* end_address_mapped() const { + return (HeapWord*) ((uintptr_t)(this->bias() + this->length()) << this->shift_by()); + } + +protected: + virtual T default_value() const = 0; + // Set all elements of the given array to the given value. + void clear() { + T value = default_value(); + for (idx_t i = 0; i < length(); i++) { + set_by_index(i, value); + } + } +public: + G1BiasedMappedArray() {} + + // Allocate and initialize this array to cover the heap addresses in the range + // of [bottom, end). + void initialize(HeapWord* bottom, HeapWord* end, size_t mapping_granularity) { + G1BiasedMappedArrayBase::initialize(bottom, end, sizeof(T), mapping_granularity); + this->clear(); + } +}; + +#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1BIASEDARRAY_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.cpp index 31972bf3c4e..59041d34ae2 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.cpp @@ -65,9 +65,7 @@ void G1CardCounts::initialize() { // threshold limit is no more than this. guarantee(G1ConcRSHotCardLimit <= max_jubyte, "sanity"); - ModRefBarrierSet* bs = _g1h->mr_bs(); - guarantee(bs->is_a(BarrierSet::CardTableModRef), "Precondition"); - _ct_bs = (CardTableModRefBS*)bs; + _ct_bs = _g1h->g1_barrier_set(); _ct_bot = _ct_bs->byte_for_const(_g1h->reserved_region().start()); // Allocate/Reserve the counts table diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index 1d8ff8a26dc..3f53067ca8d 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -125,10 +125,8 @@ class ClearLoggedCardTableEntryClosure: public CardTableEntryClosure { int _histo[256]; public: ClearLoggedCardTableEntryClosure() : - _calls(0) + _calls(0), _g1h(G1CollectedHeap::heap()), _ctbs(_g1h->g1_barrier_set()) { - _g1h = G1CollectedHeap::heap(); - _ctbs = (CardTableModRefBS*)_g1h->barrier_set(); for (int i = 0; i < 256; i++) _histo[i] = 0; } bool do_card_ptr(jbyte* card_ptr, int worker_i) { @@ -158,11 +156,8 @@ class RedirtyLoggedCardTableEntryClosure: public CardTableEntryClosure { CardTableModRefBS* _ctbs; public: RedirtyLoggedCardTableEntryClosure() : - _calls(0) - { - _g1h = G1CollectedHeap::heap(); - _ctbs = (CardTableModRefBS*)_g1h->barrier_set(); - } + _calls(0), _g1h(G1CollectedHeap::heap()), _ctbs(_g1h->g1_barrier_set()) {} + bool do_card_ptr(jbyte* card_ptr, int worker_i) { if (_g1h->is_in_reserved(_ctbs->addr_for(card_ptr))) { _calls++; @@ -478,7 +473,7 @@ bool G1CollectedHeap::is_scavengable(const void* p) { void G1CollectedHeap::check_ct_logs_at_safepoint() { DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); - CardTableModRefBS* ct_bs = (CardTableModRefBS*)barrier_set(); + CardTableModRefBS* ct_bs = g1_barrier_set(); // Count the dirty cards at the start. CountNonCleanMemRegionClosure count1(this); @@ -1205,7 +1200,7 @@ public: }; void G1CollectedHeap::clear_rsets_post_compaction() { - PostMCRemSetClearClosure rs_clear(this, mr_bs()); + PostMCRemSetClearClosure rs_clear(this, g1_barrier_set()); heap_region_iterate(&rs_clear); } @@ -1777,7 +1772,6 @@ void G1CollectedHeap::update_committed_space(HeapWord* old_end, } bool G1CollectedHeap::expand(size_t expand_bytes) { - size_t old_mem_size = _g1_storage.committed_size(); size_t aligned_expand_bytes = ReservedSpace::page_align_size_up(expand_bytes); aligned_expand_bytes = align_size_up(aligned_expand_bytes, HeapRegion::GrainBytes); @@ -1787,6 +1781,13 @@ bool G1CollectedHeap::expand(size_t expand_bytes) { ergo_format_byte("attempted expansion amount"), expand_bytes, aligned_expand_bytes); + if (_g1_storage.uncommitted_size() == 0) { + ergo_verbose0(ErgoHeapSizing, + "did not expand the heap", + ergo_format_reason("heap already fully expanded")); + return false; + } + // First commit the memory. HeapWord* old_end = (HeapWord*) _g1_storage.high(); bool successful = _g1_storage.expand_by(aligned_expand_bytes); @@ -1845,7 +1846,6 @@ bool G1CollectedHeap::expand(size_t expand_bytes) { } void G1CollectedHeap::shrink_helper(size_t shrink_bytes) { - size_t old_mem_size = _g1_storage.committed_size(); size_t aligned_shrink_bytes = ReservedSpace::page_align_size_down(shrink_bytes); aligned_shrink_bytes = align_size_down(aligned_shrink_bytes, @@ -2045,20 +2045,13 @@ jint G1CollectedHeap::initialize() { // Create the gen rem set (and barrier set) for the entire reserved region. _rem_set = collector_policy()->create_rem_set(_reserved, 2); set_barrier_set(rem_set()->bs()); - if (barrier_set()->is_a(BarrierSet::ModRef)) { - _mr_bs = (ModRefBarrierSet*)_barrier_set; - } else { - vm_exit_during_initialization("G1 requires a mod ref bs."); + if (!barrier_set()->is_a(BarrierSet::G1SATBCTLogging)) { + vm_exit_during_initialization("G1 requires a G1SATBLoggingCardTableModRefBS"); return JNI_ENOMEM; } // Also create a G1 rem set. - if (mr_bs()->is_a(BarrierSet::CardTableModRef)) { - _g1_rem_set = new G1RemSet(this, (CardTableModRefBS*)mr_bs()); - } else { - vm_exit_during_initialization("G1 requires a cardtable mod ref bs."); - return JNI_ENOMEM; - } + _g1_rem_set = new G1RemSet(this, g1_barrier_set()); // Carve out the G1 part of the heap. @@ -2069,8 +2062,10 @@ jint G1CollectedHeap::initialize() { _g1_storage.initialize(g1_rs, 0); _g1_committed = MemRegion((HeapWord*)_g1_storage.low(), (size_t) 0); _hrs.initialize((HeapWord*) _g1_reserved.start(), - (HeapWord*) _g1_reserved.end(), - _expansion_regions); + (HeapWord*) _g1_reserved.end()); + assert(_hrs.max_length() == _expansion_regions, + err_msg("max length: %u expansion regions: %u", + _hrs.max_length(), _expansion_regions)); // Do later initialization work for concurrent refinement. _cg1r->init(); @@ -3679,6 +3674,11 @@ void G1CollectedHeap::gc_prologue(bool full /* Ignored */) { assert(InlineCacheBuffer::is_empty(), "should have cleaned up ICBuffer"); // Fill TLAB's and such ensure_parsability(true); + + if (G1SummarizeRSetStats && (G1SummarizeRSetStatsPeriod > 0) && + (total_collections() % G1SummarizeRSetStatsPeriod == 0)) { + g1_rem_set()->print_periodic_summary_info("Before GC RS summary"); + } } void G1CollectedHeap::gc_epilogue(bool full /* Ignored */) { @@ -3687,7 +3687,7 @@ void G1CollectedHeap::gc_epilogue(bool full /* Ignored */) { (G1SummarizeRSetStatsPeriod > 0) && // we are at the end of the GC. Total collections has already been increased. ((total_collections() - 1) % G1SummarizeRSetStatsPeriod == 0)) { - g1_rem_set()->print_periodic_summary_info(); + g1_rem_set()->print_periodic_summary_info("After GC RS summary"); } // FIXME: what is this about? @@ -4548,7 +4548,7 @@ G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num) : _g1h(g1h), _refs(g1h->task_queue(queue_num)), _dcq(&g1h->dirty_card_queue_set()), - _ct_bs((CardTableModRefBS*)_g1h->barrier_set()), + _ct_bs(g1h->g1_barrier_set()), _g1_rem(g1h->g1_rem_set()), _hash_seed(17), _queue_num(queue_num), _term_attempts(0), @@ -4615,7 +4615,7 @@ bool G1ParScanThreadState::verify_ref(narrowOop* ref) const { assert(!has_partial_array_mask(ref), err_msg("ref=" PTR_FORMAT, ref)); oop p = oopDesc::load_decode_heap_oop(ref); assert(_g1h->is_in_g1_reserved(p), - err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, intptr_t(p))); + err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, (void *)p)); return true; } @@ -4625,11 +4625,11 @@ bool G1ParScanThreadState::verify_ref(oop* ref) const { // Must be in the collection set--it's already been copied. oop p = clear_partial_array_mask(ref); assert(_g1h->obj_in_cs(p), - err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, intptr_t(p))); + err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, (void *)p)); } else { oop p = oopDesc::load_decode_heap_oop(ref); assert(_g1h->is_in_g1_reserved(p), - err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, intptr_t(p))); + err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, (void *)p)); } return true; } @@ -5977,11 +5977,11 @@ void G1CollectedHeap::update_sets_after_freeing_regions(size_t pre_used, } class G1ParCleanupCTTask : public AbstractGangTask { - CardTableModRefBS* _ct_bs; + G1SATBCardTableModRefBS* _ct_bs; G1CollectedHeap* _g1h; HeapRegion* volatile _su_head; public: - G1ParCleanupCTTask(CardTableModRefBS* ct_bs, + G1ParCleanupCTTask(G1SATBCardTableModRefBS* ct_bs, G1CollectedHeap* g1h) : AbstractGangTask("G1 Par Cleanup CT Task"), _ct_bs(ct_bs), _g1h(g1h) { } @@ -6004,9 +6004,9 @@ public: #ifndef PRODUCT class G1VerifyCardTableCleanup: public HeapRegionClosure { G1CollectedHeap* _g1h; - CardTableModRefBS* _ct_bs; + G1SATBCardTableModRefBS* _ct_bs; public: - G1VerifyCardTableCleanup(G1CollectedHeap* g1h, CardTableModRefBS* ct_bs) + G1VerifyCardTableCleanup(G1CollectedHeap* g1h, G1SATBCardTableModRefBS* ct_bs) : _g1h(g1h), _ct_bs(ct_bs) { } virtual bool doHeapRegion(HeapRegion* r) { if (r->is_survivor()) { @@ -6020,7 +6020,7 @@ public: void G1CollectedHeap::verify_not_dirty_region(HeapRegion* hr) { // All of the region should be clean. - CardTableModRefBS* ct_bs = (CardTableModRefBS*)barrier_set(); + G1SATBCardTableModRefBS* ct_bs = g1_barrier_set(); MemRegion mr(hr->bottom(), hr->end()); ct_bs->verify_not_dirty_region(mr); } @@ -6033,13 +6033,17 @@ void G1CollectedHeap::verify_dirty_region(HeapRegion* hr) { // not dirty that area (one less thing to have to do while holding // a lock). So we can only verify that [bottom(),pre_dummy_top()] // is dirty. - CardTableModRefBS* ct_bs = (CardTableModRefBS*) barrier_set(); + G1SATBCardTableModRefBS* ct_bs = g1_barrier_set(); MemRegion mr(hr->bottom(), hr->pre_dummy_top()); - ct_bs->verify_dirty_region(mr); + if (hr->is_young()) { + ct_bs->verify_g1_young_region(mr); + } else { + ct_bs->verify_dirty_region(mr); + } } void G1CollectedHeap::verify_dirty_young_list(HeapRegion* head) { - CardTableModRefBS* ct_bs = (CardTableModRefBS*) barrier_set(); + G1SATBCardTableModRefBS* ct_bs = g1_barrier_set(); for (HeapRegion* hr = head; hr != NULL; hr = hr->get_next_young_region()) { verify_dirty_region(hr); } @@ -6051,7 +6055,7 @@ void G1CollectedHeap::verify_dirty_young_regions() { #endif void G1CollectedHeap::cleanUpCardTable() { - CardTableModRefBS* ct_bs = (CardTableModRefBS*) (barrier_set()); + G1SATBCardTableModRefBS* ct_bs = g1_barrier_set(); double start = os::elapsedTime(); { diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp index 747b2326236..689814dfa07 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @@ -31,6 +31,7 @@ #include "gc_implementation/g1/g1HRPrinter.hpp" #include "gc_implementation/g1/g1MonitoringSupport.hpp" #include "gc_implementation/g1/g1RemSet.hpp" +#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" #include "gc_implementation/g1/g1YCTypes.hpp" #include "gc_implementation/g1/heapRegionSeq.hpp" #include "gc_implementation/g1/heapRegionSets.hpp" @@ -703,7 +704,7 @@ public: if (_g1_committed.contains((HeapWord*) obj)) { // no need to subtract the bottom of the heap from obj, // _in_cset_fast_test is biased - uintx index = (uintx) obj >> HeapRegion::LogOfHRGrainBytes; + uintx index = cast_from_oop(obj) >> HeapRegion::LogOfHRGrainBytes; bool ret = _in_cset_fast_test[index]; // let's make sure the result is consistent with what the slower // test returns @@ -791,8 +792,6 @@ protected: // The g1 remembered set of the heap. G1RemSet* _g1_rem_set; - // And it's mod ref barrier set, used to track updates for the above. - ModRefBarrierSet* _mr_bs; // A set of cards that cover the objects for which the Rsets should be updated // concurrently after the collection. @@ -1127,7 +1126,6 @@ public: // The rem set and barrier set. G1RemSet* g1_rem_set() const { return _g1_rem_set; } - ModRefBarrierSet* mr_bs() const { return _mr_bs; } unsigned get_gc_time_stamp() { return _gc_time_stamp; @@ -1346,6 +1344,10 @@ public: virtual bool is_in_closed_subset(const void* p) const; + G1SATBCardTableModRefBS* g1_barrier_set() { + return (G1SATBCardTableModRefBS*) barrier_set(); + } + // This resets the card table to all zeros. It is used after // a collection pause which used the card table to claim cards. void cleanUpCardTable(); @@ -1875,7 +1877,7 @@ protected: G1CollectedHeap* _g1h; RefToScanQueue* _refs; DirtyCardQueue _dcq; - CardTableModRefBS* _ct_bs; + G1SATBCardTableModRefBS* _ct_bs; G1RemSet* _g1_rem; G1ParGCAllocBufferContainer _surviving_alloc_buffer; @@ -1914,7 +1916,7 @@ protected: void add_to_undo_waste(size_t waste) { _undo_waste += waste; } DirtyCardQueue& dirty_card_queue() { return _dcq; } - CardTableModRefBS* ctbs() { return _ct_bs; } + G1SATBCardTableModRefBS* ctbs() { return _ct_bs; } template void immediate_rs_update(HeapRegion* from, T* p, int tid) { if (!from->is_survivor()) { diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp index 20eb1693c43..d309e609f4a 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp @@ -29,6 +29,7 @@ #include "gc_implementation/g1/g1CollectedHeap.hpp" #include "gc_implementation/g1/g1AllocRegion.inline.hpp" #include "gc_implementation/g1/g1CollectorPolicy.hpp" +#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" #include "gc_implementation/g1/heapRegionSeq.inline.hpp" #include "utilities/taskqueue.hpp" @@ -134,7 +135,7 @@ G1CollectedHeap::dirty_young_block(HeapWord* start, size_t word_size) { assert(containing_hr->is_in(end - 1), "it should also contain end - 1"); MemRegion mr(start, end); - ((CardTableModRefBS*)_g1h->barrier_set())->dirty(mr); + g1_barrier_set()->g1_mark_as_young(mr); } inline RefToScanQueue* G1CollectedHeap::task_queue(int i) const { diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp index 178acd26afd..92eee2e8eb9 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @@ -319,10 +319,10 @@ G1CollectorPolicy::G1CollectorPolicy() : } void G1CollectorPolicy::initialize_flags() { - set_min_alignment(HeapRegion::GrainBytes); + _min_alignment = HeapRegion::GrainBytes; size_t card_table_alignment = GenRemSet::max_alignment_constraint(rem_set_name()); size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size(); - set_max_alignment(MAX3(card_table_alignment, min_alignment(), page_size)); + _max_alignment = MAX3(card_table_alignment, _min_alignment, page_size); if (SurvivorRatio < 1) { vm_exit_during_initialization("Invalid survivor ratio specified"); } @@ -344,6 +344,10 @@ G1YoungGenSizer::G1YoungGenSizer() : _sizer_kind(SizerDefaults), _adaptive_size( } } + if (FLAG_IS_CMDLINE(NewSize) && FLAG_IS_CMDLINE(MaxNewSize) && NewSize > MaxNewSize) { + vm_exit_during_initialization("Initial young gen size set larger than the maximum young gen size"); + } + if (FLAG_IS_CMDLINE(NewSize)) { _min_desired_young_length = MAX2((uint) (NewSize / HeapRegion::GrainBytes), 1U); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp index 84d998265a9..1333f287047 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp @@ -41,11 +41,11 @@ class UpdateRSetDeferred : public OopsInHeapRegionClosure { private: G1CollectedHeap* _g1; DirtyCardQueue *_dcq; - CardTableModRefBS* _ct_bs; + G1SATBCardTableModRefBS* _ct_bs; public: UpdateRSetDeferred(G1CollectedHeap* g1, DirtyCardQueue* dcq) : - _g1(g1), _ct_bs((CardTableModRefBS*)_g1->barrier_set()), _dcq(dcq) {} + _g1(g1), _ct_bs(_g1->g1_barrier_set()), _dcq(dcq) {} virtual void do_oop(narrowOop* p) { do_oop_work(p); } virtual void do_oop( oop* p) { do_oop_work(p); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp index 74aabc1298d..87650103d60 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp @@ -220,7 +220,7 @@ class G1PrepareCompactClosure: public HeapRegionClosure { public: G1PrepareCompactClosure(CompactibleSpace* cs) : _g1h(G1CollectedHeap::heap()), - _mrbs(G1CollectedHeap::heap()->mr_bs()), + _mrbs(_g1h->g1_barrier_set()), _cp(NULL, cs, cs->initialize_threshold()), _humongous_proxy_set("G1MarkSweep Humongous Proxy Set") { } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp index 86dce1cb8e1..b616cb9eb4c 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -91,12 +91,12 @@ template inline bool has_partial_array_mask(T* ref) { } template inline T* set_partial_array_mask(T obj) { - assert(((uintptr_t)obj & G1_PARTIAL_ARRAY_MASK) == 0, "Information loss!"); - return (T*) ((uintptr_t)obj | G1_PARTIAL_ARRAY_MASK); + assert(((uintptr_t)(void *)obj & G1_PARTIAL_ARRAY_MASK) == 0, "Information loss!"); + return (T*) ((uintptr_t)(void *)obj | G1_PARTIAL_ARRAY_MASK); } template inline oop clear_partial_array_mask(T* ref) { - return oop((intptr_t)ref & ~G1_PARTIAL_ARRAY_MASK); + return cast_to_oop((intptr_t)ref & ~G1_PARTIAL_ARRAY_MASK); } class G1ParScanPartialArrayClosure : public G1ParClosureSuper { diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp index 5a1b92d3422..0ed37e6c5a5 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp @@ -83,7 +83,9 @@ G1RemSet::G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs) for (uint i = 0; i < n_workers(); i++) { _cset_rs_update_cl[i] = NULL; } - _prev_period_summary.initialize(this, n_workers()); + if (G1SummarizeRSetStats) { + _prev_period_summary.initialize(this); + } } G1RemSet::~G1RemSet() { @@ -109,7 +111,7 @@ class ScanRSClosure : public HeapRegionClosure { CodeBlobToOopClosure* _code_root_cl; G1BlockOffsetSharedArray* _bot_shared; - CardTableModRefBS *_ct_bs; + G1SATBCardTableModRefBS *_ct_bs; double _strong_code_root_scan_time_sec; int _worker_i; @@ -130,7 +132,7 @@ public: { _g1h = G1CollectedHeap::heap(); _bot_shared = _g1h->bot_shared(); - _ct_bs = (CardTableModRefBS*) (_g1h->barrier_set()); + _ct_bs = _g1h->g1_barrier_set(); _block_size = MAX2(G1RSetScanBlockSize, 1); } @@ -505,12 +507,7 @@ public: ScrubRSClosure(BitMap* region_bm, BitMap* card_bm) : _g1h(G1CollectedHeap::heap()), _region_bm(region_bm), _card_bm(card_bm), - _ctbs(NULL) - { - ModRefBarrierSet* bs = _g1h->mr_bs(); - guarantee(bs->is_a(BarrierSet::CardTableModRef), "Precondition"); - _ctbs = (CardTableModRefBS*)bs; - } + _ctbs(_g1h->g1_barrier_set()) {} bool doHeapRegion(HeapRegion* r) { if (!r->continuesHumongous()) { @@ -731,19 +728,19 @@ bool G1RemSet::refine_card(jbyte* card_ptr, int worker_i, return has_refs_into_cset; } -void G1RemSet::print_periodic_summary_info() { +void G1RemSet::print_periodic_summary_info(const char* header) { G1RemSetSummary current; - current.initialize(this, n_workers()); + current.initialize(this); _prev_period_summary.subtract_from(¤t); - print_summary_info(&_prev_period_summary); + print_summary_info(&_prev_period_summary, header); _prev_period_summary.set(¤t); } void G1RemSet::print_summary_info() { G1RemSetSummary current; - current.initialize(this, n_workers()); + current.initialize(this); print_summary_info(¤t, " Cumulative RS summary"); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp index 513945609fc..7c010f9daf6 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp @@ -145,7 +145,7 @@ public: virtual void print_summary_info(); // Print accumulated summary info from the last time called. - virtual void print_periodic_summary_info(); + virtual void print_periodic_summary_info(const char* header); // Prepare remembered set for verification. virtual void prepare_for_verify(); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSetSummary.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSetSummary.cpp index 4a6b37654d7..cdc13041a5d 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSetSummary.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSetSummary.cpp @@ -77,12 +77,12 @@ double G1RemSetSummary::rs_thread_vtime(uint thread) const { return _rs_threads_vtimes[thread]; } -void G1RemSetSummary::initialize(G1RemSet* remset, uint num_workers) { +void G1RemSetSummary::initialize(G1RemSet* remset) { assert(_rs_threads_vtimes == NULL, "just checking"); assert(remset != NULL, "just checking"); _remset = remset; - _num_vtimes = num_workers; + _num_vtimes = ConcurrentG1Refine::thread_num(); _rs_threads_vtimes = NEW_C_HEAP_ARRAY(double, _num_vtimes, mtGC); memset(_rs_threads_vtimes, 0, sizeof(double) * _num_vtimes); @@ -125,25 +125,119 @@ void G1RemSetSummary::subtract_from(G1RemSetSummary* other) { _sampling_thread_vtime = other->sampling_thread_vtime() - _sampling_thread_vtime; } -class HRRSStatsIter: public HeapRegionClosure { - size_t _occupied; +static double percent_of(size_t numerator, size_t denominator) { + if (denominator != 0) { + return (double)numerator / denominator * 100.0f; + } else { + return 0.0f; + } +} + +static size_t round_to_K(size_t value) { + return value / K; +} + +class RegionTypeCounter VALUE_OBJ_CLASS_SPEC { +private: + const char* _name; + + size_t _rs_mem_size; + size_t _cards_occupied; + size_t _amount; + + size_t _code_root_mem_size; + size_t _code_root_elems; + + double rs_mem_size_percent_of(size_t total) { + return percent_of(_rs_mem_size, total); + } + + double cards_occupied_percent_of(size_t total) { + return percent_of(_cards_occupied, total); + } + + double code_root_mem_size_percent_of(size_t total) { + return percent_of(_code_root_mem_size, total); + } + + double code_root_elems_percent_of(size_t total) { + return percent_of(_code_root_elems, total); + } + + size_t amount() const { return _amount; } + +public: + + RegionTypeCounter(const char* name) : _name(name), _rs_mem_size(0), _cards_occupied(0), + _amount(0), _code_root_mem_size(0), _code_root_elems(0) { } + + void add(size_t rs_mem_size, size_t cards_occupied, size_t code_root_mem_size, + size_t code_root_elems) { + _rs_mem_size += rs_mem_size; + _cards_occupied += cards_occupied; + _code_root_mem_size += code_root_mem_size; + _code_root_elems += code_root_elems; + _amount++; + } + + size_t rs_mem_size() const { return _rs_mem_size; } + size_t cards_occupied() const { return _cards_occupied; } + + size_t code_root_mem_size() const { return _code_root_mem_size; } + size_t code_root_elems() const { return _code_root_elems; } + + void print_rs_mem_info_on(outputStream * out, size_t total) { + out->print_cr(" "SIZE_FORMAT_W(8)"K (%5.1f%%) by "SIZE_FORMAT" %s regions", + round_to_K(rs_mem_size()), rs_mem_size_percent_of(total), amount(), _name); + } + + void print_cards_occupied_info_on(outputStream * out, size_t total) { + out->print_cr(" "SIZE_FORMAT_W(8)" (%5.1f%%) entries by "SIZE_FORMAT" %s regions", + cards_occupied(), cards_occupied_percent_of(total), amount(), _name); + } + + void print_code_root_mem_info_on(outputStream * out, size_t total) { + out->print_cr(" "SIZE_FORMAT_W(8)"K (%5.1f%%) by "SIZE_FORMAT" %s regions", + round_to_K(code_root_mem_size()), code_root_mem_size_percent_of(total), amount(), _name); + } + + void print_code_root_elems_info_on(outputStream * out, size_t total) { + out->print_cr(" "SIZE_FORMAT_W(8)" (%5.1f%%) elements by "SIZE_FORMAT" %s regions", + code_root_elems(), code_root_elems_percent_of(total), amount(), _name); + } +}; + + +class HRRSStatsIter: public HeapRegionClosure { +private: + RegionTypeCounter _young; + RegionTypeCounter _humonguous; + RegionTypeCounter _free; + RegionTypeCounter _old; + RegionTypeCounter _all; - size_t _total_rs_mem_sz; size_t _max_rs_mem_sz; HeapRegion* _max_rs_mem_sz_region; - size_t _total_code_root_mem_sz; + size_t total_rs_mem_sz() const { return _all.rs_mem_size(); } + size_t total_cards_occupied() const { return _all.cards_occupied(); } + + size_t max_rs_mem_sz() const { return _max_rs_mem_sz; } + HeapRegion* max_rs_mem_sz_region() const { return _max_rs_mem_sz_region; } + size_t _max_code_root_mem_sz; HeapRegion* _max_code_root_mem_sz_region; + + size_t total_code_root_mem_sz() const { return _all.code_root_mem_size(); } + size_t total_code_root_elems() const { return _all.code_root_elems(); } + + size_t max_code_root_mem_sz() const { return _max_code_root_mem_sz; } + HeapRegion* max_code_root_mem_sz_region() const { return _max_code_root_mem_sz_region; } + public: - HRRSStatsIter() : - _occupied(0), - _total_rs_mem_sz(0), - _max_rs_mem_sz(0), - _max_rs_mem_sz_region(NULL), - _total_code_root_mem_sz(0), - _max_code_root_mem_sz(0), - _max_code_root_mem_sz_region(NULL) + HRRSStatsIter() : _all("All"), _young("Young"), _humonguous("Humonguous"), + _free("Free"), _old("Old"), _max_code_root_mem_sz_region(NULL), _max_rs_mem_sz_region(NULL), + _max_rs_mem_sz(0), _max_code_root_mem_sz(0) {} bool doHeapRegion(HeapRegion* r) { @@ -156,46 +250,95 @@ public: _max_rs_mem_sz = rs_mem_sz; _max_rs_mem_sz_region = r; } - _total_rs_mem_sz += rs_mem_sz; - + size_t occupied_cards = hrrs->occupied(); size_t code_root_mem_sz = hrrs->strong_code_roots_mem_size(); - if (code_root_mem_sz > _max_code_root_mem_sz) { - _max_code_root_mem_sz = code_root_mem_sz; + if (code_root_mem_sz > max_code_root_mem_sz()) { _max_code_root_mem_sz_region = r; } - _total_code_root_mem_sz += code_root_mem_sz; + size_t code_root_elems = hrrs->strong_code_roots_list_length(); + + RegionTypeCounter* current = NULL; + if (r->is_young()) { + current = &_young; + } else if (r->isHumongous()) { + current = &_humonguous; + } else if (r->is_empty()) { + current = &_free; + } else { + current = &_old; + } + current->add(rs_mem_sz, occupied_cards, code_root_mem_sz, code_root_elems); + _all.add(rs_mem_sz, occupied_cards, code_root_mem_sz, code_root_elems); - size_t occ = hrrs->occupied(); - _occupied += occ; return false; } - size_t total_rs_mem_sz() { return _total_rs_mem_sz; } - size_t max_rs_mem_sz() { return _max_rs_mem_sz; } - HeapRegion* max_rs_mem_sz_region() { return _max_rs_mem_sz_region; } - size_t total_code_root_mem_sz() { return _total_code_root_mem_sz; } - size_t max_code_root_mem_sz() { return _max_code_root_mem_sz; } - HeapRegion* max_code_root_mem_sz_region() { return _max_code_root_mem_sz_region; } - size_t occupied() { return _occupied; } + + void print_summary_on(outputStream* out) { + RegionTypeCounter* counters[] = { &_young, &_humonguous, &_free, &_old, NULL }; + + out->print_cr("\n Current rem set statistics"); + out->print_cr(" Total per region rem sets sizes = "SIZE_FORMAT"K." + " Max = "SIZE_FORMAT"K.", + round_to_K(total_rs_mem_sz()), round_to_K(max_rs_mem_sz())); + for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) { + (*current)->print_rs_mem_info_on(out, total_rs_mem_sz()); + } + + out->print_cr(" Static structures = "SIZE_FORMAT"K," + " free_lists = "SIZE_FORMAT"K.", + round_to_K(HeapRegionRemSet::static_mem_size()), + round_to_K(HeapRegionRemSet::fl_mem_size())); + + out->print_cr(" "SIZE_FORMAT" occupied cards represented.", + total_cards_occupied()); + for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) { + (*current)->print_cards_occupied_info_on(out, total_cards_occupied()); + } + + // Largest sized rem set region statistics + HeapRegionRemSet* rem_set = max_rs_mem_sz_region()->rem_set(); + out->print_cr(" Region with largest rem set = "HR_FORMAT", " + "size = "SIZE_FORMAT "K, occupied = "SIZE_FORMAT"K.", + HR_FORMAT_PARAMS(max_rs_mem_sz_region()), + round_to_K(rem_set->mem_size()), + round_to_K(rem_set->occupied())); + + // Strong code root statistics + HeapRegionRemSet* max_code_root_rem_set = max_code_root_mem_sz_region()->rem_set(); + out->print_cr(" Total heap region code root sets sizes = "SIZE_FORMAT"K." + " Max = "SIZE_FORMAT"K.", + round_to_K(total_code_root_mem_sz()), + round_to_K(max_code_root_rem_set->strong_code_roots_mem_size())); + for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) { + (*current)->print_code_root_mem_info_on(out, total_code_root_mem_sz()); + } + + out->print_cr(" "SIZE_FORMAT" code roots represented.", + total_code_root_elems()); + for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) { + (*current)->print_code_root_elems_info_on(out, total_code_root_elems()); + } + + out->print_cr(" Region with largest amount of code roots = "HR_FORMAT", " + "size = "SIZE_FORMAT "K, num_elems = "SIZE_FORMAT".", + HR_FORMAT_PARAMS(max_code_root_mem_sz_region()), + round_to_K(max_code_root_rem_set->strong_code_roots_mem_size()), + round_to_K(max_code_root_rem_set->strong_code_roots_list_length())); + } }; -double calc_percentage(size_t numerator, size_t denominator) { - if (denominator != 0) { - return (double)numerator / denominator * 100.0; - } else { - return 0.0f; - } -} - void G1RemSetSummary::print_on(outputStream* out) { - out->print_cr("\n Concurrent RS processed "SIZE_FORMAT" cards", + out->print_cr("\n Recent concurrent refinement statistics"); + out->print_cr(" Processed "SIZE_FORMAT" cards", num_concurrent_refined_cards()); - out->print_cr(" Of %d completed buffers:", num_processed_buf_total()); - out->print_cr(" %8d (%5.1f%%) by concurrent RS threads.", + out->print_cr(" Of "SIZE_FORMAT" completed buffers:", num_processed_buf_total()); + out->print_cr(" "SIZE_FORMAT_W(8)" (%5.1f%%) by concurrent RS threads.", num_processed_buf_total(), - calc_percentage(num_processed_buf_rs_threads(), num_processed_buf_total())); - out->print_cr(" %8d (%5.1f%%) by mutator threads.", + percent_of(num_processed_buf_rs_threads(), num_processed_buf_total())); + out->print_cr(" "SIZE_FORMAT_W(8)" (%5.1f%%) by mutator threads.", num_processed_buf_mutator(), - calc_percentage(num_processed_buf_mutator(), num_processed_buf_total())); + percent_of(num_processed_buf_mutator(), num_processed_buf_total())); + out->print_cr(" Did "SIZE_FORMAT" coarsenings.", num_coarsenings()); out->print_cr(" Concurrent RS threads times (s)"); out->print(" "); for (uint i = 0; i < _num_vtimes; i++) { @@ -207,33 +350,5 @@ void G1RemSetSummary::print_on(outputStream* out) { HRRSStatsIter blk; G1CollectedHeap::heap()->heap_region_iterate(&blk); - // RemSet stats - out->print_cr(" Total heap region rem set sizes = "SIZE_FORMAT"K." - " Max = "SIZE_FORMAT"K.", - blk.total_rs_mem_sz()/K, blk.max_rs_mem_sz()/K); - out->print_cr(" Static structures = "SIZE_FORMAT"K," - " free_lists = "SIZE_FORMAT"K.", - HeapRegionRemSet::static_mem_size() / K, - HeapRegionRemSet::fl_mem_size() / K); - out->print_cr(" "SIZE_FORMAT" occupied cards represented.", - blk.occupied()); - HeapRegion* max_rs_mem_sz_region = blk.max_rs_mem_sz_region(); - HeapRegionRemSet* max_rs_rem_set = max_rs_mem_sz_region->rem_set(); - out->print_cr(" Max size region = "HR_FORMAT", " - "size = "SIZE_FORMAT "K, occupied = "SIZE_FORMAT"K.", - HR_FORMAT_PARAMS(max_rs_mem_sz_region), - (max_rs_rem_set->mem_size() + K - 1)/K, - (max_rs_rem_set->occupied() + K - 1)/K); - out->print_cr(" Did %d coarsenings.", num_coarsenings()); - // Strong code root stats - out->print_cr(" Total heap region code-root set sizes = "SIZE_FORMAT"K." - " Max = "SIZE_FORMAT"K.", - blk.total_code_root_mem_sz()/K, blk.max_code_root_mem_sz()/K); - HeapRegion* max_code_root_mem_sz_region = blk.max_code_root_mem_sz_region(); - HeapRegionRemSet* max_code_root_rem_set = max_code_root_mem_sz_region->rem_set(); - out->print_cr(" Max size region = "HR_FORMAT", " - "size = "SIZE_FORMAT "K, num_elems = "SIZE_FORMAT".", - HR_FORMAT_PARAMS(max_code_root_mem_sz_region), - (max_code_root_rem_set->strong_code_roots_mem_size() + K - 1)/K, - (max_code_root_rem_set->strong_code_roots_list_length())); + blk.print_summary_on(out); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSetSummary.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSetSummary.hpp index 7f5f377637a..9c019d99e13 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSetSummary.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSetSummary.hpp @@ -84,7 +84,7 @@ public: void subtract_from(G1RemSetSummary* other); // initialize and get the first sampling - void initialize(G1RemSet* remset, uint num_workers); + void initialize(G1RemSet* remset); void print_on(outputStream* out); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp index 218be0c0e40..9af87ed66a7 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,6 +64,46 @@ G1SATBCardTableModRefBS::write_ref_array_pre_work(T* dst, int count) { } } +bool G1SATBCardTableModRefBS::mark_card_deferred(size_t card_index) { + jbyte val = _byte_map[card_index]; + // It's already processed + if ((val & (clean_card_mask_val() | deferred_card_val())) == deferred_card_val()) { + return false; + } + + if (val == g1_young_gen) { + // the card is for a young gen region. We don't need to keep track of all pointers into young + return false; + } + + // Cached bit can be installed either on a clean card or on a claimed card. + jbyte new_val = val; + if (val == clean_card_val()) { + new_val = (jbyte)deferred_card_val(); + } else { + if (val & claimed_card_val()) { + new_val = val | (jbyte)deferred_card_val(); + } + } + if (new_val != val) { + Atomic::cmpxchg(new_val, &_byte_map[card_index], val); + } + return true; +} + +void G1SATBCardTableModRefBS::g1_mark_as_young(const MemRegion& mr) { + jbyte *const first = byte_for(mr.start()); + jbyte *const last = byte_after(mr.last()); + + memset(first, g1_young_gen, last - first); +} + +#ifndef PRODUCT +void G1SATBCardTableModRefBS::verify_g1_young_region(MemRegion mr) { + verify_region(mr, g1_young_gen, true); +} +#endif + G1SATBCardTableLoggingModRefBS:: G1SATBCardTableLoggingModRefBS(MemRegion whole_heap, int max_covered_regions) : @@ -76,7 +116,11 @@ G1SATBCardTableLoggingModRefBS(MemRegion whole_heap, void G1SATBCardTableLoggingModRefBS::write_ref_field_work(void* field, oop new_val) { - jbyte* byte = byte_for(field); + volatile jbyte* byte = byte_for(field); + if (*byte == g1_young_gen) { + return; + } + OrderAccess::storeload(); if (*byte != dirty_card) { *byte = dirty_card; Thread* thr = Thread::current(); @@ -95,7 +139,7 @@ void G1SATBCardTableLoggingModRefBS::write_ref_field_static(void* field, oop new_val) { uintptr_t field_uint = (uintptr_t)field; - uintptr_t new_val_uint = (uintptr_t)new_val; + uintptr_t new_val_uint = cast_from_oop(new_val); uintptr_t comb = field_uint ^ new_val_uint; comb = comb >> HeapRegion::LogOfHRGrainBytes; if (comb == 0) return; @@ -108,7 +152,7 @@ G1SATBCardTableLoggingModRefBS::write_ref_field_static(void* field, void G1SATBCardTableLoggingModRefBS::invalidate(MemRegion mr, bool whole_heap) { - jbyte* byte = byte_for(mr.start()); + volatile jbyte* byte = byte_for(mr.start()); jbyte* last_byte = byte_for(mr.last()); Thread* thr = Thread::current(); if (whole_heap) { @@ -117,25 +161,35 @@ G1SATBCardTableLoggingModRefBS::invalidate(MemRegion mr, bool whole_heap) { byte++; } } else { - // Enqueue if necessary. - if (thr->is_Java_thread()) { - JavaThread* jt = (JavaThread*)thr; - while (byte <= last_byte) { - if (*byte != dirty_card) { - *byte = dirty_card; - jt->dirty_card_queue().enqueue(byte); + // skip all consecutive young cards + for (; byte <= last_byte && *byte == g1_young_gen; byte++); + + if (byte <= last_byte) { + OrderAccess::storeload(); + // Enqueue if necessary. + if (thr->is_Java_thread()) { + JavaThread* jt = (JavaThread*)thr; + for (; byte <= last_byte; byte++) { + if (*byte == g1_young_gen) { + continue; + } + if (*byte != dirty_card) { + *byte = dirty_card; + jt->dirty_card_queue().enqueue(byte); + } } - byte++; - } - } else { - MutexLockerEx x(Shared_DirtyCardQ_lock, - Mutex::_no_safepoint_check_flag); - while (byte <= last_byte) { - if (*byte != dirty_card) { - *byte = dirty_card; - _dcqs.shared_dirty_card_queue()->enqueue(byte); + } else { + MutexLockerEx x(Shared_DirtyCardQ_lock, + Mutex::_no_safepoint_check_flag); + for (; byte <= last_byte; byte++) { + if (*byte == g1_young_gen) { + continue; + } + if (*byte != dirty_card) { + *byte = dirty_card; + _dcqs.shared_dirty_card_queue()->enqueue(byte); + } } - byte++; } } } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp index 6f887583cab..a943c9f6db3 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp @@ -38,7 +38,14 @@ class DirtyCardQueueSet; // snapshot-at-the-beginning marking. class G1SATBCardTableModRefBS: public CardTableModRefBSForCTRS { +protected: + enum G1CardValues { + g1_young_gen = CT_MR_BS_last_reserved << 1 + }; + public: + static int g1_young_card_val() { return g1_young_gen; } + // Add "pre_val" to a set of objects that may have been disconnected from the // pre-marking object graph. static void enqueue(oop pre_val); @@ -89,6 +96,45 @@ public: write_ref_array_pre_work(dst, count); } } + +/* + Claimed and deferred bits are used together in G1 during the evacuation + pause. These bits can have the following state transitions: + 1. The claimed bit can be put over any other card state. Except that + the "dirty -> dirty and claimed" transition is checked for in + G1 code and is not used. + 2. Deferred bit can be set only if the previous state of the card + was either clean or claimed. mark_card_deferred() is wait-free. + We do not care if the operation is be successful because if + it does not it will only result in duplicate entry in the update + buffer because of the "cache-miss". So it's not worth spinning. + */ + + bool is_card_claimed(size_t card_index) { + jbyte val = _byte_map[card_index]; + return (val & (clean_card_mask_val() | claimed_card_val())) == claimed_card_val(); + } + + void set_card_claimed(size_t card_index) { + jbyte val = _byte_map[card_index]; + if (val == clean_card_val()) { + val = (jbyte)claimed_card_val(); + } else { + val |= (jbyte)claimed_card_val(); + } + _byte_map[card_index] = val; + } + + void verify_g1_young_region(MemRegion mr) PRODUCT_RETURN; + void g1_mark_as_young(const MemRegion& mr); + + bool mark_card_deferred(size_t card_index); + + bool is_card_deferred(size_t card_index) { + jbyte val = _byte_map[card_index]; + return (val & (clean_card_mask_val() | deferred_card_val())) == deferred_card_val(); + } + }; // Adds card-table logging to the post-barrier. diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp index 726acbfcdc0..00eec548995 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp @@ -637,7 +637,7 @@ class VerifyStrongCodeRootOopClosure: public OopClosure { gclog_or_tty->print_cr("Object "PTR_FORMAT" in region " "["PTR_FORMAT", "PTR_FORMAT") is above " "top "PTR_FORMAT, - obj, _hr->bottom(), _hr->end(), _hr->top()); + (void *)obj, _hr->bottom(), _hr->end(), _hr->top()); _failures = true; return; } @@ -951,12 +951,12 @@ void HeapRegion::verify(VerifyOption vo, Klass* klass = obj->klass(); if (!klass->is_metaspace_object()) { gclog_or_tty->print_cr("klass "PTR_FORMAT" of object "PTR_FORMAT" " - "not metadata", klass, obj); + "not metadata", klass, (void *)obj); *failures = true; return; } else if (!klass->is_klass()) { gclog_or_tty->print_cr("klass "PTR_FORMAT" of object "PTR_FORMAT" " - "not a klass", klass, obj); + "not a klass", klass, (void *)obj); *failures = true; return; } else { @@ -971,7 +971,7 @@ void HeapRegion::verify(VerifyOption vo, } } } else { - gclog_or_tty->print_cr(PTR_FORMAT" no an oop", obj); + gclog_or_tty->print_cr(PTR_FORMAT" no an oop", (void *)obj); *failures = true; return; } diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp index 69eaa53c31a..68bdd760c2b 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp @@ -91,8 +91,8 @@ protected: gclog_or_tty->print_cr(" PRT::Add_reference_work(" PTR_FORMAT "->" PTR_FORMAT").", from, UseCompressedOops - ? oopDesc::load_decode_heap_oop((narrowOop*)from) - : oopDesc::load_decode_heap_oop((oop*)from)); + ? (void *)oopDesc::load_decode_heap_oop((narrowOop*)from) + : (void *)oopDesc::load_decode_heap_oop((oop*)from)); } HeapRegion* loc_hr = hr(); @@ -403,8 +403,8 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, int tid) { gclog_or_tty->print_cr("ORT::add_reference_work(" PTR_FORMAT "->" PTR_FORMAT ").", from, UseCompressedOops - ? oopDesc::load_decode_heap_oop((narrowOop*)from) - : oopDesc::load_decode_heap_oop((oop*)from)); + ? (void *)oopDesc::load_decode_heap_oop((narrowOop*)from) + : (void *)oopDesc::load_decode_heap_oop((oop*)from)); } int from_card = (int)(uintptr_t(from) >> CardTableModRefBS::card_shift); diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp index dade3dfdfcf..eaa8e10f38d 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp @@ -71,27 +71,16 @@ uint HeapRegionSeq::find_contiguous_from(uint from, uint num) { // Public -void HeapRegionSeq::initialize(HeapWord* bottom, HeapWord* end, - uint max_length) { +void HeapRegionSeq::initialize(HeapWord* bottom, HeapWord* end) { assert((uintptr_t) bottom % HeapRegion::GrainBytes == 0, "bottom should be heap region aligned"); assert((uintptr_t) end % HeapRegion::GrainBytes == 0, "end should be heap region aligned"); - _length = 0; - _heap_bottom = bottom; - _heap_end = end; - _region_shift = HeapRegion::LogOfHRGrainBytes; _next_search_index = 0; _allocated_length = 0; - _max_length = max_length; - _regions = NEW_C_HEAP_ARRAY(HeapRegion*, max_length, mtGC); - memset(_regions, 0, (size_t) max_length * sizeof(HeapRegion*)); - _regions_biased = _regions - ((uintx) bottom >> _region_shift); - - assert(&_regions[0] == &_regions_biased[addr_to_index_biased(bottom)], - "bottom should be included in the region with index 0"); + _regions.initialize(bottom, end, HeapRegion::GrainBytes); } MemRegion HeapRegionSeq::expand_by(HeapWord* old_end, @@ -101,15 +90,15 @@ MemRegion HeapRegionSeq::expand_by(HeapWord* old_end, G1CollectedHeap* g1h = G1CollectedHeap::heap(); HeapWord* next_bottom = old_end; - assert(_heap_bottom <= next_bottom, "invariant"); + assert(heap_bottom() <= next_bottom, "invariant"); while (next_bottom < new_end) { - assert(next_bottom < _heap_end, "invariant"); + assert(next_bottom < heap_end(), "invariant"); uint index = length(); - assert(index < _max_length, "otherwise we cannot expand further"); + assert(index < max_length(), "otherwise we cannot expand further"); if (index == 0) { // We have not allocated any regions so far - assert(next_bottom == _heap_bottom, "invariant"); + assert(next_bottom == heap_bottom(), "invariant"); } else { // next_bottom should match the end of the last/previous region assert(next_bottom == at(index - 1)->end(), "invariant"); @@ -122,8 +111,8 @@ MemRegion HeapRegionSeq::expand_by(HeapWord* old_end, // allocation failed, we bail out and return what we have done so far return MemRegion(old_end, next_bottom); } - assert(_regions[index] == NULL, "invariant"); - _regions[index] = new_hr; + assert(_regions.get_by_index(index) == NULL, "invariant"); + _regions.set_by_index(index, new_hr); increment_allocated_length(); } // Have to increment the length first, otherwise we will get an @@ -228,26 +217,26 @@ uint HeapRegionSeq::shrink_by(uint num_regions_to_remove) { #ifndef PRODUCT void HeapRegionSeq::verify_optional() { - guarantee(_length <= _allocated_length, + guarantee(length() <= _allocated_length, err_msg("invariant: _length: %u _allocated_length: %u", - _length, _allocated_length)); - guarantee(_allocated_length <= _max_length, + length(), _allocated_length)); + guarantee(_allocated_length <= max_length(), err_msg("invariant: _allocated_length: %u _max_length: %u", - _allocated_length, _max_length)); - guarantee(_next_search_index <= _length, + _allocated_length, max_length())); + guarantee(_next_search_index <= length(), err_msg("invariant: _next_search_index: %u _length: %u", - _next_search_index, _length)); + _next_search_index, length())); - HeapWord* prev_end = _heap_bottom; + HeapWord* prev_end = heap_bottom(); for (uint i = 0; i < _allocated_length; i += 1) { - HeapRegion* hr = _regions[i]; + HeapRegion* hr = _regions.get_by_index(i); guarantee(hr != NULL, err_msg("invariant: i: %u", i)); guarantee(hr->bottom() == prev_end, err_msg("invariant i: %u "HR_FORMAT" prev_end: "PTR_FORMAT, i, HR_FORMAT_PARAMS(hr), prev_end)); guarantee(hr->hrs_index() == i, err_msg("invariant: i: %u hrs_index(): %u", i, hr->hrs_index())); - if (i < _length) { + if (i < length()) { // Asserts will fire if i is >= _length HeapWord* addr = hr->bottom(); guarantee(addr_to_region(addr) == hr, "sanity"); @@ -265,8 +254,8 @@ void HeapRegionSeq::verify_optional() { prev_end = hr->end(); } } - for (uint i = _allocated_length; i < _max_length; i += 1) { - guarantee(_regions[i] == NULL, err_msg("invariant i: %u", i)); + for (uint i = _allocated_length; i < max_length(); i += 1) { + guarantee(_regions.get_by_index(i) == NULL, err_msg("invariant i: %u", i)); } } #endif // PRODUCT diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp index b7a58f76a7f..b0c3eb48a0b 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp @@ -25,10 +25,17 @@ #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_HPP #define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_HPP +#include "gc_implementation/g1/g1BiasedArray.hpp" + class HeapRegion; class HeapRegionClosure; class FreeRegionList; +class G1HeapRegionTable : public G1BiasedMappedArray { + protected: + virtual HeapRegion* default_value() const { return NULL; } +}; + // This class keeps track of the region metadata (i.e., HeapRegion // instances). They are kept in the _regions array in address // order. A region's index in the array corresponds to its index in @@ -44,35 +51,21 @@ class FreeRegionList; // // We keep track of three lengths: // -// * _length (returned by length()) is the number of currently +// * _committed_length (returned by length()) is the number of currently // committed regions. // * _allocated_length (not exposed outside this class) is the // number of regions for which we have HeapRegions. -// * _max_length (returned by max_length()) is the maximum number of -// regions the heap can have. +// * max_length() returns the maximum number of regions the heap can have. // -// and maintain that: _length <= _allocated_length <= _max_length +// and maintain that: _committed_length <= _allocated_length <= max_length() class HeapRegionSeq: public CHeapObj { friend class VMStructs; - // The array that holds the HeapRegions. - HeapRegion** _regions; - - // Version of _regions biased to address 0 - HeapRegion** _regions_biased; + G1HeapRegionTable _regions; // The number of regions committed in the heap. - uint _length; - - // The address of the first reserved word in the heap. - HeapWord* _heap_bottom; - - // The address of the last reserved word in the heap - 1. - HeapWord* _heap_end; - - // The log of the region byte size. - uint _region_shift; + uint _committed_length; // A hint for which index to start searching from for humongous // allocations. @@ -81,37 +74,33 @@ class HeapRegionSeq: public CHeapObj { // The number of regions for which we have allocated HeapRegions for. uint _allocated_length; - // The maximum number of regions in the heap. - uint _max_length; - // Find a contiguous set of empty regions of length num, starting // from the given index. uint find_contiguous_from(uint from, uint num); - // Map a heap address to a biased region index. Assume that the - // address is valid. - inline uintx addr_to_index_biased(HeapWord* addr) const; - void increment_allocated_length() { - assert(_allocated_length < _max_length, "pre-condition"); + assert(_allocated_length < max_length(), "pre-condition"); _allocated_length++; } void increment_length() { - assert(_length < _max_length, "pre-condition"); - _length++; + assert(length() < max_length(), "pre-condition"); + _committed_length++; } void decrement_length() { - assert(_length > 0, "pre-condition"); - _length--; + assert(length() > 0, "pre-condition"); + _committed_length--; } + HeapWord* heap_bottom() const { return _regions.bottom_address_mapped(); } + HeapWord* heap_end() const {return _regions.end_address_mapped(); } + public: // Empty contructor, we'll initialize it with the initialize() method. - HeapRegionSeq() { } + HeapRegionSeq() : _regions(), _committed_length(0), _next_search_index(0), _allocated_length(0) { } - void initialize(HeapWord* bottom, HeapWord* end, uint max_length); + void initialize(HeapWord* bottom, HeapWord* end); // Return the HeapRegion at the given index. Assume that the index // is valid. @@ -126,10 +115,10 @@ class HeapRegionSeq: public CHeapObj { inline HeapRegion* addr_to_region_unsafe(HeapWord* addr) const; // Return the number of regions that have been committed in the heap. - uint length() const { return _length; } + uint length() const { return _committed_length; } // Return the maximum number of regions in the heap. - uint max_length() const { return _max_length; } + uint max_length() const { return (uint)_regions.length(); } // Expand the sequence to reflect that the heap has grown from // old_end to new_end. Either create new HeapRegions, or re-use diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp index e840287edc7..96588dea042 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp @@ -28,28 +28,16 @@ #include "gc_implementation/g1/heapRegion.hpp" #include "gc_implementation/g1/heapRegionSeq.hpp" -inline uintx HeapRegionSeq::addr_to_index_biased(HeapWord* addr) const { - assert(_heap_bottom <= addr && addr < _heap_end, - err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT" end: "PTR_FORMAT, - addr, _heap_bottom, _heap_end)); - uintx index = (uintx) addr >> _region_shift; - return index; -} - inline HeapRegion* HeapRegionSeq::addr_to_region_unsafe(HeapWord* addr) const { - assert(_heap_bottom <= addr && addr < _heap_end, - err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT" end: "PTR_FORMAT, - addr, _heap_bottom, _heap_end)); - uintx index_biased = addr_to_index_biased(addr); - HeapRegion* hr = _regions_biased[index_biased]; + HeapRegion* hr = _regions.get_by_address(addr); assert(hr != NULL, "invariant"); return hr; } inline HeapRegion* HeapRegionSeq::addr_to_region(HeapWord* addr) const { - if (addr != NULL && addr < _heap_end) { - assert(addr >= _heap_bottom, - err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT, addr, _heap_bottom)); + if (addr != NULL && addr < heap_end()) { + assert(addr >= heap_bottom(), + err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT, addr, heap_bottom())); return addr_to_region_unsafe(addr); } return NULL; @@ -57,7 +45,7 @@ inline HeapRegion* HeapRegionSeq::addr_to_region(HeapWord* addr) const { inline HeapRegion* HeapRegionSeq::at(uint index) const { assert(index < length(), "pre-condition"); - HeapRegion* hr = _regions[index]; + HeapRegion* hr = _regions.get_by_index(index); assert(hr != NULL, "sanity"); assert(hr->hrs_index() == index, "sanity"); return hr; diff --git a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp index 958317166ea..e39e38277c7 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp @@ -80,6 +80,10 @@ public: void reset() { if (_buf != NULL) _index = _sz; } + void enqueue(volatile void* ptr) { + enqueue((void*)(ptr)); + } + // Enqueues the given "obj". void enqueue(void* ptr) { if (!_active) return; diff --git a/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp b/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp index 736c2d75096..9268eb78ef4 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp @@ -34,8 +34,14 @@ static_field(HeapRegion, GrainBytes, size_t) \ static_field(HeapRegion, LogOfHRGrainBytes, int) \ \ - nonstatic_field(HeapRegionSeq, _regions, HeapRegion**) \ - nonstatic_field(HeapRegionSeq, _length, uint) \ + nonstatic_field(G1HeapRegionTable, _base, address) \ + nonstatic_field(G1HeapRegionTable, _length, size_t) \ + nonstatic_field(G1HeapRegionTable, _biased_base, address) \ + nonstatic_field(G1HeapRegionTable, _bias, size_t) \ + nonstatic_field(G1HeapRegionTable, _shift_by, uint) \ + \ + nonstatic_field(HeapRegionSeq, _regions, G1HeapRegionTable) \ + nonstatic_field(HeapRegionSeq, _committed_length, uint) \ \ nonstatic_field(G1CollectedHeap, _hrs, HeapRegionSeq) \ nonstatic_field(G1CollectedHeap, _g1_committed, MemRegion) \ @@ -58,6 +64,8 @@ #define VM_TYPES_G1(declare_type, declare_toplevel_type) \ \ + declare_toplevel_type(G1HeapRegionTable) \ + \ declare_type(G1CollectedHeap, SharedHeap) \ \ declare_type(HeapRegion, ContiguousSpace) \ diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp index a1eb3130bc6..1d4ef410c34 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp @@ -1103,7 +1103,7 @@ void ParNewGeneration::waste_some_time() { } } -static const oop ClaimedForwardPtr = oop(0x4); +static const oop ClaimedForwardPtr = cast_to_oop(0x4); // Because of concurrency, there are times where an object for which // "is_forwarded()" is true contains an "interim" forwarding pointer @@ -1226,7 +1226,7 @@ oop ParNewGeneration::copy_to_survivor_space_avoiding_promotion_undo( if (TraceScavenge) { gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", is_in_reserved(new_obj) ? "copying" : "tenuring", - new_obj->klass()->internal_name(), old, new_obj, new_obj->size()); + new_obj->klass()->internal_name(), (void *)old, (void *)new_obj, new_obj->size()); } #endif @@ -1347,7 +1347,7 @@ oop ParNewGeneration::copy_to_survivor_space_with_undo( if (TraceScavenge) { gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", is_in_reserved(new_obj) ? "copying" : "tenuring", - new_obj->klass()->internal_name(), old, new_obj, new_obj->size()); + new_obj->klass()->internal_name(), (void *)old, (void *)new_obj, new_obj->size()); } #endif @@ -1436,7 +1436,7 @@ bool ParNewGeneration::should_simulate_overflow() { // (although some performance comparisons would be useful since // single global lists have their own performance disadvantages // as we were made painfully aware not long ago, see 6786503). -#define BUSY (oop(0x1aff1aff)) +#define BUSY (cast_to_oop(0x1aff1aff)) void ParNewGeneration::push_on_overflow_list(oop from_space_obj, ParScanThreadState* par_scan_state) { assert(is_in_reserved(from_space_obj), "Should be from this generation"); if (ParGCUseLocalOverflow) { @@ -1512,7 +1512,7 @@ bool ParNewGeneration::take_from_overflow_list_work(ParScanThreadState* par_scan if (_overflow_list == NULL) return false; // Otherwise, there was something there; try claiming the list. - oop prefix = (oop)Atomic::xchg_ptr(BUSY, &_overflow_list); + oop prefix = cast_to_oop(Atomic::xchg_ptr(BUSY, &_overflow_list)); // Trim off a prefix of at most objsFromOverflow items Thread* tid = Thread::current(); size_t spin_count = (size_t)ParallelGCThreads; @@ -1526,7 +1526,7 @@ bool ParNewGeneration::take_from_overflow_list_work(ParScanThreadState* par_scan return false; } else if (_overflow_list != BUSY) { // try and grab the prefix - prefix = (oop)Atomic::xchg_ptr(BUSY, &_overflow_list); + prefix = cast_to_oop(Atomic::xchg_ptr(BUSY, &_overflow_list)); } } if (prefix == NULL || prefix == BUSY) { diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp index 38f61fbefd2..383a579bec9 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -84,7 +84,7 @@ inline void ParScanClosure::do_oop_work(T* p, Space* sp = gch->space_containing(p); oop obj = oop(sp->block_start(p)); assert((HeapWord*)obj < (HeapWord*)p, "Error"); - tty->print_cr("Object: " PTR_FORMAT, obj); + tty->print_cr("Object: " PTR_FORMAT, (void *)obj); tty->print_cr("-------"); obj->print(); tty->print_cr("-----"); @@ -110,7 +110,7 @@ inline void ParScanClosure::do_oop_work(T* p, if (TraceScavenge) { gclog_or_tty->print_cr("{%s %s ( " PTR_FORMAT " ) " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", "forwarded ", - new_obj->klass()->internal_name(), p, obj, new_obj, new_obj->size()); + new_obj->klass()->internal_name(), p, (void *)obj, (void *)new_obj, new_obj->size()); } #endif diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp index e5637687e84..f7be7671ff9 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp @@ -40,10 +40,8 @@ class GenerationSizer : public TwoGenerationCollectorPolicy { void initialize_flags() { // Do basic sizing work - this->TwoGenerationCollectorPolicy::initialize_flags(); + TwoGenerationCollectorPolicy::initialize_flags(); - // If the user hasn't explicitly set the number of worker - // threads, set the count. assert(UseSerialGC || !FLAG_IS_DEFAULT(ParallelGCThreads) || (ParallelGCThreads > 0), diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp index 7fba4f35813..8d411811b3c 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp @@ -23,7 +23,6 @@ */ #include "precompiled.hpp" -#include "gc_implementation/parallelScavenge/generationSizer.hpp" #include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" #include "gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp" #include "gc_implementation/parallelScavenge/psScavenge.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp index b0cb8c7efbf..d88af2bf6ef 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp @@ -53,7 +53,6 @@ // Forward decls class elapsedTimer; -class GenerationSizer; class PSAdaptiveSizePolicy : public AdaptiveSizePolicy { friend class PSGCAdaptivePolicyCounters; diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp index dcdc21806af..5cbd2b4f66a 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp @@ -26,7 +26,6 @@ #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "code/codeCache.hpp" -#include "gc_implementation/parallelScavenge/generationSizer.hpp" #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" #include "gc_implementation/parallelScavenge/psMarkSweep.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp index 27a42de95a6..bd3be226773 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp @@ -27,7 +27,6 @@ #include "classfile/systemDictionary.hpp" #include "code/codeCache.hpp" #include "gc_implementation/parallelScavenge/gcTaskManager.hpp" -#include "gc_implementation/parallelScavenge/generationSizer.hpp" #include "gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp" #include "gc_implementation/parallelScavenge/pcTasks.hpp" #include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp index dd3933b0009..e8a88cb3518 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp @@ -333,7 +333,7 @@ oop PSPromotionManager::oop_promotion_failed(oop obj, markOop obj_mark) { gclog_or_tty->print_cr("{%s %s 0x%x (%d)}", "promotion-failure", obj->klass()->internal_name(), - obj, obj->size()); + (void *)obj, obj->size()); } #endif diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp index 6707ade2d17..69292400f33 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp @@ -126,7 +126,7 @@ class PSPromotionManager VALUE_OBJ_CLASS_SPEC { oop* mask_chunked_array_oop(oop obj) { assert(!is_oop_masked((oop*) obj), "invariant"); - oop* ret = (oop*) ((uintptr_t)obj | PS_CHUNKED_ARRAY_OOP_MASK); + oop* ret = (oop*) (cast_from_oop(obj) | PS_CHUNKED_ARRAY_OOP_MASK); assert(is_oop_masked(ret), "invariant"); return ret; } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp index 34c935408d8..92c97e06174 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp @@ -225,7 +225,7 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) { if (TraceScavenge) { gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", PSScavenge::should_scavenge(&new_obj) ? "copying" : "tenuring", - new_obj->klass()->internal_name(), o, new_obj, new_obj->size()); + new_obj->klass()->internal_name(), (void *)o, (void *)new_obj, new_obj->size()); } #endif diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp index 60c0267bbe3..026b1a09506 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp @@ -27,7 +27,6 @@ #include "code/codeCache.hpp" #include "gc_implementation/parallelScavenge/cardTableExtension.hpp" #include "gc_implementation/parallelScavenge/gcTaskManager.hpp" -#include "gc_implementation/parallelScavenge/generationSizer.hpp" #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/psAdaptiveSizePolicy.hpp" #include "gc_implementation/parallelScavenge/psMarkSweep.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp index e67dedf98d4..0835f4f1f84 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,7 +81,7 @@ inline void PSScavenge::copy_and_push_safe_barrier(PSPromotionManager* pm, if (TraceScavenge && o->is_forwarded()) { gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", "forwarding", - new_obj->klass()->internal_name(), o, new_obj, new_obj->size()); + new_obj->klass()->internal_name(), (void *)o, (void *)new_obj, new_obj->size()); } #endif diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp index 31e6bddf421..6f535034346 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp @@ -211,7 +211,7 @@ void VM_CollectForMetadataAllocation::doit() { // a GC that freed space for the allocation. if (!MetadataAllocationFailALot) { _result = _loader_data->metaspace_non_null()->allocate(_size, _mdtype); - } + } if (_result == NULL) { if (UseConcMarkSweepGC) { @@ -223,9 +223,7 @@ void VM_CollectForMetadataAllocation::doit() { _loader_data->metaspace_non_null()->expand_and_allocate(_size, _mdtype); } if (_result == NULL) { - // Don't clear the soft refs. This GC is for reclaiming metadata - // and is unrelated to the fullness of the Java heap which should - // be the criteria for clearing SoftReferences. + // Don't clear the soft refs yet. if (Verbose && PrintGCDetails && UseConcMarkSweepGC) { gclog_or_tty->print_cr("\nCMS full GC for Metaspace"); } @@ -235,7 +233,7 @@ void VM_CollectForMetadataAllocation::doit() { _result = _loader_data->metaspace_non_null()->allocate(_size, _mdtype); } - if (_result == NULL && !UseConcMarkSweepGC /* CMS already tried */) { + if (_result == NULL) { // If still failing, allow the Metaspace to expand. // See delta_capacity_until_GC() for explanation of the // amount of the expansion. @@ -243,7 +241,16 @@ void VM_CollectForMetadataAllocation::doit() { // or a MaxMetaspaceSize has been specified on the command line. _result = _loader_data->metaspace_non_null()->expand_and_allocate(_size, _mdtype); - + if (_result == NULL) { + // If expansion failed, do a last-ditch collection and try allocating + // again. A last-ditch collection will clear softrefs. This + // behavior is similar to the last-ditch collection done for perm + // gen when it was full and a collection for failed allocation + // did not free perm gen space. + heap->collect_as_vm_thread(GCCause::_last_ditch_collection); + _result = + _loader_data->metaspace_non_null()->allocate(_size, _mdtype); + } } if (Verbose && PrintGCDetails && _result == NULL) { gclog_or_tty->print_cr("\nAfter Metaspace GC failed to allocate size " diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp index 60b3a9679c1..82cbf231fa6 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp @@ -214,9 +214,6 @@ class VM_CollectForMetadataAllocation: public VM_GC_Operation { : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true), _loader_data(loader_data), _size(size), _mdtype(mdtype), _result(NULL) { } - ~VM_CollectForMetadataAllocation() { - MetaspaceGC::set_expand_after_GC(false); - } virtual VMOp_Type type() const { return VMOp_CollectForMetadataAllocation; } virtual void doit(); MetaWord* result() const { return _result; } diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp index 3f5364b79c0..bbf5419fd0f 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp @@ -202,12 +202,6 @@ void CollectedHeap::collect_as_vm_thread(GCCause::Cause cause) { ShouldNotReachHere(); // Unexpected use of this function } } -MetaWord* CollectedHeap::satisfy_failed_metadata_allocation( - ClassLoaderData* loader_data, - size_t size, Metaspace::MetadataType mdtype) { - return collector_policy()->satisfy_failed_metadata_allocation(loader_data, size, mdtype); -} - void CollectedHeap::pre_initialize() { // Used for ReduceInitialCardMarks (when COMPILER2 is used); diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp index c26ca77a8b8..1e60ed116d8 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp @@ -475,11 +475,6 @@ class CollectedHeap : public CHeapObj { // the context of the vm thread. virtual void collect_as_vm_thread(GCCause::Cause cause); - // Callback from VM_CollectForMetadataAllocation operation. - MetaWord* satisfy_failed_metadata_allocation(ClassLoaderData* loader_data, - size_t size, - Metaspace::MetadataType mdtype); - // Returns the barrier set for this heap BarrierSet* barrier_set() { return _barrier_set; } diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp index 77471ad3d5f..0ebfd1cdf13 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -30,11 +30,8 @@ #include "runtime/thread.inline.hpp" #include "runtime/vmThread.hpp" #include "utilities/top.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "interp_masm_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "interp_masm_x86_64.hpp" +#ifdef TARGET_ARCH_x86 +# include "interp_masm_x86.hpp" #endif #ifdef TARGET_ARCH_MODEL_sparc # include "interp_masm_sparc.hpp" @@ -161,8 +158,8 @@ class AbstractInterpreter: AllStatic { // Runtime support // length = invoke bytecode length (to advance to next bytecode) - static address deopt_entry (TosState state, int length) { ShouldNotReachHere(); return NULL; } - static address return_entry (TosState state, int length) { ShouldNotReachHere(); return NULL; } + static address deopt_entry(TosState state, int length) { ShouldNotReachHere(); return NULL; } + static address return_entry(TosState state, int length, Bytecodes::Code code) { ShouldNotReachHere(); return NULL; } static address rethrow_exception_entry() { return _rethrow_exception_entry; } diff --git a/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp b/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp index ac490ec4449..37ac6d1a6e4 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp @@ -215,7 +215,7 @@ void print_oop(oop value, outputStream* st) { st->print_cr(" %s", buf); } } else { - st->print_cr(" " PTR_FORMAT, (intptr_t) value); + st->print_cr(" " PTR_FORMAT, (void *)value); } } diff --git a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp index 4997a443257..71f78840b95 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp @@ -78,7 +78,7 @@ class CppInterpreter: public AbstractInterpreter { static address stack_result_to_stack(int index) { return _stack_to_stack[index]; } static address stack_result_to_native(int index) { return _stack_to_native_abi[index]; } - static address return_entry (TosState state, int length); + static address return_entry (TosState state, int length, Bytecodes::Code code); static address deopt_entry (TosState state, int length); #ifdef TARGET_ARCH_x86 diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp index dfd8b5b145a..60246e9013d 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.cpp +++ b/hotspot/src/share/vm/interpreter/interpreter.cpp @@ -329,15 +329,21 @@ void AbstractInterpreter::print_method_kind(MethodKind kind) { //------------------------------------------------------------------------------------------------------------------------ // Deoptimization support -// If deoptimization happens, this function returns the point of next bytecode to continue execution +/** + * If a deoptimization happens, this function returns the point of next bytecode to continue execution. + */ address AbstractInterpreter::deopt_continue_after_entry(Method* method, address bcp, int callee_parameters, bool is_top_frame) { assert(method->contains(bcp), "just checkin'"); - Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); + + // Get the original and rewritten bytecode. + Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); assert(!Interpreter::bytecode_should_reexecute(code), "should not reexecute"); - int bci = method->bci_from(bcp); - int length = -1; // initial value for debugging + + const int bci = method->bci_from(bcp); + // compute continuation length - length = Bytecodes::length_at(method, bcp); + const int length = Bytecodes::length_at(method, bcp); + // compute result type BasicType type = T_ILLEGAL; @@ -393,7 +399,7 @@ address AbstractInterpreter::deopt_continue_after_entry(Method* method, address return is_top_frame ? Interpreter::deopt_entry (as_TosState(type), length) - : Interpreter::return_entry(as_TosState(type), length); + : Interpreter::return_entry(as_TosState(type), length, code); } // If deoptimization happens, this function returns the point where the interpreter reexecutes diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp index 44ac9e0862d..f88dd153394 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp @@ -158,6 +158,22 @@ CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass) { index = vt->index_of_miranda(resolved_method->name(), resolved_method->signature()); kind = CallInfo::vtable_call; + } else if (resolved_method->has_vtable_index()) { + // Can occur if an interface redeclares a method of Object. + +#ifdef ASSERT + // Ensure that this is really the case. + KlassHandle object_klass = SystemDictionary::Object_klass(); + Method * object_resolved_method = object_klass()->vtable()->method_at(index); + assert(object_resolved_method->name() == resolved_method->name(), + err_msg("Object and interface method names should match at vtable index %d, %s != %s", + index, object_resolved_method->name()->as_C_string(), resolved_method->name()->as_C_string())); + assert(object_resolved_method->signature() == resolved_method->signature(), + err_msg("Object and interface method signatures should match at vtable index %d, %s != %s", + index, object_resolved_method->signature()->as_C_string(), resolved_method->signature()->as_C_string())); +#endif // ASSERT + + kind = CallInfo::vtable_call; } else { // A regular interface call. kind = CallInfo::itable_call; @@ -222,8 +238,17 @@ void LinkResolver::resolve_klass(KlassHandle& result, constantPoolHandle pool, i // // According to JVM spec. $5.4.3c & $5.4.3d +// Look up method in klasses, including static methods +// Then look up local default methods void LinkResolver::lookup_method_in_klasses(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS) { Method* result_oop = klass->uncached_lookup_method(name, signature); + if (result_oop == NULL) { + Array* default_methods = InstanceKlass::cast(klass())->default_methods(); + if (default_methods != NULL) { + result_oop = InstanceKlass::find_method(default_methods, name, signature); + } + } + if (EnableInvokeDynamic && result_oop != NULL) { vmIntrinsics::ID iid = result_oop->intrinsic_id(); if (MethodHandles::is_signature_polymorphic(iid)) { @@ -235,20 +260,46 @@ void LinkResolver::lookup_method_in_klasses(methodHandle& result, KlassHandle kl } // returns first instance method +// Looks up method in classes, then looks up local default methods void LinkResolver::lookup_instance_method_in_klasses(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS) { Method* result_oop = klass->uncached_lookup_method(name, signature); result = methodHandle(THREAD, result_oop); - while (!result.is_null() && result->is_static()) { + while (!result.is_null() && result->is_static() && result->method_holder()->super() != NULL) { klass = KlassHandle(THREAD, result->method_holder()->super()); result = methodHandle(THREAD, klass->uncached_lookup_method(name, signature)); } + + if (result.is_null()) { + Array* default_methods = InstanceKlass::cast(klass())->default_methods(); + if (default_methods != NULL) { + result = methodHandle(InstanceKlass::find_method(default_methods, name, signature)); + assert(result.is_null() || !result->is_static(), "static defaults not allowed"); + } + } } +int LinkResolver::vtable_index_of_interface_method(KlassHandle klass, + methodHandle resolved_method, TRAPS) { -int LinkResolver::vtable_index_of_miranda_method(KlassHandle klass, Symbol* name, Symbol* signature, TRAPS) { - ResourceMark rm(THREAD); - klassVtable *vt = InstanceKlass::cast(klass())->vtable(); - return vt->index_of_miranda(name, signature); + int vtable_index = Method::invalid_vtable_index; + Symbol* name = resolved_method->name(); + Symbol* signature = resolved_method->signature(); + + // First check in default method array + if (!resolved_method->is_abstract() && + (InstanceKlass::cast(klass())->default_methods() != NULL)) { + int index = InstanceKlass::find_method_index(InstanceKlass::cast(klass())->default_methods(), name, signature); + if (index >= 0 ) { + vtable_index = InstanceKlass::cast(klass())->default_vtable_indices()->at(index); + } + } + if (vtable_index == Method::invalid_vtable_index) { + // get vtable_index for miranda methods + ResourceMark rm(THREAD); + klassVtable *vt = InstanceKlass::cast(klass())->vtable(); + vtable_index = vt->index_of_miranda(name, signature); + } + return vtable_index; } void LinkResolver::lookup_method_in_interfaces(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS) { @@ -367,18 +418,28 @@ void LinkResolver::check_method_accessability(KlassHandle ref_klass, AccessFlags flags = sel_method->access_flags(); - // Special case: arrays always override "clone". JVMS 2.15. + // Special case #1: arrays always override "clone". JVMS 2.15. // If the resolved klass is an array class, and the declaring class // is java.lang.Object and the method is "clone", set the flags // to public. + // Special case #2: If the resolved klass is an interface, and + // the declaring class is java.lang.Object, and the method is + // "clone" or "finalize", set the flags to public. If the + // resolved interface does not contain "clone" or "finalize" + // methods, the method/interface method resolution looks to + // the interface's super class, java.lang.Object. With JDK 8 + // interface accessability check requirement, special casing + // this scenario is necessary to avoid an IAE. // - // We'll check for the method name first, as that's most likely - // to be false (so we'll short-circuit out of these tests). - if (sel_method->name() == vmSymbols::clone_name() && - sel_klass() == SystemDictionary::Object_klass() && - resolved_klass->oop_is_array()) { + // We'll check for each method name first and then java.lang.Object + // to best short-circuit out of these tests. + if (((sel_method->name() == vmSymbols::clone_name() && + (resolved_klass->oop_is_array() || resolved_klass->is_interface())) || + (sel_method->name() == vmSymbols::finalize_method_name() && + resolved_klass->is_interface())) && + sel_klass() == SystemDictionary::Object_klass()) { // We need to change "protected" to "public". - assert(flags.is_protected(), "clone not protected?"); + assert(flags.is_protected(), "clone or finalize not protected?"); jint new_flags = flags.as_int(); new_flags = new_flags & (~JVM_ACC_PROTECTED); new_flags = new_flags | JVM_ACC_PUBLIC; @@ -419,7 +480,7 @@ void LinkResolver::resolve_method_statically(methodHandle& resolved_method, Klas Symbol* method_name = vmSymbols::invoke_name(); Symbol* method_signature = pool->signature_ref_at(index); KlassHandle current_klass(THREAD, pool->pool_holder()); - resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, CHECK); + resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, false, CHECK); return; } @@ -441,22 +502,34 @@ void LinkResolver::resolve_method_statically(methodHandle& resolved_method, Klas if (code == Bytecodes::_invokeinterface) { resolve_interface_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, CHECK); + } else if (code == Bytecodes::_invokevirtual) { + resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, true, CHECK); } else { - resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, CHECK); + resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, false, CHECK); } } void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, - KlassHandle current_klass, bool check_access, TRAPS) { + KlassHandle current_klass, bool check_access, + bool require_methodref, TRAPS) { Handle nested_exception; - // 1. lookup method in resolved klass and its super klasses + // 1. check if methodref required, that resolved_klass is not interfacemethodref + if (require_methodref && resolved_klass->is_interface()) { + ResourceMark rm(THREAD); + char buf[200]; + jio_snprintf(buf, sizeof(buf), "Found interface %s, but class was expected", + resolved_klass()->external_name()); + THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); + } + + // 2. lookup method in resolved klass and its super klasses lookup_method_in_klasses(resolved_method, resolved_klass, method_name, method_signature, CHECK); if (resolved_method.is_null()) { // not found in the class hierarchy - // 2. lookup method in all the interfaces implemented by the resolved klass + // 3. lookup method in all the interfaces implemented by the resolved klass lookup_method_in_interfaces(resolved_method, resolved_klass, method_name, method_signature, CHECK); if (resolved_method.is_null()) { @@ -470,7 +543,7 @@ void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle res } if (resolved_method.is_null()) { - // 3. method lookup failed + // 4. method lookup failed ResourceMark rm(THREAD); THROW_MSG_CAUSE(vmSymbols::java_lang_NoSuchMethodError(), Method::name_and_sig_as_C_string(resolved_klass(), @@ -480,15 +553,6 @@ void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle res } } - // 4. check if klass is not interface - if (resolved_klass->is_interface() && resolved_method->is_abstract()) { - ResourceMark rm(THREAD); - char buf[200]; - jio_snprintf(buf, sizeof(buf), "Found interface %s, but class was expected", - resolved_klass()->external_name()); - THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); - } - // 5. check if method is concrete if (resolved_method->is_abstract() && !resolved_klass->is_abstract()) { ResourceMark rm(THREAD); @@ -573,6 +637,16 @@ void LinkResolver::resolve_interface_method(methodHandle& resolved_method, } if (check_access) { + // JDK8 adds non-public interface methods, and accessability check requirement + assert(current_klass.not_null() , "current_klass should not be null"); + + // check if method can be accessed by the referring class + check_method_accessability(current_klass, + resolved_klass, + KlassHandle(THREAD, resolved_method->method_holder()), + resolved_method, + CHECK); + HandleMark hm(THREAD); Handle loader (THREAD, InstanceKlass::cast(current_klass())->class_loader()); Handle class_loader (THREAD, resolved_method->method_holder()->class_loader()); @@ -604,6 +678,26 @@ void LinkResolver::resolve_interface_method(methodHandle& resolved_method, } } } + + if (TraceItables && Verbose) { + ResourceMark rm(THREAD); + tty->print("invokeinterface resolved method: caller-class:%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ", + (current_klass.is_null() ? "" : current_klass->internal_name()), + (resolved_klass.is_null() ? "" : resolved_klass->internal_name()), + Method::name_and_sig_as_C_string(resolved_klass(), + resolved_method->name(), + resolved_method->signature()), + resolved_method->method_holder()->internal_name() + ); + resolved_method->access_flags().print_on(tty); + if (resolved_method->is_default_method()) { + tty->print("default"); + } + if (resolved_method->is_overpass()) { + tty->print("overpass"); + } + tty->cr(); + } } //------------------------------------------------------------------------------------------------------------------------ @@ -768,7 +862,7 @@ void LinkResolver::linktime_resolve_static_method(methodHandle& resolved_method, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS) { - resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, CHECK); + resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, false, CHECK); assert(resolved_method->name() != vmSymbols::class_initializer_name(), "should have been checked in verifier"); // check if static @@ -795,28 +889,14 @@ void LinkResolver::linktime_resolve_special_method(methodHandle& resolved_method Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS) { - if (resolved_klass->is_interface() && current_klass() != NULL) { - // If the target class is a direct interface, treat this as a "super" - // default call. - // - // If the current method is an overpass that happens to call a direct - // super-interface's method, then we'll end up rerunning the default method - // analysis even though we don't need to, but that's ok since it will end - // up with the same answer. - InstanceKlass* ik = InstanceKlass::cast(current_klass()); - Array* interfaces = ik->local_interfaces(); - int num_interfaces = interfaces->length(); - for (int index = 0; index < num_interfaces; index++) { - if (interfaces->at(index) == resolved_klass()) { - Method* method = DefaultMethods::find_super_default(current_klass(), - resolved_klass(), method_name, method_signature, CHECK); - resolved_method = methodHandle(THREAD, method); - return; - } - } - } + // Invokespecial is called for multiple special reasons: + // + // local private method invocation, for classes and interfaces + // superclass.method, which can also resolve to a default method + // and the selected method is recalculated relative to the direct superclass + // superinterface.method, which explicitly does not check shadowing - resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, CHECK); + resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, false, CHECK); // check if method name is , that it is found in same klass as static type if (resolved_method->name() == vmSymbols::object_initializer_name() && @@ -844,6 +924,26 @@ void LinkResolver::linktime_resolve_special_method(methodHandle& resolved_method resolved_method->signature())); THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } + + if (TraceItables && Verbose) { + ResourceMark rm(THREAD); + tty->print("invokespecial resolved method: caller-class:%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ", + (current_klass.is_null() ? "" : current_klass->internal_name()), + (resolved_klass.is_null() ? "" : resolved_klass->internal_name()), + Method::name_and_sig_as_C_string(resolved_klass(), + resolved_method->name(), + resolved_method->signature()), + resolved_method->method_holder()->internal_name() + ); + resolved_method->access_flags().print_on(tty); + if (resolved_method->is_default_method()) { + tty->print("default"); + } + if (resolved_method->is_overpass()) { + tty->print("overpass"); + } + tty->cr(); + } } // throws runtime exceptions @@ -851,23 +951,24 @@ void LinkResolver::runtime_resolve_special_method(CallInfo& result, methodHandle KlassHandle current_klass, bool check_access, TRAPS) { // resolved method is selected method unless we have an old-style lookup + // for a superclass method + // Invokespecial for a superinterface, resolved method is selected method, + // no checks for shadowing methodHandle sel_method(THREAD, resolved_method()); // check if this is an old-style super call and do a new lookup if so { KlassHandle method_klass = KlassHandle(THREAD, resolved_method->method_holder()); - const bool direct_calling_default_method = - resolved_klass() != NULL && resolved_method() != NULL && - resolved_klass->is_interface() && !resolved_method->is_abstract(); - - if (!direct_calling_default_method && - check_access && + if (check_access && // a) check if ACC_SUPER flag is set for the current class (current_klass->is_super() || !AllowNonVirtualCalls) && - // b) check if the method class is a superclass of the current class (superclass relation is not reflexive!) - current_klass->is_subtype_of(method_klass()) && - current_klass() != method_klass() && + // b) check if the class of the resolved_klass is a superclass + // (not supertype in order to exclude interface classes) of the current class. + // This check is not performed for super.invoke for interface methods + // in super interfaces. + current_klass->is_subclass_of(resolved_klass()) && + current_klass() != resolved_klass() && // c) check if the method is not resolved_method->name() != vmSymbols::object_initializer_name()) { // Lookup super method @@ -905,6 +1006,25 @@ void LinkResolver::runtime_resolve_special_method(CallInfo& result, methodHandle sel_method->signature())); } + if (TraceItables && Verbose) { + ResourceMark rm(THREAD); + tty->print("invokespecial selected method: resolved-class:%s, method:%s, method_holder:%s, access_flags: ", + (resolved_klass.is_null() ? "" : resolved_klass->internal_name()), + Method::name_and_sig_as_C_string(resolved_klass(), + sel_method->name(), + sel_method->signature()), + sel_method->method_holder()->internal_name() + ); + sel_method->access_flags().print_on(tty); + if (sel_method->is_default_method()) { + tty->print("default"); + } + if (sel_method->is_overpass()) { + tty->print("overpass"); + } + tty->cr(); + } + // setup result result.set_static(resolved_klass, sel_method, CHECK); } @@ -922,11 +1042,23 @@ void LinkResolver::linktime_resolve_virtual_method(methodHandle &resolved_method Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS) { // normal method resolution - resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, CHECK); + resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, true, CHECK); assert(resolved_method->name() != vmSymbols::object_initializer_name(), "should have been checked in verifier"); assert(resolved_method->name() != vmSymbols::class_initializer_name (), "should have been checked in verifier"); + // check if private interface method + if (resolved_klass->is_interface() && resolved_method->is_private()) { + ResourceMark rm(THREAD); + char buf[200]; + jio_snprintf(buf, sizeof(buf), "private interface method requires invokespecial, not invokevirtual: method %s, caller-class:%s", + Method::name_and_sig_as_C_string(resolved_klass(), + resolved_method->name(), + resolved_method->signature()), + (current_klass.is_null() ? "" : current_klass->internal_name())); + THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); + } + // check if not static if (resolved_method->is_static()) { ResourceMark rm(THREAD); @@ -936,6 +1068,26 @@ void LinkResolver::linktime_resolve_virtual_method(methodHandle &resolved_method resolved_method->signature())); THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } + + if (PrintVtables && Verbose) { + ResourceMark rm(THREAD); + tty->print("invokevirtual resolved method: caller-class:%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ", + (current_klass.is_null() ? "" : current_klass->internal_name()), + (resolved_klass.is_null() ? "" : resolved_klass->internal_name()), + Method::name_and_sig_as_C_string(resolved_klass(), + resolved_method->name(), + resolved_method->signature()), + resolved_method->method_holder()->internal_name() + ); + resolved_method->access_flags().print_on(tty); + if (resolved_method->is_default_method()) { + tty->print("default"); + } + if (resolved_method->is_overpass()) { + tty->print("overpass"); + } + tty->cr(); + } } // throws runtime exceptions @@ -965,10 +1117,8 @@ void LinkResolver::runtime_resolve_virtual_method(CallInfo& result, // do lookup based on receiver klass using the vtable index if (resolved_method->method_holder()->is_interface()) { // miranda method - vtable_index = vtable_index_of_miranda_method(resolved_klass, - resolved_method->name(), - resolved_method->signature(), CHECK); - + vtable_index = vtable_index_of_interface_method(resolved_klass, + resolved_method, CHECK); assert(vtable_index >= 0 , "we should have valid vtable index at this point"); InstanceKlass* inst = InstanceKlass::cast(recv_klass()); @@ -1012,6 +1162,26 @@ void LinkResolver::runtime_resolve_virtual_method(CallInfo& result, selected_method->signature())); } + if (PrintVtables && Verbose) { + ResourceMark rm(THREAD); + tty->print("invokevirtual selected method: receiver-class:%s, resolved-class:%s, method:%s, method_holder:%s, vtable_index:%d, access_flags: ", + (recv_klass.is_null() ? "" : recv_klass->internal_name()), + (resolved_klass.is_null() ? "" : resolved_klass->internal_name()), + Method::name_and_sig_as_C_string(resolved_klass(), + resolved_method->name(), + resolved_method->signature()), + selected_method->method_holder()->internal_name(), + vtable_index + ); + selected_method->access_flags().print_on(tty); + if (selected_method->is_default_method()) { + tty->print("default"); + } + if (selected_method->is_overpass()) { + tty->print("overpass"); + } + tty->cr(); + } // setup result result.set_virtual(resolved_klass, recv_klass, resolved_method, selected_method, vtable_index, CHECK); } @@ -1042,6 +1212,17 @@ void LinkResolver::runtime_resolve_interface_method(CallInfo& result, methodHand THROW(vmSymbols::java_lang_NullPointerException()); } + // check if private interface method + if (resolved_klass->is_interface() && resolved_method->is_private()) { + ResourceMark rm(THREAD); + char buf[200]; + jio_snprintf(buf, sizeof(buf), "private interface method requires invokespecial, not invokeinterface: method %s", + Method::name_and_sig_as_C_string(resolved_klass(), + resolved_method->name(), + resolved_method->signature())); + THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); + } + // check if receiver klass implements the resolved interface if (!recv_klass->is_subtype_of(resolved_klass())) { ResourceMark rm(THREAD); @@ -1071,27 +1252,13 @@ void LinkResolver::runtime_resolve_interface_method(CallInfo& result, methodHand resolved_method->signature())); } // check access - if (sel_method->method_holder()->is_interface()) { - // Method holder is an interface. Throw Illegal Access Error if sel_method - // is neither public nor private. - if (!(sel_method->is_public() || sel_method->is_private())) { - ResourceMark rm(THREAD); - THROW_MSG(vmSymbols::java_lang_IllegalAccessError(), - Method::name_and_sig_as_C_string(recv_klass(), - sel_method->name(), - sel_method->signature())); - } - } - else { - // Method holder is a class. Throw Illegal Access Error if sel_method - // is not public. - if (!sel_method->is_public()) { - ResourceMark rm(THREAD); - THROW_MSG(vmSymbols::java_lang_IllegalAccessError(), - Method::name_and_sig_as_C_string(recv_klass(), - sel_method->name(), - sel_method->signature())); - } + // Throw Illegal Access Error if sel_method is not public. + if (!sel_method->is_public()) { + ResourceMark rm(THREAD); + THROW_MSG(vmSymbols::java_lang_IllegalAccessError(), + Method::name_and_sig_as_C_string(recv_klass(), + sel_method->name(), + sel_method->signature())); } // check if abstract if (check_null_and_abstract && sel_method->is_abstract()) { @@ -1109,6 +1276,26 @@ void LinkResolver::runtime_resolve_interface_method(CallInfo& result, methodHand return; } int itable_index = resolved_method()->itable_index(); + + if (TraceItables && Verbose) { + ResourceMark rm(THREAD); + tty->print("invokeinterface selected method: receiver-class:%s, resolved-class:%s, method:%s, method_holder:%s, access_flags: ", + (recv_klass.is_null() ? "" : recv_klass->internal_name()), + (resolved_klass.is_null() ? "" : resolved_klass->internal_name()), + Method::name_and_sig_as_C_string(resolved_klass(), + resolved_method->name(), + resolved_method->signature()), + sel_method->method_holder()->internal_name() + ); + sel_method->access_flags().print_on(tty); + if (sel_method->is_default_method()) { + tty->print("default"); + } + if (sel_method->is_overpass()) { + tty->print("overpass"); + } + tty->cr(); + } result.set_interface(resolved_klass, recv_klass, resolved_method, sel_method, itable_index, CHECK); } @@ -1384,7 +1571,7 @@ void LinkResolver::resolve_dynamic_call(CallInfo& result, THREAD); if (HAS_PENDING_EXCEPTION) { if (TraceMethodHandles) { - tty->print_cr("invokedynamic throws BSME for "INTPTR_FORMAT, PENDING_EXCEPTION); + tty->print_cr("invokedynamic throws BSME for "INTPTR_FORMAT, (void *)PENDING_EXCEPTION); PENDING_EXCEPTION->print(); } if (PENDING_EXCEPTION->is_a(SystemDictionary::BootstrapMethodError_klass())) { diff --git a/hotspot/src/share/vm/interpreter/linkResolver.hpp b/hotspot/src/share/vm/interpreter/linkResolver.hpp index 0fb551a23a8..339cb92ba29 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.hpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.hpp @@ -130,14 +130,13 @@ class LinkResolver: AllStatic { static void lookup_polymorphic_method (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, KlassHandle current_klass, Handle *appendix_result_or_null, Handle *method_type_result, TRAPS); - static int vtable_index_of_miranda_method(KlassHandle klass, Symbol* name, Symbol* signature, TRAPS); - + static int vtable_index_of_interface_method(KlassHandle klass, methodHandle resolved_method, TRAPS); static void resolve_klass (KlassHandle& result, constantPoolHandle pool, int index, TRAPS); static void resolve_pool (KlassHandle& resolved_klass, Symbol*& method_name, Symbol*& method_signature, KlassHandle& current_klass, constantPoolHandle pool, int index, TRAPS); static void resolve_interface_method(methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS); - static void resolve_method (methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS); + static void resolve_method (methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, bool require_methodref, TRAPS); static void linktime_resolve_static_method (methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS); static void linktime_resolve_special_method (methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS); diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp index 9f7ed4c7e97..e3e89e8eed9 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp @@ -184,8 +184,9 @@ EntryPoint TemplateInterpreter::_deopt_entry [TemplateInterpreter::number_of_deo EntryPoint TemplateInterpreter::_continuation_entry; EntryPoint TemplateInterpreter::_safept_entry; -address TemplateInterpreter::_return_3_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; -address TemplateInterpreter::_return_5_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; +address TemplateInterpreter::_invoke_return_entry[TemplateInterpreter::number_of_return_addrs]; +address TemplateInterpreter::_invokeinterface_return_entry[TemplateInterpreter::number_of_return_addrs]; +address TemplateInterpreter::_invokedynamic_return_entry[TemplateInterpreter::number_of_return_addrs]; DispatchTable TemplateInterpreter::_active_table; DispatchTable TemplateInterpreter::_normal_table; @@ -237,22 +238,37 @@ void TemplateInterpreterGenerator::generate_all() { #endif // !PRODUCT { CodeletMark cm(_masm, "return entry points"); + const int index_size = sizeof(u2); for (int i = 0; i < Interpreter::number_of_return_entries; i++) { Interpreter::_return_entry[i] = EntryPoint( - generate_return_entry_for(itos, i), - generate_return_entry_for(itos, i), - generate_return_entry_for(itos, i), - generate_return_entry_for(atos, i), - generate_return_entry_for(itos, i), - generate_return_entry_for(ltos, i), - generate_return_entry_for(ftos, i), - generate_return_entry_for(dtos, i), - generate_return_entry_for(vtos, i) + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(atos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(ltos, i, index_size), + generate_return_entry_for(ftos, i, index_size), + generate_return_entry_for(dtos, i, index_size), + generate_return_entry_for(vtos, i, index_size) ); } } + { CodeletMark cm(_masm, "invoke return entry points"); + const TosState states[] = {itos, itos, itos, itos, ltos, ftos, dtos, atos, vtos}; + const int invoke_length = Bytecodes::length_for(Bytecodes::_invokestatic); + const int invokeinterface_length = Bytecodes::length_for(Bytecodes::_invokeinterface); + const int invokedynamic_length = Bytecodes::length_for(Bytecodes::_invokedynamic); + + for (int i = 0; i < Interpreter::number_of_return_addrs; i++) { + TosState state = states[i]; + Interpreter::_invoke_return_entry[i] = generate_return_entry_for(state, invoke_length, sizeof(u2)); + Interpreter::_invokeinterface_return_entry[i] = generate_return_entry_for(state, invokeinterface_length, sizeof(u2)); + Interpreter::_invokedynamic_return_entry[i] = generate_return_entry_for(state, invokedynamic_length, sizeof(u4)); + } + } + { CodeletMark cm(_masm, "earlyret entry points"); Interpreter::_earlyret_entry = EntryPoint( @@ -298,13 +314,6 @@ void TemplateInterpreterGenerator::generate_all() { } } - for (int j = 0; j < number_of_states; j++) { - const TosState states[] = {btos, ctos, stos, itos, ltos, ftos, dtos, atos, vtos}; - int index = Interpreter::TosState_as_index(states[j]); - Interpreter::_return_3_addrs_by_index[index] = Interpreter::return_entry(states[j], 3); - Interpreter::_return_5_addrs_by_index[index] = Interpreter::return_entry(states[j], 5); - } - { CodeletMark cm(_masm, "continuation entry points"); Interpreter::_continuation_entry = EntryPoint( @@ -534,9 +543,46 @@ void TemplateInterpreterGenerator::generate_and_dispatch(Template* t, TosState t //------------------------------------------------------------------------------------------------------------------------ // Entry points -address TemplateInterpreter::return_entry(TosState state, int length) { +/** + * Returns the return entry table for the given invoke bytecode. + */ +address* TemplateInterpreter::invoke_return_entry_table_for(Bytecodes::Code code) { + switch (code) { + case Bytecodes::_invokestatic: + case Bytecodes::_invokespecial: + case Bytecodes::_invokevirtual: + case Bytecodes::_invokehandle: + return Interpreter::invoke_return_entry_table(); + case Bytecodes::_invokeinterface: + return Interpreter::invokeinterface_return_entry_table(); + case Bytecodes::_invokedynamic: + return Interpreter::invokedynamic_return_entry_table(); + default: + fatal(err_msg("invalid bytecode: %s", Bytecodes::name(code))); + return NULL; + } +} + +/** + * Returns the return entry address for the given top-of-stack state and bytecode. + */ +address TemplateInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { guarantee(0 <= length && length < Interpreter::number_of_return_entries, "illegal length"); - return _return_entry[length].entry(state); + const int index = TosState_as_index(state); + switch (code) { + case Bytecodes::_invokestatic: + case Bytecodes::_invokespecial: + case Bytecodes::_invokevirtual: + case Bytecodes::_invokehandle: + return _invoke_return_entry[index]; + case Bytecodes::_invokeinterface: + return _invokeinterface_return_entry[index]; + case Bytecodes::_invokedynamic: + return _invokedynamic_return_entry[index]; + default: + assert(!Bytecodes::is_invoke(code), err_msg("invoke instructions should be handled separately: %s", Bytecodes::name(code))); + return _return_entry[length].entry(state); + } } diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp index 43fe4bdb1c0..838e2e08473 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -120,8 +120,9 @@ class TemplateInterpreter: public AbstractInterpreter { static EntryPoint _continuation_entry; static EntryPoint _safept_entry; - static address _return_3_addrs_by_index[number_of_return_addrs]; // for invokevirtual return entries - static address _return_5_addrs_by_index[number_of_return_addrs]; // for invokeinterface return entries + static address _invoke_return_entry[number_of_return_addrs]; // for invokestatic, invokespecial, invokevirtual return entries + static address _invokeinterface_return_entry[number_of_return_addrs]; // for invokeinterface return entries + static address _invokedynamic_return_entry[number_of_return_addrs]; // for invokedynamic return entries static DispatchTable _active_table; // the active dispatch table (used by the interpreter for dispatch) static DispatchTable _normal_table; // the normal dispatch table (used to set the active table in normal mode) @@ -161,12 +162,15 @@ class TemplateInterpreter: public AbstractInterpreter { static address* normal_table() { return _normal_table.table_for(); } // Support for invokes - static address* return_3_addrs_by_index_table() { return _return_3_addrs_by_index; } - static address* return_5_addrs_by_index_table() { return _return_5_addrs_by_index; } - static int TosState_as_index(TosState state); // computes index into return_3_entry_by_index table + static address* invoke_return_entry_table() { return _invoke_return_entry; } + static address* invokeinterface_return_entry_table() { return _invokeinterface_return_entry; } + static address* invokedynamic_return_entry_table() { return _invokedynamic_return_entry; } + static int TosState_as_index(TosState state); - static address return_entry (TosState state, int length); - static address deopt_entry (TosState state, int length); + static address* invoke_return_entry_table_for(Bytecodes::Code code); + + static address deopt_entry(TosState state, int length); + static address return_entry(TosState state, int length, Bytecodes::Code code); // Safepoint support static void notice_safepoints(); // stops the thread when reaching a safepoint diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp index fb7bdc5b6c2..a80caa96409 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp @@ -53,7 +53,7 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator { address generate_ClassCastException_handler(); address generate_ArrayIndexOutOfBounds_handler(const char* name); address generate_continuation_for(TosState state); - address generate_return_entry_for(TosState state, int step); + address generate_return_entry_for(TosState state, int step, size_t index_size); address generate_earlyret_entry_for(TosState state); address generate_deopt_entry_for(TosState state, int step); address generate_safept_entry_for(TosState state, address runtime_entry); diff --git a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp index 40d05f49b49..11c875ef32d 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.hpp +++ b/hotspot/src/share/vm/interpreter/templateTable.hpp @@ -28,11 +28,8 @@ #include "interpreter/bytecodes.hpp" #include "memory/allocation.hpp" #include "runtime/frame.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "interp_masm_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "interp_masm_x86_64.hpp" +#ifdef TARGET_ARCH_x86 +# include "interp_masm_x86.hpp" #endif #ifdef TARGET_ARCH_MODEL_sparc # include "interp_masm_sparc.hpp" diff --git a/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp b/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp index bfe1d1b4ca8..30b0382992c 100644 --- a/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp +++ b/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp @@ -28,7 +28,6 @@ #include "memory/binaryTreeDictionary.hpp" #include "memory/freeList.hpp" #include "memory/freeBlockDictionary.hpp" -#include "memory/metablock.hpp" #include "memory/metachunk.hpp" #include "runtime/globals.hpp" #include "utilities/ostream.hpp" diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp index 82336503eb4..5e9d843ff52 100644 --- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp @@ -423,60 +423,6 @@ void CardTableModRefBS::write_ref_field_work(void* field, oop newVal) { inline_write_ref_field(field, newVal); } -/* - Claimed and deferred bits are used together in G1 during the evacuation - pause. These bits can have the following state transitions: - 1. The claimed bit can be put over any other card state. Except that - the "dirty -> dirty and claimed" transition is checked for in - G1 code and is not used. - 2. Deferred bit can be set only if the previous state of the card - was either clean or claimed. mark_card_deferred() is wait-free. - We do not care if the operation is be successful because if - it does not it will only result in duplicate entry in the update - buffer because of the "cache-miss". So it's not worth spinning. - */ - - -bool CardTableModRefBS::claim_card(size_t card_index) { - jbyte val = _byte_map[card_index]; - assert(val != dirty_card_val(), "Shouldn't claim a dirty card"); - while (val == clean_card_val() || - (val & (clean_card_mask_val() | claimed_card_val())) != claimed_card_val()) { - jbyte new_val = val; - if (val == clean_card_val()) { - new_val = (jbyte)claimed_card_val(); - } else { - new_val = val | (jbyte)claimed_card_val(); - } - jbyte res = Atomic::cmpxchg(new_val, &_byte_map[card_index], val); - if (res == val) { - return true; - } - val = res; - } - return false; -} - -bool CardTableModRefBS::mark_card_deferred(size_t card_index) { - jbyte val = _byte_map[card_index]; - // It's already processed - if ((val & (clean_card_mask_val() | deferred_card_val())) == deferred_card_val()) { - return false; - } - // Cached bit can be installed either on a clean card or on a claimed card. - jbyte new_val = val; - if (val == clean_card_val()) { - new_val = (jbyte)deferred_card_val(); - } else { - if (val & claimed_card_val()) { - new_val = val | (jbyte)deferred_card_val(); - } - } - if (new_val != val) { - Atomic::cmpxchg(new_val, &_byte_map[card_index], val); - } - return true; -} void CardTableModRefBS::non_clean_card_iterate_possibly_parallel(Space* sp, MemRegion mr, diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp index 6b5de2a4460..cadb4cb88aa 100644 --- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp @@ -339,34 +339,10 @@ public: _byte_map[card_index] = dirty_card_val(); } - bool is_card_claimed(size_t card_index) { - jbyte val = _byte_map[card_index]; - return (val & (clean_card_mask_val() | claimed_card_val())) == claimed_card_val(); - } - - void set_card_claimed(size_t card_index) { - jbyte val = _byte_map[card_index]; - if (val == clean_card_val()) { - val = (jbyte)claimed_card_val(); - } else { - val |= (jbyte)claimed_card_val(); - } - _byte_map[card_index] = val; - } - - bool claim_card(size_t card_index); - bool is_card_clean(size_t card_index) { return _byte_map[card_index] == clean_card_val(); } - bool is_card_deferred(size_t card_index) { - jbyte val = _byte_map[card_index]; - return (val & (clean_card_mask_val() | deferred_card_val())) == deferred_card_val(); - } - - bool mark_card_deferred(size_t card_index); - // Card marking array base (adjusted for heap low boundary) // This would be the 0th element of _byte_map, if the heap started at 0x0. // But since the heap starts at some higher address, this points to somewhere diff --git a/hotspot/src/share/vm/memory/collectorPolicy.cpp b/hotspot/src/share/vm/memory/collectorPolicy.cpp index 0728997b769..a3c466327ef 100644 --- a/hotspot/src/share/vm/memory/collectorPolicy.cpp +++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp @@ -47,83 +47,53 @@ // CollectorPolicy methods. -// Align down. If the aligning result in 0, return 'alignment'. -static size_t restricted_align_down(size_t size, size_t alignment) { - return MAX2(alignment, align_size_down_(size, alignment)); -} - void CollectorPolicy::initialize_flags() { - assert(max_alignment() >= min_alignment(), - err_msg("max_alignment: " SIZE_FORMAT " less than min_alignment: " SIZE_FORMAT, - max_alignment(), min_alignment())); - assert(max_alignment() % min_alignment() == 0, - err_msg("max_alignment: " SIZE_FORMAT " not aligned by min_alignment: " SIZE_FORMAT, - max_alignment(), min_alignment())); + assert(_max_alignment >= _min_alignment, + err_msg("max_alignment: " SIZE_FORMAT " less than min_alignment: " SIZE_FORMAT, + _max_alignment, _min_alignment)); + assert(_max_alignment % _min_alignment == 0, + err_msg("max_alignment: " SIZE_FORMAT " not aligned by min_alignment: " SIZE_FORMAT, + _max_alignment, _min_alignment)); if (MaxHeapSize < InitialHeapSize) { vm_exit_during_initialization("Incompatible initial and maximum heap sizes specified"); } - if (!is_size_aligned(MaxMetaspaceSize, max_alignment())) { - FLAG_SET_ERGO(uintx, MaxMetaspaceSize, - restricted_align_down(MaxMetaspaceSize, max_alignment())); - } - - if (MetaspaceSize > MaxMetaspaceSize) { - FLAG_SET_ERGO(uintx, MetaspaceSize, MaxMetaspaceSize); - } - - if (!is_size_aligned(MetaspaceSize, min_alignment())) { - FLAG_SET_ERGO(uintx, MetaspaceSize, - restricted_align_down(MetaspaceSize, min_alignment())); - } - - assert(MetaspaceSize <= MaxMetaspaceSize, "Must be"); - - MinMetaspaceExpansion = restricted_align_down(MinMetaspaceExpansion, min_alignment()); - MaxMetaspaceExpansion = restricted_align_down(MaxMetaspaceExpansion, min_alignment()); - - MinHeapDeltaBytes = align_size_up(MinHeapDeltaBytes, min_alignment()); - - assert(MetaspaceSize % min_alignment() == 0, "metapace alignment"); - assert(MaxMetaspaceSize % max_alignment() == 0, "maximum metaspace alignment"); - if (MetaspaceSize < 256*K) { - vm_exit_during_initialization("Too small initial Metaspace size"); - } + MinHeapDeltaBytes = align_size_up(MinHeapDeltaBytes, _min_alignment); } void CollectorPolicy::initialize_size_info() { // User inputs from -mx and ms must be aligned - set_min_heap_byte_size(align_size_up(Arguments::min_heap_size(), min_alignment())); - set_initial_heap_byte_size(align_size_up(InitialHeapSize, min_alignment())); - set_max_heap_byte_size(align_size_up(MaxHeapSize, max_alignment())); + _min_heap_byte_size = align_size_up(Arguments::min_heap_size(), _min_alignment); + _initial_heap_byte_size = align_size_up(InitialHeapSize, _min_alignment); + _max_heap_byte_size = align_size_up(MaxHeapSize, _max_alignment); // Check heap parameter properties - if (initial_heap_byte_size() < M) { + if (_initial_heap_byte_size < M) { vm_exit_during_initialization("Too small initial heap"); } // Check heap parameter properties - if (min_heap_byte_size() < M) { + if (_min_heap_byte_size < M) { vm_exit_during_initialization("Too small minimum heap"); } - if (initial_heap_byte_size() <= NewSize) { + if (_initial_heap_byte_size <= NewSize) { // make sure there is at least some room in old space vm_exit_during_initialization("Too small initial heap for new size specified"); } - if (max_heap_byte_size() < min_heap_byte_size()) { + if (_max_heap_byte_size < _min_heap_byte_size) { vm_exit_during_initialization("Incompatible minimum and maximum heap sizes specified"); } - if (initial_heap_byte_size() < min_heap_byte_size()) { + if (_initial_heap_byte_size < _min_heap_byte_size) { vm_exit_during_initialization("Incompatible minimum and initial heap sizes specified"); } - if (max_heap_byte_size() < initial_heap_byte_size()) { + if (_max_heap_byte_size < _initial_heap_byte_size) { vm_exit_during_initialization("Incompatible initial and maximum heap sizes specified"); } if (PrintGCDetails && Verbose) { gclog_or_tty->print_cr("Minimum heap " SIZE_FORMAT " Initial heap " SIZE_FORMAT " Maximum heap " SIZE_FORMAT, - min_heap_byte_size(), initial_heap_byte_size(), max_heap_byte_size()); + _min_heap_byte_size, _initial_heap_byte_size, _max_heap_byte_size); } } @@ -135,15 +105,8 @@ bool CollectorPolicy::use_should_clear_all_soft_refs(bool v) { GenRemSet* CollectorPolicy::create_rem_set(MemRegion whole_heap, int max_covered_regions) { - switch (rem_set_name()) { - case GenRemSet::CardTable: { - CardTableRS* res = new CardTableRS(whole_heap, max_covered_regions); - return res; - } - default: - guarantee(false, "unrecognized GenRemSet::Name"); - return NULL; - } + assert(rem_set_name() == GenRemSet::CardTable, "unrecognized GenRemSet::Name"); + return new CardTableRS(whole_heap, max_covered_regions); } void CollectorPolicy::cleared_all_soft_refs() { @@ -185,15 +148,15 @@ size_t CollectorPolicy::compute_max_alignment() { size_t GenCollectorPolicy::scale_by_NewRatio_aligned(size_t base_size) { size_t x = base_size / (NewRatio+1); - size_t new_gen_size = x > min_alignment() ? - align_size_down(x, min_alignment()) : - min_alignment(); + size_t new_gen_size = x > _min_alignment ? + align_size_down(x, _min_alignment) : + _min_alignment; return new_gen_size; } size_t GenCollectorPolicy::bound_minus_alignment(size_t desired_size, size_t maximum_size) { - size_t alignment = min_alignment(); + size_t alignment = _min_alignment; size_t max_minus = maximum_size - alignment; return desired_size < max_minus ? desired_size : max_minus; } @@ -212,8 +175,8 @@ void GenCollectorPolicy::initialize_size_policy(size_t init_eden_size, void GenCollectorPolicy::initialize_flags() { // All sizes must be multiples of the generation granularity. - set_min_alignment((uintx) Generation::GenGrain); - set_max_alignment(compute_max_alignment()); + _min_alignment = (uintx) Generation::GenGrain; + _max_alignment = compute_max_alignment(); CollectorPolicy::initialize_flags(); @@ -223,26 +186,26 @@ void GenCollectorPolicy::initialize_flags() { if (NewSize > MaxNewSize) { MaxNewSize = NewSize; } - NewSize = align_size_down(NewSize, min_alignment()); - MaxNewSize = align_size_down(MaxNewSize, min_alignment()); + NewSize = align_size_down(NewSize, _min_alignment); + MaxNewSize = align_size_down(MaxNewSize, _min_alignment); // Check validity of heap flags - assert(NewSize % min_alignment() == 0, "eden space alignment"); - assert(MaxNewSize % min_alignment() == 0, "survivor space alignment"); + assert(NewSize % _min_alignment == 0, "eden space alignment"); + assert(MaxNewSize % _min_alignment == 0, "survivor space alignment"); - if (NewSize < 3*min_alignment()) { + if (NewSize < 3 * _min_alignment) { // make sure there room for eden and two survivor spaces vm_exit_during_initialization("Too small new size specified"); } if (SurvivorRatio < 1 || NewRatio < 1) { - vm_exit_during_initialization("Invalid heap ratio specified"); + vm_exit_during_initialization("Invalid young gen ratio specified"); } } void TwoGenerationCollectorPolicy::initialize_flags() { GenCollectorPolicy::initialize_flags(); - OldSize = align_size_down(OldSize, min_alignment()); + OldSize = align_size_down(OldSize, _min_alignment); if (FLAG_IS_CMDLINE(OldSize) && FLAG_IS_DEFAULT(NewSize)) { // NewRatio will be used later to set the young generation size so we use @@ -251,11 +214,11 @@ void TwoGenerationCollectorPolicy::initialize_flags() { assert(NewRatio > 0, "NewRatio should have been set up earlier"); size_t calculated_heapsize = (OldSize / NewRatio) * (NewRatio + 1); - calculated_heapsize = align_size_up(calculated_heapsize, max_alignment()); + calculated_heapsize = align_size_up(calculated_heapsize, _max_alignment); MaxHeapSize = calculated_heapsize; InitialHeapSize = calculated_heapsize; } - MaxHeapSize = align_size_up(MaxHeapSize, max_alignment()); + MaxHeapSize = align_size_up(MaxHeapSize, _max_alignment); // adjust max heap size if necessary if (NewSize + OldSize > MaxHeapSize) { @@ -265,18 +228,18 @@ void TwoGenerationCollectorPolicy::initialize_flags() { uintx calculated_size = NewSize + OldSize; double shrink_factor = (double) MaxHeapSize / calculated_size; // align - NewSize = align_size_down((uintx) (NewSize * shrink_factor), min_alignment()); + NewSize = align_size_down((uintx) (NewSize * shrink_factor), _min_alignment); // OldSize is already aligned because above we aligned MaxHeapSize to - // max_alignment(), and we just made sure that NewSize is aligned to - // min_alignment(). In initialize_flags() we verified that max_alignment() - // is a multiple of min_alignment(). + // _max_alignment, and we just made sure that NewSize is aligned to + // _min_alignment. In initialize_flags() we verified that _max_alignment + // is a multiple of _min_alignment. OldSize = MaxHeapSize - NewSize; } else { MaxHeapSize = NewSize + OldSize; } } // need to do this again - MaxHeapSize = align_size_up(MaxHeapSize, max_alignment()); + MaxHeapSize = align_size_up(MaxHeapSize, _max_alignment); // adjust max heap size if necessary if (NewSize + OldSize > MaxHeapSize) { @@ -286,24 +249,24 @@ void TwoGenerationCollectorPolicy::initialize_flags() { uintx calculated_size = NewSize + OldSize; double shrink_factor = (double) MaxHeapSize / calculated_size; // align - NewSize = align_size_down((uintx) (NewSize * shrink_factor), min_alignment()); + NewSize = align_size_down((uintx) (NewSize * shrink_factor), _min_alignment); // OldSize is already aligned because above we aligned MaxHeapSize to - // max_alignment(), and we just made sure that NewSize is aligned to - // min_alignment(). In initialize_flags() we verified that max_alignment() - // is a multiple of min_alignment(). + // _max_alignment, and we just made sure that NewSize is aligned to + // _min_alignment. In initialize_flags() we verified that _max_alignment + // is a multiple of _min_alignment. OldSize = MaxHeapSize - NewSize; } else { MaxHeapSize = NewSize + OldSize; } } // need to do this again - MaxHeapSize = align_size_up(MaxHeapSize, max_alignment()); + MaxHeapSize = align_size_up(MaxHeapSize, _max_alignment); always_do_update_barrier = UseConcMarkSweepGC; // Check validity of heap flags - assert(OldSize % min_alignment() == 0, "old space alignment"); - assert(MaxHeapSize % max_alignment() == 0, "maximum heap alignment"); + assert(OldSize % _min_alignment == 0, "old space alignment"); + assert(MaxHeapSize % _max_alignment == 0, "maximum heap alignment"); } // Values set on the command line win over any ergonomically @@ -318,7 +281,7 @@ void TwoGenerationCollectorPolicy::initialize_flags() { void GenCollectorPolicy::initialize_size_info() { CollectorPolicy::initialize_size_info(); - // min_alignment() is used for alignment within a generation. + // _min_alignment is used for alignment within a generation. // There is additional alignment done down stream for some // collectors that sometimes causes unwanted rounding up of // generations sizes. @@ -327,18 +290,18 @@ void GenCollectorPolicy::initialize_size_info() { size_t max_new_size = 0; if (FLAG_IS_CMDLINE(MaxNewSize) || FLAG_IS_ERGO(MaxNewSize)) { - if (MaxNewSize < min_alignment()) { - max_new_size = min_alignment(); + if (MaxNewSize < _min_alignment) { + max_new_size = _min_alignment; } - if (MaxNewSize >= max_heap_byte_size()) { - max_new_size = align_size_down(max_heap_byte_size() - min_alignment(), - min_alignment()); + if (MaxNewSize >= _max_heap_byte_size) { + max_new_size = align_size_down(_max_heap_byte_size - _min_alignment, + _min_alignment); warning("MaxNewSize (" SIZE_FORMAT "k) is equal to or " "greater than the entire heap (" SIZE_FORMAT "k). A " "new generation size of " SIZE_FORMAT "k will be used.", - MaxNewSize/K, max_heap_byte_size()/K, max_new_size/K); + MaxNewSize/K, _max_heap_byte_size/K, max_new_size/K); } else { - max_new_size = align_size_down(MaxNewSize, min_alignment()); + max_new_size = align_size_down(MaxNewSize, _min_alignment); } // The case for FLAG_IS_ERGO(MaxNewSize) could be treated @@ -356,7 +319,7 @@ void GenCollectorPolicy::initialize_size_info() { // just accept those choices. The choices currently made are // not always "wise". } else { - max_new_size = scale_by_NewRatio_aligned(max_heap_byte_size()); + max_new_size = scale_by_NewRatio_aligned(_max_heap_byte_size); // Bound the maximum size by NewSize below (since it historically // would have been NewSize and because the NewRatio calculation could // yield a size that is too small) and bound it by MaxNewSize above. @@ -369,13 +332,13 @@ void GenCollectorPolicy::initialize_size_info() { // Given the maximum gen0 size, determine the initial and // minimum gen0 sizes. - if (max_heap_byte_size() == min_heap_byte_size()) { + if (_max_heap_byte_size == _min_heap_byte_size) { // The maximum and minimum heap sizes are the same so // the generations minimum and initial must be the // same as its maximum. - set_min_gen0_size(max_new_size); - set_initial_gen0_size(max_new_size); - set_max_gen0_size(max_new_size); + _min_gen0_size = max_new_size; + _initial_gen0_size = max_new_size; + _max_gen0_size = max_new_size; } else { size_t desired_new_size = 0; if (!FLAG_IS_DEFAULT(NewSize)) { @@ -396,43 +359,37 @@ void GenCollectorPolicy::initialize_size_info() { // Use the default NewSize as the floor for these values. If // NewRatio is overly large, the resulting sizes can be too // small. - _min_gen0_size = MAX2(scale_by_NewRatio_aligned(min_heap_byte_size()), - NewSize); + _min_gen0_size = MAX2(scale_by_NewRatio_aligned(_min_heap_byte_size), NewSize); desired_new_size = - MAX2(scale_by_NewRatio_aligned(initial_heap_byte_size()), - NewSize); + MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), NewSize); } assert(_min_gen0_size > 0, "Sanity check"); - set_initial_gen0_size(desired_new_size); - set_max_gen0_size(max_new_size); + _initial_gen0_size = desired_new_size; + _max_gen0_size = max_new_size; // At this point the desirable initial and minimum sizes have been // determined without regard to the maximum sizes. // Bound the sizes by the corresponding overall heap sizes. - set_min_gen0_size( - bound_minus_alignment(_min_gen0_size, min_heap_byte_size())); - set_initial_gen0_size( - bound_minus_alignment(_initial_gen0_size, initial_heap_byte_size())); - set_max_gen0_size( - bound_minus_alignment(_max_gen0_size, max_heap_byte_size())); + _min_gen0_size = bound_minus_alignment(_min_gen0_size, _min_heap_byte_size); + _initial_gen0_size = bound_minus_alignment(_initial_gen0_size, _initial_heap_byte_size); + _max_gen0_size = bound_minus_alignment(_max_gen0_size, _max_heap_byte_size); // At this point all three sizes have been checked against the // maximum sizes but have not been checked for consistency // among the three. // Final check min <= initial <= max - set_min_gen0_size(MIN2(_min_gen0_size, _max_gen0_size)); - set_initial_gen0_size( - MAX2(MIN2(_initial_gen0_size, _max_gen0_size), _min_gen0_size)); - set_min_gen0_size(MIN2(_min_gen0_size, _initial_gen0_size)); + _min_gen0_size = MIN2(_min_gen0_size, _max_gen0_size); + _initial_gen0_size = MAX2(MIN2(_initial_gen0_size, _max_gen0_size), _min_gen0_size); + _min_gen0_size = MIN2(_min_gen0_size, _initial_gen0_size); } if (PrintGCDetails && Verbose) { gclog_or_tty->print_cr("1: Minimum gen0 " SIZE_FORMAT " Initial gen0 " SIZE_FORMAT " Maximum gen0 " SIZE_FORMAT, - min_gen0_size(), initial_gen0_size(), max_gen0_size()); + _min_gen0_size, _initial_gen0_size, _max_gen0_size); } } @@ -452,19 +409,17 @@ bool TwoGenerationCollectorPolicy::adjust_gen0_sizes(size_t* gen0_size_ptr, if ((*gen1_size_ptr + *gen0_size_ptr) > heap_size) { if ((heap_size < (*gen0_size_ptr + min_gen1_size)) && - (heap_size >= min_gen1_size + min_alignment())) { + (heap_size >= min_gen1_size + _min_alignment)) { // Adjust gen0 down to accommodate min_gen1_size *gen0_size_ptr = heap_size - min_gen1_size; *gen0_size_ptr = - MAX2((uintx)align_size_down(*gen0_size_ptr, min_alignment()), - min_alignment()); + MAX2((uintx)align_size_down(*gen0_size_ptr, _min_alignment), _min_alignment); assert(*gen0_size_ptr > 0, "Min gen0 is too large"); result = true; } else { *gen1_size_ptr = heap_size - *gen0_size_ptr; *gen1_size_ptr = - MAX2((uintx)align_size_down(*gen1_size_ptr, min_alignment()), - min_alignment()); + MAX2((uintx)align_size_down(*gen1_size_ptr, _min_alignment), _min_alignment); } } return result; @@ -485,10 +440,9 @@ void TwoGenerationCollectorPolicy::initialize_size_info() { // The maximum gen1 size can be determined from the maximum gen0 // and maximum heap size since no explicit flags exits // for setting the gen1 maximum. - _max_gen1_size = max_heap_byte_size() - _max_gen0_size; + _max_gen1_size = _max_heap_byte_size - _max_gen0_size; _max_gen1_size = - MAX2((uintx)align_size_down(_max_gen1_size, min_alignment()), - min_alignment()); + MAX2((uintx)align_size_down(_max_gen1_size, _min_alignment), _min_alignment); // If no explicit command line flag has been set for the // gen1 size, use what is left for gen1. if (FLAG_IS_DEFAULT(OldSize) || FLAG_IS_ERGO(OldSize)) { @@ -497,70 +451,66 @@ void TwoGenerationCollectorPolicy::initialize_size_info() { // with the overall heap size). In either case make // the minimum, maximum and initial sizes consistent // with the gen0 sizes and the overall heap sizes. - assert(min_heap_byte_size() > _min_gen0_size, + assert(_min_heap_byte_size > _min_gen0_size, "gen0 has an unexpected minimum size"); - set_min_gen1_size(min_heap_byte_size() - min_gen0_size()); - set_min_gen1_size( - MAX2((uintx)align_size_down(_min_gen1_size, min_alignment()), - min_alignment())); - set_initial_gen1_size(initial_heap_byte_size() - initial_gen0_size()); - set_initial_gen1_size( - MAX2((uintx)align_size_down(_initial_gen1_size, min_alignment()), - min_alignment())); - + _min_gen1_size = _min_heap_byte_size - _min_gen0_size; + _min_gen1_size = + MAX2((uintx)align_size_down(_min_gen1_size, _min_alignment), _min_alignment); + _initial_gen1_size = _initial_heap_byte_size - _initial_gen0_size; + _initial_gen1_size = + MAX2((uintx)align_size_down(_initial_gen1_size, _min_alignment), _min_alignment); } else { // It's been explicitly set on the command line. Use the // OldSize and then determine the consequences. - set_min_gen1_size(OldSize); - set_initial_gen1_size(OldSize); + _min_gen1_size = OldSize; + _initial_gen1_size = OldSize; // If the user has explicitly set an OldSize that is inconsistent // with other command line flags, issue a warning. // The generation minimums and the overall heap mimimum should // be within one heap alignment. - if ((_min_gen1_size + _min_gen0_size + min_alignment()) < - min_heap_byte_size()) { + if ((_min_gen1_size + _min_gen0_size + _min_alignment) < _min_heap_byte_size) { warning("Inconsistency between minimum heap size and minimum " - "generation sizes: using minimum heap = " SIZE_FORMAT, - min_heap_byte_size()); + "generation sizes: using minimum heap = " SIZE_FORMAT, + _min_heap_byte_size); } if ((OldSize > _max_gen1_size)) { warning("Inconsistency between maximum heap size and maximum " - "generation sizes: using maximum heap = " SIZE_FORMAT - " -XX:OldSize flag is being ignored", - max_heap_byte_size()); + "generation sizes: using maximum heap = " SIZE_FORMAT + " -XX:OldSize flag is being ignored", + _max_heap_byte_size); } // If there is an inconsistency between the OldSize and the minimum and/or // initial size of gen0, since OldSize was explicitly set, OldSize wins. if (adjust_gen0_sizes(&_min_gen0_size, &_min_gen1_size, - min_heap_byte_size(), OldSize)) { + _min_heap_byte_size, OldSize)) { if (PrintGCDetails && Verbose) { gclog_or_tty->print_cr("2: Minimum gen0 " SIZE_FORMAT " Initial gen0 " SIZE_FORMAT " Maximum gen0 " SIZE_FORMAT, - min_gen0_size(), initial_gen0_size(), max_gen0_size()); + _min_gen0_size, _initial_gen0_size, _max_gen0_size); } } // Initial size if (adjust_gen0_sizes(&_initial_gen0_size, &_initial_gen1_size, - initial_heap_byte_size(), OldSize)) { + _initial_heap_byte_size, OldSize)) { if (PrintGCDetails && Verbose) { gclog_or_tty->print_cr("3: Minimum gen0 " SIZE_FORMAT " Initial gen0 " SIZE_FORMAT " Maximum gen0 " SIZE_FORMAT, - min_gen0_size(), initial_gen0_size(), max_gen0_size()); + _min_gen0_size, _initial_gen0_size, _max_gen0_size); } } } // Enforce the maximum gen1 size. - set_min_gen1_size(MIN2(_min_gen1_size, _max_gen1_size)); + _min_gen1_size = MIN2(_min_gen1_size, _max_gen1_size); // Check that min gen1 <= initial gen1 <= max gen1 - set_initial_gen1_size(MAX2(_initial_gen1_size, _min_gen1_size)); - set_initial_gen1_size(MIN2(_initial_gen1_size, _max_gen1_size)); + _initial_gen1_size = MAX2(_initial_gen1_size, _min_gen1_size); + _initial_gen1_size = MIN2(_initial_gen1_size, _max_gen1_size); if (PrintGCDetails && Verbose) { gclog_or_tty->print_cr("Minimum gen1 " SIZE_FORMAT " Initial gen1 " SIZE_FORMAT " Maximum gen1 " SIZE_FORMAT, - min_gen1_size(), initial_gen1_size(), max_gen1_size()); + _min_gen1_size, _initial_gen1_size, _max_gen1_size); } } diff --git a/hotspot/src/share/vm/memory/collectorPolicy.hpp b/hotspot/src/share/vm/memory/collectorPolicy.hpp index 73fd177d7ba..42976b34563 100644 --- a/hotspot/src/share/vm/memory/collectorPolicy.hpp +++ b/hotspot/src/share/vm/memory/collectorPolicy.hpp @@ -101,17 +101,12 @@ class CollectorPolicy : public CHeapObj { // Return maximum heap alignment that may be imposed by the policy static size_t compute_max_alignment(); - void set_min_alignment(size_t align) { _min_alignment = align; } size_t min_alignment() { return _min_alignment; } - void set_max_alignment(size_t align) { _max_alignment = align; } size_t max_alignment() { return _max_alignment; } size_t initial_heap_byte_size() { return _initial_heap_byte_size; } - void set_initial_heap_byte_size(size_t v) { _initial_heap_byte_size = v; } size_t max_heap_byte_size() { return _max_heap_byte_size; } - void set_max_heap_byte_size(size_t v) { _max_heap_byte_size = v; } size_t min_heap_byte_size() { return _min_heap_byte_size; } - void set_min_heap_byte_size(size_t v) { _min_heap_byte_size = v; } enum Name { CollectorPolicyKind, @@ -248,12 +243,9 @@ class GenCollectorPolicy : public CollectorPolicy { public: // Accessors - size_t min_gen0_size() { return _min_gen0_size; } - void set_min_gen0_size(size_t v) { _min_gen0_size = v; } + size_t min_gen0_size() { return _min_gen0_size; } size_t initial_gen0_size() { return _initial_gen0_size; } - void set_initial_gen0_size(size_t v) { _initial_gen0_size = v; } - size_t max_gen0_size() { return _max_gen0_size; } - void set_max_gen0_size(size_t v) { _max_gen0_size = v; } + size_t max_gen0_size() { return _max_gen0_size; } virtual int number_of_generations() = 0; @@ -302,12 +294,9 @@ class TwoGenerationCollectorPolicy : public GenCollectorPolicy { public: // Accessors - size_t min_gen1_size() { return _min_gen1_size; } - void set_min_gen1_size(size_t v) { _min_gen1_size = v; } + size_t min_gen1_size() { return _min_gen1_size; } size_t initial_gen1_size() { return _initial_gen1_size; } - void set_initial_gen1_size(size_t v) { _initial_gen1_size = v; } - size_t max_gen1_size() { return _max_gen1_size; } - void set_max_gen1_size(size_t v) { _max_gen1_size = v; } + size_t max_gen1_size() { return _max_gen1_size; } // Inherited methods TwoGenerationCollectorPolicy* as_two_generation_policy() { return this; } diff --git a/hotspot/src/share/vm/memory/filemap.hpp b/hotspot/src/share/vm/memory/filemap.hpp index 8d7535ed990..0c93c87992b 100644 --- a/hotspot/src/share/vm/memory/filemap.hpp +++ b/hotspot/src/share/vm/memory/filemap.hpp @@ -26,6 +26,7 @@ #define SHARE_VM_MEMORY_FILEMAP_HPP #include "memory/metaspaceShared.hpp" +#include "memory/metaspace.hpp" // Layout of the file: // header: dump of archive instance plus versioning info, datestamp, etc. diff --git a/hotspot/src/share/vm/memory/freeBlockDictionary.cpp b/hotspot/src/share/vm/memory/freeBlockDictionary.cpp index 713036ea500..7cb2b17b57b 100644 --- a/hotspot/src/share/vm/memory/freeBlockDictionary.cpp +++ b/hotspot/src/share/vm/memory/freeBlockDictionary.cpp @@ -28,7 +28,6 @@ #include "gc_implementation/concurrentMarkSweep/freeChunk.hpp" #endif // INCLUDE_ALL_GCS #include "memory/freeBlockDictionary.hpp" -#include "memory/metablock.hpp" #include "memory/metachunk.hpp" #include "runtime/thread.inline.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/memory/freeList.cpp b/hotspot/src/share/vm/memory/freeList.cpp index 385451caf81..78785e8809f 100644 --- a/hotspot/src/share/vm/memory/freeList.cpp +++ b/hotspot/src/share/vm/memory/freeList.cpp @@ -25,7 +25,6 @@ #include "precompiled.hpp" #include "memory/freeBlockDictionary.hpp" #include "memory/freeList.hpp" -#include "memory/metablock.hpp" #include "memory/metachunk.hpp" #include "memory/sharedHeap.hpp" #include "runtime/globals.hpp" diff --git a/hotspot/src/share/vm/memory/gcLocker.cpp b/hotspot/src/share/vm/memory/gcLocker.cpp index eda728b7047..1b0c94ee171 100644 --- a/hotspot/src/share/vm/memory/gcLocker.cpp +++ b/hotspot/src/share/vm/memory/gcLocker.cpp @@ -122,7 +122,7 @@ void GC_locker::jni_unlock(JavaThread* thread) { // strictly needed. It's added here to make it clear that // the GC will NOT be performed if any other caller // of GC_locker::lock() still needs GC locked. - if (!is_active()) { + if (!is_active_internal()) { _doing_gc = true; { // Must give up the lock while at a safepoint diff --git a/hotspot/src/share/vm/memory/gcLocker.hpp b/hotspot/src/share/vm/memory/gcLocker.hpp index 8ede8fb275b..45b8a8f89e7 100644 --- a/hotspot/src/share/vm/memory/gcLocker.hpp +++ b/hotspot/src/share/vm/memory/gcLocker.hpp @@ -88,7 +88,7 @@ class GC_locker: public AllStatic { public: // Accessors static bool is_active() { - assert(_needs_gc || SafepointSynchronize::is_at_safepoint(), "only read at safepoint"); + assert(SafepointSynchronize::is_at_safepoint(), "only read at safepoint"); return is_active_internal(); } static bool needs_gc() { return _needs_gc; } diff --git a/hotspot/src/share/vm/memory/genRemSet.cpp b/hotspot/src/share/vm/memory/genRemSet.cpp index 95a08e1370b..c496deafc03 100644 --- a/hotspot/src/share/vm/memory/genRemSet.cpp +++ b/hotspot/src/share/vm/memory/genRemSet.cpp @@ -32,13 +32,8 @@ // enumeration.) uintx GenRemSet::max_alignment_constraint(Name nm) { - switch (nm) { - case GenRemSet::CardTable: - return CardTableRS::ct_max_alignment_constraint(); - default: - guarantee(false, "Unrecognized GenRemSet type."); - return (0); // Make Windows compiler happy - } + assert(nm == GenRemSet::CardTable, "Unrecognized GenRemSet type."); + return CardTableRS::ct_max_alignment_constraint(); } class HasAccumulatedModifiedOopsClosure : public KlassClosure { diff --git a/hotspot/src/share/vm/memory/heapInspection.hpp b/hotspot/src/share/vm/memory/heapInspection.hpp index 09558b0a2a9..25e438981d3 100644 --- a/hotspot/src/share/vm/memory/heapInspection.hpp +++ b/hotspot/src/share/vm/memory/heapInspection.hpp @@ -73,6 +73,10 @@ "Number of bytes used by the InstanceKlass::methods() array") \ f(method_ordering_bytes, IK_method_ordering, \ "Number of bytes used by the InstanceKlass::method_ordering() array") \ + f(default_methods_array_bytes, IK_default_methods, \ + "Number of bytes used by the InstanceKlass::default_methods() array") \ + f(default_vtable_indices_bytes, IK_default_vtable_indices, \ + "Number of bytes used by the InstanceKlass::default_vtable_indices() array") \ f(local_interfaces_bytes, IK_local_interfaces, \ "Number of bytes used by the InstanceKlass::local_interfaces() array") \ f(transitive_interfaces_bytes, IK_transitive_interfaces, \ @@ -150,11 +154,11 @@ public: HEAP_INSPECTION_COLUMNS_DO(DECLARE_KLASS_SIZE_STATS_FIELD) static int count(oop x) { - return (HeapWordSize * ((x) ? (x)->size() : 0)); + return (HeapWordSize * (((x) != NULL) ? (x)->size() : 0)); } static int count_array(objArrayOop x) { - return (HeapWordSize * ((x) ? (x)->size() : 0)); + return (HeapWordSize * (((x) != NULL) ? (x)->size() : 0)); } template static int count(T* x) { diff --git a/hotspot/src/share/vm/memory/metablock.cpp b/hotspot/src/share/vm/memory/metablock.cpp deleted file mode 100644 index b6c6947e1ac..00000000000 --- a/hotspot/src/share/vm/memory/metablock.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "memory/allocation.hpp" -#include "memory/metablock.hpp" -#include "utilities/copy.hpp" -#include "utilities/debug.hpp" - -// Blocks of space for metadata are allocated out of Metachunks. -// -// Metachunk are allocated out of MetadataVirtualspaces and once -// allocated there is no explicit link between a Metachunk and -// the MetadataVirtualspaces from which it was allocated. -// -// Each SpaceManager maintains a -// list of the chunks it is using and the current chunk. The current -// chunk is the chunk from which allocations are done. Space freed in -// a chunk is placed on the free list of blocks (BlockFreelist) and -// reused from there. -// -// Future modification -// -// The Metachunk can conceivable be replaced by the Chunk in -// allocation.hpp. Note that the latter Chunk is the space for -// allocation (allocations from the chunk are out of the space in -// the Chunk after the header for the Chunk) where as Metachunks -// point to space in a VirtualSpace. To replace Metachunks with -// Chunks, change Chunks so that they can be allocated out of a VirtualSpace. -size_t Metablock::_min_block_byte_size = sizeof(Metablock); - -// New blocks returned by the Metaspace are zero initialized. -// We should fix the constructors to not assume this instead. -Metablock* Metablock::initialize(MetaWord* p, size_t word_size) { - if (p == NULL) { - return NULL; - } - - Metablock* result = (Metablock*) p; - - // Clear the memory - Copy::fill_to_aligned_words((HeapWord*)result, word_size); -#ifdef ASSERT - result->set_word_size(word_size); -#endif - return result; -} diff --git a/hotspot/src/share/vm/memory/metablock.hpp b/hotspot/src/share/vm/memory/metablock.hpp deleted file mode 100644 index fa4c6c0b445..00000000000 --- a/hotspot/src/share/vm/memory/metablock.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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. - * - */ -#ifndef SHARE_VM_MEMORY_METABLOCK_HPP -#define SHARE_VM_MEMORY_METABLOCK_HPP - -// Metablock are the unit of allocation from a Chunk. It is initialized -// with the size of the requested allocation. That size is overwritten -// once the allocation returns. -// -// A Metablock may be reused by its SpaceManager but are never moved between -// SpaceManagers. There is no explicit link to the Metachunk -// from which it was allocated. Metablock may be deallocated and -// put on a freelist but the space is never freed, rather -// the Metachunk it is a part of will be deallocated when it's -// associated class loader is collected. - -class Metablock VALUE_OBJ_CLASS_SPEC { - friend class VMStructs; - private: - // Used to align the allocation (see below). - union block_t { - void* _data[3]; - struct header_t { - size_t _word_size; - Metablock* _next; - Metablock* _prev; - } _header; - } _block; - static size_t _min_block_byte_size; - - typedef union block_t Block; - typedef struct header_t Header; - const Block* block() const { return &_block; } - const Block::header_t* header() const { return &(block()->_header); } - public: - - static Metablock* initialize(MetaWord* p, size_t word_size); - - // This places the body of the block at a 2 word boundary - // because every block starts on a 2 word boundary. Work out - // how to make the body on a 2 word boundary if the block - // starts on a arbitrary boundary. JJJ - - size_t word_size() const { return header()->_word_size; } - void set_word_size(size_t v) { _block._header._word_size = v; } - size_t size() const volatile { return _block._header._word_size; } - void set_size(size_t v) { _block._header._word_size = v; } - Metablock* next() const { return header()->_next; } - void set_next(Metablock* v) { _block._header._next = v; } - Metablock* prev() const { return header()->_prev; } - void set_prev(Metablock* v) { _block._header._prev = v; } - - static size_t min_block_byte_size() { return _min_block_byte_size; } - - bool is_free() { return header()->_word_size != 0; } - void clear_next() { set_next(NULL); } - void link_prev(Metablock* ptr) { set_prev(ptr); } - uintptr_t* end() { return ((uintptr_t*) this) + size(); } - bool cantCoalesce() const { return false; } - void link_next(Metablock* ptr) { set_next(ptr); } - void link_after(Metablock* ptr){ - link_next(ptr); - if (ptr != NULL) ptr->link_prev(this); - } - - // Should not be needed in a free list of Metablocks - void markNotFree() { ShouldNotReachHere(); } - - // Debug support -#ifdef ASSERT - void* prev_addr() const { return (void*)&_block._header._prev; } - void* next_addr() const { return (void*)&_block._header._next; } - void* size_addr() const { return (void*)&_block._header._word_size; } -#endif - bool verify_chunk_in_free_list(Metablock* tc) const { return true; } - bool verify_par_locked() { return true; } - - void assert_is_mangled() const {/* Don't check "\*/} -}; -#endif // SHARE_VM_MEMORY_METABLOCK_HPP diff --git a/hotspot/src/share/vm/memory/metachunk.cpp b/hotspot/src/share/vm/memory/metachunk.cpp index 0ac4ced70f4..81a1f8f8224 100644 --- a/hotspot/src/share/vm/memory/metachunk.cpp +++ b/hotspot/src/share/vm/memory/metachunk.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,42 +29,39 @@ #include "utilities/debug.hpp" class VirtualSpaceNode; -// -// Future modification -// -// The Metachunk can conceivable be replaced by the Chunk in -// allocation.hpp. Note that the latter Chunk is the space for -// allocation (allocations from the chunk are out of the space in -// the Chunk after the header for the Chunk) where as Metachunks -// point to space in a VirtualSpace. To replace Metachunks with -// Chunks, change Chunks so that they can be allocated out of a VirtualSpace. const size_t metadata_chunk_initialize = 0xf7f7f7f7; -size_t Metachunk::_overhead = - Chunk::aligned_overhead_size(sizeof(Metachunk)) / BytesPerWord; +size_t Metachunk::object_alignment() { + // Must align pointers and sizes to 8, + // so that 64 bit types get correctly aligned. + const size_t alignment = 8; + + // Make sure that the Klass alignment also agree. + STATIC_ASSERT(alignment == (size_t)KlassAlignmentInBytes); + + return alignment; +} + +size_t Metachunk::overhead() { + return align_size_up(sizeof(Metachunk), object_alignment()) / BytesPerWord; +} // Metachunk methods Metachunk::Metachunk(size_t word_size, - VirtualSpaceNode* container) : - _word_size(word_size), - _bottom(NULL), - _end(NULL), + VirtualSpaceNode* container) + : Metabase(word_size), _top(NULL), - _next(NULL), - _prev(NULL), _container(container) { - _bottom = (MetaWord*)this; - _top = (MetaWord*)this + _overhead; - _end = (MetaWord*)this + word_size; + _top = initial_top(); #ifdef ASSERT - set_is_free(false); + set_is_tagged_free(false); size_t data_word_size = pointer_delta(end(), - top(), + _top, sizeof(MetaWord)); - Copy::fill_to_words((HeapWord*) top(), + Copy::fill_to_words((HeapWord*)_top, data_word_size, metadata_chunk_initialize); #endif @@ -82,22 +79,18 @@ MetaWord* Metachunk::allocate(size_t word_size) { // _bottom points to the start of the chunk including the overhead. size_t Metachunk::used_word_size() const { - return pointer_delta(_top, _bottom, sizeof(MetaWord)); + return pointer_delta(_top, bottom(), sizeof(MetaWord)); } size_t Metachunk::free_word_size() const { - return pointer_delta(_end, _top, sizeof(MetaWord)); -} - -size_t Metachunk::capacity_word_size() const { - return pointer_delta(_end, _bottom, sizeof(MetaWord)); + return pointer_delta(end(), _top, sizeof(MetaWord)); } void Metachunk::print_on(outputStream* st) const { st->print_cr("Metachunk:" " bottom " PTR_FORMAT " top " PTR_FORMAT " end " PTR_FORMAT " size " SIZE_FORMAT, - bottom(), top(), end(), word_size()); + bottom(), _top, end(), word_size()); if (Verbose) { st->print_cr(" used " SIZE_FORMAT " free " SIZE_FORMAT, used_word_size(), free_word_size()); @@ -109,8 +102,8 @@ void Metachunk::mangle() { // Mangle the payload of the chunk and not the links that // maintain list of chunks. HeapWord* start = (HeapWord*)(bottom() + overhead()); - size_t word_size = capacity_word_size() - overhead(); - Copy::fill_to_words(start, word_size, metadata_chunk_initialize); + size_t size = word_size() - overhead(); + Copy::fill_to_words(start, size, metadata_chunk_initialize); } #endif // PRODUCT @@ -118,9 +111,68 @@ void Metachunk::verify() { #ifdef ASSERT // Cannot walk through the blocks unless the blocks have // headers with sizes. - assert(_bottom <= _top && - _top <= _end, + assert(bottom() <= _top && + _top <= (MetaWord*)end(), "Chunk has been smashed"); #endif return; } + +/////////////// Unit tests /////////////// + +#ifndef PRODUCT + +class TestMetachunk { + public: + static void test() { + size_t size = 2 * 1024 * 1024; + void* memory = malloc(size); + assert(memory != NULL, "Failed to malloc 2MB"); + + Metachunk* metachunk = ::new (memory) Metachunk(size / BytesPerWord, NULL); + + assert(metachunk->bottom() == (MetaWord*)metachunk, "assert"); + assert(metachunk->end() == (uintptr_t*)metachunk + metachunk->size(), "assert"); + + // Check sizes + assert(metachunk->size() == metachunk->word_size(), "assert"); + assert(metachunk->word_size() == pointer_delta(metachunk->end(), metachunk->bottom(), + sizeof(MetaWord*)), "assert"); + + // Check usage + assert(metachunk->used_word_size() == metachunk->overhead(), "assert"); + assert(metachunk->free_word_size() == metachunk->word_size() - metachunk->used_word_size(), "assert"); + assert(metachunk->top() == metachunk->initial_top(), "assert"); + assert(metachunk->is_empty(), "assert"); + + // Allocate + size_t alloc_size = 64; // Words + assert(is_size_aligned(alloc_size, Metachunk::object_alignment()), "assert"); + + MetaWord* mem = metachunk->allocate(alloc_size); + + // Check post alloc + assert(mem == metachunk->initial_top(), "assert"); + assert(mem + alloc_size == metachunk->top(), "assert"); + assert(metachunk->used_word_size() == metachunk->overhead() + alloc_size, "assert"); + assert(metachunk->free_word_size() == metachunk->word_size() - metachunk->used_word_size(), "assert"); + assert(!metachunk->is_empty(), "assert"); + + // Clear chunk + metachunk->reset_empty(); + + // Check post clear + assert(metachunk->used_word_size() == metachunk->overhead(), "assert"); + assert(metachunk->free_word_size() == metachunk->word_size() - metachunk->used_word_size(), "assert"); + assert(metachunk->top() == metachunk->initial_top(), "assert"); + assert(metachunk->is_empty(), "assert"); + + free(memory); + } +}; + +void TestMetachunk_test() { + TestMetachunk::test(); +} + +#endif diff --git a/hotspot/src/share/vm/memory/metachunk.hpp b/hotspot/src/share/vm/memory/metachunk.hpp index ff237ab5d3f..3bd4d15bca8 100644 --- a/hotspot/src/share/vm/memory/metachunk.hpp +++ b/hotspot/src/share/vm/memory/metachunk.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,89 +24,44 @@ #ifndef SHARE_VM_MEMORY_METACHUNK_HPP #define SHARE_VM_MEMORY_METACHUNK_HPP -// Metachunk - Quantum of allocation from a Virtualspace -// Metachunks are reused (when freed are put on a global freelist) and -// have no permanent association to a SpaceManager. - -// +--------------+ <- end -// | | --+ ---+ -// | | | free | -// | | | | -// | | | | capacity -// | | | | -// | | <- top --+ | -// | | ---+ | -// | | | used | -// | | | | -// | | | | -// +--------------+ <- bottom ---+ ---+ +#include "memory/allocation.hpp" +#include "utilities/debug.hpp" +#include "utilities/globalDefinitions.hpp" class VirtualSpaceNode; -class Metachunk VALUE_OBJ_CLASS_SPEC { - // link to support lists of chunks - Metachunk* _next; - Metachunk* _prev; - VirtualSpaceNode* _container; - - MetaWord* _bottom; - MetaWord* _end; - MetaWord* _top; +// Super class of Metablock and Metachunk to allow them to +// be put on the FreeList and in the BinaryTreeDictionary. +template +class Metabase VALUE_OBJ_CLASS_SPEC { size_t _word_size; - // Used in a guarantee() so included in the Product builds - // even through it is only for debugging. - bool _is_free; + T* _next; + T* _prev; - // Metachunks are allocated out of a MetadataVirtualSpace and - // and use some of its space to describe itself (plus alignment - // considerations). Metadata is allocated in the rest of the chunk. - // This size is the overhead of maintaining the Metachunk within - // the space. - static size_t _overhead; + protected: + Metabase(size_t word_size) : _word_size(word_size), _next(NULL), _prev(NULL) {} public: - Metachunk(size_t word_size , VirtualSpaceNode* container); + T* next() const { return _next; } + T* prev() const { return _prev; } + void set_next(T* v) { _next = v; assert(v != this, "Boom");} + void set_prev(T* v) { _prev = v; assert(v != this, "Boom");} + void clear_next() { set_next(NULL); } + void clear_prev() { set_prev(NULL); } - // Used to add a Metachunk to a list of Metachunks - void set_next(Metachunk* v) { _next = v; assert(v != this, "Boom");} - void set_prev(Metachunk* v) { _prev = v; assert(v != this, "Boom");} - void set_container(VirtualSpaceNode* v) { _container = v; } - - MetaWord* allocate(size_t word_size); - - // Accessors - Metachunk* next() const { return _next; } - Metachunk* prev() const { return _prev; } - VirtualSpaceNode* container() const { return _container; } - MetaWord* bottom() const { return _bottom; } - MetaWord* end() const { return _end; } - MetaWord* top() const { return _top; } - size_t word_size() const { return _word_size; } size_t size() const volatile { return _word_size; } void set_size(size_t v) { _word_size = v; } - bool is_free() { return _is_free; } - void set_is_free(bool v) { _is_free = v; } - static size_t overhead() { return _overhead; } - void clear_next() { set_next(NULL); } - void link_prev(Metachunk* ptr) { set_prev(ptr); } - uintptr_t* end() { return ((uintptr_t*) this) + size(); } - bool cantCoalesce() const { return false; } - void link_next(Metachunk* ptr) { set_next(ptr); } - void link_after(Metachunk* ptr){ + + void link_next(T* ptr) { set_next(ptr); } + void link_prev(T* ptr) { set_prev(ptr); } + void link_after(T* ptr) { link_next(ptr); - if (ptr != NULL) ptr->link_prev(this); + if (ptr != NULL) ptr->link_prev((T*)this); } - // Reset top to bottom so chunk can be reused. - void reset_empty() { _top = (_bottom + _overhead); _next = NULL; _prev = NULL; } - bool is_empty() { return _top == (_bottom + _overhead); } + uintptr_t* end() const { return ((uintptr_t*) this) + size(); } - // used (has been allocated) - // free (available for future allocations) - // capacity (total size of chunk) - size_t used_word_size() const; - size_t free_word_size() const; - size_t capacity_word_size()const; + bool cantCoalesce() const { return false; } // Debug support #ifdef ASSERT @@ -114,14 +69,99 @@ class Metachunk VALUE_OBJ_CLASS_SPEC { void* next_addr() const { return (void*)&_next; } void* size_addr() const { return (void*)&_word_size; } #endif - bool verify_chunk_in_free_list(Metachunk* tc) const { return true; } + bool verify_chunk_in_free_list(T* tc) const { return true; } bool verify_par_locked() { return true; } void assert_is_mangled() const {/* Don't check "\*/} + bool is_free() { return true; } +}; + +// Metachunk - Quantum of allocation from a Virtualspace +// Metachunks are reused (when freed are put on a global freelist) and +// have no permanent association to a SpaceManager. + +// +--------------+ <- end --+ --+ +// | | | | +// | | | free | +// | | | | +// | | | | size | capacity +// | | | | +// | | <- top -- + | +// | | | | +// | | | used | +// | | | | +// | | | | +// +--------------+ <- bottom --+ --+ + +class Metachunk : public Metabase { + friend class TestMetachunk; + // The VirtualSpaceNode containing this chunk. + VirtualSpaceNode* _container; + + // Current allocation top. + MetaWord* _top; + + DEBUG_ONLY(bool _is_tagged_free;) + + MetaWord* initial_top() const { return (MetaWord*)this + overhead(); } + MetaWord* top() const { return _top; } + + public: + // Metachunks are allocated out of a MetadataVirtualSpace and + // and use some of its space to describe itself (plus alignment + // considerations). Metadata is allocated in the rest of the chunk. + // This size is the overhead of maintaining the Metachunk within + // the space. + + // Alignment of each allocation in the chunks. + static size_t object_alignment(); + + // Size of the Metachunk header, including alignment. + static size_t overhead(); + + Metachunk(size_t word_size , VirtualSpaceNode* container); + + MetaWord* allocate(size_t word_size); + + VirtualSpaceNode* container() const { return _container; } + + MetaWord* bottom() const { return (MetaWord*) this; } + + // Reset top to bottom so chunk can be reused. + void reset_empty() { _top = initial_top(); clear_next(); clear_prev(); } + bool is_empty() { return _top == initial_top(); } + + // used (has been allocated) + // free (available for future allocations) + size_t word_size() const { return size(); } + size_t used_word_size() const; + size_t free_word_size() const; + +#ifdef ASSERT + bool is_tagged_free() { return _is_tagged_free; } + void set_is_tagged_free(bool v) { _is_tagged_free = v; } +#endif + NOT_PRODUCT(void mangle();) void print_on(outputStream* st) const; void verify(); }; + +// Metablock is the unit of allocation from a Chunk. +// +// A Metablock may be reused by its SpaceManager but are never moved between +// SpaceManagers. There is no explicit link to the Metachunk +// from which it was allocated. Metablock may be deallocated and +// put on a freelist but the space is never freed, rather +// the Metachunk it is a part of will be deallocated when it's +// associated class loader is collected. + +class Metablock : public Metabase { + friend class VMStructs; + public: + Metablock(size_t word_size) : Metabase(word_size) {} +}; + #endif // SHARE_VM_MEMORY_METACHUNK_HPP diff --git a/hotspot/src/share/vm/memory/metadataFactory.hpp b/hotspot/src/share/vm/memory/metadataFactory.hpp index fce8d9b34d7..9f7a22eaf55 100644 --- a/hotspot/src/share/vm/memory/metadataFactory.hpp +++ b/hotspot/src/share/vm/memory/metadataFactory.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,6 +65,7 @@ class MetadataFactory : AllStatic { static void free_array(ClassLoaderData* loader_data, Array* data) { if (data != NULL) { assert(loader_data != NULL, "shouldn't pass null"); + assert(!data->is_shared(), "cannot deallocate array in shared spaces"); int size = data->size(); if (DumpSharedSpaces) { loader_data->ro_metaspace()->deallocate((MetaWord*)data, size, false); @@ -83,6 +84,7 @@ class MetadataFactory : AllStatic { // Call metadata's deallocate function which will call deallocate fields assert(!DumpSharedSpaces, "cannot deallocate metadata when dumping CDS archive"); assert(!md->on_stack(), "can't deallocate things on stack"); + assert(!md->is_shared(), "cannot deallocate if in shared spaces"); md->deallocate_contents(loader_data); loader_data->metaspace_non_null()->deallocate((MetaWord*)md, size, md->is_klass()); } diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp index c12c0b8637b..f9e3385eb22 100644 --- a/hotspot/src/share/vm/memory/metaspace.cpp +++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -23,39 +23,40 @@ */ #include "precompiled.hpp" #include "gc_interface/collectedHeap.hpp" +#include "memory/allocation.hpp" #include "memory/binaryTreeDictionary.hpp" #include "memory/freeList.hpp" #include "memory/collectorPolicy.hpp" #include "memory/filemap.hpp" #include "memory/freeList.hpp" -#include "memory/metablock.hpp" +#include "memory/gcLocker.hpp" #include "memory/metachunk.hpp" #include "memory/metaspace.hpp" #include "memory/metaspaceShared.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.hpp" +#include "runtime/atomic.inline.hpp" #include "runtime/globals.hpp" +#include "runtime/init.hpp" #include "runtime/java.hpp" #include "runtime/mutex.hpp" #include "runtime/orderAccess.hpp" #include "services/memTracker.hpp" +#include "services/memoryService.hpp" #include "utilities/copy.hpp" #include "utilities/debug.hpp" typedef BinaryTreeDictionary BlockTreeDictionary; typedef BinaryTreeDictionary ChunkTreeDictionary; -// Define this macro to enable slow integrity checking of -// the free chunk lists + +// Set this constant to enable slow integrity checking of the free chunk lists const bool metaspace_slow_verify = false; -// Parameters for stress mode testing -const uint metadata_deallocate_a_lot_block = 10; -const uint metadata_deallocate_a_lock_chunk = 3; size_t const allocation_from_dictionary_limit = 4 * K; MetaWord* last_allocated = 0; -size_t Metaspace::_class_metaspace_size; +size_t Metaspace::_compressed_class_space_size; // Used in declarations in SpaceManager and ChunkManager enum ChunkIndex { @@ -74,8 +75,7 @@ enum ChunkSizes { // in words. ClassSmallChunk = 256, SmallChunk = 512, ClassMediumChunk = 4 * K, - MediumChunk = 8 * K, - HumongousChunkGranularity = 8 + MediumChunk = 8 * K }; static ChunkIndex next_chunk_index(ChunkIndex i) { @@ -83,35 +83,15 @@ static ChunkIndex next_chunk_index(ChunkIndex i) { return (ChunkIndex) (i+1); } -// Originally _capacity_until_GC was set to MetaspaceSize here but -// the default MetaspaceSize before argument processing was being -// used which was not the desired value. See the code -// in should_expand() to see how the initialization is handled -// now. -size_t MetaspaceGC::_capacity_until_GC = 0; -bool MetaspaceGC::_expand_after_GC = false; +volatile intptr_t MetaspaceGC::_capacity_until_GC = 0; uint MetaspaceGC::_shrink_factor = 0; bool MetaspaceGC::_should_concurrent_collect = false; -// Blocks of space for metadata are allocated out of Metachunks. -// -// Metachunk are allocated out of MetadataVirtualspaces and once -// allocated there is no explicit link between a Metachunk and -// the MetadataVirtualspaces from which it was allocated. -// -// Each SpaceManager maintains a -// list of the chunks it is using and the current chunk. The current -// chunk is the chunk from which allocations are done. Space freed in -// a chunk is placed on the free list of blocks (BlockFreelist) and -// reused from there. - typedef class FreeList ChunkList; // Manages the global free lists of chunks. -// Has three lists of free chunks, and a total size and -// count that includes all three - -class ChunkManager VALUE_OBJ_CLASS_SPEC { +class ChunkManager : public CHeapObj { + friend class TestVirtualSpaceNodeTest; // Free list of chunks of different sizes. // SpecializedChunk @@ -120,7 +100,6 @@ class ChunkManager VALUE_OBJ_CLASS_SPEC { // HumongousChunk ChunkList _free_chunks[NumberOfFreeLists]; - // HumongousChunk ChunkTreeDictionary _humongous_dictionary; @@ -158,11 +137,15 @@ class ChunkManager VALUE_OBJ_CLASS_SPEC { public: - ChunkManager() : _free_chunks_total(0), _free_chunks_count(0) {} + ChunkManager(size_t specialized_size, size_t small_size, size_t medium_size) + : _free_chunks_total(0), _free_chunks_count(0) { + _free_chunks[SpecializedIndex].set_size(specialized_size); + _free_chunks[SmallIndex].set_size(small_size); + _free_chunks[MediumIndex].set_size(medium_size); + } // add or delete (return) a chunk to the global freelist. Metachunk* chunk_freelist_allocate(size_t word_size); - void chunk_freelist_deallocate(Metachunk* chunk); // Map a size to a list index assuming that there are lists // for special, small, medium, and humongous chunks. @@ -196,9 +179,7 @@ class ChunkManager VALUE_OBJ_CLASS_SPEC { // Returns the list for the given chunk word size. ChunkList* find_free_chunks_list(size_t word_size); - // Add and remove from a list by size. Selects - // list based on size of chunk. - void free_chunks_put(Metachunk* chuck); + // Remove from a list by size. Selects list based on size of chunk. Metachunk* free_chunks_get(size_t chunk_word_size); // Debug support @@ -219,14 +200,13 @@ class ChunkManager VALUE_OBJ_CLASS_SPEC { void locked_print_free_chunks(outputStream* st); void locked_print_sum_free_chunks(outputStream* st); - void print_on(outputStream* st); + void print_on(outputStream* st) const; }; // Used to manage the free list of Metablocks (a block corresponds // to the allocation of a quantum of metadata). class BlockFreelist VALUE_OBJ_CLASS_SPEC { BlockTreeDictionary* _dictionary; - static Metablock* initialize_free_chunk(MetaWord* p, size_t word_size); // Only allocate and split from freelist if the size of the allocation // is at least 1/4th the size of the available block. @@ -254,6 +234,7 @@ class BlockFreelist VALUE_OBJ_CLASS_SPEC { void print_on(outputStream* st) const; }; +// A VirtualSpaceList node. class VirtualSpaceNode : public CHeapObj { friend class VirtualSpaceList; @@ -276,11 +257,8 @@ class VirtualSpaceNode : public CHeapObj { // VirtualSpace Metachunk* first_chunk() { return (Metachunk*) bottom(); } - void inc_container_count(); -#ifdef ASSERT - uint container_count_slow(); -#endif - + // Committed but unused space in the virtual space + size_t free_words_in_vs() const; public: VirtualSpaceNode(size_t byte_size); @@ -292,9 +270,10 @@ class VirtualSpaceNode : public CHeapObj { MetaWord* end() const { return (MetaWord*) _virtual_space.high(); } size_t reserved_words() const { return _virtual_space.reserved_size() / BytesPerWord; } - size_t expanded_words() const { return _virtual_space.committed_size() / BytesPerWord; } size_t committed_words() const { return _virtual_space.actual_committed_size() / BytesPerWord; } + bool is_pre_committed() const { return _virtual_space.special(); } + // address of next available space in _virtual_space; // Accessors VirtualSpaceNode* next() { return _next; } @@ -314,15 +293,16 @@ class VirtualSpaceNode : public CHeapObj { void inc_top(size_t word_size) { _top += word_size; } uintx container_count() { return _container_count; } + void inc_container_count(); void dec_container_count(); #ifdef ASSERT + uint container_count_slow(); void verify_container_count(); #endif // used and capacity in this single entry in the list size_t used_words_in_vs() const; size_t capacity_words_in_vs() const; - size_t free_words_in_vs() const; bool initialize(); @@ -334,12 +314,19 @@ class VirtualSpaceNode : public CHeapObj { // Expands/shrinks the committed space in a virtual space. Delegates // to Virtualspace - bool expand_by(size_t words, bool pre_touch = false); + bool expand_by(size_t min_words, size_t preferred_words); // In preparation for deleting this node, remove all the chunks // in the node from any freelist. void purge(ChunkManager* chunk_manager); + // If an allocation doesn't fit in the current node a new node is created. + // Allocate chunks out of the remaining committed space in this node + // to avoid wasting that memory. + // This always adds up because all the chunk sizes are multiples of + // the smallest chunk size. + void retire(ChunkManager* chunk_manager); + #ifdef ASSERT // Debug support void mangle(); @@ -348,42 +335,77 @@ class VirtualSpaceNode : public CHeapObj { void print_on(outputStream* st) const; }; +#define assert_is_ptr_aligned(ptr, alignment) \ + assert(is_ptr_aligned(ptr, alignment), \ + err_msg(PTR_FORMAT " is not aligned to " \ + SIZE_FORMAT, ptr, alignment)) + +#define assert_is_size_aligned(size, alignment) \ + assert(is_size_aligned(size, alignment), \ + err_msg(SIZE_FORMAT " is not aligned to " \ + SIZE_FORMAT, size, alignment)) + + +// Decide if large pages should be committed when the memory is reserved. +static bool should_commit_large_pages_when_reserving(size_t bytes) { + if (UseLargePages && UseLargePagesInMetaspace && !os::can_commit_large_page_memory()) { + size_t words = bytes / BytesPerWord; + bool is_class = false; // We never reserve large pages for the class space. + if (MetaspaceGC::can_expand(words, is_class) && + MetaspaceGC::allowed_expansion() >= words) { + return true; + } + } + + return false; +} + // byte_size is the size of the associated virtualspace. -VirtualSpaceNode::VirtualSpaceNode(size_t byte_size) : _top(NULL), _next(NULL), _rs(), _container_count(0) { - // align up to vm allocation granularity - byte_size = align_size_up(byte_size, os::vm_allocation_granularity()); +VirtualSpaceNode::VirtualSpaceNode(size_t bytes) : _top(NULL), _next(NULL), _rs(), _container_count(0) { + assert_is_size_aligned(bytes, Metaspace::reserve_alignment()); // This allocates memory with mmap. For DumpSharedspaces, try to reserve // configurable address, generally at the top of the Java heap so other // memory addresses don't conflict. if (DumpSharedSpaces) { - char* shared_base = (char*)SharedBaseAddress; - _rs = ReservedSpace(byte_size, 0, false, shared_base, 0); + bool large_pages = false; // No large pages when dumping the CDS archive. + char* shared_base = (char*)align_ptr_up((char*)SharedBaseAddress, Metaspace::reserve_alignment()); + + _rs = ReservedSpace(bytes, Metaspace::reserve_alignment(), large_pages, shared_base, 0); if (_rs.is_reserved()) { assert(shared_base == 0 || _rs.base() == shared_base, "should match"); } else { // Get a mmap region anywhere if the SharedBaseAddress fails. - _rs = ReservedSpace(byte_size); + _rs = ReservedSpace(bytes, Metaspace::reserve_alignment(), large_pages); } MetaspaceShared::set_shared_rs(&_rs); } else { - _rs = ReservedSpace(byte_size); + bool large_pages = should_commit_large_pages_when_reserving(bytes); + + _rs = ReservedSpace(bytes, Metaspace::reserve_alignment(), large_pages); } - MemTracker::record_virtual_memory_type((address)_rs.base(), mtClass); + if (_rs.is_reserved()) { + assert(_rs.base() != NULL, "Catch if we get a NULL address"); + assert(_rs.size() != 0, "Catch if we get a 0 size"); + assert_is_ptr_aligned(_rs.base(), Metaspace::reserve_alignment()); + assert_is_size_aligned(_rs.size(), Metaspace::reserve_alignment()); + + MemTracker::record_virtual_memory_type((address)_rs.base(), mtClass); + } } void VirtualSpaceNode::purge(ChunkManager* chunk_manager) { Metachunk* chunk = first_chunk(); Metachunk* invalid_chunk = (Metachunk*) top(); while (chunk < invalid_chunk ) { - assert(chunk->is_free(), "Should be marked free"); - MetaWord* next = ((MetaWord*)chunk) + chunk->word_size(); - chunk_manager->remove_chunk(chunk); - assert(chunk->next() == NULL && - chunk->prev() == NULL, - "Was not removed from its list"); - chunk = (Metachunk*) next; + assert(chunk->is_tagged_free(), "Should be tagged free"); + MetaWord* next = ((MetaWord*)chunk) + chunk->word_size(); + chunk_manager->remove_chunk(chunk); + assert(chunk->next() == NULL && + chunk->prev() == NULL, + "Was not removed from its list"); + chunk = (Metachunk*) next; } } @@ -397,7 +419,7 @@ uint VirtualSpaceNode::container_count_slow() { // Don't count the chunks on the free lists. Those are // still part of the VirtualSpaceNode but not currently // counted. - if (!chunk->is_free()) { + if (!chunk->is_tagged_free()) { count++; } chunk = (Metachunk*) next; @@ -407,8 +429,6 @@ uint VirtualSpaceNode::container_count_slow() { #endif // List of VirtualSpaces for metadata allocation. -// It has a _next link for singly linked list and a MemRegion -// for total space in the VirtualSpace. class VirtualSpaceList : public CHeapObj { friend class VirtualSpaceNode; @@ -416,18 +436,13 @@ class VirtualSpaceList : public CHeapObj { VirtualSpaceSize = 256 * K }; - // Global list of virtual spaces // Head of the list VirtualSpaceNode* _virtual_space_list; // virtual space currently being used for allocations VirtualSpaceNode* _current_virtual_space; - // Free chunk list for all other metadata - ChunkManager _chunk_manager; - // Can this virtual list allocate >1 spaces? Also, used to determine - // whether to allocate unlimited small chunks in this virtual space + // Is this VirtualSpaceList used for the compressed class space bool _is_class; - bool can_grow() const { return !is_class() || !UseCompressedClassPointers; } // Sum of reserved and committed memory in the virtual spaces size_t _reserved_words; @@ -452,7 +467,11 @@ class VirtualSpaceList : public CHeapObj { // Get another virtual space and add it to the list. This // is typically prompted by a failed attempt to allocate a chunk // and is typically followed by the allocation of a chunk. - bool grow_vs(size_t vs_word_size); + bool create_new_virtual_space(size_t vs_word_size); + + // Chunk up the unused committed space in the current + // virtual space and add the chunks to the free list. + void retire_current_virtual_space(); public: VirtualSpaceList(size_t word_size); @@ -464,22 +483,20 @@ class VirtualSpaceList : public CHeapObj { size_t grow_chunks_by_words, size_t medium_chunk_bunch); - bool expand_by(VirtualSpaceNode* node, size_t word_size, bool pre_touch = false); + bool expand_node_by(VirtualSpaceNode* node, + size_t min_words, + size_t preferred_words); - // Get the first chunk for a Metaspace. Used for - // special cases such as the boot class loader, reflection - // class loader and anonymous class loader. - Metachunk* get_initialization_chunk(size_t word_size, size_t chunk_bunch); + bool expand_by(size_t min_words, + size_t preferred_words); VirtualSpaceNode* current_virtual_space() { return _current_virtual_space; } - ChunkManager* chunk_manager() { return &_chunk_manager; } bool is_class() const { return _is_class; } - // Allocate the first virtualspace. - void initialize(size_t word_size); + bool initialization_succeeded() { return _virtual_space_list != NULL; } size_t reserved_words() { return _reserved_words; } size_t reserved_bytes() { return reserved_words() * BytesPerWord; } @@ -494,14 +511,7 @@ class VirtualSpaceList : public CHeapObj { void dec_virtual_space_count(); // Unlink empty VirtualSpaceNodes and free it. - void purge(); - - // Used and capacity in the entire list of virtual spaces. - // These are global values shared by all Metaspaces - size_t capacity_words_sum(); - size_t capacity_bytes_sum() { return capacity_words_sum() * BytesPerWord; } - size_t used_words_sum(); - size_t used_bytes_sum() { return used_words_sum() * BytesPerWord; } + void purge(ChunkManager* chunk_manager); bool contains(const void *ptr); @@ -529,44 +539,16 @@ class VirtualSpaceList : public CHeapObj { class Metadebug : AllStatic { // Debugging support for Metaspaces - static int _deallocate_block_a_lot_count; - static int _deallocate_chunk_a_lot_count; static int _allocation_fail_alot_count; public: - static int deallocate_block_a_lot_count() { - return _deallocate_block_a_lot_count; - } - static void set_deallocate_block_a_lot_count(int v) { - _deallocate_block_a_lot_count = v; - } - static void inc_deallocate_block_a_lot_count() { - _deallocate_block_a_lot_count++; - } - static int deallocate_chunk_a_lot_count() { - return _deallocate_chunk_a_lot_count; - } - static void reset_deallocate_chunk_a_lot_count() { - _deallocate_chunk_a_lot_count = 1; - } - static void inc_deallocate_chunk_a_lot_count() { - _deallocate_chunk_a_lot_count++; - } static void init_allocation_fail_alot_count(); #ifdef ASSERT static bool test_metadata_failure(); #endif - - static void deallocate_chunk_a_lot(SpaceManager* sm, - size_t chunk_word_size); - static void deallocate_block_a_lot(SpaceManager* sm, - size_t chunk_word_size); - }; -int Metadebug::_deallocate_block_a_lot_count = 0; -int Metadebug::_deallocate_chunk_a_lot_count = 0; int Metadebug::_allocation_fail_alot_count = 0; // SpaceManager - used by Metaspace to handle allocations @@ -582,18 +564,12 @@ class SpaceManager : public CHeapObj { // Type of metadata allocated. Metaspace::MetadataType _mdtype; - // Chunk related size - size_t _medium_chunk_bunch; - // List of chunks in use by this SpaceManager. Allocations // are done from the current chunk. The list is used for deallocating // chunks when the SpaceManager is freed. Metachunk* _chunks_in_use[NumberOfInUseLists]; Metachunk* _current_chunk; - // Virtual space where allocation comes from. - VirtualSpaceList* _vs_list; - // Number of small chunks to allocate to a manager // If class space manager, small chunks are unlimited static uint const _small_chunk_limit; @@ -626,7 +602,9 @@ class SpaceManager : public CHeapObj { } Metaspace::MetadataType mdtype() { return _mdtype; } - VirtualSpaceList* vs_list() const { return _vs_list; } + + VirtualSpaceList* vs_list() const { return Metaspace::get_space_list(_mdtype); } + ChunkManager* chunk_manager() const { return Metaspace::get_chunk_manager(_mdtype); } Metachunk* current_chunk() const { return _current_chunk; } void set_current_chunk(Metachunk* v) { @@ -648,19 +626,22 @@ class SpaceManager : public CHeapObj { public: SpaceManager(Metaspace::MetadataType mdtype, - Mutex* lock, - VirtualSpaceList* vs_list); + Mutex* lock); ~SpaceManager(); enum ChunkMultiples { MediumChunkMultiple = 4 }; + bool is_class() { return _mdtype == Metaspace::ClassType; } + // Accessors - size_t specialized_chunk_size() { return SpecializedChunk; } - size_t small_chunk_size() { return (size_t) vs_list()->is_class() ? ClassSmallChunk : SmallChunk; } - size_t medium_chunk_size() { return (size_t) vs_list()->is_class() ? ClassMediumChunk : MediumChunk; } - size_t medium_chunk_bunch() { return medium_chunk_size() * MediumChunkMultiple; } + size_t specialized_chunk_size() { return (size_t) is_class() ? ClassSpecializedChunk : SpecializedChunk; } + size_t small_chunk_size() { return (size_t) is_class() ? ClassSmallChunk : SmallChunk; } + size_t medium_chunk_size() { return (size_t) is_class() ? ClassMediumChunk : MediumChunk; } + size_t medium_chunk_bunch() { return medium_chunk_size() * MediumChunkMultiple; } + + size_t smallest_chunk_size() { return specialized_chunk_size(); } size_t allocated_blocks_words() const { return _allocated_blocks_words; } size_t allocated_blocks_bytes() const { return _allocated_blocks_words * BytesPerWord; } @@ -718,6 +699,9 @@ class SpaceManager : public CHeapObj { // and allocates from that chunk. MetaWord* grow_and_allocate(size_t word_size); + // Notify memory usage to MemoryService. + void track_metaspace_memory_usage(); + // debugging support. void dump(outputStream* const out) const; @@ -732,14 +716,11 @@ class SpaceManager : public CHeapObj { #endif size_t get_raw_word_size(size_t word_size) { - // If only the dictionary is going to be used (i.e., no - // indexed free list), then there is a minimum size requirement. - // MinChunkSize is a placeholder for the real minimum size JJJ size_t byte_size = word_size * BytesPerWord; - size_t raw_bytes_size = MAX2(byte_size, - Metablock::min_block_byte_size()); - raw_bytes_size = ARENA_ALIGN(raw_bytes_size); + size_t raw_bytes_size = MAX2(byte_size, sizeof(Metablock)); + raw_bytes_size = align_size_up(raw_bytes_size, Metachunk::object_alignment()); + size_t raw_word_size = raw_bytes_size / BytesPerWord; assert(raw_word_size * BytesPerWord == raw_bytes_size, "Size problem"); @@ -762,7 +743,7 @@ void VirtualSpaceNode::inc_container_count() { _container_count++; assert(_container_count == container_count_slow(), err_msg("Inconsistency in countainer_count _container_count " SIZE_FORMAT - "container_count_slow() " SIZE_FORMAT, + " container_count_slow() " SIZE_FORMAT, _container_count, container_count_slow())); } @@ -775,7 +756,7 @@ void VirtualSpaceNode::dec_container_count() { void VirtualSpaceNode::verify_container_count() { assert(_container_count == container_count_slow(), err_msg("Inconsistency in countainer_count _container_count " SIZE_FORMAT - "container_count_slow() " SIZE_FORMAT, _container_count, container_count_slow())); + " container_count_slow() " SIZE_FORMAT, _container_count, container_count_slow())); } #endif @@ -792,17 +773,8 @@ BlockFreelist::~BlockFreelist() { } } -Metablock* BlockFreelist::initialize_free_chunk(MetaWord* p, size_t word_size) { - Metablock* block = (Metablock*) p; - block->set_word_size(word_size); - block->set_prev(NULL); - block->set_next(NULL); - - return block; -} - void BlockFreelist::return_block(MetaWord* p, size_t word_size) { - Metablock* free_chunk = initialize_free_chunk(p, word_size); + Metablock* free_chunk = ::new (p) Metablock(word_size); if (dictionary() == NULL) { _dictionary = new BlockTreeDictionary(); } @@ -879,6 +851,12 @@ Metachunk* VirtualSpaceNode::take_from_committed(size_t chunk_word_size) { MetaWord* chunk_limit = top(); assert(chunk_limit != NULL, "Not safe to call this method"); + // The virtual spaces are always expanded by the + // commit granularity to enforce the following condition. + // Without this the is_available check will not work correctly. + assert(_virtual_space.committed_size() == _virtual_space.actual_committed_size(), + "The committed memory doesn't match the expanded memory."); + if (!is_available(chunk_word_size)) { if (TraceMetadataChunkAllocation) { gclog_or_tty->print("VirtualSpaceNode::take_from_committed() not available %d words ", chunk_word_size); @@ -898,14 +876,21 @@ Metachunk* VirtualSpaceNode::take_from_committed(size_t chunk_word_size) { // Expand the virtual space (commit more of the reserved space) -bool VirtualSpaceNode::expand_by(size_t words, bool pre_touch) { - size_t bytes = words * BytesPerWord; - bool result = virtual_space()->expand_by(bytes, pre_touch); - if (TraceMetavirtualspaceAllocation && !result) { - gclog_or_tty->print_cr("VirtualSpaceNode::expand_by() failed " - "for byte size " SIZE_FORMAT, bytes); - virtual_space()->print_on(gclog_or_tty); +bool VirtualSpaceNode::expand_by(size_t min_words, size_t preferred_words) { + size_t min_bytes = min_words * BytesPerWord; + size_t preferred_bytes = preferred_words * BytesPerWord; + + size_t uncommitted = virtual_space()->reserved_size() - virtual_space()->actual_committed_size(); + + if (uncommitted < min_bytes) { + return false; } + + size_t commit = MIN2(preferred_bytes, uncommitted); + bool result = virtual_space()->expand_by(commit, false); + + assert(result, "Failed to commit memory"); + return result; } @@ -924,12 +909,23 @@ bool VirtualSpaceNode::initialize() { return false; } - // An allocation out of this Virtualspace that is larger - // than an initial commit size can waste that initial committed - // space. - size_t committed_byte_size = 0; - bool result = virtual_space()->initialize(_rs, committed_byte_size); + // These are necessary restriction to make sure that the virtual space always + // grows in steps of Metaspace::commit_alignment(). If both base and size are + // aligned only the middle alignment of the VirtualSpace is used. + assert_is_ptr_aligned(_rs.base(), Metaspace::commit_alignment()); + assert_is_size_aligned(_rs.size(), Metaspace::commit_alignment()); + + // ReservedSpaces marked as special will have the entire memory + // pre-committed. Setting a committed size will make sure that + // committed_size and actual_committed_size agrees. + size_t pre_committed_size = _rs.special() ? _rs.size() : 0; + + bool result = virtual_space()->initialize_with_granularity(_rs, pre_committed_size, + Metaspace::commit_alignment()); if (result) { + assert(virtual_space()->committed_size() == virtual_space()->actual_committed_size(), + "Checking that the pre-committed memory was registered by the VirtualSpace"); + set_top((MetaWord*)virtual_space()->low()); set_reserved(MemRegion((HeapWord*)_rs.base(), (HeapWord*)(_rs.base() + _rs.size()))); @@ -986,13 +982,23 @@ void VirtualSpaceList::dec_reserved_words(size_t v) { _reserved_words = _reserved_words - v; } +#define assert_committed_below_limit() \ + assert(MetaspaceAux::committed_bytes() <= MaxMetaspaceSize, \ + err_msg("Too much committed memory. Committed: " SIZE_FORMAT \ + " limit (MaxMetaspaceSize): " SIZE_FORMAT, \ + MetaspaceAux::committed_bytes(), MaxMetaspaceSize)); + void VirtualSpaceList::inc_committed_words(size_t v) { assert_lock_strong(SpaceManager::expand_lock()); _committed_words = _committed_words + v; + + assert_committed_below_limit(); } void VirtualSpaceList::dec_committed_words(size_t v) { assert_lock_strong(SpaceManager::expand_lock()); _committed_words = _committed_words - v; + + assert_committed_below_limit(); } void VirtualSpaceList::inc_virtual_space_count() { @@ -1014,13 +1020,13 @@ void ChunkManager::remove_chunk(Metachunk* chunk) { } // Chunk is being removed from the chunks free list. - dec_free_chunks_total(chunk->capacity_word_size()); + dec_free_chunks_total(chunk->word_size()); } // Walk the list of VirtualSpaceNodes and delete // nodes with a 0 container_count. Remove Metachunks in // the node from their respective freelists. -void VirtualSpaceList::purge() { +void VirtualSpaceList::purge(ChunkManager* chunk_manager) { assert_lock_strong(SpaceManager::expand_lock()); // Don't use a VirtualSpaceListIterator because this // list is being changed and a straightforward use of an iterator is not safe. @@ -1035,14 +1041,14 @@ void VirtualSpaceList::purge() { if (vsl->container_count() == 0 && vsl != current_virtual_space()) { // Unlink it from the list if (prev_vsl == vsl) { - // This is the case of the current note being the first note. - assert(vsl == virtual_space_list(), "Expected to be the first note"); + // This is the case of the current node being the first node. + assert(vsl == virtual_space_list(), "Expected to be the first node"); set_virtual_space_list(vsl->next()); } else { prev_vsl->set_next(vsl->next()); } - vsl->purge(chunk_manager()); + vsl->purge(chunk_manager); dec_reserved_words(vsl->reserved_words()); dec_committed_words(vsl->committed_words()); dec_virtual_space_count(); @@ -1064,37 +1070,36 @@ void VirtualSpaceList::purge() { #endif } -size_t VirtualSpaceList::used_words_sum() { - size_t allocated_by_vs = 0; - VirtualSpaceListIterator iter(virtual_space_list()); - while (iter.repeat()) { - VirtualSpaceNode* vsl = iter.get_next(); - // Sum used region [bottom, top) in each virtualspace - allocated_by_vs += vsl->used_words_in_vs(); - } - assert(allocated_by_vs >= chunk_manager()->free_chunks_total_words(), - err_msg("Total in free chunks " SIZE_FORMAT - " greater than total from virtual_spaces " SIZE_FORMAT, - allocated_by_vs, chunk_manager()->free_chunks_total_words())); - size_t used = - allocated_by_vs - chunk_manager()->free_chunks_total_words(); - return used; +void VirtualSpaceList::retire_current_virtual_space() { + assert_lock_strong(SpaceManager::expand_lock()); + + VirtualSpaceNode* vsn = current_virtual_space(); + + ChunkManager* cm = is_class() ? Metaspace::chunk_manager_class() : + Metaspace::chunk_manager_metadata(); + + vsn->retire(cm); } -// Space available in all MetadataVirtualspaces allocated -// for metadata. This is the upper limit on the capacity -// of chunks allocated out of all the MetadataVirtualspaces. -size_t VirtualSpaceList::capacity_words_sum() { - size_t capacity = 0; - VirtualSpaceListIterator iter(virtual_space_list()); - while (iter.repeat()) { - VirtualSpaceNode* vsl = iter.get_next(); - capacity += vsl->capacity_words_in_vs(); +void VirtualSpaceNode::retire(ChunkManager* chunk_manager) { + for (int i = (int)MediumIndex; i >= (int)ZeroIndex; --i) { + ChunkIndex index = (ChunkIndex)i; + size_t chunk_size = chunk_manager->free_chunks(index)->size(); + + while (free_words_in_vs() >= chunk_size) { + DEBUG_ONLY(verify_container_count();) + Metachunk* chunk = get_chunk_vs(chunk_size); + assert(chunk != NULL, "allocation should have been successful"); + + chunk_manager->return_chunks(index, chunk); + chunk_manager->inc_free_chunks_total(chunk_size); + DEBUG_ONLY(verify_container_count();) + } } - return capacity; + assert(free_words_in_vs() == 0, "should be empty now"); } -VirtualSpaceList::VirtualSpaceList(size_t word_size ) : +VirtualSpaceList::VirtualSpaceList(size_t word_size) : _is_class(false), _virtual_space_list(NULL), _current_virtual_space(NULL), @@ -1103,13 +1108,7 @@ VirtualSpaceList::VirtualSpaceList(size_t word_size ) : _virtual_space_count(0) { MutexLockerEx cl(SpaceManager::expand_lock(), Mutex::_no_safepoint_check_flag); - bool initialization_succeeded = grow_vs(word_size); - - _chunk_manager.free_chunks(SpecializedIndex)->set_size(SpecializedChunk); - _chunk_manager.free_chunks(SmallIndex)->set_size(SmallChunk); - _chunk_manager.free_chunks(MediumIndex)->set_size(MediumChunk); - assert(initialization_succeeded, - " VirtualSpaceList initialization should not fail"); + create_new_virtual_space(word_size); } VirtualSpaceList::VirtualSpaceList(ReservedSpace rs) : @@ -1123,11 +1122,9 @@ VirtualSpaceList::VirtualSpaceList(ReservedSpace rs) : Mutex::_no_safepoint_check_flag); VirtualSpaceNode* class_entry = new VirtualSpaceNode(rs); bool succeeded = class_entry->initialize(); - _chunk_manager.free_chunks(SpecializedIndex)->set_size(SpecializedChunk); - _chunk_manager.free_chunks(SmallIndex)->set_size(ClassSmallChunk); - _chunk_manager.free_chunks(MediumIndex)->set_size(ClassMediumChunk); - assert(succeeded, " VirtualSpaceList initialization should not fail"); - link_vs(class_entry); + if (succeeded) { + link_vs(class_entry); + } } size_t VirtualSpaceList::free_bytes() { @@ -1135,14 +1132,24 @@ size_t VirtualSpaceList::free_bytes() { } // Allocate another meta virtual space and add it to the list. -bool VirtualSpaceList::grow_vs(size_t vs_word_size) { +bool VirtualSpaceList::create_new_virtual_space(size_t vs_word_size) { assert_lock_strong(SpaceManager::expand_lock()); - if (vs_word_size == 0) { + + if (is_class()) { + assert(false, "We currently don't support more than one VirtualSpace for" + " the compressed class space. The initialization of the" + " CCS uses another code path and should not hit this path."); return false; } + + if (vs_word_size == 0) { + assert(false, "vs_word_size should always be at least _reserve_alignment large."); + return false; + } + // Reserve the space size_t vs_byte_size = vs_word_size * BytesPerWord; - assert(vs_byte_size % os::vm_page_size() == 0, "Not aligned"); + assert_is_size_aligned(vs_byte_size, Metaspace::reserve_alignment()); // Allocate the meta virtual space and initialize it. VirtualSpaceNode* new_entry = new VirtualSpaceNode(vs_byte_size); @@ -1150,7 +1157,8 @@ bool VirtualSpaceList::grow_vs(size_t vs_word_size) { delete new_entry; return false; } else { - assert(new_entry->reserved_words() == vs_word_size, "Must be"); + assert(new_entry->reserved_words() == vs_word_size, + "Reserved memory size differs from requested memory size"); // ensure lock-free iteration sees fully initialized node OrderAccess::storestore(); link_vs(new_entry); @@ -1177,89 +1185,96 @@ void VirtualSpaceList::link_vs(VirtualSpaceNode* new_entry) { } } -bool VirtualSpaceList::expand_by(VirtualSpaceNode* node, size_t word_size, bool pre_touch) { +bool VirtualSpaceList::expand_node_by(VirtualSpaceNode* node, + size_t min_words, + size_t preferred_words) { size_t before = node->committed_words(); - bool result = node->expand_by(word_size, pre_touch); + bool result = node->expand_by(min_words, preferred_words); size_t after = node->committed_words(); // after and before can be the same if the memory was pre-committed. - assert(after >= before, "Must be"); + assert(after >= before, "Inconsistency"); inc_committed_words(after - before); return result; } +bool VirtualSpaceList::expand_by(size_t min_words, size_t preferred_words) { + assert_is_size_aligned(min_words, Metaspace::commit_alignment_words()); + assert_is_size_aligned(preferred_words, Metaspace::commit_alignment_words()); + assert(min_words <= preferred_words, "Invalid arguments"); + + if (!MetaspaceGC::can_expand(min_words, this->is_class())) { + return false; + } + + size_t allowed_expansion_words = MetaspaceGC::allowed_expansion(); + if (allowed_expansion_words < min_words) { + return false; + } + + size_t max_expansion_words = MIN2(preferred_words, allowed_expansion_words); + + // Commit more memory from the the current virtual space. + bool vs_expanded = expand_node_by(current_virtual_space(), + min_words, + max_expansion_words); + if (vs_expanded) { + return true; + } + retire_current_virtual_space(); + + // Get another virtual space. + size_t grow_vs_words = MAX2((size_t)VirtualSpaceSize, preferred_words); + grow_vs_words = align_size_up(grow_vs_words, Metaspace::reserve_alignment_words()); + + if (create_new_virtual_space(grow_vs_words)) { + if (current_virtual_space()->is_pre_committed()) { + // The memory was pre-committed, so we are done here. + assert(min_words <= current_virtual_space()->committed_words(), + "The new VirtualSpace was pre-committed, so it" + "should be large enough to fit the alloc request."); + return true; + } + + return expand_node_by(current_virtual_space(), + min_words, + max_expansion_words); + } + + return false; +} + Metachunk* VirtualSpaceList::get_new_chunk(size_t word_size, size_t grow_chunks_by_words, size_t medium_chunk_bunch) { - // Get a chunk from the chunk freelist - Metachunk* next = chunk_manager()->chunk_freelist_allocate(grow_chunks_by_words); + // Allocate a chunk out of the current virtual space. + Metachunk* next = current_virtual_space()->get_chunk_vs(grow_chunks_by_words); if (next != NULL) { - next->container()->inc_container_count(); - } else { - // Allocate a chunk out of the current virtual space. + return next; + } + + // The expand amount is currently only determined by the requested sizes + // and not how much committed memory is left in the current virtual space. + + size_t min_word_size = align_size_up(grow_chunks_by_words, Metaspace::commit_alignment_words()); + size_t preferred_word_size = align_size_up(medium_chunk_bunch, Metaspace::commit_alignment_words()); + if (min_word_size >= preferred_word_size) { + // Can happen when humongous chunks are allocated. + preferred_word_size = min_word_size; + } + + bool expanded = expand_by(min_word_size, preferred_word_size); + if (expanded) { next = current_virtual_space()->get_chunk_vs(grow_chunks_by_words); + assert(next != NULL, "The allocation was expected to succeed after the expansion"); } - if (next == NULL) { - // Not enough room in current virtual space. Try to commit - // more space. - size_t expand_vs_by_words = MAX2(medium_chunk_bunch, - grow_chunks_by_words); - size_t page_size_words = os::vm_page_size() / BytesPerWord; - size_t aligned_expand_vs_by_words = align_size_up(expand_vs_by_words, - page_size_words); - bool vs_expanded = - expand_by(current_virtual_space(), aligned_expand_vs_by_words); - if (!vs_expanded) { - // Should the capacity of the metaspaces be expanded for - // this allocation? If it's the virtual space for classes and is - // being used for CompressedHeaders, don't allocate a new virtualspace. - if (can_grow() && MetaspaceGC::should_expand(this, word_size)) { - // Get another virtual space. - size_t grow_vs_words = - MAX2((size_t)VirtualSpaceSize, aligned_expand_vs_by_words); - if (grow_vs(grow_vs_words)) { - // Got it. It's on the list now. Get a chunk from it. - assert(current_virtual_space()->expanded_words() == 0, - "New virtuals space nodes should not have expanded"); - - size_t grow_chunks_by_words_aligned = align_size_up(grow_chunks_by_words, - page_size_words); - // We probably want to expand by aligned_expand_vs_by_words here. - expand_by(current_virtual_space(), grow_chunks_by_words_aligned); - next = current_virtual_space()->get_chunk_vs(grow_chunks_by_words); - } - } else { - // Allocation will fail and induce a GC - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr("VirtualSpaceList::get_new_chunk():" - " Fail instead of expand the metaspace"); - } - } - } else { - // The virtual space expanded, get a new chunk - next = current_virtual_space()->get_chunk_vs(grow_chunks_by_words); - assert(next != NULL, "Just expanded, should succeed"); - } - } - - assert(next == NULL || (next->next() == NULL && next->prev() == NULL), - "New chunk is still on some list"); - return next; -} - -Metachunk* VirtualSpaceList::get_initialization_chunk(size_t chunk_word_size, - size_t chunk_bunch) { - // Get a chunk from the chunk freelist - Metachunk* new_chunk = get_new_chunk(chunk_word_size, - chunk_word_size, - chunk_bunch); - return new_chunk; + return next; } void VirtualSpaceList::print_on(outputStream* st) const { @@ -1308,95 +1323,96 @@ bool VirtualSpaceList::contains(const void *ptr) { // Calculate the amount to increase the high water mark (HWM). // Increase by a minimum amount (MinMetaspaceExpansion) so that // another expansion is not requested too soon. If that is not -// enough to satisfy the allocation (i.e. big enough for a word_size -// allocation), increase by MaxMetaspaceExpansion. If that is still -// not enough, expand by the size of the allocation (word_size) plus -// some. -size_t MetaspaceGC::delta_capacity_until_GC(size_t word_size) { - size_t before_inc = MetaspaceGC::capacity_until_GC(); - size_t min_delta_words = MinMetaspaceExpansion / BytesPerWord; - size_t max_delta_words = MaxMetaspaceExpansion / BytesPerWord; - size_t page_size_words = os::vm_page_size() / BytesPerWord; - size_t size_delta_words = align_size_up(word_size, page_size_words); - size_t delta_words = MAX2(size_delta_words, min_delta_words); - if (delta_words > min_delta_words) { +// enough to satisfy the allocation, increase by MaxMetaspaceExpansion. +// If that is still not enough, expand by the size of the allocation +// plus some. +size_t MetaspaceGC::delta_capacity_until_GC(size_t bytes) { + size_t min_delta = MinMetaspaceExpansion; + size_t max_delta = MaxMetaspaceExpansion; + size_t delta = align_size_up(bytes, Metaspace::commit_alignment()); + + if (delta <= min_delta) { + delta = min_delta; + } else if (delta <= max_delta) { // Don't want to hit the high water mark on the next // allocation so make the delta greater than just enough // for this allocation. - delta_words = MAX2(delta_words, max_delta_words); - if (delta_words > max_delta_words) { - // This allocation is large but the next ones are probably not - // so increase by the minimum. - delta_words = delta_words + min_delta_words; - } - } - return delta_words; -} - -bool MetaspaceGC::should_expand(VirtualSpaceList* vsl, size_t word_size) { - - // If the user wants a limit, impose one. - // The reason for someone using this flag is to limit reserved space. So - // for non-class virtual space, compare against virtual spaces that are reserved. - // For class virtual space, we only compare against the committed space, not - // reserved space, because this is a larger space prereserved for compressed - // class pointers. - if (!FLAG_IS_DEFAULT(MaxMetaspaceSize)) { - size_t real_allocated = Metaspace::space_list()->reserved_words() + - MetaspaceAux::allocated_capacity_bytes(Metaspace::ClassType); - if (real_allocated >= MaxMetaspaceSize) { - return false; - } - } - - // Class virtual space should always be expanded. Call GC for the other - // metadata virtual space. - if (Metaspace::using_class_space() && - (vsl == Metaspace::class_space_list())) return true; - - // If this is part of an allocation after a GC, expand - // unconditionally. - if (MetaspaceGC::expand_after_GC()) { - return true; - } - - - // If the capacity is below the minimum capacity, allow the - // expansion. Also set the high-water-mark (capacity_until_GC) - // to that minimum capacity so that a GC will not be induced - // until that minimum capacity is exceeded. - size_t committed_capacity_bytes = MetaspaceAux::allocated_capacity_bytes(); - size_t metaspace_size_bytes = MetaspaceSize; - if (committed_capacity_bytes < metaspace_size_bytes || - capacity_until_GC() == 0) { - set_capacity_until_GC(metaspace_size_bytes); - return true; + delta = max_delta; } else { - if (committed_capacity_bytes < capacity_until_GC()) { - return true; - } else { - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr(" allocation request size " SIZE_FORMAT - " capacity_until_GC " SIZE_FORMAT - " allocated_capacity_bytes " SIZE_FORMAT, - word_size, - capacity_until_GC(), - MetaspaceAux::allocated_capacity_bytes()); - } + // This allocation is large but the next ones are probably not + // so increase by the minimum. + delta = delta + min_delta; + } + + assert_is_size_aligned(delta, Metaspace::commit_alignment()); + + return delta; +} + +size_t MetaspaceGC::capacity_until_GC() { + size_t value = (size_t)OrderAccess::load_ptr_acquire(&_capacity_until_GC); + assert(value >= MetaspaceSize, "Not initialied properly?"); + return value; +} + +size_t MetaspaceGC::inc_capacity_until_GC(size_t v) { + assert_is_size_aligned(v, Metaspace::commit_alignment()); + + return (size_t)Atomic::add_ptr(v, &_capacity_until_GC); +} + +size_t MetaspaceGC::dec_capacity_until_GC(size_t v) { + assert_is_size_aligned(v, Metaspace::commit_alignment()); + + return (size_t)Atomic::add_ptr(-(intptr_t)v, &_capacity_until_GC); +} + +bool MetaspaceGC::can_expand(size_t word_size, bool is_class) { + // Check if the compressed class space is full. + if (is_class && Metaspace::using_class_space()) { + size_t class_committed = MetaspaceAux::committed_bytes(Metaspace::ClassType); + if (class_committed + word_size * BytesPerWord > CompressedClassSpaceSize) { return false; } } + + // Check if the user has imposed a limit on the metaspace memory. + size_t committed_bytes = MetaspaceAux::committed_bytes(); + if (committed_bytes + word_size * BytesPerWord > MaxMetaspaceSize) { + return false; + } + + return true; } +size_t MetaspaceGC::allowed_expansion() { + size_t committed_bytes = MetaspaceAux::committed_bytes(); + size_t left_until_max = MaxMetaspaceSize - committed_bytes; + + // Always grant expansion if we are initiating the JVM, + // or if the GC_locker is preventing GCs. + if (!is_init_completed() || GC_locker::is_active_and_needs_gc()) { + return left_until_max / BytesPerWord; + } + + size_t capacity_until_gc = capacity_until_GC(); + + if (capacity_until_gc <= committed_bytes) { + return 0; + } + + size_t left_until_GC = capacity_until_gc - committed_bytes; + size_t left_to_commit = MIN2(left_until_GC, left_until_max); + + return left_to_commit / BytesPerWord; +} void MetaspaceGC::compute_new_size() { assert(_shrink_factor <= 100, "invalid shrink factor"); uint current_shrink_factor = _shrink_factor; _shrink_factor = 0; - // Until a faster way of calculating the "used" quantity is implemented, - // use "capacity". const size_t used_after_gc = MetaspaceAux::allocated_capacity_bytes(); const size_t capacity_until_GC = MetaspaceGC::capacity_until_GC(); @@ -1428,9 +1444,10 @@ void MetaspaceGC::compute_new_size() { // If we have less capacity below the metaspace HWM, then // increment the HWM. size_t expand_bytes = minimum_desired_capacity - capacity_until_GC; + expand_bytes = align_size_up(expand_bytes, Metaspace::commit_alignment()); // Don't expand unless it's significant if (expand_bytes >= MinMetaspaceExpansion) { - MetaspaceGC::set_capacity_until_GC(capacity_until_GC + expand_bytes); + MetaspaceGC::inc_capacity_until_GC(expand_bytes); } if (PrintGCDetails && Verbose) { size_t new_capacity_until_GC = capacity_until_GC; @@ -1487,6 +1504,9 @@ void MetaspaceGC::compute_new_size() { // on the third call, and 100% by the fourth call. But if we recompute // size without shrinking, it goes back to 0%. shrink_bytes = shrink_bytes / 100 * current_shrink_factor; + + shrink_bytes = align_size_down(shrink_bytes, Metaspace::commit_alignment()); + assert(shrink_bytes <= max_shrink_bytes, err_msg("invalid shrink size " SIZE_FORMAT " not <= " SIZE_FORMAT, shrink_bytes, max_shrink_bytes)); @@ -1518,60 +1538,12 @@ void MetaspaceGC::compute_new_size() { // Don't shrink unless it's significant if (shrink_bytes >= MinMetaspaceExpansion && ((capacity_until_GC - shrink_bytes) >= MetaspaceSize)) { - MetaspaceGC::set_capacity_until_GC(capacity_until_GC - shrink_bytes); + MetaspaceGC::dec_capacity_until_GC(shrink_bytes); } } // Metadebug methods -void Metadebug::deallocate_chunk_a_lot(SpaceManager* sm, - size_t chunk_word_size){ -#ifdef ASSERT - VirtualSpaceList* vsl = sm->vs_list(); - if (MetaDataDeallocateALot && - Metadebug::deallocate_chunk_a_lot_count() % MetaDataDeallocateALotInterval == 0 ) { - Metadebug::reset_deallocate_chunk_a_lot_count(); - for (uint i = 0; i < metadata_deallocate_a_lock_chunk; i++) { - Metachunk* dummy_chunk = vsl->current_virtual_space()->take_from_committed(chunk_word_size); - if (dummy_chunk == NULL) { - break; - } - vsl->chunk_manager()->chunk_freelist_deallocate(dummy_chunk); - - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print("Metadebug::deallocate_chunk_a_lot: %d) ", - sm->sum_count_in_chunks_in_use()); - dummy_chunk->print_on(gclog_or_tty); - gclog_or_tty->print_cr(" Free chunks total %d count %d", - vsl->chunk_manager()->free_chunks_total_words(), - vsl->chunk_manager()->free_chunks_count()); - } - } - } else { - Metadebug::inc_deallocate_chunk_a_lot_count(); - } -#endif -} - -void Metadebug::deallocate_block_a_lot(SpaceManager* sm, - size_t raw_word_size){ -#ifdef ASSERT - if (MetaDataDeallocateALot && - Metadebug::deallocate_block_a_lot_count() % MetaDataDeallocateALotInterval == 0 ) { - Metadebug::set_deallocate_block_a_lot_count(0); - for (uint i = 0; i < metadata_deallocate_a_lot_block; i++) { - MetaWord* dummy_block = sm->allocate_work(raw_word_size); - if (dummy_block == 0) { - break; - } - sm->deallocate(dummy_block, raw_word_size); - } - } else { - Metadebug::inc_deallocate_block_a_lot_count(); - } -#endif -} - void Metadebug::init_allocation_fail_alot_count() { if (MetadataAllocationFailALot) { _allocation_fail_alot_count = @@ -1715,31 +1687,6 @@ ChunkList* ChunkManager::find_free_chunks_list(size_t word_size) { return free_chunks(index); } -void ChunkManager::free_chunks_put(Metachunk* chunk) { - assert_lock_strong(SpaceManager::expand_lock()); - ChunkList* free_list = find_free_chunks_list(chunk->word_size()); - chunk->set_next(free_list->head()); - free_list->set_head(chunk); - // chunk is being returned to the chunk free list - inc_free_chunks_total(chunk->capacity_word_size()); - slow_locked_verify(); -} - -void ChunkManager::chunk_freelist_deallocate(Metachunk* chunk) { - // The deallocation of a chunk originates in the freelist - // manangement code for a Metaspace and does not hold the - // lock. - assert(chunk != NULL, "Deallocating NULL"); - assert_lock_strong(SpaceManager::expand_lock()); - slow_locked_verify(); - if (TraceMetadataChunkAllocation) { - gclog_or_tty->print_cr("ChunkManager::chunk_freelist_deallocate: chunk " - PTR_FORMAT " size " SIZE_FORMAT, - chunk, chunk->word_size()); - } - free_chunks_put(chunk); -} - Metachunk* ChunkManager::free_chunks_get(size_t word_size) { assert_lock_strong(SpaceManager::expand_lock()); @@ -1751,7 +1698,6 @@ Metachunk* ChunkManager::free_chunks_get(size_t word_size) { assert(free_list != NULL, "Sanity check"); chunk = free_list->head(); - debug_only(Metachunk* debug_head = chunk;) if (chunk == NULL) { return NULL; @@ -1760,9 +1706,6 @@ Metachunk* ChunkManager::free_chunks_get(size_t word_size) { // Remove the chunk as the head of the list. free_list->remove_chunk(chunk); - // Chunk is being removed from the chunks free list. - dec_free_chunks_total(chunk->capacity_word_size()); - if (TraceMetadataChunkAllocation && Verbose) { gclog_or_tty->print_cr("ChunkManager::free_chunks_get: free_list " PTR_FORMAT " head " PTR_FORMAT " size " SIZE_FORMAT, @@ -1773,29 +1716,32 @@ Metachunk* ChunkManager::free_chunks_get(size_t word_size) { word_size, FreeBlockDictionary::atLeast); - if (chunk != NULL) { - if (TraceMetadataHumongousAllocation) { - size_t waste = chunk->word_size() - word_size; - gclog_or_tty->print_cr("Free list allocate humongous chunk size " - SIZE_FORMAT " for requested size " SIZE_FORMAT - " waste " SIZE_FORMAT, - chunk->word_size(), word_size, waste); - } - // Chunk is being removed from the chunks free list. - dec_free_chunks_total(chunk->capacity_word_size()); - } else { + if (chunk == NULL) { return NULL; } + + if (TraceMetadataHumongousAllocation) { + size_t waste = chunk->word_size() - word_size; + gclog_or_tty->print_cr("Free list allocate humongous chunk size " + SIZE_FORMAT " for requested size " SIZE_FORMAT + " waste " SIZE_FORMAT, + chunk->word_size(), word_size, waste); + } } + // Chunk is being removed from the chunks free list. + dec_free_chunks_total(chunk->word_size()); + // Remove it from the links to this freelist chunk->set_next(NULL); chunk->set_prev(NULL); #ifdef ASSERT // Chunk is no longer on any freelist. Setting to false make container_count_slow() // work. - chunk->set_is_free(false); + chunk->set_is_tagged_free(false); #endif + chunk->container()->inc_container_count(); + slow_locked_verify(); return chunk; } @@ -1830,9 +1776,9 @@ Metachunk* ChunkManager::chunk_freelist_allocate(size_t word_size) { return chunk; } -void ChunkManager::print_on(outputStream* out) { +void ChunkManager::print_on(outputStream* out) const { if (PrintFLSStatistics != 0) { - humongous_dictionary()->report_statistics(); + const_cast(this)->humongous_dictionary()->report_statistics(); } } @@ -1924,7 +1870,7 @@ size_t SpaceManager::sum_capacity_in_chunks_in_use() const { for (ChunkIndex i = ZeroIndex; i < NumberOfInUseLists; i = next_chunk_index(i)) { Metachunk* chunk = chunks_in_use(i); while (chunk != NULL) { - sum += chunk->capacity_word_size(); + sum += chunk->word_size(); chunk = chunk->next(); } } @@ -1979,8 +1925,8 @@ void SpaceManager::locked_print_chunks_in_use_on(outputStream* st) const { } } - vs_list()->chunk_manager()->locked_print_free_chunks(st); - vs_list()->chunk_manager()->locked_print_sum_free_chunks(st); + chunk_manager()->locked_print_free_chunks(st); + chunk_manager()->locked_print_sum_free_chunks(st); } size_t SpaceManager::calc_chunk_size(size_t word_size) { @@ -2000,12 +1946,12 @@ size_t SpaceManager::calc_chunk_size(size_t word_size) { chunk_word_size = medium_chunk_size(); } - // Might still need a humongous chunk. Enforce an - // eight word granularity to facilitate reuse (some - // wastage but better chance of reuse). + // Might still need a humongous chunk. Enforce + // humongous allocations sizes to be aligned up to + // the smallest chunk size. size_t if_humongous_sized_chunk = align_size_up(word_size + Metachunk::overhead(), - HumongousChunkGranularity); + smallest_chunk_size()); chunk_word_size = MAX2((size_t) chunk_word_size, if_humongous_sized_chunk); @@ -2026,6 +1972,15 @@ size_t SpaceManager::calc_chunk_size(size_t word_size) { return chunk_word_size; } +void SpaceManager::track_metaspace_memory_usage() { + if (is_init_completed()) { + if (is_class()) { + MemoryService::track_compressed_class_memory_usage(); + } + MemoryService::track_metaspace_memory_usage(); + } +} + MetaWord* SpaceManager::grow_and_allocate(size_t word_size) { assert(vs_list()->current_virtual_space() != NULL, "Should have been set"); @@ -2051,15 +2006,20 @@ MetaWord* SpaceManager::grow_and_allocate(size_t word_size) { size_t grow_chunks_by_words = calc_chunk_size(word_size); Metachunk* next = get_new_chunk(word_size, grow_chunks_by_words); + MetaWord* mem = NULL; + // If a chunk was available, add it to the in-use chunk list // and do an allocation from it. if (next != NULL) { - Metadebug::deallocate_chunk_a_lot(this, grow_chunks_by_words); // Add to this manager's list of chunks in use. add_chunk(next, false); - return next->allocate(word_size); + mem = next->allocate(word_size); } - return NULL; + + // Track metaspace memory usage statistic. + track_metaspace_memory_usage(); + + return mem; } void SpaceManager::print_on(outputStream* st) const { @@ -2084,9 +2044,7 @@ void SpaceManager::print_on(outputStream* st) const { } SpaceManager::SpaceManager(Metaspace::MetadataType mdtype, - Mutex* lock, - VirtualSpaceList* vs_list) : - _vs_list(vs_list), + Mutex* lock) : _mdtype(mdtype), _allocated_blocks_words(0), _allocated_chunks_words(0), @@ -2156,7 +2114,7 @@ void ChunkManager::return_chunks(ChunkIndex index, Metachunk* chunks) { // Capture the next link before it is changed // by the call to return_chunk_at_head(); Metachunk* next = cur->next(); - cur->set_is_free(true); + DEBUG_ONLY(cur->set_is_tagged_free(true);) list->return_chunk_at_head(cur); cur = next; } @@ -2172,9 +2130,7 @@ SpaceManager::~SpaceManager() { MutexLockerEx fcl(SpaceManager::expand_lock(), Mutex::_no_safepoint_check_flag); - ChunkManager* chunk_manager = vs_list()->chunk_manager(); - - chunk_manager->slow_locked_verify(); + chunk_manager()->slow_locked_verify(); dec_total_from_size_metrics(); @@ -2188,8 +2144,8 @@ SpaceManager::~SpaceManager() { // Have to update before the chunks_in_use lists are emptied // below. - chunk_manager->inc_free_chunks_total(allocated_chunks_words(), - sum_count_in_chunks_in_use()); + chunk_manager()->inc_free_chunks_total(allocated_chunks_words(), + sum_count_in_chunks_in_use()); // Add all the chunks in use by this space manager // to the global list of free chunks. @@ -2204,11 +2160,11 @@ SpaceManager::~SpaceManager() { chunk_size_name(i)); } Metachunk* chunks = chunks_in_use(i); - chunk_manager->return_chunks(i, chunks); + chunk_manager()->return_chunks(i, chunks); set_chunks_in_use(i, NULL); if (TraceMetadataChunkAllocation && Verbose) { gclog_or_tty->print_cr("updated freelist count %d %s", - chunk_manager->free_chunks(i)->count(), + chunk_manager()->free_chunks(i)->count(), chunk_size_name(i)); } assert(i != HumongousIndex, "Humongous chunks are handled explicitly later"); @@ -2230,7 +2186,7 @@ SpaceManager::~SpaceManager() { while (humongous_chunks != NULL) { #ifdef ASSERT - humongous_chunks->set_is_free(true); + humongous_chunks->set_is_tagged_free(true); #endif if (TraceMetadataChunkAllocation && Verbose) { gclog_or_tty->print(PTR_FORMAT " (" SIZE_FORMAT ") ", @@ -2239,22 +2195,22 @@ SpaceManager::~SpaceManager() { } assert(humongous_chunks->word_size() == (size_t) align_size_up(humongous_chunks->word_size(), - HumongousChunkGranularity), + smallest_chunk_size()), err_msg("Humongous chunk size is wrong: word size " SIZE_FORMAT " granularity %d", - humongous_chunks->word_size(), HumongousChunkGranularity)); + humongous_chunks->word_size(), smallest_chunk_size())); Metachunk* next_humongous_chunks = humongous_chunks->next(); humongous_chunks->container()->dec_container_count(); - chunk_manager->humongous_dictionary()->return_chunk(humongous_chunks); + chunk_manager()->humongous_dictionary()->return_chunk(humongous_chunks); humongous_chunks = next_humongous_chunks; } if (TraceMetadataChunkAllocation && Verbose) { gclog_or_tty->print_cr(""); gclog_or_tty->print_cr("updated dictionary count %d %s", - chunk_manager->humongous_dictionary()->total_count(), + chunk_manager()->humongous_dictionary()->total_count(), chunk_size_name(HumongousIndex)); } - chunk_manager->slow_locked_verify(); + chunk_manager()->slow_locked_verify(); } const char* SpaceManager::chunk_size_name(ChunkIndex index) const { @@ -2343,9 +2299,7 @@ void SpaceManager::add_chunk(Metachunk* new_chunk, bool make_current) { gclog_or_tty->print("SpaceManager::add_chunk: %d) ", sum_count_in_chunks_in_use()); new_chunk->print_on(gclog_or_tty); - if (vs_list() != NULL) { - vs_list()->chunk_manager()->locked_print_free_chunks(gclog_or_tty); - } + chunk_manager()->locked_print_free_chunks(gclog_or_tty); } } @@ -2361,10 +2315,14 @@ void SpaceManager::retire_current_chunk() { Metachunk* SpaceManager::get_new_chunk(size_t word_size, size_t grow_chunks_by_words) { + // Get a chunk from the chunk freelist + Metachunk* next = chunk_manager()->chunk_freelist_allocate(grow_chunks_by_words); - Metachunk* next = vs_list()->get_new_chunk(word_size, - grow_chunks_by_words, - medium_chunk_bunch()); + if (next == NULL) { + next = vs_list()->get_new_chunk(word_size, + grow_chunks_by_words, + medium_chunk_bunch()); + } if (TraceMetadataHumongousAllocation && next != NULL && SpaceManager::is_humongous(next->word_size())) { @@ -2392,7 +2350,6 @@ MetaWord* SpaceManager::allocate(size_t word_size) { if (p == NULL) { p = allocate_work(raw_word_size); } - Metadebug::deallocate_block_a_lot(this, raw_word_size); return p; } @@ -2417,6 +2374,7 @@ MetaWord* SpaceManager::allocate_work(size_t word_size) { inc_used_metrics(word_size); return current_chunk()->allocate(word_size); // caller handles null result } + if (current_chunk() != NULL) { result = current_chunk()->allocate(word_size); } @@ -2424,7 +2382,8 @@ MetaWord* SpaceManager::allocate_work(size_t word_size) { if (result == NULL) { result = grow_and_allocate(word_size); } - if (result != 0) { + + if (result != NULL) { inc_used_metrics(word_size); assert(result != (MetaWord*) chunks_in_use(MediumIndex), "Head of the list is being allocated"); @@ -2489,7 +2448,7 @@ void SpaceManager::dump(outputStream* const out) const { curr->print_on(out); curr_total += curr->word_size(); used += curr->used_word_size(); - capacity += curr->capacity_word_size(); + capacity += curr->word_size(); waste += curr->free_word_size() + curr->overhead();; } } @@ -2644,13 +2603,12 @@ size_t MetaspaceAux::committed_bytes(Metaspace::MetadataType mdtype) { size_t MetaspaceAux::min_chunk_size_words() { return Metaspace::first_chunk_word_size(); } size_t MetaspaceAux::free_chunks_total_words(Metaspace::MetadataType mdtype) { - VirtualSpaceList* list = Metaspace::get_space_list(mdtype); - if (list == NULL) { + ChunkManager* chunk_manager = Metaspace::get_chunk_manager(mdtype); + if (chunk_manager == NULL) { return 0; } - ChunkManager* chunk = list->chunk_manager(); - chunk->slow_verify(); - return chunk->free_chunks_total_words(); + chunk_manager->slow_verify(); + return chunk_manager->free_chunks_total_words(); } size_t MetaspaceAux::free_chunks_total_bytes(Metaspace::MetadataType mdtype) { @@ -2691,24 +2649,26 @@ void MetaspaceAux::print_metaspace_change(size_t prev_metadata_used) { void MetaspaceAux::print_on(outputStream* out) { Metaspace::MetadataType nct = Metaspace::NonClassType; - out->print_cr(" Metaspace total " - SIZE_FORMAT "K, used " SIZE_FORMAT "K," - " reserved " SIZE_FORMAT "K", - allocated_capacity_bytes()/K, allocated_used_bytes()/K, reserved_bytes()/K); + out->print_cr(" Metaspace " + "used " SIZE_FORMAT "K, " + "capacity " SIZE_FORMAT "K, " + "committed " SIZE_FORMAT "K, " + "reserved " SIZE_FORMAT "K", + allocated_used_bytes()/K, + allocated_capacity_bytes()/K, + committed_bytes()/K, + reserved_bytes()/K); - out->print_cr(" data space " - SIZE_FORMAT "K, used " SIZE_FORMAT "K," - " reserved " SIZE_FORMAT "K", - allocated_capacity_bytes(nct)/K, - allocated_used_bytes(nct)/K, - reserved_bytes(nct)/K); if (Metaspace::using_class_space()) { Metaspace::MetadataType ct = Metaspace::ClassType; out->print_cr(" class space " - SIZE_FORMAT "K, used " SIZE_FORMAT "K," - " reserved " SIZE_FORMAT "K", - allocated_capacity_bytes(ct)/K, + "used " SIZE_FORMAT "K, " + "capacity " SIZE_FORMAT "K, " + "committed " SIZE_FORMAT "K, " + "reserved " SIZE_FORMAT "K", allocated_used_bytes(ct)/K, + allocated_capacity_bytes(ct)/K, + committed_bytes(ct)/K, reserved_bytes(ct)/K); } } @@ -2801,9 +2761,9 @@ void MetaspaceAux::dump(outputStream* out) { } void MetaspaceAux::verify_free_chunks() { - Metaspace::space_list()->chunk_manager()->verify(); + Metaspace::chunk_manager_metadata()->verify(); if (Metaspace::using_class_space()) { - Metaspace::class_space_list()->chunk_manager()->verify(); + Metaspace::chunk_manager_class()->verify(); } } @@ -2860,6 +2820,9 @@ void MetaspaceAux::verify_metrics() { size_t Metaspace::_first_chunk_word_size = 0; size_t Metaspace::_first_class_chunk_word_size = 0; +size_t Metaspace::_commit_alignment = 0; +size_t Metaspace::_reserve_alignment = 0; + Metaspace::Metaspace(Mutex* lock, MetaspaceType type) { initialize(lock, type); } @@ -2874,9 +2837,14 @@ Metaspace::~Metaspace() { VirtualSpaceList* Metaspace::_space_list = NULL; VirtualSpaceList* Metaspace::_class_space_list = NULL; +ChunkManager* Metaspace::_chunk_manager_metadata = NULL; +ChunkManager* Metaspace::_chunk_manager_class = NULL; + #define VIRTUALSPACEMULTIPLIER 2 #ifdef _LP64 +static const uint64_t UnscaledClassSpaceMax = (uint64_t(max_juint) + 1); + void Metaspace::set_narrow_klass_base_and_shift(address metaspace_base, address cds_base) { // Figure out the narrow_klass_base and the narrow_klass_shift. The // narrow_klass_base is the lower of the metaspace base and the cds base @@ -2886,14 +2854,22 @@ void Metaspace::set_narrow_klass_base_and_shift(address metaspace_base, address address higher_address; if (UseSharedSpaces) { higher_address = MAX2((address)(cds_base + FileMapInfo::shared_spaces_size()), - (address)(metaspace_base + class_metaspace_size())); + (address)(metaspace_base + compressed_class_space_size())); lower_base = MIN2(metaspace_base, cds_base); } else { - higher_address = metaspace_base + class_metaspace_size(); + higher_address = metaspace_base + compressed_class_space_size(); lower_base = metaspace_base; + + uint64_t klass_encoding_max = UnscaledClassSpaceMax << LogKlassAlignmentInBytes; + // If compressed class space fits in lower 32G, we don't need a base. + if (higher_address <= (address)klass_encoding_max) { + lower_base = 0; // effectively lower base is zero. + } } + Universe::set_narrow_klass_base(lower_base); - if ((uint64_t)(higher_address - lower_base) < (uint64_t)max_juint) { + + if ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax) { Universe::set_narrow_klass_shift(0); } else { assert(!UseSharedSpaces, "Cannot shift with UseSharedSpaces"); @@ -2908,31 +2884,40 @@ bool Metaspace::can_use_cds_with_metaspace_addr(char* metaspace_base, address cd assert(UseCompressedClassPointers, "Only use with CompressedKlassPtrs"); address lower_base = MIN2((address)metaspace_base, cds_base); address higher_address = MAX2((address)(cds_base + FileMapInfo::shared_spaces_size()), - (address)(metaspace_base + class_metaspace_size())); - return ((uint64_t)(higher_address - lower_base) < (uint64_t)max_juint); + (address)(metaspace_base + compressed_class_space_size())); + return ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax); } // Try to allocate the metaspace at the requested addr. void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, address cds_base) { assert(using_class_space(), "called improperly"); assert(UseCompressedClassPointers, "Only use with CompressedKlassPtrs"); - assert(class_metaspace_size() < KlassEncodingMetaspaceMax, + assert(compressed_class_space_size() < KlassEncodingMetaspaceMax, "Metaspace size is too big"); + assert_is_ptr_aligned(requested_addr, _reserve_alignment); + assert_is_ptr_aligned(cds_base, _reserve_alignment); + assert_is_size_aligned(compressed_class_space_size(), _reserve_alignment); - ReservedSpace metaspace_rs = ReservedSpace(class_metaspace_size(), - os::vm_allocation_granularity(), - false, requested_addr, 0); + // Don't use large pages for the class space. + bool large_pages = false; + + ReservedSpace metaspace_rs = ReservedSpace(compressed_class_space_size(), + _reserve_alignment, + large_pages, + requested_addr, 0); if (!metaspace_rs.is_reserved()) { if (UseSharedSpaces) { + size_t increment = align_size_up(1*G, _reserve_alignment); + // Keep trying to allocate the metaspace, increasing the requested_addr // by 1GB each time, until we reach an address that will no longer allow // use of CDS with compressed klass pointers. char *addr = requested_addr; - while (!metaspace_rs.is_reserved() && (addr + 1*G > addr) && - can_use_cds_with_metaspace_addr(addr + 1*G, cds_base)) { - addr = addr + 1*G; - metaspace_rs = ReservedSpace(class_metaspace_size(), - os::vm_allocation_granularity(), false, addr, 0); + while (!metaspace_rs.is_reserved() && (addr + increment > addr) && + can_use_cds_with_metaspace_addr(addr + increment, cds_base)) { + addr = addr + increment; + metaspace_rs = ReservedSpace(compressed_class_space_size(), + _reserve_alignment, large_pages, addr, 0); } } @@ -2942,11 +2927,11 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a // initialization has happened that depends on UseCompressedClassPointers. // So, UseCompressedClassPointers cannot be turned off at this point. if (!metaspace_rs.is_reserved()) { - metaspace_rs = ReservedSpace(class_metaspace_size(), - os::vm_allocation_granularity(), false); + metaspace_rs = ReservedSpace(compressed_class_space_size(), + _reserve_alignment, large_pages); if (!metaspace_rs.is_reserved()) { vm_exit_during_initialization(err_msg("Could not allocate metaspace: %d bytes", - class_metaspace_size())); + compressed_class_space_size())); } } } @@ -2968,8 +2953,8 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a if (PrintCompressedOopsMode || (PrintMiscellaneous && Verbose)) { gclog_or_tty->print_cr("Narrow klass base: " PTR_FORMAT ", Narrow klass shift: " SIZE_FORMAT, Universe::narrow_klass_base(), Universe::narrow_klass_shift()); - gclog_or_tty->print_cr("Metaspace Size: " SIZE_FORMAT " Address: " PTR_FORMAT " Req Addr: " PTR_FORMAT, - class_metaspace_size(), metaspace_rs.base(), requested_addr); + gclog_or_tty->print_cr("Compressed class space size: " SIZE_FORMAT " Address: " PTR_FORMAT " Req Addr: " PTR_FORMAT, + compressed_class_space_size(), metaspace_rs.base(), requested_addr); } } @@ -2981,33 +2966,97 @@ void Metaspace::initialize_class_space(ReservedSpace rs) { err_msg(SIZE_FORMAT " != " UINTX_FORMAT, rs.size(), CompressedClassSpaceSize)); assert(using_class_space(), "Must be using class space"); _class_space_list = new VirtualSpaceList(rs); + _chunk_manager_class = new ChunkManager(SpecializedChunk, ClassSmallChunk, ClassMediumChunk); + + if (!_class_space_list->initialization_succeeded()) { + vm_exit_during_initialization("Failed to setup compressed class space virtual space list."); + } } #endif +// Align down. If the aligning result in 0, return 'alignment'. +static size_t restricted_align_down(size_t size, size_t alignment) { + return MAX2(alignment, align_size_down_(size, alignment)); +} + +void Metaspace::ergo_initialize() { + if (DumpSharedSpaces) { + // Using large pages when dumping the shared archive is currently not implemented. + FLAG_SET_ERGO(bool, UseLargePagesInMetaspace, false); + } + + size_t page_size = os::vm_page_size(); + if (UseLargePages && UseLargePagesInMetaspace) { + page_size = os::large_page_size(); + } + + _commit_alignment = page_size; + _reserve_alignment = MAX2(page_size, (size_t)os::vm_allocation_granularity()); + + // Do not use FLAG_SET_ERGO to update MaxMetaspaceSize, since this will + // override if MaxMetaspaceSize was set on the command line or not. + // This information is needed later to conform to the specification of the + // java.lang.management.MemoryUsage API. + // + // Ideally, we would be able to set the default value of MaxMetaspaceSize in + // globals.hpp to the aligned value, but this is not possible, since the + // alignment depends on other flags being parsed. + MaxMetaspaceSize = restricted_align_down(MaxMetaspaceSize, _reserve_alignment); + + if (MetaspaceSize > MaxMetaspaceSize) { + MetaspaceSize = MaxMetaspaceSize; + } + + MetaspaceSize = restricted_align_down(MetaspaceSize, _commit_alignment); + + assert(MetaspaceSize <= MaxMetaspaceSize, "MetaspaceSize should be limited by MaxMetaspaceSize"); + + if (MetaspaceSize < 256*K) { + vm_exit_during_initialization("Too small initial Metaspace size"); + } + + MinMetaspaceExpansion = restricted_align_down(MinMetaspaceExpansion, _commit_alignment); + MaxMetaspaceExpansion = restricted_align_down(MaxMetaspaceExpansion, _commit_alignment); + + CompressedClassSpaceSize = restricted_align_down(CompressedClassSpaceSize, _reserve_alignment); + set_compressed_class_space_size(CompressedClassSpaceSize); +} + void Metaspace::global_initialize() { // Initialize the alignment for shared spaces. int max_alignment = os::vm_page_size(); size_t cds_total = 0; - set_class_metaspace_size(align_size_up(CompressedClassSpaceSize, - os::vm_allocation_granularity())); - MetaspaceShared::set_max_alignment(max_alignment); if (DumpSharedSpaces) { - SharedReadOnlySize = align_size_up(SharedReadOnlySize, max_alignment); + SharedReadOnlySize = align_size_up(SharedReadOnlySize, max_alignment); SharedReadWriteSize = align_size_up(SharedReadWriteSize, max_alignment); - SharedMiscDataSize = align_size_up(SharedMiscDataSize, max_alignment); - SharedMiscCodeSize = align_size_up(SharedMiscCodeSize, max_alignment); + SharedMiscDataSize = align_size_up(SharedMiscDataSize, max_alignment); + SharedMiscCodeSize = align_size_up(SharedMiscCodeSize, max_alignment); // Initialize with the sum of the shared space sizes. The read-only // and read write metaspace chunks will be allocated out of this and the // remainder is the misc code and data chunks. cds_total = FileMapInfo::shared_spaces_size(); + cds_total = align_size_up(cds_total, _reserve_alignment); _space_list = new VirtualSpaceList(cds_total/wordSize); + _chunk_manager_metadata = new ChunkManager(SpecializedChunk, SmallChunk, MediumChunk); + + if (!_space_list->initialization_succeeded()) { + vm_exit_during_initialization("Unable to dump shared archive.", NULL); + } #ifdef _LP64 + if (cds_total + compressed_class_space_size() > UnscaledClassSpaceMax) { + vm_exit_during_initialization("Unable to dump shared archive.", + err_msg("Size of archive (" SIZE_FORMAT ") + compressed class space (" + SIZE_FORMAT ") == total (" SIZE_FORMAT ") is larger than compressed " + "klass limit: " SIZE_FORMAT, cds_total, compressed_class_space_size(), + cds_total + compressed_class_space_size(), UnscaledClassSpaceMax)); + } + // Set the compressed klass pointer base so that decoding of these pointers works // properly when creating the shared archive. assert(UseCompressedOops && UseCompressedClassPointers, @@ -3018,9 +3067,6 @@ void Metaspace::global_initialize() { _space_list->current_virtual_space()->bottom()); } - // Set the shift to zero. - assert(class_metaspace_size() < (uint64_t)(max_juint) - cds_total, - "CDS region is too large"); Universe::set_narrow_klass_shift(0); #endif @@ -3039,12 +3085,12 @@ void Metaspace::global_initialize() { // Map in spaces now also if (mapinfo->initialize() && MetaspaceShared::map_shared_spaces(mapinfo)) { FileMapInfo::set_current_info(mapinfo); + cds_total = FileMapInfo::shared_spaces_size(); + cds_address = (address)mapinfo->region_base(0); } else { assert(!mapinfo->is_open() && !UseSharedSpaces, "archive file not closed or shared spaces not disabled."); } - cds_total = FileMapInfo::shared_spaces_size(); - cds_address = (address)mapinfo->region_base(0); } #ifdef _LP64 @@ -3052,9 +3098,12 @@ void Metaspace::global_initialize() { // above the heap and above the CDS area (if it exists). if (using_class_space()) { if (UseSharedSpaces) { - allocate_metaspace_compressed_klass_ptrs((char *)(cds_address + cds_total), cds_address); + char* cds_end = (char*)(cds_address + cds_total); + cds_end = (char *)align_ptr_up(cds_end, _reserve_alignment); + allocate_metaspace_compressed_klass_ptrs(cds_end, cds_address); } else { - allocate_metaspace_compressed_klass_ptrs((char *)CompressedKlassPointersBase, 0); + char* base = (char*)align_ptr_up(Universe::heap()->reserved_region().end(), _reserve_alignment); + allocate_metaspace_compressed_klass_ptrs(base, 0); } } #endif @@ -3070,18 +3119,41 @@ void Metaspace::global_initialize() { _first_class_chunk_word_size = align_word_size_up(_first_class_chunk_word_size); // Arbitrarily set the initial virtual space to a multiple // of the boot class loader size. - size_t word_size = VIRTUALSPACEMULTIPLIER * first_chunk_word_size(); + size_t word_size = VIRTUALSPACEMULTIPLIER * _first_chunk_word_size; + word_size = align_size_up(word_size, Metaspace::reserve_alignment_words()); + // Initialize the list of virtual spaces. _space_list = new VirtualSpaceList(word_size); + _chunk_manager_metadata = new ChunkManager(SpecializedChunk, SmallChunk, MediumChunk); + + if (!_space_list->initialization_succeeded()) { + vm_exit_during_initialization("Unable to setup metadata virtual space list.", NULL); + } } + + MetaspaceGC::initialize(); +} + +Metachunk* Metaspace::get_initialization_chunk(MetadataType mdtype, + size_t chunk_word_size, + size_t chunk_bunch) { + // Get a chunk from the chunk freelist + Metachunk* chunk = get_chunk_manager(mdtype)->chunk_freelist_allocate(chunk_word_size); + if (chunk != NULL) { + return chunk; + } + + return get_space_list(mdtype)->get_new_chunk(chunk_word_size, chunk_word_size, chunk_bunch); } void Metaspace::initialize(Mutex* lock, MetaspaceType type) { assert(space_list() != NULL, "Metadata VirtualSpaceList has not been initialized"); + assert(chunk_manager_metadata() != NULL, + "Metadata ChunkManager has not been initialized"); - _vsm = new SpaceManager(NonClassType, lock, space_list()); + _vsm = new SpaceManager(NonClassType, lock); if (_vsm == NULL) { return; } @@ -3090,11 +3162,13 @@ void Metaspace::initialize(Mutex* lock, MetaspaceType type) { vsm()->get_initial_chunk_sizes(type, &word_size, &class_word_size); if (using_class_space()) { - assert(class_space_list() != NULL, - "Class VirtualSpaceList has not been initialized"); + assert(class_space_list() != NULL, + "Class VirtualSpaceList has not been initialized"); + assert(chunk_manager_class() != NULL, + "Class ChunkManager has not been initialized"); // Allocate SpaceManager for classes. - _class_vsm = new SpaceManager(ClassType, lock, class_space_list()); + _class_vsm = new SpaceManager(ClassType, lock); if (_class_vsm == NULL) { return; } @@ -3103,9 +3177,9 @@ void Metaspace::initialize(Mutex* lock, MetaspaceType type) { MutexLockerEx cl(SpaceManager::expand_lock(), Mutex::_no_safepoint_check_flag); // Allocate chunk for metadata objects - Metachunk* new_chunk = - space_list()->get_initialization_chunk(word_size, - vsm()->medium_chunk_bunch()); + Metachunk* new_chunk = get_initialization_chunk(NonClassType, + word_size, + vsm()->medium_chunk_bunch()); assert(!DumpSharedSpaces || new_chunk != NULL, "should have enough space for both chunks"); if (new_chunk != NULL) { // Add to this manager's list of chunks in use and current_chunk(). @@ -3114,9 +3188,9 @@ void Metaspace::initialize(Mutex* lock, MetaspaceType type) { // Allocate chunk for class metadata objects if (using_class_space()) { - Metachunk* class_chunk = - class_space_list()->get_initialization_chunk(class_word_size, - class_vsm()->medium_chunk_bunch()); + Metachunk* class_chunk = get_initialization_chunk(ClassType, + class_word_size, + class_vsm()->medium_chunk_bunch()); if (class_chunk != NULL) { class_vsm()->add_chunk(class_chunk, true); } @@ -3134,7 +3208,7 @@ size_t Metaspace::align_word_size_up(size_t word_size) { MetaWord* Metaspace::allocate(size_t word_size, MetadataType mdtype) { // DumpSharedSpaces doesn't use class metadata area (yet) // Also, don't use class_vsm() unless UseCompressedClassPointers is true. - if (mdtype == ClassType && using_class_space()) { + if (is_class_space_allocation(mdtype)) { return class_vsm()->allocate(word_size); } else { return vsm()->allocate(word_size); @@ -3142,19 +3216,18 @@ MetaWord* Metaspace::allocate(size_t word_size, MetadataType mdtype) { } MetaWord* Metaspace::expand_and_allocate(size_t word_size, MetadataType mdtype) { - MetaWord* result; - MetaspaceGC::set_expand_after_GC(true); - size_t before_inc = MetaspaceGC::capacity_until_GC(); - size_t delta_bytes = MetaspaceGC::delta_capacity_until_GC(word_size) * BytesPerWord; - MetaspaceGC::inc_capacity_until_GC(delta_bytes); + size_t delta_bytes = MetaspaceGC::delta_capacity_until_GC(word_size * BytesPerWord); + assert(delta_bytes > 0, "Must be"); + + size_t after_inc = MetaspaceGC::inc_capacity_until_GC(delta_bytes); + size_t before_inc = after_inc - delta_bytes; + if (PrintGCDetails && Verbose) { gclog_or_tty->print_cr("Increase capacity to GC from " SIZE_FORMAT - " to " SIZE_FORMAT, before_inc, MetaspaceGC::capacity_until_GC()); + " to " SIZE_FORMAT, before_inc, after_inc); } - result = allocate(word_size, mdtype); - - return result; + return allocate(word_size, mdtype); } // Space allocated in the Metaspace. This may @@ -3236,69 +3309,108 @@ void Metaspace::deallocate(MetaWord* ptr, size_t word_size, bool is_class) { } } -Metablock* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size, + +MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size, bool read_only, MetaspaceObj::Type type, TRAPS) { if (HAS_PENDING_EXCEPTION) { assert(false, "Should not allocate with exception pending"); return NULL; // caller does a CHECK_NULL too } - MetadataType mdtype = (type == MetaspaceObj::ClassType) ? ClassType : NonClassType; - - // SSS: Should we align the allocations and make sure the sizes are aligned. - MetaWord* result = NULL; - assert(loader_data != NULL, "Should never pass around a NULL loader_data. " "ClassLoaderData::the_null_class_loader_data() should have been used."); + // Allocate in metaspaces without taking out a lock, because it deadlocks // with the SymbolTable_lock. Dumping is single threaded for now. We'll have // to revisit this for application class data sharing. if (DumpSharedSpaces) { assert(type > MetaspaceObj::UnknownType && type < MetaspaceObj::_number_of_types, "sanity"); Metaspace* space = read_only ? loader_data->ro_metaspace() : loader_data->rw_metaspace(); - result = space->allocate(word_size, NonClassType); + MetaWord* result = space->allocate(word_size, NonClassType); if (result == NULL) { report_out_of_shared_space(read_only ? SharedReadOnly : SharedReadWrite); - } else { - space->record_allocation(result, type, space->vsm()->get_raw_word_size(word_size)); } - return Metablock::initialize(result, word_size); + + space->record_allocation(result, type, space->vsm()->get_raw_word_size(word_size)); + + // Zero initialize. + Copy::fill_to_aligned_words((HeapWord*)result, word_size, 0); + + return result; } - result = loader_data->metaspace_non_null()->allocate(word_size, mdtype); + MetadataType mdtype = (type == MetaspaceObj::ClassType) ? ClassType : NonClassType; + + // Try to allocate metadata. + MetaWord* result = loader_data->metaspace_non_null()->allocate(word_size, mdtype); if (result == NULL) { - // Try to clean out some memory and retry. - result = - Universe::heap()->collector_policy()->satisfy_failed_metadata_allocation( - loader_data, word_size, mdtype); + // Allocation failed. + if (is_init_completed()) { + // Only start a GC if the bootstrapping has completed. - // If result is still null, we are out of memory. - if (result == NULL) { - if (Verbose && TraceMetadataChunkAllocation) { - gclog_or_tty->print_cr("Metaspace allocation failed for size " - SIZE_FORMAT, word_size); - if (loader_data->metaspace_or_null() != NULL) loader_data->dump(gclog_or_tty); - MetaspaceAux::dump(gclog_or_tty); - } - // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support - const char* space_string = (mdtype == ClassType) ? "Compressed class space" : - "Metadata space"; - report_java_out_of_memory(space_string); - - if (JvmtiExport::should_post_resource_exhausted()) { - JvmtiExport::post_resource_exhausted( - JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR, - space_string); - } - if (mdtype == ClassType) { - THROW_OOP_0(Universe::out_of_memory_error_class_metaspace()); - } else { - THROW_OOP_0(Universe::out_of_memory_error_metaspace()); - } + // Try to clean out some memory and retry. + result = Universe::heap()->collector_policy()->satisfy_failed_metadata_allocation( + loader_data, word_size, mdtype); } } - return Metablock::initialize(result, word_size); + + if (result == NULL) { + report_metadata_oome(loader_data, word_size, mdtype, CHECK_NULL); + } + + // Zero initialize. + Copy::fill_to_aligned_words((HeapWord*)result, word_size, 0); + + return result; +} + +size_t Metaspace::class_chunk_size(size_t word_size) { + assert(using_class_space(), "Has to use class space"); + return class_vsm()->calc_chunk_size(word_size); +} + +void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_size, MetadataType mdtype, TRAPS) { + // If result is still null, we are out of memory. + if (Verbose && TraceMetadataChunkAllocation) { + gclog_or_tty->print_cr("Metaspace allocation failed for size " + SIZE_FORMAT, word_size); + if (loader_data->metaspace_or_null() != NULL) { + loader_data->dump(gclog_or_tty); + } + MetaspaceAux::dump(gclog_or_tty); + } + + bool out_of_compressed_class_space = false; + if (is_class_space_allocation(mdtype)) { + Metaspace* metaspace = loader_data->metaspace_non_null(); + out_of_compressed_class_space = + MetaspaceAux::committed_bytes(Metaspace::ClassType) + + (metaspace->class_chunk_size(word_size) * BytesPerWord) > + CompressedClassSpaceSize; + } + + // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support + const char* space_string = out_of_compressed_class_space ? + "Compressed class space" : "Metaspace"; + + report_java_out_of_memory(space_string); + + if (JvmtiExport::should_post_resource_exhausted()) { + JvmtiExport::post_resource_exhausted( + JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR, + space_string); + } + + if (!is_init_completed()) { + vm_exit_during_initialization("OutOfMemoryError", space_string); + } + + if (out_of_compressed_class_space) { + THROW_OOP(Universe::out_of_memory_error_class_metaspace()); + } else { + THROW_OOP(Universe::out_of_memory_error_metaspace()); + } } void Metaspace::record_allocation(void* ptr, MetaspaceObj::Type type, size_t word_size) { @@ -3333,12 +3445,16 @@ void Metaspace::iterate(Metaspace::AllocRecordClosure *closure) { } } +void Metaspace::purge(MetadataType mdtype) { + get_space_list(mdtype)->purge(get_chunk_manager(mdtype)); +} + void Metaspace::purge() { MutexLockerEx cl(SpaceManager::expand_lock(), Mutex::_no_safepoint_check_flag); - space_list()->purge(); + purge(NonClassType); if (using_class_space()) { - class_space_list()->purge(); + purge(ClassType); } } @@ -3385,7 +3501,7 @@ void Metaspace::dump(outputStream* const out) const { #ifndef PRODUCT -class MetaspaceAuxTest : AllStatic { +class TestMetaspaceAuxTest : AllStatic { public: static void test_reserved() { size_t reserved = MetaspaceAux::reserved_bytes(); @@ -3425,14 +3541,115 @@ class MetaspaceAuxTest : AllStatic { } } + static void test_virtual_space_list_large_chunk() { + VirtualSpaceList* vs_list = new VirtualSpaceList(os::vm_allocation_granularity()); + MutexLockerEx cl(SpaceManager::expand_lock(), Mutex::_no_safepoint_check_flag); + // A size larger than VirtualSpaceSize (256k) and add one page to make it _not_ be + // vm_allocation_granularity aligned on Windows. + size_t large_size = (size_t)(2*256*K + (os::vm_page_size()/BytesPerWord)); + large_size += (os::vm_page_size()/BytesPerWord); + vs_list->get_new_chunk(large_size, large_size, 0); + } + static void test() { test_reserved(); test_committed(); + test_virtual_space_list_large_chunk(); } }; -void MetaspaceAux_test() { - MetaspaceAuxTest::test(); +void TestMetaspaceAux_test() { + TestMetaspaceAuxTest::test(); +} + +class TestVirtualSpaceNodeTest { + static void chunk_up(size_t words_left, size_t& num_medium_chunks, + size_t& num_small_chunks, + size_t& num_specialized_chunks) { + num_medium_chunks = words_left / MediumChunk; + words_left = words_left % MediumChunk; + + num_small_chunks = words_left / SmallChunk; + words_left = words_left % SmallChunk; + // how many specialized chunks can we get? + num_specialized_chunks = words_left / SpecializedChunk; + assert(words_left % SpecializedChunk == 0, "should be nothing left"); + } + + public: + static void test() { + MutexLockerEx ml(SpaceManager::expand_lock(), Mutex::_no_safepoint_check_flag); + const size_t vsn_test_size_words = MediumChunk * 4; + const size_t vsn_test_size_bytes = vsn_test_size_words * BytesPerWord; + + // The chunk sizes must be multiples of eachother, or this will fail + STATIC_ASSERT(MediumChunk % SmallChunk == 0); + STATIC_ASSERT(SmallChunk % SpecializedChunk == 0); + + { // No committed memory in VSN + ChunkManager cm(SpecializedChunk, SmallChunk, MediumChunk); + VirtualSpaceNode vsn(vsn_test_size_bytes); + vsn.initialize(); + vsn.retire(&cm); + assert(cm.sum_free_chunks_count() == 0, "did not commit any memory in the VSN"); + } + + { // All of VSN is committed, half is used by chunks + ChunkManager cm(SpecializedChunk, SmallChunk, MediumChunk); + VirtualSpaceNode vsn(vsn_test_size_bytes); + vsn.initialize(); + vsn.expand_by(vsn_test_size_words, vsn_test_size_words); + vsn.get_chunk_vs(MediumChunk); + vsn.get_chunk_vs(MediumChunk); + vsn.retire(&cm); + assert(cm.sum_free_chunks_count() == 2, "should have been memory left for 2 medium chunks"); + assert(cm.sum_free_chunks() == 2*MediumChunk, "sizes should add up"); + } + + { // 4 pages of VSN is committed, some is used by chunks + ChunkManager cm(SpecializedChunk, SmallChunk, MediumChunk); + VirtualSpaceNode vsn(vsn_test_size_bytes); + const size_t page_chunks = 4 * (size_t)os::vm_page_size() / BytesPerWord; + assert(page_chunks < MediumChunk, "Test expects medium chunks to be at least 4*page_size"); + vsn.initialize(); + vsn.expand_by(page_chunks, page_chunks); + vsn.get_chunk_vs(SmallChunk); + vsn.get_chunk_vs(SpecializedChunk); + vsn.retire(&cm); + + // committed - used = words left to retire + const size_t words_left = page_chunks - SmallChunk - SpecializedChunk; + + size_t num_medium_chunks, num_small_chunks, num_spec_chunks; + chunk_up(words_left, num_medium_chunks, num_small_chunks, num_spec_chunks); + + assert(num_medium_chunks == 0, "should not get any medium chunks"); + assert(cm.sum_free_chunks_count() == (num_small_chunks + num_spec_chunks), "should be space for 3 chunks"); + assert(cm.sum_free_chunks() == words_left, "sizes should add up"); + } + + { // Half of VSN is committed, a humongous chunk is used + ChunkManager cm(SpecializedChunk, SmallChunk, MediumChunk); + VirtualSpaceNode vsn(vsn_test_size_bytes); + vsn.initialize(); + vsn.expand_by(MediumChunk * 2, MediumChunk * 2); + vsn.get_chunk_vs(MediumChunk + SpecializedChunk); // Humongous chunks will be aligned up to MediumChunk + SpecializedChunk + vsn.retire(&cm); + + const size_t words_left = MediumChunk * 2 - (MediumChunk + SpecializedChunk); + size_t num_medium_chunks, num_small_chunks, num_spec_chunks; + chunk_up(words_left, num_medium_chunks, num_small_chunks, num_spec_chunks); + + assert(num_medium_chunks == 0, "should not get any medium chunks"); + assert(cm.sum_free_chunks_count() == (num_small_chunks + num_spec_chunks), "should be space for 3 chunks"); + assert(cm.sum_free_chunks() == words_left, "sizes should add up"); + } + + } +}; + +void TestVirtualSpaceNode_test() { + TestVirtualSpaceNodeTest::test(); } #endif diff --git a/hotspot/src/share/vm/memory/metaspace.hpp b/hotspot/src/share/vm/memory/metaspace.hpp index 242fa61b1cc..c22d2170761 100644 --- a/hotspot/src/share/vm/memory/metaspace.hpp +++ b/hotspot/src/share/vm/memory/metaspace.hpp @@ -56,12 +56,15 @@ // +-------------------+ // +class ChunkManager; class ClassLoaderData; class Metablock; +class Metachunk; class MetaWord; class Mutex; class outputStream; class SpaceManager; +class VirtualSpaceList; // Metaspaces each have a SpaceManager and allocations // are done by the SpaceManager. Allocations are done @@ -76,8 +79,6 @@ class SpaceManager; // allocate() method returns a block for use as a // quantum of metadata. -class VirtualSpaceList; - class Metaspace : public CHeapObj { friend class VMStructs; friend class SpaceManager; @@ -86,9 +87,10 @@ class Metaspace : public CHeapObj { friend class MetaspaceAux; public: - enum MetadataType {ClassType = 0, - NonClassType = ClassType + 1, - MetadataTypeCount = ClassType + 2 + enum MetadataType { + ClassType, + NonClassType, + MetadataTypeCount }; enum MetaspaceType { StandardMetaspaceType, @@ -102,22 +104,32 @@ class Metaspace : public CHeapObj { private: void initialize(Mutex* lock, MetaspaceType type); + // Get the first chunk for a Metaspace. Used for + // special cases such as the boot class loader, reflection + // class loader and anonymous class loader. + Metachunk* get_initialization_chunk(MetadataType mdtype, + size_t chunk_word_size, + size_t chunk_bunch); + // Align up the word size to the allocation word size static size_t align_word_size_up(size_t); // Aligned size of the metaspace. - static size_t _class_metaspace_size; + static size_t _compressed_class_space_size; - static size_t class_metaspace_size() { - return _class_metaspace_size; + static size_t compressed_class_space_size() { + return _compressed_class_space_size; } - static void set_class_metaspace_size(size_t metaspace_size) { - _class_metaspace_size = metaspace_size; + static void set_compressed_class_space_size(size_t size) { + _compressed_class_space_size = size; } static size_t _first_chunk_word_size; static size_t _first_class_chunk_word_size; + static size_t _commit_alignment; + static size_t _reserve_alignment; + SpaceManager* _vsm; SpaceManager* vsm() const { return _vsm; } @@ -127,13 +139,16 @@ class Metaspace : public CHeapObj { // Allocate space for metadata of type mdtype. This is space // within a Metachunk and is used by // allocate(ClassLoaderData*, size_t, bool, MetadataType, TRAPS) - // which returns a Metablock. MetaWord* allocate(size_t word_size, MetadataType mdtype); // Virtual Space lists for both classes and other metadata static VirtualSpaceList* _space_list; static VirtualSpaceList* _class_space_list; + static ChunkManager* _chunk_manager_metadata; + static ChunkManager* _chunk_manager_class; + + public: static VirtualSpaceList* space_list() { return _space_list; } static VirtualSpaceList* class_space_list() { return _class_space_list; } static VirtualSpaceList* get_space_list(MetadataType mdtype) { @@ -141,6 +156,14 @@ class Metaspace : public CHeapObj { return mdtype == ClassType ? class_space_list() : space_list(); } + static ChunkManager* chunk_manager_metadata() { return _chunk_manager_metadata; } + static ChunkManager* chunk_manager_class() { return _chunk_manager_class; } + static ChunkManager* get_chunk_manager(MetadataType mdtype) { + assert(mdtype != MetadataTypeCount, "MetadaTypeCount can't be used as mdtype"); + return mdtype == ClassType ? chunk_manager_class() : chunk_manager_metadata(); + } + + private: // This is used by DumpSharedSpaces only, where only _vsm is used. So we will // maintain a single list for now. void record_allocation(void* ptr, MetaspaceObj::Type type, size_t word_size); @@ -169,17 +192,24 @@ class Metaspace : public CHeapObj { AllocRecord * _alloc_record_head; AllocRecord * _alloc_record_tail; + size_t class_chunk_size(size_t word_size); + public: Metaspace(Mutex* lock, MetaspaceType type); ~Metaspace(); - // Initialize globals for Metaspace + static void ergo_initialize(); static void global_initialize(); static size_t first_chunk_word_size() { return _first_chunk_word_size; } static size_t first_class_chunk_word_size() { return _first_class_chunk_word_size; } + static size_t reserve_alignment() { return _reserve_alignment; } + static size_t reserve_alignment_words() { return _reserve_alignment / BytesPerWord; } + static size_t commit_alignment() { return _commit_alignment; } + static size_t commit_alignment_words() { return _commit_alignment / BytesPerWord; } + char* bottom() const; size_t used_words_slow(MetadataType mdtype) const; size_t free_words_slow(MetadataType mdtype) const; @@ -188,8 +218,8 @@ class Metaspace : public CHeapObj { size_t used_bytes_slow(MetadataType mdtype) const; size_t capacity_bytes_slow(MetadataType mdtype) const; - static Metablock* allocate(ClassLoaderData* loader_data, size_t word_size, - bool read_only, MetaspaceObj::Type type, TRAPS); + static MetaWord* allocate(ClassLoaderData* loader_data, size_t word_size, + bool read_only, MetaspaceObj::Type type, TRAPS); void deallocate(MetaWord* ptr, size_t byte_size, bool is_class); MetaWord* expand_and_allocate(size_t size, @@ -199,8 +229,12 @@ class Metaspace : public CHeapObj { void dump(outputStream* const out) const; // Free empty virtualspaces + static void purge(MetadataType mdtype); static void purge(); + static void report_metadata_oome(ClassLoaderData* loader_data, size_t word_size, + MetadataType mdtype, TRAPS); + void print_on(outputStream* st) const; // Debugging support void verify(); @@ -217,6 +251,10 @@ class Metaspace : public CHeapObj { return NOT_LP64(false) LP64_ONLY(UseCompressedClassPointers && !DumpSharedSpaces); } + static bool is_class_space_allocation(MetadataType mdType) { + return mdType == ClassType && using_class_space(); + } + }; class MetaspaceAux : AllStatic { @@ -331,17 +369,10 @@ class MetaspaceAux : AllStatic { class MetaspaceGC : AllStatic { - // The current high-water-mark for inducing a GC. When - // the capacity of all space in the virtual lists reaches this value, - // a GC is induced and the value is increased. This should be changed - // to the space actually used for allocations to avoid affects of - // fragmentation losses to partially used chunks. Size is in words. - static size_t _capacity_until_GC; - - // After a GC is done any allocation that fails should try to expand - // the capacity of the Metaspaces. This flag is set during attempts - // to allocate in the VMGCOperation that does the GC. - static bool _expand_after_GC; + // The current high-water-mark for inducing a GC. + // When committed memory of all metaspaces reaches this value, + // a GC is induced and the value is increased. Size is in bytes. + static volatile intptr_t _capacity_until_GC; // For a CMS collection, signal that a concurrent collection should // be started. @@ -349,20 +380,16 @@ class MetaspaceGC : AllStatic { static uint _shrink_factor; - static void set_capacity_until_GC(size_t v) { _capacity_until_GC = v; } - static size_t shrink_factor() { return _shrink_factor; } void set_shrink_factor(uint v) { _shrink_factor = v; } public: - static size_t capacity_until_GC() { return _capacity_until_GC; } - static void inc_capacity_until_GC(size_t v) { _capacity_until_GC += v; } - static void dec_capacity_until_GC(size_t v) { - _capacity_until_GC = _capacity_until_GC > v ? _capacity_until_GC - v : 0; - } - static bool expand_after_GC() { return _expand_after_GC; } - static void set_expand_after_GC(bool v) { _expand_after_GC = v; } + static void initialize() { _capacity_until_GC = MetaspaceSize; } + + static size_t capacity_until_GC(); + static size_t inc_capacity_until_GC(size_t v); + static size_t dec_capacity_until_GC(size_t v); static bool should_concurrent_collect() { return _should_concurrent_collect; } static void set_should_concurrent_collect(bool v) { @@ -370,11 +397,14 @@ class MetaspaceGC : AllStatic { } // The amount to increase the high-water-mark (_capacity_until_GC) - static size_t delta_capacity_until_GC(size_t word_size); + static size_t delta_capacity_until_GC(size_t bytes); - // It is expected that this will be called when the current capacity - // has been used and a GC should be considered. - static bool should_expand(VirtualSpaceList* vsl, size_t word_size); + // Tells if we have can expand metaspace without hitting set limits. + static bool can_expand(size_t words, bool is_class); + + // Returns amount that we can expand without hitting a GC, + // measured in words. + static size_t allowed_expansion(); // Calculate the new high-water mark at which to induce // a GC. diff --git a/hotspot/src/share/vm/memory/metaspaceShared.cpp b/hotspot/src/share/vm/memory/metaspaceShared.cpp index 2a9873957a8..ef51c926662 100644 --- a/hotspot/src/share/vm/memory/metaspaceShared.cpp +++ b/hotspot/src/share/vm/memory/metaspaceShared.cpp @@ -103,9 +103,10 @@ static void calculate_fingerprints() { if (k->oop_is_instance()) { InstanceKlass* ik = InstanceKlass::cast(k); for (int i = 0; i < ik->methods()->length(); i++) { - ResourceMark rm; Method* m = ik->methods()->at(i); - (new Fingerprinter(m))->fingerprint(); + Fingerprinter fp(m); + // The side effect of this call sets method's fingerprint field. + fp.fingerprint(); } } } diff --git a/hotspot/src/share/vm/memory/referenceProcessor.cpp b/hotspot/src/share/vm/memory/referenceProcessor.cpp index 1333c082c54..f5e7fadae72 100644 --- a/hotspot/src/share/vm/memory/referenceProcessor.cpp +++ b/hotspot/src/share/vm/memory/referenceProcessor.cpp @@ -367,7 +367,7 @@ void ReferenceProcessor::enqueue_discovered_reflist(DiscoveredList& refs_list, next_d = java_lang_ref_Reference::discovered(obj); if (TraceReferenceGC && PrintGCDetails) { gclog_or_tty->print_cr(" obj " INTPTR_FORMAT "/next_d " INTPTR_FORMAT, - obj, next_d); + (void *)obj, (void *)next_d); } assert(java_lang_ref_Reference::next(obj) == NULL, "Reference not active; should not be discovered"); @@ -392,7 +392,7 @@ void ReferenceProcessor::enqueue_discovered_reflist(DiscoveredList& refs_list, next_d = java_lang_ref_Reference::discovered(obj); if (TraceReferenceGC && PrintGCDetails) { gclog_or_tty->print_cr(" obj " INTPTR_FORMAT "/next_d " INTPTR_FORMAT, - obj, next_d); + (void *)obj, (void *)next_d); } assert(java_lang_ref_Reference::next(obj) == NULL, "The reference should not be enqueued"); @@ -562,7 +562,7 @@ ReferenceProcessor::process_phase1(DiscoveredList& refs_list, !policy->should_clear_reference(iter.obj(), _soft_ref_timestamp_clock)) { if (TraceReferenceGC) { gclog_or_tty->print_cr("Dropping reference (" INTPTR_FORMAT ": %s" ") by policy", - iter.obj(), iter.obj()->klass()->internal_name()); + (void *)iter.obj(), iter.obj()->klass()->internal_name()); } // Remove Reference object from list iter.remove(); @@ -601,7 +601,7 @@ ReferenceProcessor::pp2_work(DiscoveredList& refs_list, if (iter.is_referent_alive()) { if (TraceReferenceGC) { gclog_or_tty->print_cr("Dropping strongly reachable reference (" INTPTR_FORMAT ": %s)", - iter.obj(), iter.obj()->klass()->internal_name()); + (void *)iter.obj(), iter.obj()->klass()->internal_name()); } // The referent is reachable after all. // Remove Reference object from list. @@ -687,7 +687,7 @@ ReferenceProcessor::process_phase3(DiscoveredList& refs_list, if (TraceReferenceGC) { gclog_or_tty->print_cr("Adding %sreference (" INTPTR_FORMAT ": %s) as pending", clear_referent ? "cleared " : "", - iter.obj(), iter.obj()->klass()->internal_name()); + (void *)iter.obj(), iter.obj()->klass()->internal_name()); } assert(iter.obj()->is_oop(UseConcMarkSweepGC), "Adding a bad reference"); iter.next(); @@ -1003,7 +1003,7 @@ void ReferenceProcessor::clean_up_discovered_reflist(DiscoveredList& refs_list) gclog_or_tty->print_cr("clean_up_discovered_list: Dropping Reference: " INTPTR_FORMAT " with next field: " INTPTR_FORMAT " and referent: " INTPTR_FORMAT, - iter.obj(), next, iter.referent()); + (void *)iter.obj(), (void *)next, (void *)iter.referent()); } ) // Remove Reference object from list @@ -1103,14 +1103,14 @@ ReferenceProcessor::add_to_discovered_list_mt(DiscoveredList& refs_list, if (TraceReferenceGC) { gclog_or_tty->print_cr("Discovered reference (mt) (" INTPTR_FORMAT ": %s)", - obj, obj->klass()->internal_name()); + (void *)obj, obj->klass()->internal_name()); } } else { // If retest was non NULL, another thread beat us to it: // The reference has already been discovered... if (TraceReferenceGC) { gclog_or_tty->print_cr("Already discovered reference (" INTPTR_FORMAT ": %s)", - obj, obj->klass()->internal_name()); + (void *)obj, obj->klass()->internal_name()); } } } @@ -1125,7 +1125,7 @@ void ReferenceProcessor::verify_referent(oop obj) { assert(da ? referent->is_oop() : referent->is_oop_or_null(), err_msg("Bad referent " INTPTR_FORMAT " found in Reference " INTPTR_FORMAT " during %satomic discovery ", - (intptr_t)referent, (intptr_t)obj, da ? "" : "non-")); + (void *)referent, (void *)obj, da ? "" : "non-")); } #endif @@ -1205,7 +1205,7 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) { // The reference has already been discovered... if (TraceReferenceGC) { gclog_or_tty->print_cr("Already discovered reference (" INTPTR_FORMAT ": %s)", - obj, obj->klass()->internal_name()); + (void *)obj, obj->klass()->internal_name()); } if (RefDiscoveryPolicy == ReferentBasedDiscovery) { // assumes that an object is not processed twice; @@ -1273,7 +1273,7 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) { if (TraceReferenceGC) { gclog_or_tty->print_cr("Discovered reference (" INTPTR_FORMAT ": %s)", - obj, obj->klass()->internal_name()); + (void *)obj, obj->klass()->internal_name()); } } assert(obj->is_oop(), "Discovered a bad reference"); @@ -1372,7 +1372,7 @@ ReferenceProcessor::preclean_discovered_reflist(DiscoveredList& refs_list, // active; we need to trace and mark its cohort. if (TraceReferenceGC) { gclog_or_tty->print_cr("Precleaning Reference (" INTPTR_FORMAT ": %s)", - iter.obj(), iter.obj()->klass()->internal_name()); + (void *)iter.obj(), iter.obj()->klass()->internal_name()); } // Remove Reference object from list iter.remove(); diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index 1f632ae478f..043962c6304 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -677,13 +677,13 @@ jint universe_init() { // HeapBased - Use compressed oops with heap base + encoding. // 4Gb -static const uint64_t NarrowOopHeapMax = (uint64_t(max_juint) + 1); +static const uint64_t UnscaledOopHeapMax = (uint64_t(max_juint) + 1); // 32Gb -// OopEncodingHeapMax == NarrowOopHeapMax << LogMinObjAlignmentInBytes; +// OopEncodingHeapMax == UnscaledOopHeapMax << LogMinObjAlignmentInBytes; char* Universe::preferred_heap_base(size_t heap_size, size_t alignment, NARROW_OOP_MODE mode) { assert(is_size_aligned((size_t)OopEncodingHeapMax, alignment), "Must be"); - assert(is_size_aligned((size_t)NarrowOopHeapMax, alignment), "Must be"); + assert(is_size_aligned((size_t)UnscaledOopHeapMax, alignment), "Must be"); assert(is_size_aligned(heap_size, alignment), "Must be"); uintx heap_base_min_address_aligned = align_size_up(HeapBaseMinAddress, alignment); @@ -702,20 +702,40 @@ char* Universe::preferred_heap_base(size_t heap_size, size_t alignment, NARROW_O // If the total size is small enough to allow UnscaledNarrowOop then // just use UnscaledNarrowOop. } else if ((total_size <= OopEncodingHeapMax) && (mode != HeapBasedNarrowOop)) { - if ((total_size <= NarrowOopHeapMax) && (mode == UnscaledNarrowOop) && + if ((total_size <= UnscaledOopHeapMax) && (mode == UnscaledNarrowOop) && (Universe::narrow_oop_shift() == 0)) { // Use 32-bits oops without encoding and // place heap's top on the 4Gb boundary - base = (NarrowOopHeapMax - heap_size); + base = (UnscaledOopHeapMax - heap_size); } else { // Can't reserve with NarrowOopShift == 0 Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes); + if (mode == UnscaledNarrowOop || - mode == ZeroBasedNarrowOop && total_size <= NarrowOopHeapMax) { + mode == ZeroBasedNarrowOop && total_size <= UnscaledOopHeapMax) { + // Use zero based compressed oops with encoding and // place heap's top on the 32Gb boundary in case // total_size > 4Gb or failed to reserve below 4Gb. - base = (OopEncodingHeapMax - heap_size); + uint64_t heap_top = OopEncodingHeapMax; + + // For small heaps, save some space for compressed class pointer + // space so it can be decoded with no base. + if (UseCompressedClassPointers && !UseSharedSpaces && + OopEncodingHeapMax <= 32*G) { + + uint64_t class_space = align_size_up(CompressedClassSpaceSize, alignment); + assert(is_size_aligned((size_t)OopEncodingHeapMax-class_space, + alignment), "difference must be aligned too"); + uint64_t new_top = OopEncodingHeapMax-class_space; + + if (total_size <= new_top) { + heap_top = new_top; + } + } + + // Align base to the adjusted top of the heap + base = heap_top - heap_size; } } } else { @@ -737,7 +757,7 @@ char* Universe::preferred_heap_base(size_t heap_size, size_t alignment, NARROW_O // Set to a non-NULL value so the ReservedSpace ctor computes // the correct no-access prefix. // The final value will be set in initialize_heap() below. - Universe::set_narrow_oop_base((address)NarrowOopHeapMax); + Universe::set_narrow_oop_base((address)UnscaledOopHeapMax); #ifdef _WIN64 if (UseLargePages) { // Cannot allocate guard pages for implicit checks in indexed @@ -833,7 +853,7 @@ jint Universe::initialize_heap() { Universe::set_narrow_oop_use_implicit_null_checks(true); } #endif // _WIN64 - if((uint64_t)Universe::heap()->reserved_region().end() > NarrowOopHeapMax) { + if((uint64_t)Universe::heap()->reserved_region().end() > UnscaledOopHeapMax) { // Can't reserve heap below 4Gb. Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes); } else { @@ -1029,7 +1049,7 @@ bool universe_post_init() { Handle msg = java_lang_String::create_from_str("Java heap space", CHECK_false); java_lang_Throwable::set_message(Universe::_out_of_memory_error_java_heap, msg()); - msg = java_lang_String::create_from_str("Metadata space", CHECK_false); + msg = java_lang_String::create_from_str("Metaspace", CHECK_false); java_lang_Throwable::set_message(Universe::_out_of_memory_error_metaspace, msg()); msg = java_lang_String::create_from_str("Compressed class space", CHECK_false); java_lang_Throwable::set_message(Universe::_out_of_memory_error_class_metaspace, msg()); diff --git a/hotspot/src/share/vm/oops/constantPool.cpp b/hotspot/src/share/vm/oops/constantPool.cpp index 673da4dd622..16b53a69929 100644 --- a/hotspot/src/share/vm/oops/constantPool.cpp +++ b/hotspot/src/share/vm/oops/constantPool.cpp @@ -40,7 +40,6 @@ #include "runtime/init.hpp" #include "runtime/javaCalls.hpp" #include "runtime/signature.hpp" -#include "runtime/synchronizer.hpp" #include "runtime/vframe.hpp" ConstantPool* ConstantPool::allocate(ClassLoaderData* loader_data, int length, TRAPS) { @@ -70,6 +69,7 @@ ConstantPool::ConstantPool(Array* tags) { // only set to non-zero if constant pool is merged by RedefineClasses set_version(0); + set_lock(new Monitor(Monitor::nonleaf + 2, "A constant pool lock")); // initialize tag array int length = tags->length(); @@ -95,6 +95,9 @@ void ConstantPool::deallocate_contents(ClassLoaderData* loader_data) { void ConstantPool::release_C_heap_structures() { // walk constant pool and decrement symbol reference counts unreference_symbols(); + + delete _lock; + set_lock(NULL); } objArrayOop ConstantPool::resolved_references() const { @@ -108,16 +111,16 @@ objArrayOop ConstantPool::resolved_references() const { void ConstantPool::initialize_resolved_references(ClassLoaderData* loader_data, intStack reference_map, int constant_pool_map_length, - TRAPS) { + TRAPS) { // Initialized the resolved object cache. int map_length = reference_map.length(); if (map_length > 0) { // Only need mapping back to constant pool entries. The map isn't used for - // invokedynamic resolved_reference entries. The constant pool cache index - // has the mapping back to both the constant pool and to the resolved - // reference index. + // invokedynamic resolved_reference entries. For invokedynamic entries, + // the constant pool cache index has the mapping back to both the constant + // pool and to the resolved reference index. if (constant_pool_map_length > 0) { - Array* om = MetadataFactory::new_array(loader_data, map_length, CHECK); + Array* om = MetadataFactory::new_array(loader_data, constant_pool_map_length, CHECK); for (int i = 0; i < constant_pool_map_length; i++) { int x = reference_map.at(i); @@ -151,6 +154,9 @@ void ConstantPool::restore_unshareable_info(TRAPS) { ClassLoaderData* loader_data = pool_holder()->class_loader_data(); set_resolved_references(loader_data->add_handle(refs_handle)); } + + // Also need to recreate the mutex. Make sure this matches the constructor + set_lock(new Monitor(Monitor::nonleaf + 2, "A constant pool lock")); } } @@ -161,37 +167,14 @@ void ConstantPool::remove_unshareable_info() { set_resolved_reference_length( resolved_references() != NULL ? resolved_references()->length() : 0); set_resolved_references(NULL); -} - -oop ConstantPool::lock() { - if (_pool_holder) { - // We re-use the _pool_holder's init_lock to reduce footprint. - // Notes on deadlocks: - // [1] This lock is a Java oop, so it can be recursively locked by - // the same thread without self-deadlocks. - // [2] Deadlock will happen if there is circular dependency between - // the of two Java classes. However, in this case, - // the deadlock would have happened long before we reach - // ConstantPool::lock(), so reusing init_lock does not - // increase the possibility of deadlock. - return _pool_holder->init_lock(); - } else { - return NULL; - } + set_lock(NULL); } int ConstantPool::cp_to_object_index(int cp_index) { // this is harder don't do this so much. - for (int i = 0; i< reference_map()->length(); i++) { - if (reference_map()->at(i) == cp_index) return i; - // Zero entry is divider between constant pool indices for strings, - // method handles and method types. After that the index is a constant - // pool cache index for invokedynamic. Stop when zero (which can never - // be a constant pool index) - if (reference_map()->at(i) == 0) break; - } - // We might not find the index. - return _no_index_sentinel; + int i = reference_map()->find(cp_index); + // We might not find the index for jsr292 call. + return (i < 0) ? _no_index_sentinel : i; } Klass* ConstantPool::klass_at_impl(constantPoolHandle this_oop, int which, TRAPS) { @@ -218,9 +201,7 @@ Klass* ConstantPool::klass_at_impl(constantPoolHandle this_oop, int which, TRAPS Symbol* name = NULL; Handle loader; - { - oop cplock = this_oop->lock(); - ObjectLocker ol(cplock , THREAD, cplock != NULL); + { MonitorLockerEx ml(this_oop->lock()); if (this_oop->tag_at(which).is_unresolved_klass()) { if (this_oop->tag_at(which).is_unresolved_klass_in_error()) { @@ -267,8 +248,7 @@ Klass* ConstantPool::klass_at_impl(constantPoolHandle this_oop, int which, TRAPS bool throw_orig_error = false; { - oop cplock = this_oop->lock(); - ObjectLocker ol(cplock, THREAD, cplock != NULL); + MonitorLockerEx ml(this_oop->lock()); // some other thread has beaten us and has resolved the class. if (this_oop->tag_at(which).is_klass()) { @@ -336,8 +316,7 @@ Klass* ConstantPool::klass_at_impl(constantPoolHandle this_oop, int which, TRAPS } return k(); } else { - oop cplock = this_oop->lock(); - ObjectLocker ol(cplock, THREAD, cplock != NULL); + MonitorLockerEx ml(this_oop->lock()); // Only updated constant pool - if it is resolved. do_resolve = this_oop->tag_at(which).is_unresolved_klass(); if (do_resolve) { @@ -607,8 +586,7 @@ void ConstantPool::save_and_throw_exception(constantPoolHandle this_oop, int whi int tag, TRAPS) { ResourceMark rm; Symbol* error = PENDING_EXCEPTION->klass()->name(); - oop cplock = this_oop->lock(); - ObjectLocker ol(cplock, THREAD, cplock != NULL); // lock cpool to change tag. + MonitorLockerEx ml(this_oop->lock()); // lock cpool to change tag. int error_tag = (tag == JVM_CONSTANT_MethodHandle) ? JVM_CONSTANT_MethodHandleInError : JVM_CONSTANT_MethodTypeInError; @@ -769,8 +747,7 @@ oop ConstantPool::resolve_constant_at_impl(constantPoolHandle this_oop, int inde if (cache_index >= 0) { // Cache the oop here also. Handle result_handle(THREAD, result_oop); - oop cplock = this_oop->lock(); - ObjectLocker ol(cplock, THREAD, cplock != NULL); // don't know if we really need this + MonitorLockerEx ml(this_oop->lock()); // don't know if we really need this oop result = this_oop->resolved_references()->obj_at(cache_index); // Benign race condition: resolved_references may already be filled in while we were trying to lock. // The important thing here is that all threads pick up the same result. @@ -840,8 +817,7 @@ oop ConstantPool::string_at_impl(constantPoolHandle this_oop, int which, int obj // If the string has already been interned, this entry will be non-null oop str = this_oop->resolved_references()->obj_at(obj_index); if (str != NULL) return str; - - Symbol* sym = this_oop->unresolved_string_at(which); + Symbol* sym = this_oop->unresolved_string_at(which); str = StringTable::intern(sym, CHECK_(NULL)); this_oop->string_at_put(which, obj_index, str); assert(java_lang_String::is_instance(str), "must be string"); @@ -877,18 +853,9 @@ void ConstantPool::unreference_symbols() { bool ConstantPool::compare_entry_to(int index1, constantPoolHandle cp2, int index2, TRAPS) { - jbyte t1 = tag_at(index1).value(); - jbyte t2 = cp2->tag_at(index2).value(); - - - // JVM_CONSTANT_UnresolvedClassInError is equal to JVM_CONSTANT_UnresolvedClass - // when comparing - if (t1 == JVM_CONSTANT_UnresolvedClassInError) { - t1 = JVM_CONSTANT_UnresolvedClass; - } - if (t2 == JVM_CONSTANT_UnresolvedClassInError) { - t2 = JVM_CONSTANT_UnresolvedClass; - } + // The error tags are equivalent to non-error tags when comparing + jbyte t1 = tag_at(index1).non_error_value(); + jbyte t2 = cp2->tag_at(index2).non_error_value(); if (t1 != t2) { // Not the same entry type so there is nothing else to check. Note @@ -1009,8 +976,8 @@ bool ConstantPool::compare_entry_to(int index1, constantPoolHandle cp2, case JVM_CONSTANT_MethodType: { - int k1 = method_type_index_at(index1); - int k2 = cp2->method_type_index_at(index2); + int k1 = method_type_index_at_error_ok(index1); + int k2 = cp2->method_type_index_at_error_ok(index2); bool match = compare_entry_to(k1, cp2, k2, CHECK_false); if (match) { return true; @@ -1019,11 +986,11 @@ bool ConstantPool::compare_entry_to(int index1, constantPoolHandle cp2, case JVM_CONSTANT_MethodHandle: { - int k1 = method_handle_ref_kind_at(index1); - int k2 = cp2->method_handle_ref_kind_at(index2); + int k1 = method_handle_ref_kind_at_error_ok(index1); + int k2 = cp2->method_handle_ref_kind_at_error_ok(index2); if (k1 == k2) { - int i1 = method_handle_index_at(index1); - int i2 = cp2->method_handle_index_at(index2); + int i1 = method_handle_index_at_error_ok(index1); + int i2 = cp2->method_handle_index_at_error_ok(index2); bool match = compare_entry_to(i1, cp2, i2, CHECK_false); if (match) { return true; @@ -1337,14 +1304,6 @@ void ConstantPool::copy_entry_to(constantPoolHandle from_cp, int from_i, } } break; - case JVM_CONSTANT_UnresolvedClassInError: - { - Symbol* k = from_cp->unresolved_klass_at(from_i); - to_cp->unresolved_klass_at_put(to_i, k); - to_cp->tag_at_put(to_i, JVM_CONSTANT_UnresolvedClassInError); - } break; - - case JVM_CONSTANT_String: { Symbol* s = from_cp->unresolved_string_at(from_i); @@ -1360,15 +1319,17 @@ void ConstantPool::copy_entry_to(constantPoolHandle from_cp, int from_i, } break; case JVM_CONSTANT_MethodType: + case JVM_CONSTANT_MethodTypeInError: { - jint k = from_cp->method_type_index_at(from_i); + jint k = from_cp->method_type_index_at_error_ok(from_i); to_cp->method_type_index_at_put(to_i, k); } break; case JVM_CONSTANT_MethodHandle: + case JVM_CONSTANT_MethodHandleInError: { - int k1 = from_cp->method_handle_ref_kind_at(from_i); - int k2 = from_cp->method_handle_index_at(from_i); + int k1 = from_cp->method_handle_ref_kind_at_error_ok(from_i); + int k2 = from_cp->method_handle_index_at_error_ok(from_i); to_cp->method_handle_index_at_put(to_i, k1, k2); } break; @@ -1619,9 +1580,11 @@ jint ConstantPool::cpool_entry_size(jint idx) { case JVM_CONSTANT_UnresolvedClassInError: case JVM_CONSTANT_StringIndex: case JVM_CONSTANT_MethodType: + case JVM_CONSTANT_MethodTypeInError: return 3; case JVM_CONSTANT_MethodHandle: + case JVM_CONSTANT_MethodHandleInError: return 4; //tag, ref_kind, ref_index case JVM_CONSTANT_Integer: @@ -1802,8 +1765,8 @@ int ConstantPool::copy_cpool_bytes(int cpool_size, case JVM_CONSTANT_MethodHandle: case JVM_CONSTANT_MethodHandleInError: { *bytes = JVM_CONSTANT_MethodHandle; - int kind = method_handle_ref_kind_at(idx); - idx1 = method_handle_index_at(idx); + int kind = method_handle_ref_kind_at_error_ok(idx); + idx1 = method_handle_index_at_error_ok(idx); *(bytes+1) = (unsigned char) kind; Bytes::put_Java_u2((address) (bytes+2), idx1); DBG(printf("JVM_CONSTANT_MethodHandle: %d %hd", kind, idx1)); @@ -1812,7 +1775,7 @@ int ConstantPool::copy_cpool_bytes(int cpool_size, case JVM_CONSTANT_MethodType: case JVM_CONSTANT_MethodTypeInError: { *bytes = JVM_CONSTANT_MethodType; - idx1 = method_type_index_at(idx); + idx1 = method_type_index_at_error_ok(idx); Bytes::put_Java_u2((address) (bytes+1), idx1); DBG(printf("JVM_CONSTANT_MethodType: %hd", idx1)); break; @@ -1924,7 +1887,7 @@ void ConstantPool::print_on(outputStream* st) const { st->print_cr(" - holder: " INTPTR_FORMAT, pool_holder()); } st->print_cr(" - cache: " INTPTR_FORMAT, cache()); - st->print_cr(" - resolved_references: " INTPTR_FORMAT, resolved_references()); + st->print_cr(" - resolved_references: " INTPTR_FORMAT, (void *)resolved_references()); st->print_cr(" - reference_map: " INTPTR_FORMAT, reference_map()); for (int index = 1; index < length(); index++) { // Index 0 is unused @@ -2000,12 +1963,12 @@ void ConstantPool::print_entry_on(const int index, outputStream* st) { break; case JVM_CONSTANT_MethodHandle : case JVM_CONSTANT_MethodHandleInError : - st->print("ref_kind=%d", method_handle_ref_kind_at(index)); - st->print(" ref_index=%d", method_handle_index_at(index)); + st->print("ref_kind=%d", method_handle_ref_kind_at_error_ok(index)); + st->print(" ref_index=%d", method_handle_index_at_error_ok(index)); break; case JVM_CONSTANT_MethodType : case JVM_CONSTANT_MethodTypeInError : - st->print("signature_index=%d", method_type_index_at(index)); + st->print("signature_index=%d", method_type_index_at_error_ok(index)); break; case JVM_CONSTANT_InvokeDynamic : { diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp index b7d607d763a..497df53d778 100644 --- a/hotspot/src/share/vm/oops/constantPool.hpp +++ b/hotspot/src/share/vm/oops/constantPool.hpp @@ -111,6 +111,7 @@ class ConstantPool : public Metadata { int _version; } _saved; + Monitor* _lock; void set_tags(Array* tags) { _tags = tags; } void tag_at_put(int which, jbyte t) { tags()->at_put(which, t); } @@ -231,7 +232,6 @@ class ConstantPool : public Metadata { static int cache_offset_in_bytes() { return offset_of(ConstantPool, _cache); } static int pool_holder_offset_in_bytes() { return offset_of(ConstantPool, _pool_holder); } static int resolved_references_offset_in_bytes() { return offset_of(ConstantPool, _resolved_references); } - static int reference_map_offset_in_bytes() { return offset_of(ConstantPool, _reference_map); } // Storing constants @@ -475,18 +475,42 @@ class ConstantPool : public Metadata { return *int_at_addr(which); } - int method_handle_ref_kind_at(int which) { - assert(tag_at(which).is_method_handle(), "Corrupted constant pool"); + private: + int method_handle_ref_kind_at(int which, bool error_ok) { + assert(tag_at(which).is_method_handle() || + (error_ok && tag_at(which).is_method_handle_in_error()), "Corrupted constant pool"); return extract_low_short_from_int(*int_at_addr(which)); // mask out unwanted ref_index bits } - int method_handle_index_at(int which) { - assert(tag_at(which).is_method_handle(), "Corrupted constant pool"); + int method_handle_index_at(int which, bool error_ok) { + assert(tag_at(which).is_method_handle() || + (error_ok && tag_at(which).is_method_handle_in_error()), "Corrupted constant pool"); return extract_high_short_from_int(*int_at_addr(which)); // shift out unwanted ref_kind bits } - int method_type_index_at(int which) { - assert(tag_at(which).is_method_type(), "Corrupted constant pool"); + int method_type_index_at(int which, bool error_ok) { + assert(tag_at(which).is_method_type() || + (error_ok && tag_at(which).is_method_type_in_error()), "Corrupted constant pool"); return *int_at_addr(which); } + public: + int method_handle_ref_kind_at(int which) { + return method_handle_ref_kind_at(which, false); + } + int method_handle_ref_kind_at_error_ok(int which) { + return method_handle_ref_kind_at(which, true); + } + int method_handle_index_at(int which) { + return method_handle_index_at(which, false); + } + int method_handle_index_at_error_ok(int which) { + return method_handle_index_at(which, true); + } + int method_type_index_at(int which) { + return method_type_index_at(which, false); + } + int method_type_index_at_error_ok(int which) { + return method_type_index_at(which, true); + } + // Derived queries: Symbol* method_handle_name_ref_at(int which) { int member = method_handle_index_at(which); @@ -820,17 +844,8 @@ class ConstantPool : public Metadata { void set_resolved_reference_length(int length) { _saved._resolved_reference_length = length; } int resolved_reference_length() const { return _saved._resolved_reference_length; } - - // lock() may return null -- constant pool updates may happen before this lock is - // initialized, because the _pool_holder has not been fully initialized and - // has not been registered into the system dictionary. In this case, no other - // thread can be modifying this constantpool, so no synchronization is - // necessary. - // - // Use cplock() like this: - // oop cplock = cp->lock(); - // ObjectLocker ol(cplock , THREAD, cplock != NULL); - oop lock(); + void set_lock(Monitor* lock) { _lock = lock; } + Monitor* lock() { return _lock; } // Decrease ref counts of symbols that are in the constant pool // when the holder class is unloaded diff --git a/hotspot/src/share/vm/oops/cpCache.cpp b/hotspot/src/share/vm/oops/cpCache.cpp index 9d358955025..215cf7796f0 100644 --- a/hotspot/src/share/vm/oops/cpCache.cpp +++ b/hotspot/src/share/vm/oops/cpCache.cpp @@ -284,8 +284,7 @@ void ConstantPoolCacheEntry::set_method_handle_common(constantPoolHandle cpool, // the lock, so that when the losing writer returns, he can use the linked // cache entry. - oop cplock = cpool->lock(); - ObjectLocker ol(cplock, Thread::current(), cplock != NULL); + MonitorLockerEx ml(cpool->lock()); if (!is_f1_null()) { return; } @@ -306,8 +305,8 @@ void ConstantPoolCacheEntry::set_method_handle_common(constantPoolHandle cpool, if (TraceInvokeDynamic) { tty->print_cr("set_method_handle bc=%d appendix="PTR_FORMAT"%s method_type="PTR_FORMAT"%s method="PTR_FORMAT" ", invoke_code, - (intptr_t)appendix(), (has_appendix ? "" : " (unused)"), - (intptr_t)method_type(), (has_method_type ? "" : " (unused)"), + (void *)appendix(), (has_appendix ? "" : " (unused)"), + (void *)method_type(), (has_method_type ? "" : " (unused)"), (intptr_t)adapter()); adapter->print(); if (has_appendix) appendix()->print(); diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index cf77300dcf0..510102d4e35 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -106,7 +106,7 @@ HS_DTRACE_PROBE_DECL5(hotspot, class__initialization__end, len = name->utf8_length(); \ } \ HS_DTRACE_PROBE4(hotspot, class__initialization__##type, \ - data, len, (clss)->class_loader(), thread_type); \ + data, len, SOLARIS_ONLY((void *))(clss)->class_loader(), thread_type); \ } #define DTRACE_CLASSINIT_PROBE_WAIT(type, clss, thread_type, wait) \ @@ -119,7 +119,7 @@ HS_DTRACE_PROBE_DECL5(hotspot, class__initialization__end, len = name->utf8_length(); \ } \ HS_DTRACE_PROBE5(hotspot, class__initialization__##type, \ - data, len, (clss)->class_loader(), thread_type, wait); \ + data, len, SOLARIS_ONLY((void *))(clss)->class_loader(), thread_type, wait); \ } #else /* USDT2 */ @@ -238,6 +238,13 @@ void InstanceKlass::copy_method_ordering(intArray* m, TRAPS) { } } +// create a new array of vtable_indices for default methods +Array* InstanceKlass::create_new_default_vtable_indices(int len, TRAPS) { + Array* vtable_indices = MetadataFactory::new_array(class_loader_data(), len, CHECK_NULL); + assert(default_vtable_indices() == NULL, "only create once"); + set_default_vtable_indices(vtable_indices); + return vtable_indices; +} InstanceKlass::InstanceKlass(int vtable_len, int itable_len, @@ -263,6 +270,8 @@ InstanceKlass::InstanceKlass(int vtable_len, set_array_klasses(NULL); set_methods(NULL); set_method_ordering(NULL); + set_default_methods(NULL); + set_default_vtable_indices(NULL); set_local_interfaces(NULL); set_transitive_interfaces(NULL); init_implementor(); @@ -311,7 +320,8 @@ InstanceKlass::InstanceKlass(int vtable_len, void InstanceKlass::deallocate_methods(ClassLoaderData* loader_data, Array* methods) { - if (methods != NULL && methods != Universe::the_empty_method_array()) { + if (methods != NULL && methods != Universe::the_empty_method_array() && + !methods->is_shared()) { for (int i = 0; i < methods->length(); i++) { Method* method = methods->at(i); if (method == NULL) continue; // maybe null if error processing @@ -335,13 +345,14 @@ void InstanceKlass::deallocate_interfaces(ClassLoaderData* loader_data, // check that the interfaces don't come from super class Array* sti = (super_klass == NULL) ? NULL : InstanceKlass::cast(super_klass)->transitive_interfaces(); - if (ti != sti) { + if (ti != sti && ti != NULL && !ti->is_shared()) { MetadataFactory::free_array(loader_data, ti); } } // local interfaces can be empty - if (local_interfaces != Universe::the_empty_klass_array()) { + if (local_interfaces != Universe::the_empty_klass_array() && + local_interfaces != NULL && !local_interfaces->is_shared()) { MetadataFactory::free_array(loader_data, local_interfaces); } } @@ -371,16 +382,37 @@ void InstanceKlass::deallocate_contents(ClassLoaderData* loader_data) { deallocate_methods(loader_data, methods()); set_methods(NULL); - if (method_ordering() != Universe::the_empty_int_array()) { + if (method_ordering() != NULL && + method_ordering() != Universe::the_empty_int_array() && + !method_ordering()->is_shared()) { MetadataFactory::free_array(loader_data, method_ordering()); } set_method_ordering(NULL); + // default methods can be empty + if (default_methods() != NULL && + default_methods() != Universe::the_empty_method_array() && + !default_methods()->is_shared()) { + MetadataFactory::free_array(loader_data, default_methods()); + } + // Do NOT deallocate the default methods, they are owned by superinterfaces. + set_default_methods(NULL); + + // default methods vtable indices can be empty + if (default_vtable_indices() != NULL && + !default_vtable_indices()->is_shared()) { + MetadataFactory::free_array(loader_data, default_vtable_indices()); + } + set_default_vtable_indices(NULL); + + // This array is in Klass, but remove it with the InstanceKlass since // this place would be the only caller and it can share memory with transitive // interfaces. - if (secondary_supers() != Universe::the_empty_klass_array() && - secondary_supers() != transitive_interfaces()) { + if (secondary_supers() != NULL && + secondary_supers() != Universe::the_empty_klass_array() && + secondary_supers() != transitive_interfaces() && + !secondary_supers()->is_shared()) { MetadataFactory::free_array(loader_data, secondary_supers()); } set_secondary_supers(NULL); @@ -389,24 +421,32 @@ void InstanceKlass::deallocate_contents(ClassLoaderData* loader_data) { set_transitive_interfaces(NULL); set_local_interfaces(NULL); - MetadataFactory::free_array(loader_data, fields()); + if (fields() != NULL && !fields()->is_shared()) { + MetadataFactory::free_array(loader_data, fields()); + } set_fields(NULL, 0); // If a method from a redefined class is using this constant pool, don't // delete it, yet. The new class's previous version will point to this. if (constants() != NULL) { assert (!constants()->on_stack(), "shouldn't be called if anything is onstack"); - MetadataFactory::free_metadata(loader_data, constants()); + if (!constants()->is_shared()) { + MetadataFactory::free_metadata(loader_data, constants()); + } set_constants(NULL); } - if (inner_classes() != Universe::the_empty_short_array()) { + if (inner_classes() != NULL && + inner_classes() != Universe::the_empty_short_array() && + !inner_classes()->is_shared()) { MetadataFactory::free_array(loader_data, inner_classes()); } set_inner_classes(NULL); - // We should deallocate the Annotations instance - MetadataFactory::free_metadata(loader_data, annotations()); + // We should deallocate the Annotations instance if it's not in shared spaces. + if (annotations() != NULL && !annotations()->is_shared()) { + MetadataFactory::free_metadata(loader_data, annotations()); + } set_annotations(NULL); } @@ -456,15 +496,29 @@ objArrayOop InstanceKlass::signers() const { return java_lang_Class::signers(java_mirror()); } -volatile oop InstanceKlass::init_lock() const { +oop InstanceKlass::init_lock() const { // return the init lock from the mirror - return java_lang_Class::init_lock(java_mirror()); + oop lock = java_lang_Class::init_lock(java_mirror()); + assert((oop)lock != NULL || !is_not_initialized(), // initialized or in_error state + "only fully initialized state can have a null lock"); + return lock; +} + +// Set the initialization lock to null so the object can be GC'ed. Any racing +// threads to get this lock will see a null lock and will not lock. +// That's okay because they all check for initialized state after getting +// the lock and return. +void InstanceKlass::fence_and_clear_init_lock() { + // make sure previous stores are all done, notably the init_state. + OrderAccess::storestore(); + java_lang_Class::set_init_lock(java_mirror(), NULL); + assert(!is_not_initialized(), "class must be initialized now"); } void InstanceKlass::eager_initialize_impl(instanceKlassHandle this_oop) { EXCEPTION_MARK; - volatile oop init_lock = this_oop->init_lock(); - ObjectLocker ol(init_lock, THREAD); + oop init_lock = this_oop->init_lock(); + ObjectLocker ol(init_lock, THREAD, init_lock != NULL); // abort if someone beat us to the initialization if (!this_oop->is_not_initialized()) return; // note: not equivalent to is_initialized() @@ -483,6 +537,7 @@ void InstanceKlass::eager_initialize_impl(instanceKlassHandle this_oop) { } else { // linking successfull, mark class as initialized this_oop->set_init_state (fully_initialized); + this_oop->fence_and_clear_init_lock(); // trace if (TraceClassInitialization) { ResourceMark rm(THREAD); @@ -608,8 +663,8 @@ bool InstanceKlass::link_class_impl( // verification & rewriting { - volatile oop init_lock = this_oop->init_lock(); - ObjectLocker ol(init_lock, THREAD); + oop init_lock = this_oop->init_lock(); + ObjectLocker ol(init_lock, THREAD, init_lock != NULL); // rewritten will have been set if loader constraint error found // on an earlier link attempt // don't verify or rewrite if already rewritten @@ -731,8 +786,8 @@ void InstanceKlass::initialize_impl(instanceKlassHandle this_oop, TRAPS) { // refer to the JVM book page 47 for description of steps // Step 1 { - volatile oop init_lock = this_oop->init_lock(); - ObjectLocker ol(init_lock, THREAD); + oop init_lock = this_oop->init_lock(); + ObjectLocker ol(init_lock, THREAD, init_lock != NULL); Thread *self = THREAD; // it's passed the current thread @@ -879,9 +934,10 @@ void InstanceKlass::set_initialization_state_and_notify(ClassState state, TRAPS) } void InstanceKlass::set_initialization_state_and_notify_impl(instanceKlassHandle this_oop, ClassState state, TRAPS) { - volatile oop init_lock = this_oop->init_lock(); - ObjectLocker ol(init_lock, THREAD); + oop init_lock = this_oop->init_lock(); + ObjectLocker ol(init_lock, THREAD, init_lock != NULL); this_oop->set_init_state(state); + this_oop->fence_and_clear_init_lock(); ol.notify_all(CHECK); } @@ -1354,32 +1410,44 @@ static int binary_search(Array* methods, Symbol* name) { return -1; } +// find_method looks up the name/signature in the local methods array Method* InstanceKlass::find_method(Symbol* name, Symbol* signature) const { return InstanceKlass::find_method(methods(), name, signature); } +// find_method looks up the name/signature in the local methods array Method* InstanceKlass::find_method( Array* methods, Symbol* name, Symbol* signature) { + int hit = find_method_index(methods, name, signature); + return hit >= 0 ? methods->at(hit): NULL; +} + +// Used directly for default_methods to find the index into the +// default_vtable_indices, and indirectly by find_method +// find_method_index looks in the local methods array to return the index +// of the matching name/signature +int InstanceKlass::find_method_index( + Array* methods, Symbol* name, Symbol* signature) { int hit = binary_search(methods, name); if (hit != -1) { Method* m = methods->at(hit); // Do linear search to find matching signature. First, quick check // for common case - if (m->signature() == signature) return m; + if (m->signature() == signature) return hit; // search downwards through overloaded methods int i; for (i = hit - 1; i >= 0; --i) { Method* m = methods->at(i); assert(m->is_method(), "must be method"); if (m->name() != name) break; - if (m->signature() == signature) return m; + if (m->signature() == signature) return i; } // search upwards for (i = hit + 1; i < methods->length(); ++i) { Method* m = methods->at(i); assert(m->is_method(), "must be method"); if (m->name() != name) break; - if (m->signature() == signature) return m; + if (m->signature() == signature) return i; } // not found #ifdef ASSERT @@ -1387,9 +1455,8 @@ Method* InstanceKlass::find_method( assert(index == -1, err_msg("binary search should have found entry %d", index)); #endif } - return NULL; + return -1; } - int InstanceKlass::find_method_by_name(Symbol* name, int* end) { return find_method_by_name(methods(), name, end); } @@ -1408,6 +1475,7 @@ int InstanceKlass::find_method_by_name( return -1; } +// lookup_method searches both the local methods array and all superclasses methods arrays Method* InstanceKlass::uncached_lookup_method(Symbol* name, Symbol* signature) const { Klass* klass = const_cast(this); while (klass != NULL) { @@ -1418,7 +1486,24 @@ Method* InstanceKlass::uncached_lookup_method(Symbol* name, Symbol* signature) c return NULL; } +// lookup a method in the default methods list then in all transitive interfaces +// Do NOT return private or static methods +Method* InstanceKlass::lookup_method_in_ordered_interfaces(Symbol* name, + Symbol* signature) const { + Method* m = NULL; + if (default_methods() != NULL) { + m = find_method(default_methods(), name, signature); + } + // Look up interfaces + if (m == NULL) { + m = lookup_method_in_all_interfaces(name, signature); + } + return m; +} + // lookup a method in all the interfaces that this class implements +// Do NOT return private or static methods, new in JDK8 which are not externally visible +// They should only be found in the initial InterfaceMethodRef Method* InstanceKlass::lookup_method_in_all_interfaces(Symbol* name, Symbol* signature) const { Array* all_ifs = transitive_interfaces(); @@ -1427,7 +1512,7 @@ Method* InstanceKlass::lookup_method_in_all_interfaces(Symbol* name, for (int i = 0; i < num_ifs; i++) { ik = InstanceKlass::cast(all_ifs->at(i)); Method* m = ik->lookup_method(name, signature); - if (m != NULL) { + if (m != NULL && m->is_public() && !m->is_static()) { return m; } } @@ -2303,20 +2388,43 @@ void InstanceKlass::set_source_debug_extension(char* array, int length) { } address InstanceKlass::static_field_addr(int offset) { - return (address)(offset + InstanceMirrorKlass::offset_of_static_fields() + (intptr_t)java_mirror()); + return (address)(offset + InstanceMirrorKlass::offset_of_static_fields() + cast_from_oop(java_mirror())); } const char* InstanceKlass::signature_name() const { + int hash_len = 0; + char hash_buf[40]; + + // If this is an anonymous class, append a hash to make the name unique + if (is_anonymous()) { + assert(EnableInvokeDynamic, "EnableInvokeDynamic was not set."); + intptr_t hash = (java_mirror() != NULL) ? java_mirror()->identity_hash() : 0; + sprintf(hash_buf, "/" UINTX_FORMAT, (uintx)hash); + hash_len = (int)strlen(hash_buf); + } + + // Get the internal name as a c string const char* src = (const char*) (name()->as_C_string()); const int src_length = (int)strlen(src); - char* dest = NEW_RESOURCE_ARRAY(char, src_length + 3); - int src_index = 0; + + char* dest = NEW_RESOURCE_ARRAY(char, src_length + hash_len + 3); + + // Add L as type indicator int dest_index = 0; dest[dest_index++] = 'L'; - while (src_index < src_length) { + + // Add the actual class name + for (int src_index = 0; src_index < src_length; ) { dest[dest_index++] = src[src_index++]; } + + // If we have a hash, append it + for (int hash_index = 0; hash_index < hash_len; ) { + dest[dest_index++] = hash_buf[hash_index++]; + } + + // Add the semicolon and the NULL dest[dest_index++] = ';'; dest[dest_index] = '\0'; return dest; @@ -2546,6 +2654,42 @@ Method* InstanceKlass::method_at_itable(Klass* holder, int index, TRAPS) { return m; } + +#if INCLUDE_JVMTI +// update default_methods for redefineclasses for methods that are +// not yet in the vtable due to concurrent subclass define and superinterface +// redefinition +// Note: those in the vtable, should have been updated via adjust_method_entries +void InstanceKlass::adjust_default_methods(Method** old_methods, Method** new_methods, + int methods_length, bool* trace_name_printed) { + // search the default_methods for uses of either obsolete or EMCP methods + if (default_methods() != NULL) { + for (int j = 0; j < methods_length; j++) { + Method* old_method = old_methods[j]; + Method* new_method = new_methods[j]; + + for (int index = 0; index < default_methods()->length(); index ++) { + if (default_methods()->at(index) == old_method) { + default_methods()->at_put(index, new_method); + if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) { + if (!(*trace_name_printed)) { + // RC_TRACE_MESG macro has an embedded ResourceMark + RC_TRACE_MESG(("adjust: klassname=%s default methods from name=%s", + external_name(), + old_method->method_holder()->external_name())); + *trace_name_printed = true; + } + RC_TRACE(0x00100000, ("default method update: %s(%s) ", + new_method->name()->as_C_string(), + new_method->signature()->as_C_string())); + } + } + } + } + } +} +#endif // INCLUDE_JVMTI + // On-stack replacement stuff void InstanceKlass::add_osr_nmethod(nmethod* n) { // only one compilation can be active @@ -2740,11 +2884,21 @@ void InstanceKlass::print_on(outputStream* st) const { st->print(BULLET"methods: "); methods()->print_value_on(st); st->cr(); if (Verbose || WizardMode) { Array* method_array = methods(); - for(int i = 0; i < method_array->length(); i++) { + for (int i = 0; i < method_array->length(); i++) { st->print("%d : ", i); method_array->at(i)->print_value(); st->cr(); } } - st->print(BULLET"method ordering: "); method_ordering()->print_value_on(st); st->cr(); + st->print(BULLET"method ordering: "); method_ordering()->print_value_on(st); st->cr(); + st->print(BULLET"default_methods: "); default_methods()->print_value_on(st); st->cr(); + if (Verbose && default_methods() != NULL) { + Array* method_array = default_methods(); + for (int i = 0; i < method_array->length(); i++) { + st->print("%d : ", i); method_array->at(i)->print_value(); st->cr(); + } + } + if (default_vtable_indices() != NULL) { + st->print(BULLET"default vtable indices: "); default_vtable_indices()->print_value_on(st); st->cr(); + } st->print(BULLET"local interfaces: "); local_interfaces()->print_value_on(st); st->cr(); st->print(BULLET"trans. interfaces: "); transitive_interfaces()->print_value_on(st); st->cr(); st->print(BULLET"constants: "); constants()->print_value_on(st); st->cr(); @@ -2769,24 +2923,17 @@ void InstanceKlass::print_on(outputStream* st) const { st->print(BULLET"field annotations: "); fields_annotations()->print_value_on(st); st->cr(); st->print(BULLET"field type annotations: "); fields_type_annotations()->print_value_on(st); st->cr(); { - ResourceMark rm; - // PreviousVersionInfo objects returned via PreviousVersionWalker - // contain a GrowableArray of handles. We have to clean up the - // GrowableArray _after_ the PreviousVersionWalker destructor - // has destroyed the handles. - { - bool have_pv = false; - PreviousVersionWalker pvw((InstanceKlass*)this); - for (PreviousVersionInfo * pv_info = pvw.next_previous_version(); - pv_info != NULL; pv_info = pvw.next_previous_version()) { - if (!have_pv) - st->print(BULLET"previous version: "); - have_pv = true; - pv_info->prev_constant_pool_handle()()->print_value_on(st); - } - if (have_pv) st->cr(); - } // pvw is cleaned up - } // rm is cleaned up + bool have_pv = false; + PreviousVersionWalker pvw(Thread::current(), (InstanceKlass*)this); + for (PreviousVersionNode * pv_node = pvw.next_previous_version(); + pv_node != NULL; pv_node = pvw.next_previous_version()) { + if (!have_pv) + st->print(BULLET"previous version: "); + have_pv = true; + pv_node->prev_constant_pool()->print_value_on(st); + } + if (have_pv) st->cr(); + } // pvw is cleaned up if (generic_signature() != NULL) { st->print(BULLET"generic signature: "); @@ -3104,6 +3251,19 @@ void InstanceKlass::verify_on(outputStream* st, bool check_dictionary) { } } + // Verify default methods + if (default_methods() != NULL) { + Array* methods = this->default_methods(); + for (int j = 0; j < methods->length(); j++) { + guarantee(methods->at(j)->is_method(), "non-method in methods array"); + } + for (int j = 0; j < methods->length() - 1; j++) { + Method* m1 = methods->at(j); + Method* m2 = methods->at(j + 1); + guarantee(m1->name()->fast_compare(m2->name()) <= 0, "methods not sorted correctly"); + } + } + // Verify JNI static field identifiers if (jni_ids() != NULL) { jni_ids()->verify(this); @@ -3317,34 +3477,34 @@ void InstanceKlass::add_previous_version(instanceKlassHandle ikh, Array* old_methods = ikh->methods(); if (cp_ref->on_stack()) { - PreviousVersionNode * pv_node = NULL; - if (emcp_method_count == 0) { + PreviousVersionNode * pv_node = NULL; + if (emcp_method_count == 0) { // non-shared ConstantPool gets a reference - pv_node = new PreviousVersionNode(cp_ref, !cp_ref->is_shared(), NULL); - RC_TRACE(0x00000400, - ("add: all methods are obsolete; flushing any EMCP refs")); - } else { - int local_count = 0; + pv_node = new PreviousVersionNode(cp_ref, NULL); + RC_TRACE(0x00000400, + ("add: all methods are obsolete; flushing any EMCP refs")); + } else { + int local_count = 0; GrowableArray* method_refs = new (ResourceObj::C_HEAP, mtClass) - GrowableArray(emcp_method_count, true); - for (int i = 0; i < old_methods->length(); i++) { - if (emcp_methods->at(i)) { - // this old method is EMCP. Save it only if it's on the stack - Method* old_method = old_methods->at(i); - if (old_method->on_stack()) { - method_refs->append(old_method); + GrowableArray(emcp_method_count, true); + for (int i = 0; i < old_methods->length(); i++) { + if (emcp_methods->at(i)) { + // this old method is EMCP. Save it only if it's on the stack + Method* old_method = old_methods->at(i); + if (old_method->on_stack()) { + method_refs->append(old_method); + } + if (++local_count >= emcp_method_count) { + // no more EMCP methods so bail out now + break; } - if (++local_count >= emcp_method_count) { - // no more EMCP methods so bail out now - break; } } - } // non-shared ConstantPool gets a reference - pv_node = new PreviousVersionNode(cp_ref, !cp_ref->is_shared(), method_refs); + pv_node = new PreviousVersionNode(cp_ref, method_refs); } // append new previous version. - _previous_versions->append(pv_node); + _previous_versions->append(pv_node); } // Since the caller is the VMThread and we are at a safepoint, this @@ -3445,6 +3605,8 @@ Method* InstanceKlass::method_with_idnum(int idnum) { return m; } } + // None found, return null for the caller to handle. + return NULL; } return m; } @@ -3461,10 +3623,9 @@ unsigned char * InstanceKlass::get_cached_class_file_bytes() { // Construct a PreviousVersionNode entry for the array hung off // the InstanceKlass. PreviousVersionNode::PreviousVersionNode(ConstantPool* prev_constant_pool, - bool prev_cp_is_weak, GrowableArray* prev_EMCP_methods) { + GrowableArray* prev_EMCP_methods) { _prev_constant_pool = prev_constant_pool; - _prev_cp_is_weak = prev_cp_is_weak; _prev_EMCP_methods = prev_EMCP_methods; } @@ -3480,99 +3641,38 @@ PreviousVersionNode::~PreviousVersionNode() { } } - -// Construct a PreviousVersionInfo entry -PreviousVersionInfo::PreviousVersionInfo(PreviousVersionNode *pv_node) { - _prev_constant_pool_handle = constantPoolHandle(); // NULL handle - _prev_EMCP_method_handles = NULL; - - ConstantPool* cp = pv_node->prev_constant_pool(); - assert(cp != NULL, "constant pool ref was unexpectedly cleared"); - if (cp == NULL) { - return; // robustness - } - - // make the ConstantPool* safe to return - _prev_constant_pool_handle = constantPoolHandle(cp); - - GrowableArray* method_refs = pv_node->prev_EMCP_methods(); - if (method_refs == NULL) { - // the InstanceKlass did not have any EMCP methods - return; - } - - _prev_EMCP_method_handles = new GrowableArray(10); - - int n_methods = method_refs->length(); - for (int i = 0; i < n_methods; i++) { - Method* method = method_refs->at(i); - assert (method != NULL, "method has been cleared"); - if (method == NULL) { - continue; // robustness - } - // make the Method* safe to return - _prev_EMCP_method_handles->append(methodHandle(method)); - } -} - - -// Destroy a PreviousVersionInfo -PreviousVersionInfo::~PreviousVersionInfo() { - // Since _prev_EMCP_method_handles is not C-heap allocated, we - // don't have to delete it. -} - - // Construct a helper for walking the previous versions array -PreviousVersionWalker::PreviousVersionWalker(InstanceKlass *ik) { +PreviousVersionWalker::PreviousVersionWalker(Thread* thread, InstanceKlass *ik) { + _thread = thread; _previous_versions = ik->previous_versions(); _current_index = 0; - // _hm needs no initialization _current_p = NULL; -} - - -// Destroy a PreviousVersionWalker -PreviousVersionWalker::~PreviousVersionWalker() { - // Delete the current info just in case the caller didn't walk to - // the end of the previous versions list. No harm if _current_p is - // already NULL. - delete _current_p; - - // When _hm is destroyed, all the Handles returned in - // PreviousVersionInfo objects will be destroyed. - // Also, after this destructor is finished it will be - // safe to delete the GrowableArray allocated in the - // PreviousVersionInfo objects. + _current_constant_pool_handle = constantPoolHandle(thread, ik->constants()); } // Return the interesting information for the next previous version // of the klass. Returns NULL if there are no more previous versions. -PreviousVersionInfo* PreviousVersionWalker::next_previous_version() { +PreviousVersionNode* PreviousVersionWalker::next_previous_version() { if (_previous_versions == NULL) { // no previous versions so nothing to return return NULL; } - delete _current_p; // cleanup the previous info for the caller - _current_p = NULL; // reset to NULL so we don't delete same object twice + _current_p = NULL; // reset to NULL + _current_constant_pool_handle = NULL; int length = _previous_versions->length(); while (_current_index < length) { PreviousVersionNode * pv_node = _previous_versions->at(_current_index++); - PreviousVersionInfo * pv_info = new (ResourceObj::C_HEAP, mtClass) - PreviousVersionInfo(pv_node); - constantPoolHandle cp_h = pv_info->prev_constant_pool_handle(); - assert (!cp_h.is_null(), "null cp found in previous version"); - - // The caller will need to delete pv_info when they are done with it. - _current_p = pv_info; - return pv_info; + // Save a handle to the constant pool for this previous version, + // which keeps all the methods from being deallocated. + _current_constant_pool_handle = constantPoolHandle(_thread, pv_node->prev_constant_pool()); + _current_p = pv_node; + return pv_node; } - // all of the underlying nodes' info has been deleted return NULL; } // end next_previous_version() diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp index 3bd4e9de40c..283caa0a703 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceKlass.hpp @@ -269,12 +269,18 @@ class InstanceKlass: public Klass { // Method array. Array* _methods; + // Default Method Array, concrete methods inherited from interfaces + Array* _default_methods; // Interface (Klass*s) this class declares locally to implement. Array* _local_interfaces; // Interface (Klass*s) this class implements transitively. Array* _transitive_interfaces; // Int array containing the original order of method in the class file (for JVMTI). Array* _method_ordering; + // Int array containing the vtable_indices for default_methods + // offset matches _default_methods offset + Array* _default_vtable_indices; + // Instance and static variable information, starts with 6-tuples of shorts // [access, name index, sig index, initval index, low_offset, high_offset] // for all fields, followed by the generic signature data at the end of @@ -356,6 +362,15 @@ class InstanceKlass: public Klass { void set_method_ordering(Array* m) { _method_ordering = m; } void copy_method_ordering(intArray* m, TRAPS); + // default_methods + Array* default_methods() const { return _default_methods; } + void set_default_methods(Array* a) { _default_methods = a; } + + // default method vtable_indices + Array* default_vtable_indices() const { return _default_vtable_indices; } + void set_default_vtable_indices(Array* v) { _default_vtable_indices = v; } + Array* create_new_default_vtable_indices(int len, TRAPS); + // interfaces Array* local_interfaces() const { return _local_interfaces; } void set_local_interfaces(Array* a) { @@ -501,12 +516,18 @@ class InstanceKlass: public Klass { Method* find_method(Symbol* name, Symbol* signature) const; static Method* find_method(Array* methods, Symbol* name, Symbol* signature); + // find a local method index in default_methods (returns -1 if not found) + static int find_method_index(Array* methods, Symbol* name, Symbol* signature); + // lookup operation (returns NULL if not found) Method* uncached_lookup_method(Symbol* name, Symbol* signature) const; // lookup a method in all the interfaces that this class implements // (returns NULL if not found) Method* lookup_method_in_all_interfaces(Symbol* name, Symbol* signature) const; + // lookup a method in local defaults then in all interfaces + // (returns NULL if not found) + Method* lookup_method_in_ordered_interfaces(Symbol* name, Symbol* signature) const; // Find method indices by name. If a method with the specified name is // found the index to the first method is returned, and 'end' is filled in @@ -910,6 +931,11 @@ class InstanceKlass: public Klass { klassItable* itable() const; // return new klassItable wrapper Method* method_at_itable(Klass* holder, int index, TRAPS); +#if INCLUDE_JVMTI + void adjust_default_methods(Method** old_methods, Method** new_methods, + int methods_length, bool* trace_name_printed); +#endif // INCLUDE_JVMTI + // Garbage collection void oop_follow_contents(oop obj); int oop_adjust_pointers(oop obj); @@ -995,8 +1021,9 @@ public: // Must be one per class and it has to be a VM internal object so java code // cannot lock it (like the mirror). // It has to be an object not a Mutex because it's held through java calls. - volatile oop init_lock() const; + oop init_lock() const; private: + void fence_and_clear_init_lock(); // Static methods that are used to implement member methods where an exposed this pointer // is needed due to possible GCs @@ -1126,21 +1153,11 @@ class BreakpointInfo; // A collection point for interesting information about the previous -// version(s) of an InstanceKlass. This class uses weak references to -// the information so that the information may be collected as needed -// by the system. If the information is shared, then a regular -// reference must be used because a weak reference would be seen as -// collectible. A GrowableArray of PreviousVersionNodes is attached -// to the InstanceKlass as needed. See PreviousVersionWalker below. +// version(s) of an InstanceKlass. A GrowableArray of PreviousVersionNodes +// is attached to the InstanceKlass as needed. See PreviousVersionWalker below. class PreviousVersionNode : public CHeapObj { private: - // A shared ConstantPool is never collected so we'll always have - // a reference to it so we can update items in the cache. We'll - // have a weak reference to a non-shared ConstantPool until all - // of the methods (EMCP or obsolete) have been collected; the - // non-shared ConstantPool becomes collectible at that point. - ConstantPool* _prev_constant_pool; // regular or weak reference - bool _prev_cp_is_weak; // true if not a shared ConstantPool + ConstantPool* _prev_constant_pool; // If the previous version of the InstanceKlass doesn't have any // EMCP methods, then _prev_EMCP_methods will be NULL. If all the @@ -1149,8 +1166,8 @@ class PreviousVersionNode : public CHeapObj { GrowableArray* _prev_EMCP_methods; public: - PreviousVersionNode(ConstantPool* prev_constant_pool, bool prev_cp_is_weak, - GrowableArray* prev_EMCP_methods); + PreviousVersionNode(ConstantPool* prev_constant_pool, + GrowableArray* prev_EMCP_methods); ~PreviousVersionNode(); ConstantPool* prev_constant_pool() const { return _prev_constant_pool; @@ -1161,59 +1178,26 @@ public: }; -// A Handle-ized version of PreviousVersionNode. -class PreviousVersionInfo : public ResourceObj { - private: - constantPoolHandle _prev_constant_pool_handle; - // If the previous version of the InstanceKlass doesn't have any - // EMCP methods, then _prev_EMCP_methods will be NULL. Since the - // methods cannot be collected while we hold a handle, - // _prev_EMCP_methods should never have a length of zero. - GrowableArray* _prev_EMCP_method_handles; - -public: - PreviousVersionInfo(PreviousVersionNode *pv_node); - ~PreviousVersionInfo(); - constantPoolHandle prev_constant_pool_handle() const { - return _prev_constant_pool_handle; - } - GrowableArray* prev_EMCP_method_handles() const { - return _prev_EMCP_method_handles; - } -}; - - -// Helper object for walking previous versions. This helper cleans up -// the Handles that it allocates when the helper object is destroyed. -// The PreviousVersionInfo object returned by next_previous_version() -// is only valid until a subsequent call to next_previous_version() or -// the helper object is destroyed. +// Helper object for walking previous versions. class PreviousVersionWalker : public StackObj { private: + Thread* _thread; GrowableArray* _previous_versions; int _current_index; - // Fields for cleaning up when we are done walking the previous versions: - // A HandleMark for the PreviousVersionInfo handles: - HandleMark _hm; - // It would be nice to have a ResourceMark field in this helper also, - // but the ResourceMark code says to be careful to delete handles held - // in GrowableArrays _before_ deleting the GrowableArray. Since we - // can't guarantee the order in which the fields are destroyed, we - // have to let the creator of the PreviousVersionWalker object do - // the right thing. Also, adding a ResourceMark here causes an - // include loop. + // A pointer to the current node object so we can handle the deletes. + PreviousVersionNode* _current_p; - // A pointer to the current info object so we can handle the deletes. - PreviousVersionInfo * _current_p; + // The constant pool handle keeps all the methods in this class from being + // deallocated from the metaspace during class unloading. + constantPoolHandle _current_constant_pool_handle; public: - PreviousVersionWalker(InstanceKlass *ik); - ~PreviousVersionWalker(); + PreviousVersionWalker(Thread* thread, InstanceKlass *ik); // Return the interesting information for the next previous version // of the klass. Returns NULL if there are no more previous versions. - PreviousVersionInfo* next_previous_version(); + PreviousVersionNode* next_previous_version(); }; diff --git a/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp b/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp index 38f2dc81787..b861639ee0f 100644 --- a/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,7 +66,7 @@ class InstanceMirrorKlass: public InstanceKlass { // Static field offset is an offset into the Heap, should be converted by // based on UseCompressedOop for traversal static HeapWord* start_of_static_fields(oop obj) { - return (HeapWord*)((intptr_t)obj + offset_of_static_fields()); + return (HeapWord*)(cast_from_oop(obj) + offset_of_static_fields()); } static void init_offset_of_static_fields() { diff --git a/hotspot/src/share/vm/oops/instanceRefKlass.cpp b/hotspot/src/share/vm/oops/instanceRefKlass.cpp index cb5f8965521..f388980adc3 100644 --- a/hotspot/src/share/vm/oops/instanceRefKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceRefKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ void specialized_oop_follow_contents(InstanceRefKlass* ref, oop obj) { T heap_oop = oopDesc::load_heap_oop(referent_addr); debug_only( if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr("InstanceRefKlass::oop_follow_contents " INTPTR_FORMAT, obj); + gclog_or_tty->print_cr("InstanceRefKlass::oop_follow_contents " INTPTR_FORMAT, (void *)obj); } ) if (!oopDesc::is_null(heap_oop)) { @@ -62,7 +62,7 @@ void specialized_oop_follow_contents(InstanceRefKlass* ref, oop obj) { ref->InstanceKlass::oop_follow_contents(obj); debug_only( if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Non NULL enqueued " INTPTR_FORMAT, obj); + gclog_or_tty->print_cr(" Non NULL enqueued " INTPTR_FORMAT, (void *)obj); } ) return; @@ -70,7 +70,7 @@ void specialized_oop_follow_contents(InstanceRefKlass* ref, oop obj) { // treat referent as normal oop debug_only( if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Non NULL normal " INTPTR_FORMAT, obj); + gclog_or_tty->print_cr(" Non NULL normal " INTPTR_FORMAT, (void *)obj); } ) MarkSweep::mark_and_push(referent_addr); @@ -130,7 +130,7 @@ void specialized_oop_follow_contents(InstanceRefKlass* ref, T heap_oop = oopDesc::load_heap_oop(referent_addr); debug_only( if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr("InstanceRefKlass::oop_follow_contents " INTPTR_FORMAT, obj); + gclog_or_tty->print_cr("InstanceRefKlass::oop_follow_contents " INTPTR_FORMAT, (void *)obj); } ) if (!oopDesc::is_null(heap_oop)) { @@ -142,7 +142,7 @@ void specialized_oop_follow_contents(InstanceRefKlass* ref, ref->InstanceKlass::oop_follow_contents(cm, obj); debug_only( if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Non NULL enqueued " INTPTR_FORMAT, obj); + gclog_or_tty->print_cr(" Non NULL enqueued " INTPTR_FORMAT, (void *)obj); } ) return; @@ -150,7 +150,7 @@ void specialized_oop_follow_contents(InstanceRefKlass* ref, // treat referent as normal oop debug_only( if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Non NULL normal " INTPTR_FORMAT, obj); + gclog_or_tty->print_cr(" Non NULL normal " INTPTR_FORMAT, (void *)obj); } ) PSParallelCompact::mark_and_push(cm, referent_addr); diff --git a/hotspot/src/share/vm/oops/klassVtable.cpp b/hotspot/src/share/vm/oops/klassVtable.cpp index 7105368840f..568e15ffae0 100644 --- a/hotspot/src/share/vm/oops/klassVtable.cpp +++ b/hotspot/src/share/vm/oops/klassVtable.cpp @@ -83,7 +83,7 @@ void klassVtable::compute_vtable_size_and_num_mirandas( GrowableArray new_mirandas(20); // compute the number of mirandas methods that must be added to the end - get_mirandas(&new_mirandas, all_mirandas, super, methods, local_interfaces); + get_mirandas(&new_mirandas, all_mirandas, super, methods, NULL, local_interfaces); *num_new_mirandas = new_mirandas.length(); vtable_length += *num_new_mirandas * vtableEntry::size(); @@ -186,7 +186,7 @@ void klassVtable::initialize_vtable(bool checkconstraints, TRAPS) { assert(methods->at(i)->is_method(), "must be a Method*"); methodHandle mh(THREAD, methods->at(i)); - bool needs_new_entry = update_inherited_vtable(ik(), mh, super_vtable_len, checkconstraints, CHECK); + bool needs_new_entry = update_inherited_vtable(ik(), mh, super_vtable_len, -1, checkconstraints, CHECK); if (needs_new_entry) { put_method_at(mh(), initialized); @@ -195,7 +195,35 @@ void klassVtable::initialize_vtable(bool checkconstraints, TRAPS) { } } - // add miranda methods to end of vtable. + // update vtable with default_methods + Array* default_methods = ik()->default_methods(); + if (default_methods != NULL) { + len = default_methods->length(); + if (len > 0) { + Array* def_vtable_indices = NULL; + if ((def_vtable_indices = ik()->default_vtable_indices()) == NULL) { + def_vtable_indices = ik()->create_new_default_vtable_indices(len, CHECK); + } else { + assert(def_vtable_indices->length() == len, "reinit vtable len?"); + } + for (int i = 0; i < len; i++) { + HandleMark hm(THREAD); + assert(default_methods->at(i)->is_method(), "must be a Method*"); + methodHandle mh(THREAD, default_methods->at(i)); + + bool needs_new_entry = update_inherited_vtable(ik(), mh, super_vtable_len, i, checkconstraints, CHECK); + + // needs new entry + if (needs_new_entry) { + put_method_at(mh(), initialized); + def_vtable_indices->at_put(i, initialized); //set vtable index + initialized++; + } + } + } + } + + // add miranda methods; it will also return the updated initialized initialized = fill_in_mirandas(initialized); // In class hierarchies where the accessibility is not increasing (i.e., going from private -> @@ -230,14 +258,19 @@ InstanceKlass* klassVtable::find_transitive_override(InstanceKlass* initialsuper #ifndef PRODUCT if (PrintVtables && Verbose) { ResourceMark rm(THREAD); + char* sig = target_method()->name_and_sig_as_C_string(); tty->print("transitive overriding superclass %s with %s::%s index %d, original flags: ", supersuperklass->internal_name(), - _klass->internal_name(), (target_method() != NULL) ? - target_method()->name()->as_C_string() : "", vtable_index); + _klass->internal_name(), sig, vtable_index); super_method->access_flags().print_on(tty); + if (super_method->is_default_method()) { + tty->print("default"); + } tty->print("overriders flags: "); target_method->access_flags().print_on(tty); - tty->cr(); + if (target_method->is_default_method()) { + tty->print("default"); + } } #endif /*PRODUCT*/ break; // return found superk @@ -258,16 +291,31 @@ InstanceKlass* klassVtable::find_transitive_override(InstanceKlass* initialsuper // OR return true if a new vtable entry is required. // Only called for InstanceKlass's, i.e. not for arrays // If that changed, could not use _klass as handle for klass -bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle target_method, int super_vtable_len, - bool checkconstraints, TRAPS) { +bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle target_method, + int super_vtable_len, int default_index, + bool checkconstraints, TRAPS) { ResourceMark rm; bool allocate_new = true; assert(klass->oop_is_instance(), "must be InstanceKlass"); - assert(klass == target_method()->method_holder(), "caller resp."); - // Initialize the method's vtable index to "nonvirtual". - // If we allocate a vtable entry, we will update it to a non-negative number. - target_method()->set_vtable_index(Method::nonvirtual_vtable_index); + Array* def_vtable_indices = NULL; + bool is_default = false; + // default methods are concrete methods in superinterfaces which are added to the vtable + // with their real method_holder + // Since vtable and itable indices share the same storage, don't touch + // the default method's real vtable/itable index + // default_vtable_indices stores the vtable value relative to this inheritor + if (default_index >= 0 ) { + is_default = true; + def_vtable_indices = klass->default_vtable_indices(); + assert(def_vtable_indices != NULL, "def vtable alloc?"); + assert(default_index <= def_vtable_indices->length(), "def vtable len?"); + } else { + assert(klass == target_method()->method_holder(), "caller resp."); + // Initialize the method's vtable index to "nonvirtual". + // If we allocate a vtable entry, we will update it to a non-negative number. + target_method()->set_vtable_index(Method::nonvirtual_vtable_index); + } // Static and methods are never in if (target_method()->is_static() || target_method()->name() == vmSymbols::object_initializer_name()) { @@ -284,6 +332,8 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar // An interface never allocates new vtable slots, only inherits old ones. // This method will either be assigned its own itable index later, // or be assigned an inherited vtable index in the loop below. + // default methods store their vtable indices in the inheritors default_vtable_indices + assert (default_index == -1, "interfaces don't store resolved default methods"); target_method()->set_vtable_index(Method::pending_itable_index); } @@ -292,9 +342,10 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar return allocate_new; } - // private methods always have a new entry in the vtable + // private methods in classes always have a new entry in the vtable // specification interpretation since classic has // private methods not overriding + // JDK8 adds private methods in interfaces which require invokespecial if (target_method()->is_private()) { return allocate_new; } @@ -306,8 +357,15 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar Symbol* name = target_method()->name(); Symbol* signature = target_method()->signature(); - Handle target_loader(THREAD, _klass()->class_loader()); - Symbol* target_classname = _klass->name(); + + KlassHandle target_klass(THREAD, target_method()->method_holder()); + if (target_klass == NULL) { + target_klass = _klass; + } + + Handle target_loader(THREAD, target_klass->class_loader()); + + Symbol* target_classname = target_klass->name(); for(int i = 0; i < super_vtable_len; i++) { Method* super_method = method_at(i); // Check if method name matches @@ -316,10 +374,14 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar // get super_klass for method_holder for the found method InstanceKlass* super_klass = super_method->method_holder(); - if ((super_klass->is_override(super_method, target_loader, target_classname, THREAD)) || - ((klass->major_version() >= VTABLE_TRANSITIVE_OVERRIDE_VERSION) - && ((super_klass = find_transitive_override(super_klass, target_method, i, target_loader, - target_classname, THREAD)) != (InstanceKlass*)NULL))) { + if (is_default + || ((super_klass->is_override(super_method, target_loader, target_classname, THREAD)) + || ((klass->major_version() >= VTABLE_TRANSITIVE_OVERRIDE_VERSION) + && ((super_klass = find_transitive_override(super_klass, + target_method, i, target_loader, + target_classname, THREAD)) + != (InstanceKlass*)NULL)))) + { // overriding, so no new entry allocate_new = false; @@ -346,7 +408,7 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar "%s used in the signature"; char* sig = target_method()->name_and_sig_as_C_string(); const char* loader1 = SystemDictionary::loader_name(target_loader()); - char* current = _klass->name()->as_C_string(); + char* current = target_klass->name()->as_C_string(); const char* loader2 = SystemDictionary::loader_name(super_loader()); char* failed_type_name = failed_type_symbol->as_C_string(); size_t buflen = strlen(msg) + strlen(sig) + strlen(loader1) + @@ -359,16 +421,39 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar } } - put_method_at(target_method(), i); - target_method()->set_vtable_index(i); + put_method_at(target_method(), i); + if (!is_default) { + target_method()->set_vtable_index(i); + } else { + if (def_vtable_indices != NULL) { + def_vtable_indices->at_put(default_index, i); + } + assert(super_method->is_default_method() || super_method->is_overpass() + || super_method->is_abstract(), "default override error"); + } + + #ifndef PRODUCT if (PrintVtables && Verbose) { + ResourceMark rm(THREAD); + char* sig = target_method()->name_and_sig_as_C_string(); tty->print("overriding with %s::%s index %d, original flags: ", - _klass->internal_name(), (target_method() != NULL) ? - target_method()->name()->as_C_string() : "", i); + target_klass->internal_name(), sig, i); super_method->access_flags().print_on(tty); + if (super_method->is_default_method()) { + tty->print("default"); + } + if (super_method->is_overpass()) { + tty->print("overpass"); + } tty->print("overriders flags: "); target_method->access_flags().print_on(tty); + if (target_method->is_default_method()) { + tty->print("default"); + } + if (target_method->is_overpass()) { + tty->print("overpass"); + } tty->cr(); } #endif /*PRODUCT*/ @@ -377,12 +462,25 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar // but not override another. Once we override one, not need new #ifndef PRODUCT if (PrintVtables && Verbose) { + ResourceMark rm(THREAD); + char* sig = target_method()->name_and_sig_as_C_string(); tty->print("NOT overriding with %s::%s index %d, original flags: ", - _klass->internal_name(), (target_method() != NULL) ? - target_method()->name()->as_C_string() : "", i); + target_klass->internal_name(), sig,i); super_method->access_flags().print_on(tty); + if (super_method->is_default_method()) { + tty->print("default"); + } + if (super_method->is_overpass()) { + tty->print("overpass"); + } tty->print("overriders flags: "); target_method->access_flags().print_on(tty); + if (target_method->is_default_method()) { + tty->print("default"); + } + if (target_method->is_overpass()) { + tty->print("overpass"); + } tty->cr(); } #endif /*PRODUCT*/ @@ -437,14 +535,23 @@ bool klassVtable::needs_new_vtable_entry(methodHandle target_method, return false; } + // Concrete interface methods do not need new entries, they override + // abstract method entries using default inheritance rules + if (target_method()->method_holder() != NULL && + target_method()->method_holder()->is_interface() && + !target_method()->is_abstract() ) { + return false; + } + // we need a new entry if there is no superclass if (super == NULL) { return true; } - // private methods always have a new entry in the vtable + // private methods in classes always have a new entry in the vtable // specification interpretation since classic has // private methods not overriding + // JDK8 adds private methods in interfaces which require invokespecial if (target_method()->is_private()) { return true; } @@ -520,37 +627,44 @@ bool klassVtable::is_miranda_entry_at(int i) { Klass* method_holder = m->method_holder(); InstanceKlass *mhk = InstanceKlass::cast(method_holder); - // miranda methods are interface methods in a class's vtable + // miranda methods are public abstract instance interface methods in a class's vtable if (mhk->is_interface()) { assert(m->is_public(), "should be public"); assert(ik()->implements_interface(method_holder) , "this class should implement the interface"); - assert(is_miranda(m, ik()->methods(), ik()->super()), "should be a miranda_method"); + assert(is_miranda(m, ik()->methods(), ik()->default_methods(), ik()->super()), "should be a miranda_method"); return true; } return false; } -// check if a method is a miranda method, given a class's methods table and its super -// "miranda" means not static, not defined by this class, and not defined -// in super unless it is private and therefore inaccessible to this class. +// check if a method is a miranda method, given a class's methods table, +// its default_method table and its super +// "miranda" means not static, not defined by this class. +// private methods in interfaces do not belong in the miranda list. // the caller must make sure that the method belongs to an interface implemented by the class -bool klassVtable::is_miranda(Method* m, Array* class_methods, Klass* super) { - if (m->is_static()) { +// Miranda methods only include public interface instance methods +// Not private methods, not static methods, not default == concrete abstract +bool klassVtable::is_miranda(Method* m, Array* class_methods, + Array* default_methods, Klass* super) { + if (m->is_static() || m->is_private()) { return false; } Symbol* name = m->name(); Symbol* signature = m->signature(); if (InstanceKlass::find_method(class_methods, name, signature) == NULL) { // did not find it in the method table of the current class - if (super == NULL) { - // super doesn't exist - return true; - } + if ((default_methods == NULL) || + InstanceKlass::find_method(default_methods, name, signature) == NULL) { + if (super == NULL) { + // super doesn't exist + return true; + } - Method* mo = InstanceKlass::cast(super)->lookup_method(name, signature); - if (mo == NULL || mo->access_flags().is_private() ) { - // super class hierarchy does not implement it or protection is different - return true; + Method* mo = InstanceKlass::cast(super)->lookup_method(name, signature); + if (mo == NULL || mo->access_flags().is_private() ) { + // super class hierarchy does not implement it or protection is different + return true; + } } } @@ -558,7 +672,7 @@ bool klassVtable::is_miranda(Method* m, Array* class_methods, Klass* su } // Scans current_interface_methods for miranda methods that do not -// already appear in new_mirandas and are also not defined-and-non-private +// already appear in new_mirandas, or default methods, and are also not defined-and-non-private // in super (superclass). These mirandas are added to all_mirandas if it is // not null; in addition, those that are not duplicates of miranda methods // inherited by super from its interfaces are added to new_mirandas. @@ -568,7 +682,8 @@ bool klassVtable::is_miranda(Method* m, Array* class_methods, Klass* su void klassVtable::add_new_mirandas_to_lists( GrowableArray* new_mirandas, GrowableArray* all_mirandas, Array* current_interface_methods, Array* class_methods, - Klass* super) { + Array* default_methods, Klass* super) { + // iterate thru the current interface's method to see if it a miranda int num_methods = current_interface_methods->length(); for (int i = 0; i < num_methods; i++) { @@ -586,7 +701,7 @@ void klassVtable::add_new_mirandas_to_lists( } if (!is_duplicate) { // we don't want duplicate miranda entries in the vtable - if (is_miranda(im, class_methods, super)) { // is it a miranda at all? + if (is_miranda(im, class_methods, default_methods, super)) { // is it a miranda at all? InstanceKlass *sk = InstanceKlass::cast(super); // check if it is a duplicate of a super's miranda if (sk->lookup_method_in_all_interfaces(im->name(), im->signature()) == NULL) { @@ -603,6 +718,7 @@ void klassVtable::add_new_mirandas_to_lists( void klassVtable::get_mirandas(GrowableArray* new_mirandas, GrowableArray* all_mirandas, Klass* super, Array* class_methods, + Array* default_methods, Array* local_interfaces) { assert((new_mirandas->length() == 0) , "current mirandas must be 0"); @@ -611,14 +727,16 @@ void klassVtable::get_mirandas(GrowableArray* new_mirandas, for (int i = 0; i < num_local_ifs; i++) { InstanceKlass *ik = InstanceKlass::cast(local_interfaces->at(i)); add_new_mirandas_to_lists(new_mirandas, all_mirandas, - ik->methods(), class_methods, super); + ik->methods(), class_methods, + default_methods, super); // iterate thru each local's super interfaces Array* super_ifs = ik->transitive_interfaces(); int num_super_ifs = super_ifs->length(); for (int j = 0; j < num_super_ifs; j++) { InstanceKlass *sik = InstanceKlass::cast(super_ifs->at(j)); add_new_mirandas_to_lists(new_mirandas, all_mirandas, - sik->methods(), class_methods, super); + sik->methods(), class_methods, + default_methods, super); } } } @@ -629,8 +747,22 @@ void klassVtable::get_mirandas(GrowableArray* new_mirandas, int klassVtable::fill_in_mirandas(int initialized) { GrowableArray mirandas(20); get_mirandas(&mirandas, NULL, ik()->super(), ik()->methods(), - ik()->local_interfaces()); + ik()->default_methods(), ik()->local_interfaces()); for (int i = 0; i < mirandas.length(); i++) { + if (PrintVtables && Verbose) { + Method* meth = mirandas.at(i); + ResourceMark rm(Thread::current()); + if (meth != NULL) { + char* sig = meth->name_and_sig_as_C_string(); + tty->print("fill in mirandas with %s index %d, flags: ", + sig, initialized); + meth->access_flags().print_on(tty); + if (meth->is_default_method()) { + tty->print("default"); + } + tty->cr(); + } + } put_method_at(mirandas.at(i), initialized); ++initialized; } @@ -644,6 +776,26 @@ void klassVtable::copy_vtable_to(vtableEntry* start) { } #if INCLUDE_JVMTI +bool klassVtable::adjust_default_method(int vtable_index, Method* old_method, Method* new_method) { + // If old_method is default, find this vtable index in default_vtable_indices + // and replace that method in the _default_methods list + bool updated = false; + + Array* default_methods = ik()->default_methods(); + if (default_methods != NULL) { + int len = default_methods->length(); + for (int idx = 0; idx < len; idx++) { + if (vtable_index == ik()->default_vtable_indices()->at(idx)) { + if (default_methods->at(idx) == old_method) { + default_methods->at_put(idx, new_method); + updated = true; + } + break; + } + } + } + return updated; +} void klassVtable::adjust_method_entries(Method** old_methods, Method** new_methods, int methods_length, bool * trace_name_printed) { // search the vtable for uses of either obsolete or EMCP methods @@ -659,18 +811,26 @@ void klassVtable::adjust_method_entries(Method** old_methods, Method** new_metho for (int index = 0; index < length(); index++) { if (unchecked_method_at(index) == old_method) { put_method_at(new_method, index); + // For default methods, need to update the _default_methods array + // which can only have one method entry for a given signature + bool updated_default = false; + if (old_method->is_default_method()) { + updated_default = adjust_default_method(index, old_method, new_method); + } if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) { if (!(*trace_name_printed)) { // RC_TRACE_MESG macro has an embedded ResourceMark - RC_TRACE_MESG(("adjust: name=%s", + RC_TRACE_MESG(("adjust: klassname=%s for methods from name=%s", + klass()->external_name(), old_method->method_holder()->external_name())); *trace_name_printed = true; } // RC_TRACE macro has an embedded ResourceMark - RC_TRACE(0x00100000, ("vtable method update: %s(%s)", + RC_TRACE(0x00100000, ("vtable method update: %s(%s), updated default = %s", new_method->name()->as_C_string(), - new_method->signature()->as_C_string())); + new_method->signature()->as_C_string(), + updated_default ? "true" : "false")); } // cannot 'break' here; see for-loop comment above. } @@ -697,6 +857,12 @@ void klassVtable::dump_vtable() { if (m != NULL) { tty->print(" (%5d) ", i); m->access_flags().print_on(tty); + if (m->is_default_method()) { + tty->print("default"); + } + if (m->is_overpass()) { + tty->print("overpass"); + } tty->print(" -- "); m->print_name(tty); tty->cr(); @@ -753,9 +919,9 @@ static int initialize_count = 0; // Initialization void klassItable::initialize_itable(bool checkconstraints, TRAPS) { if (_klass->is_interface()) { - // This needs to go after vtable indexes are assigned but - // before implementors need to know the number of itable indexes. - assign_itable_indexes_for_interface(_klass()); + // This needs to go after vtable indices are assigned but + // before implementors need to know the number of itable indices. + assign_itable_indices_for_interface(_klass()); } // Cannot be setup doing bootstrapping, interfaces don't have @@ -799,7 +965,7 @@ inline bool interface_method_needs_itable_index(Method* m) { return true; } -int klassItable::assign_itable_indexes_for_interface(Klass* klass) { +int klassItable::assign_itable_indices_for_interface(Klass* klass) { // an interface does not have an itable, but its methods need to be numbered if (TraceItables) tty->print_cr("%3d: Initializing itable for interface %s", ++initialize_count, klass->name()->as_C_string()); @@ -842,7 +1008,7 @@ int klassItable::method_count_for_interface(Klass* interf) { } nof_methods -= 1; } - // no methods have itable indexes + // no methods have itable indices return 0; } @@ -903,6 +1069,21 @@ void klassItable::initialize_itable_for_interface(int method_table_offset, Klass int ime_num = m->itable_index(); assert(ime_num < ime_count, "oob"); itableOffsetEntry::method_entry(_klass(), method_table_offset)[ime_num].initialize(target()); + if (TraceItables && Verbose) { + ResourceMark rm(THREAD); + if (target() != NULL) { + char* sig = target()->name_and_sig_as_C_string(); + tty->print("interface: %s, ime_num: %d, target: %s, method_holder: %s ", + interf_h()->internal_name(), ime_num, sig, + target()->method_holder()->internal_name()); + tty->print("target_method flags: "); + target()->access_flags().print_on(tty); + if (target()->is_default_method()) { + tty->print("default"); + } + tty->cr(); + } + } } } } @@ -976,6 +1157,9 @@ void klassItable::dump_itable() { if (m != NULL) { tty->print(" (%5d) ", i); m->access_flags().print_on(tty); + if (m->is_default_method()) { + tty->print("default"); + } tty->print(" -- "); m->print_name(tty); tty->cr(); @@ -1112,7 +1296,7 @@ Method* klassItable::method_for_itable_index(Klass* intf, int itable_index) { Array* methods = InstanceKlass::cast(intf)->methods(); if (itable_index < 0 || itable_index >= method_count_for_interface(intf)) - return NULL; // help caller defend against bad indexes + return NULL; // help caller defend against bad indices int index = itable_index; Method* m = methods->at(index); diff --git a/hotspot/src/share/vm/oops/klassVtable.hpp b/hotspot/src/share/vm/oops/klassVtable.hpp index 06d55af2566..01ad63fcfa0 100644 --- a/hotspot/src/share/vm/oops/klassVtable.hpp +++ b/hotspot/src/share/vm/oops/klassVtable.hpp @@ -97,6 +97,7 @@ class klassVtable : public ResourceObj { // trace_name_printed is set to true if the current call has // printed the klass name so that other routines in the adjust_* // group don't print the klass name. + bool adjust_default_method(int vtable_index, Method* old_method, Method* new_method); void adjust_method_entries(Method** old_methods, Method** new_methods, int methods_length, bool * trace_name_printed); bool check_no_old_or_obsolete_entries(); @@ -118,24 +119,28 @@ class klassVtable : public ResourceObj { void put_method_at(Method* m, int index); static bool needs_new_vtable_entry(methodHandle m, Klass* super, Handle classloader, Symbol* classname, AccessFlags access_flags, TRAPS); - bool update_inherited_vtable(InstanceKlass* klass, methodHandle target_method, int super_vtable_len, bool checkconstraints, TRAPS); + bool update_inherited_vtable(InstanceKlass* klass, methodHandle target_method, int super_vtable_len, int default_index, bool checkconstraints, TRAPS); InstanceKlass* find_transitive_override(InstanceKlass* initialsuper, methodHandle target_method, int vtable_index, Handle target_loader, Symbol* target_classname, Thread* THREAD); // support for miranda methods bool is_miranda_entry_at(int i); int fill_in_mirandas(int initialized); - static bool is_miranda(Method* m, Array* class_methods, Klass* super); + static bool is_miranda(Method* m, Array* class_methods, + Array* default_methods, Klass* super); static void add_new_mirandas_to_lists( GrowableArray* new_mirandas, GrowableArray* all_mirandas, - Array* current_interface_methods, Array* class_methods, + Array* current_interface_methods, + Array* class_methods, + Array* default_methods, Klass* super); static void get_mirandas( GrowableArray* new_mirandas, GrowableArray* all_mirandas, Klass* super, - Array* class_methods, Array* local_interfaces); - + Array* class_methods, + Array* default_methods, + Array* local_interfaces); void verify_against(outputStream* st, klassVtable* vt, int index); inline InstanceKlass* ik() const; }; @@ -290,7 +295,7 @@ class klassItable : public ResourceObj { #endif // INCLUDE_JVMTI // Setup of itable - static int assign_itable_indexes_for_interface(Klass* klass); + static int assign_itable_indices_for_interface(Klass* klass); static int method_count_for_interface(Klass* klass); static int compute_itable_size(Array* transitive_interfaces); static void setup_itable_offset_table(instanceKlassHandle klass); diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp index 30631fa3b61..7c292c3ffe5 100644 --- a/hotspot/src/share/vm/oops/method.cpp +++ b/hotspot/src/share/vm/oops/method.cpp @@ -511,9 +511,9 @@ bool Method::compute_has_loops_flag() { bool Method::is_final_method(AccessFlags class_access_flags) const { // or "does_not_require_vtable_entry" - // overpass can occur, is not final (reuses vtable entry) + // default method or overpass can occur, is not final (reuses vtable entry) // private methods get vtable entries for backward class compatibility. - if (is_overpass()) return false; + if (is_overpass() || is_default_method()) return false; return is_final() || class_access_flags.is_final(); } @@ -521,11 +521,24 @@ bool Method::is_final_method() const { return is_final_method(method_holder()->access_flags()); } +bool Method::is_default_method() const { + if (method_holder() != NULL && + method_holder()->is_interface() && + !is_abstract()) { + return true; + } else { + return false; + } +} + bool Method::can_be_statically_bound(AccessFlags class_access_flags) const { if (is_final_method(class_access_flags)) return true; #ifdef ASSERT + ResourceMark rm; bool is_nonv = (vtable_index() == nonvirtual_vtable_index); - if (class_access_flags.is_interface()) assert(is_nonv == is_static(), err_msg("is_nonv=%s", is_nonv)); + if (class_access_flags.is_interface()) { + assert(is_nonv == is_static(), err_msg("is_nonv=%s", name_and_sig_as_C_string())); + } #endif assert(valid_vtable_index() || valid_itable_index(), "method must be linked before we ask this question"); return vtable_index() == nonvirtual_vtable_index; @@ -901,16 +914,6 @@ address Method::make_adapters(methodHandle mh, TRAPS) { // This function must not hit a safepoint! address Method::verified_code_entry() { debug_only(No_Safepoint_Verifier nsv;) - nmethod *code = (nmethod *)OrderAccess::load_ptr_acquire(&_code); - if (code == NULL && UseCodeCacheFlushing) { - nmethod *saved_code = CodeCache::reanimate_saved_code(this); - if (saved_code != NULL) { - methodHandle method(this); - assert( ! saved_code->is_osr_method(), "should not get here for osr" ); - set_code( method, saved_code ); - } - } - assert(_from_compiled_entry != NULL, "must be set"); return _from_compiled_entry; } @@ -1381,7 +1384,8 @@ static int method_comparator(Method* a, Method* b) { } // This is only done during class loading, so it is OK to assume method_idnum matches the methods() array -void Method::sort_methods(Array* methods, bool idempotent) { +// default_methods also uses this without the ordering for fast find_method +void Method::sort_methods(Array* methods, bool idempotent, bool set_idnums) { int length = methods->length(); if (length > 1) { { @@ -1389,14 +1393,15 @@ void Method::sort_methods(Array* methods, bool idempotent) { QuickSort::sort(methods->data(), length, method_comparator, idempotent); } // Reset method ordering - for (int i = 0; i < length; i++) { - Method* m = methods->at(i); - m->set_method_idnum(i); + if (set_idnums) { + for (int i = 0; i < length; i++) { + Method* m = methods->at(i); + m->set_method_idnum(i); + } } } } - //----------------------------------------------------------------------------------- // Non-product code unless JVM/TI needs it @@ -1510,7 +1515,10 @@ Bytecodes::Code Method::orig_bytecode_at(int bci) const { return bp->orig_bytecode(); } } - ShouldNotReachHere(); + { + ResourceMark rm; + fatal(err_msg("no original bytecode found in %s at bci %d", name_and_sig_as_C_string(), bci)); + } return Bytecodes::_shouldnotreachhere; } diff --git a/hotspot/src/share/vm/oops/method.hpp b/hotspot/src/share/vm/oops/method.hpp index 02d2253b80a..63705b3cc26 100644 --- a/hotspot/src/share/vm/oops/method.hpp +++ b/hotspot/src/share/vm/oops/method.hpp @@ -567,6 +567,7 @@ class Method : public Metadata { // checks method and its method holder bool is_final_method() const; bool is_final_method(AccessFlags class_access_flags) const; + bool is_default_method() const; // true if method needs no dynamic dispatch (final and/or no vtable entry) bool can_be_statically_bound() const; @@ -804,6 +805,7 @@ class Method : public Metadata { private: void print_made_not_compilable(int comp_level, bool is_osr, bool report, const char* reason); + public: MethodCounters* get_method_counters(TRAPS) { if (_method_counters == NULL) { build_method_counters(this, CHECK_AND_CLEAR_NULL); @@ -811,7 +813,6 @@ class Method : public Metadata { return _method_counters; } - public: bool is_not_c1_compilable() const { return access_flags().is_not_c1_compilable(); } void set_not_c1_compilable() { _access_flags.set_not_c1_compilable(); } void clear_not_c1_compilable() { _access_flags.clear_not_c1_compilable(); } @@ -846,7 +847,7 @@ class Method : public Metadata { #endif // Helper routine used for method sorting - static void sort_methods(Array* methods, bool idempotent = false); + static void sort_methods(Array* methods, bool idempotent = false, bool set_idnums = true); // Deallocation function for redefine classes or if an error occurs void deallocate_contents(ClassLoaderData* loader_data); diff --git a/hotspot/src/share/vm/oops/methodData.cpp b/hotspot/src/share/vm/oops/methodData.cpp index 89a4cd4aa6b..2cff5ee2c79 100644 --- a/hotspot/src/share/vm/oops/methodData.cpp +++ b/hotspot/src/share/vm/oops/methodData.cpp @@ -41,7 +41,7 @@ // Some types of data layouts need a length field. bool DataLayout::needs_array_len(u1 tag) { - return (tag == multi_branch_data_tag) || (tag == arg_info_data_tag); + return (tag == multi_branch_data_tag) || (tag == arg_info_data_tag) || (tag == parameters_type_data_tag); } // Perform generic initialization of the data. More specific @@ -56,6 +56,11 @@ void DataLayout::initialize(u1 tag, u2 bci, int cell_count) { if (needs_array_len(tag)) { set_cell_at(ArrayData::array_len_off_set, cell_count - 1); // -1 for header. } + if (tag == call_type_data_tag) { + CallTypeData::initialize(this, cell_count); + } else if (tag == virtual_call_type_data_tag) { + VirtualCallTypeData::initialize(this, cell_count); + } } void DataLayout::clean_weak_klass_links(BoolObjectClosure* cl) { @@ -76,7 +81,7 @@ ProfileData::ProfileData() { } #ifndef PRODUCT -void ProfileData::print_shared(outputStream* st, const char* name) { +void ProfileData::print_shared(outputStream* st, const char* name) const { st->print("bci: %d", bci()); st->fill_to(tab_width_one); st->print("%s", name); @@ -91,8 +96,8 @@ void ProfileData::print_shared(outputStream* st, const char* name) { st->print("flags(%d) ", flags); } -void ProfileData::tab(outputStream* st) { - st->fill_to(tab_width_two); +void ProfileData::tab(outputStream* st, bool first) const { + st->fill_to(first ? tab_width_one : tab_width_two); } #endif // !PRODUCT @@ -104,7 +109,7 @@ void ProfileData::tab(outputStream* st) { #ifndef PRODUCT -void BitData::print_data_on(outputStream* st) { +void BitData::print_data_on(outputStream* st) const { print_shared(st, "BitData"); } #endif // !PRODUCT @@ -115,7 +120,7 @@ void BitData::print_data_on(outputStream* st) { // A CounterData corresponds to a simple counter. #ifndef PRODUCT -void CounterData::print_data_on(outputStream* st) { +void CounterData::print_data_on(outputStream* st) const { print_shared(st, "CounterData"); st->print_cr("count(%u)", count()); } @@ -145,12 +150,217 @@ void JumpData::post_initialize(BytecodeStream* stream, MethodData* mdo) { } #ifndef PRODUCT -void JumpData::print_data_on(outputStream* st) { +void JumpData::print_data_on(outputStream* st) const { print_shared(st, "JumpData"); st->print_cr("taken(%u) displacement(%d)", taken(), displacement()); } #endif // !PRODUCT +int TypeStackSlotEntries::compute_cell_count(Symbol* signature, bool include_receiver, int max) { + // Parameter profiling include the receiver + int args_count = include_receiver ? 1 : 0; + ResourceMark rm; + SignatureStream ss(signature); + args_count += ss.reference_parameter_count(); + args_count = MIN2(args_count, max); + return args_count * per_arg_cell_count; +} + +int TypeEntriesAtCall::compute_cell_count(BytecodeStream* stream) { + assert(Bytecodes::is_invoke(stream->code()), "should be invoke"); + assert(TypeStackSlotEntries::per_arg_count() > ReturnTypeEntry::static_cell_count(), "code to test for arguments/results broken"); + Bytecode_invoke inv(stream->method(), stream->bci()); + int args_cell = 0; + if (arguments_profiling_enabled()) { + args_cell = TypeStackSlotEntries::compute_cell_count(inv.signature(), false, TypeProfileArgsLimit); + } + int ret_cell = 0; + if (return_profiling_enabled() && (inv.result_type() == T_OBJECT || inv.result_type() == T_ARRAY)) { + ret_cell = ReturnTypeEntry::static_cell_count(); + } + int header_cell = 0; + if (args_cell + ret_cell > 0) { + header_cell = header_cell_count(); + } + + return header_cell + args_cell + ret_cell; +} + +class ArgumentOffsetComputer : public SignatureInfo { +private: + int _max; + GrowableArray _offsets; + + void set(int size, BasicType type) { _size += size; } + void do_object(int begin, int end) { + if (_offsets.length() < _max) { + _offsets.push(_size); + } + SignatureInfo::do_object(begin, end); + } + void do_array (int begin, int end) { + if (_offsets.length() < _max) { + _offsets.push(_size); + } + SignatureInfo::do_array(begin, end); + } + +public: + ArgumentOffsetComputer(Symbol* signature, int max) + : SignatureInfo(signature), _max(max), _offsets(Thread::current(), max) { + } + + int total() { lazy_iterate_parameters(); return _size; } + + int off_at(int i) const { return _offsets.at(i); } +}; + +void TypeStackSlotEntries::post_initialize(Symbol* signature, bool has_receiver, bool include_receiver) { + ResourceMark rm; + int start = 0; + // Parameter profiling include the receiver + if (include_receiver && has_receiver) { + set_stack_slot(0, 0); + set_type(0, type_none()); + start += 1; + } + ArgumentOffsetComputer aos(signature, _number_of_entries-start); + aos.total(); + for (int i = start; i < _number_of_entries; i++) { + set_stack_slot(i, aos.off_at(i-start) + (has_receiver ? 1 : 0)); + set_type(i, type_none()); + } +} + +void CallTypeData::post_initialize(BytecodeStream* stream, MethodData* mdo) { + assert(Bytecodes::is_invoke(stream->code()), "should be invoke"); + Bytecode_invoke inv(stream->method(), stream->bci()); + + SignatureStream ss(inv.signature()); + if (has_arguments()) { +#ifdef ASSERT + ResourceMark rm; + int count = MIN2(ss.reference_parameter_count(), (int)TypeProfileArgsLimit); + assert(count > 0, "room for args type but none found?"); + check_number_of_arguments(count); +#endif + _args.post_initialize(inv.signature(), inv.has_receiver(), false); + } + + if (has_return()) { + assert(inv.result_type() == T_OBJECT || inv.result_type() == T_ARRAY, "room for a ret type but doesn't return obj?"); + _ret.post_initialize(); + } +} + +void VirtualCallTypeData::post_initialize(BytecodeStream* stream, MethodData* mdo) { + assert(Bytecodes::is_invoke(stream->code()), "should be invoke"); + Bytecode_invoke inv(stream->method(), stream->bci()); + + if (has_arguments()) { +#ifdef ASSERT + ResourceMark rm; + SignatureStream ss(inv.signature()); + int count = MIN2(ss.reference_parameter_count(), (int)TypeProfileArgsLimit); + assert(count > 0, "room for args type but none found?"); + check_number_of_arguments(count); +#endif + _args.post_initialize(inv.signature(), inv.has_receiver(), false); + } + + if (has_return()) { + assert(inv.result_type() == T_OBJECT || inv.result_type() == T_ARRAY, "room for a ret type but doesn't return obj?"); + _ret.post_initialize(); + } +} + +bool TypeEntries::is_loader_alive(BoolObjectClosure* is_alive_cl, intptr_t p) { + return !is_type_none(p) && + !((Klass*)klass_part(p))->is_loader_alive(is_alive_cl); +} + +void TypeStackSlotEntries::clean_weak_klass_links(BoolObjectClosure* is_alive_cl) { + for (int i = 0; i < _number_of_entries; i++) { + intptr_t p = type(i); + if (is_loader_alive(is_alive_cl, p)) { + set_type(i, type_none()); + } + } +} + +void ReturnTypeEntry::clean_weak_klass_links(BoolObjectClosure* is_alive_cl) { + intptr_t p = type(); + if (is_loader_alive(is_alive_cl, p)) { + set_type(type_none()); + } +} + +bool TypeEntriesAtCall::return_profiling_enabled() { + return MethodData::profile_return(); +} + +bool TypeEntriesAtCall::arguments_profiling_enabled() { + return MethodData::profile_arguments(); +} + +#ifndef PRODUCT +void TypeEntries::print_klass(outputStream* st, intptr_t k) { + if (is_type_none(k)) { + st->print("none"); + } else if (is_type_unknown(k)) { + st->print("unknown"); + } else { + valid_klass(k)->print_value_on(st); + } + if (was_null_seen(k)) { + st->print(" (null seen)"); + } +} + +void TypeStackSlotEntries::print_data_on(outputStream* st) const { + for (int i = 0; i < _number_of_entries; i++) { + _pd->tab(st); + st->print("%d: stack(%u) ", i, stack_slot(i)); + print_klass(st, type(i)); + st->cr(); + } +} + +void ReturnTypeEntry::print_data_on(outputStream* st) const { + _pd->tab(st); + print_klass(st, type()); + st->cr(); +} + +void CallTypeData::print_data_on(outputStream* st) const { + CounterData::print_data_on(st); + if (has_arguments()) { + tab(st, true); + st->print("argument types"); + _args.print_data_on(st); + } + if (has_return()) { + tab(st, true); + st->print("return type"); + _ret.print_data_on(st); + } +} + +void VirtualCallTypeData::print_data_on(outputStream* st) const { + VirtualCallData::print_data_on(st); + if (has_arguments()) { + tab(st, true); + st->print("argument types"); + _args.print_data_on(st); + } + if (has_return()) { + tab(st, true); + st->print("return type"); + _ret.print_data_on(st); + } +} +#endif + // ================================================================== // ReceiverTypeData // @@ -169,7 +379,7 @@ void ReceiverTypeData::clean_weak_klass_links(BoolObjectClosure* is_alive_cl) { } #ifndef PRODUCT -void ReceiverTypeData::print_receiver_data_on(outputStream* st) { +void ReceiverTypeData::print_receiver_data_on(outputStream* st) const { uint row; int entries = 0; for (row = 0; row < row_limit(); row++) { @@ -190,11 +400,11 @@ void ReceiverTypeData::print_receiver_data_on(outputStream* st) { } } } -void ReceiverTypeData::print_data_on(outputStream* st) { +void ReceiverTypeData::print_data_on(outputStream* st) const { print_shared(st, "ReceiverTypeData"); print_receiver_data_on(st); } -void VirtualCallData::print_data_on(outputStream* st) { +void VirtualCallData::print_data_on(outputStream* st) const { print_shared(st, "VirtualCallData"); print_receiver_data_on(st); } @@ -246,7 +456,7 @@ address RetData::fixup_ret(int return_bci, MethodData* h_mdo) { #ifndef PRODUCT -void RetData::print_data_on(outputStream* st) { +void RetData::print_data_on(outputStream* st) const { print_shared(st, "RetData"); uint row; int entries = 0; @@ -281,7 +491,7 @@ void BranchData::post_initialize(BytecodeStream* stream, MethodData* mdo) { } #ifndef PRODUCT -void BranchData::print_data_on(outputStream* st) { +void BranchData::print_data_on(outputStream* st) const { print_shared(st, "BranchData"); st->print_cr("taken(%u) displacement(%d)", taken(), displacement()); @@ -355,7 +565,7 @@ void MultiBranchData::post_initialize(BytecodeStream* stream, } #ifndef PRODUCT -void MultiBranchData::print_data_on(outputStream* st) { +void MultiBranchData::print_data_on(outputStream* st) const { print_shared(st, "MultiBranchData"); st->print_cr("default_count(%u) displacement(%d)", default_count(), default_displacement()); @@ -369,7 +579,7 @@ void MultiBranchData::print_data_on(outputStream* st) { #endif #ifndef PRODUCT -void ArgInfoData::print_data_on(outputStream* st) { +void ArgInfoData::print_data_on(outputStream* st) const { print_shared(st, "ArgInfoData"); int nargs = number_of_args(); for (int i = 0; i < nargs; i++) { @@ -379,6 +589,34 @@ void ArgInfoData::print_data_on(outputStream* st) { } #endif + +int ParametersTypeData::compute_cell_count(Method* m) { + if (!MethodData::profile_parameters_for_method(m)) { + return 0; + } + int max = TypeProfileParmsLimit == -1 ? INT_MAX : TypeProfileParmsLimit; + int obj_args = TypeStackSlotEntries::compute_cell_count(m->signature(), !m->is_static(), max); + if (obj_args > 0) { + return obj_args + 1; // 1 cell for array len + } + return 0; +} + +void ParametersTypeData::post_initialize(BytecodeStream* stream, MethodData* mdo) { + _parameters.post_initialize(mdo->method()->signature(), !mdo->method()->is_static(), true); +} + +bool ParametersTypeData::profiling_enabled() { + return MethodData::profile_parameters(); +} + +#ifndef PRODUCT +void ParametersTypeData::print_data_on(outputStream* st) const { + st->print("parameter types"); + _parameters.print_data_on(st); +} +#endif + // ================================================================== // MethodData* // @@ -407,7 +645,11 @@ int MethodData::bytecode_cell_count(Bytecodes::Code code) { } case Bytecodes::_invokespecial: case Bytecodes::_invokestatic: - return CounterData::static_cell_count(); + if (MethodData::profile_arguments() || MethodData::profile_return()) { + return variable_cell_count; + } else { + return CounterData::static_cell_count(); + } case Bytecodes::_goto: case Bytecodes::_goto_w: case Bytecodes::_jsr: @@ -415,9 +657,17 @@ int MethodData::bytecode_cell_count(Bytecodes::Code code) { return JumpData::static_cell_count(); case Bytecodes::_invokevirtual: case Bytecodes::_invokeinterface: - return VirtualCallData::static_cell_count(); + if (MethodData::profile_arguments() || MethodData::profile_return()) { + return variable_cell_count; + } else { + return VirtualCallData::static_cell_count(); + } case Bytecodes::_invokedynamic: - return CounterData::static_cell_count(); + if (MethodData::profile_arguments() || MethodData::profile_return()) { + return variable_cell_count; + } else { + return CounterData::static_cell_count(); + } case Bytecodes::_ret: return RetData::static_cell_count(); case Bytecodes::_ifeq: @@ -453,7 +703,36 @@ int MethodData::compute_data_size(BytecodeStream* stream) { return 0; } if (cell_count == variable_cell_count) { - cell_count = MultiBranchData::compute_cell_count(stream); + switch (stream->code()) { + case Bytecodes::_lookupswitch: + case Bytecodes::_tableswitch: + cell_count = MultiBranchData::compute_cell_count(stream); + break; + case Bytecodes::_invokespecial: + case Bytecodes::_invokestatic: + case Bytecodes::_invokedynamic: + assert(MethodData::profile_arguments() || MethodData::profile_return(), "should be collecting args profile"); + if (profile_arguments_for_invoke(stream->method(), stream->bci()) || + profile_return_for_invoke(stream->method(), stream->bci())) { + cell_count = CallTypeData::compute_cell_count(stream); + } else { + cell_count = CounterData::static_cell_count(); + } + break; + case Bytecodes::_invokevirtual: + case Bytecodes::_invokeinterface: { + assert(MethodData::profile_arguments() || MethodData::profile_return(), "should be collecting args profile"); + if (profile_arguments_for_invoke(stream->method(), stream->bci()) || + profile_return_for_invoke(stream->method(), stream->bci())) { + cell_count = VirtualCallTypeData::compute_cell_count(stream); + } else { + cell_count = VirtualCallData::static_cell_count(); + } + break; + } + default: + fatal("unexpected bytecode for var length profile data"); + } } // Note: cell_count might be zero, meaning that there is just // a DataLayout header, with no extra cells. @@ -499,6 +778,13 @@ int MethodData::compute_allocation_size_in_bytes(methodHandle method) { // Add a cell to record information about modified arguments. int arg_size = method->size_of_parameters(); object_size += DataLayout::compute_size_in_bytes(arg_size+1); + + // Reserve room for an area of the MDO dedicated to profiling of + // parameters + int args_cell = ParametersTypeData::compute_cell_count(method()); + if (args_cell > 0) { + object_size += DataLayout::compute_size_in_bytes(args_cell); + } return object_size; } @@ -534,10 +820,21 @@ int MethodData::initialize_data(BytecodeStream* stream, } break; case Bytecodes::_invokespecial: - case Bytecodes::_invokestatic: - cell_count = CounterData::static_cell_count(); - tag = DataLayout::counter_data_tag; + case Bytecodes::_invokestatic: { + int counter_data_cell_count = CounterData::static_cell_count(); + if (profile_arguments_for_invoke(stream->method(), stream->bci()) || + profile_return_for_invoke(stream->method(), stream->bci())) { + cell_count = CallTypeData::compute_cell_count(stream); + } else { + cell_count = counter_data_cell_count; + } + if (cell_count > counter_data_cell_count) { + tag = DataLayout::call_type_data_tag; + } else { + tag = DataLayout::counter_data_tag; + } break; + } case Bytecodes::_goto: case Bytecodes::_goto_w: case Bytecodes::_jsr: @@ -546,15 +843,37 @@ int MethodData::initialize_data(BytecodeStream* stream, tag = DataLayout::jump_data_tag; break; case Bytecodes::_invokevirtual: - case Bytecodes::_invokeinterface: - cell_count = VirtualCallData::static_cell_count(); - tag = DataLayout::virtual_call_data_tag; + case Bytecodes::_invokeinterface: { + int virtual_call_data_cell_count = VirtualCallData::static_cell_count(); + if (profile_arguments_for_invoke(stream->method(), stream->bci()) || + profile_return_for_invoke(stream->method(), stream->bci())) { + cell_count = VirtualCallTypeData::compute_cell_count(stream); + } else { + cell_count = virtual_call_data_cell_count; + } + if (cell_count > virtual_call_data_cell_count) { + tag = DataLayout::virtual_call_type_data_tag; + } else { + tag = DataLayout::virtual_call_data_tag; + } break; - case Bytecodes::_invokedynamic: + } + case Bytecodes::_invokedynamic: { // %%% should make a type profile for any invokedynamic that takes a ref argument - cell_count = CounterData::static_cell_count(); - tag = DataLayout::counter_data_tag; + int counter_data_cell_count = CounterData::static_cell_count(); + if (profile_arguments_for_invoke(stream->method(), stream->bci()) || + profile_return_for_invoke(stream->method(), stream->bci())) { + cell_count = CallTypeData::compute_cell_count(stream); + } else { + cell_count = counter_data_cell_count; + } + if (cell_count > counter_data_cell_count) { + tag = DataLayout::call_type_data_tag; + } else { + tag = DataLayout::counter_data_tag; + } break; + } case Bytecodes::_ret: cell_count = RetData::static_cell_count(); tag = DataLayout::ret_data_tag; @@ -585,6 +904,11 @@ int MethodData::initialize_data(BytecodeStream* stream, break; } assert(tag == DataLayout::multi_branch_data_tag || + ((MethodData::profile_arguments() || MethodData::profile_return()) && + (tag == DataLayout::call_type_data_tag || + tag == DataLayout::counter_data_tag || + tag == DataLayout::virtual_call_type_data_tag || + tag == DataLayout::virtual_call_data_tag)) || cell_count == bytecode_cell_count(c), "cell counts must agree"); if (cell_count >= 0) { assert(tag != DataLayout::no_tag, "bad tag"); @@ -631,6 +955,12 @@ ProfileData* DataLayout::data_in() { return new MultiBranchData(this); case DataLayout::arg_info_data_tag: return new ArgInfoData(this); + case DataLayout::call_type_data_tag: + return new CallTypeData(this); + case DataLayout::virtual_call_type_data_tag: + return new VirtualCallTypeData(this); + case DataLayout::parameters_type_data_tag: + return new ParametersTypeData(this); }; } @@ -652,6 +982,9 @@ void MethodData::post_initialize(BytecodeStream* stream) { stream->next(); data->post_initialize(stream, this); } + if (_parameters_type_data_di != -1) { + parameters_type_data()->post_initialize(NULL, this); + } } // Initialize the MethodData* corresponding to a given method. @@ -691,7 +1024,23 @@ MethodData::MethodData(methodHandle method, int size, TRAPS) { int arg_size = method->size_of_parameters(); dp->initialize(DataLayout::arg_info_data_tag, 0, arg_size+1); - object_size += extra_size + DataLayout::compute_size_in_bytes(arg_size+1); + int arg_data_size = DataLayout::compute_size_in_bytes(arg_size+1); + object_size += extra_size + arg_data_size; + + int args_cell = ParametersTypeData::compute_cell_count(method()); + // If we are profiling parameters, we reserver an area near the end + // of the MDO after the slots for bytecodes (because there's no bci + // for method entry so they don't fit with the framework for the + // profiling of bytecodes). We store the offset within the MDO of + // this area (or -1 if no parameter is profiled) + if (args_cell > 0) { + object_size += DataLayout::compute_size_in_bytes(args_cell); + _parameters_type_data_di = data_size + extra_size + arg_data_size; + DataLayout *dp = data_layout_at(data_size + extra_size + arg_data_size); + dp->initialize(DataLayout::parameters_type_data_tag, 0, args_cell); + } else { + _parameters_type_data_di = -1; + } // Set an initial hint. Don't use set_hint_di() because // first_di() may be out of bounds if data_size is 0. @@ -850,6 +1199,9 @@ void MethodData::print_value_on(outputStream* st) const { void MethodData::print_data_on(outputStream* st) const { ResourceMark rm; ProfileData* data = first_data(); + if (_parameters_type_data_di != -1) { + parameters_type_data()->print_data_on(st); + } for ( ; is_valid(data); data = next_data(data)) { st->print("%d", dp_to_di(data->dp())); st->fill_to(6); @@ -898,3 +1250,99 @@ void MethodData::verify_data_on(outputStream* st) { NEEDS_CLEANUP; // not yet implemented. } + +bool MethodData::profile_jsr292(methodHandle m, int bci) { + if (m->is_compiled_lambda_form()) { + return true; + } + + Bytecode_invoke inv(m , bci); + return inv.is_invokedynamic() || inv.is_invokehandle(); +} + +int MethodData::profile_arguments_flag() { + return TypeProfileLevel % 10; +} + +bool MethodData::profile_arguments() { + return profile_arguments_flag() > no_type_profile && profile_arguments_flag() <= type_profile_all; +} + +bool MethodData::profile_arguments_jsr292_only() { + return profile_arguments_flag() == type_profile_jsr292; +} + +bool MethodData::profile_all_arguments() { + return profile_arguments_flag() == type_profile_all; +} + +bool MethodData::profile_arguments_for_invoke(methodHandle m, int bci) { + if (!profile_arguments()) { + return false; + } + + if (profile_all_arguments()) { + return true; + } + + assert(profile_arguments_jsr292_only(), "inconsistent"); + return profile_jsr292(m, bci); +} + +int MethodData::profile_return_flag() { + return (TypeProfileLevel % 100) / 10; +} + +bool MethodData::profile_return() { + return profile_return_flag() > no_type_profile && profile_return_flag() <= type_profile_all; +} + +bool MethodData::profile_return_jsr292_only() { + return profile_return_flag() == type_profile_jsr292; +} + +bool MethodData::profile_all_return() { + return profile_return_flag() == type_profile_all; +} + +bool MethodData::profile_return_for_invoke(methodHandle m, int bci) { + if (!profile_return()) { + return false; + } + + if (profile_all_return()) { + return true; + } + + assert(profile_return_jsr292_only(), "inconsistent"); + return profile_jsr292(m, bci); +} + +int MethodData::profile_parameters_flag() { + return TypeProfileLevel / 100; +} + +bool MethodData::profile_parameters() { + return profile_parameters_flag() > no_type_profile && profile_parameters_flag() <= type_profile_all; +} + +bool MethodData::profile_parameters_jsr292_only() { + return profile_parameters_flag() == type_profile_jsr292; +} + +bool MethodData::profile_all_parameters() { + return profile_parameters_flag() == type_profile_all; +} + +bool MethodData::profile_parameters_for_method(methodHandle m) { + if (!profile_parameters()) { + return false; + } + + if (profile_all_parameters()) { + return true; + } + + assert(profile_parameters_jsr292_only(), "inconsistent"); + return m->is_compiled_lambda_form(); +} diff --git a/hotspot/src/share/vm/oops/methodData.hpp b/hotspot/src/share/vm/oops/methodData.hpp index 7ff9b2bbb6d..a007708bb31 100644 --- a/hotspot/src/share/vm/oops/methodData.hpp +++ b/hotspot/src/share/vm/oops/methodData.hpp @@ -117,7 +117,10 @@ public: ret_data_tag, branch_data_tag, multi_branch_data_tag, - arg_info_data_tag + arg_info_data_tag, + call_type_data_tag, + virtual_call_type_data_tag, + parameters_type_data_tag }; enum { @@ -165,7 +168,7 @@ public: // occurred, and the MDO shows N occurrences of X, we make the // simplifying assumption that all N occurrences can be blamed // on that BCI. - int trap_state() { + int trap_state() const { return ((_header._struct._flags >> trap_shift) & trap_mask); } @@ -175,11 +178,11 @@ public: _header._struct._flags = (new_state << trap_shift) | old_flags; } - u1 flags() { + u1 flags() const { return _header._struct._flags; } - u2 bci() { + u2 bci() const { return _header._struct._bci; } @@ -198,7 +201,7 @@ public: void release_set_cell_at(int index, intptr_t value) { OrderAccess::release_store_ptr(&_cells[index], value); } - intptr_t cell_at(int index) { + intptr_t cell_at(int index) const { return _cells[index]; } @@ -206,7 +209,7 @@ public: assert(flag_number < flag_limit, "oob"); _header._struct._flags |= (0x1 << flag_number); } - bool flag_at(int flag_number) { + bool flag_at(int flag_number) const { assert(flag_number < flag_limit, "oob"); return (_header._struct._flags & (0x1 << flag_number)) != 0; } @@ -254,19 +257,24 @@ class BitData; class CounterData; class ReceiverTypeData; class VirtualCallData; +class VirtualCallTypeData; class RetData; +class CallTypeData; class JumpData; class BranchData; class ArrayData; class MultiBranchData; class ArgInfoData; - +class ParametersTypeData; // ProfileData // // A ProfileData object is created to refer to a section of profiling // data in a structured way. class ProfileData : public ResourceObj { + friend class TypeEntries; + friend class ReturnTypeEntry; + friend class TypeStackSlotEntries; private: #ifndef PRODUCT enum { @@ -280,6 +288,7 @@ private: protected: DataLayout* data() { return _data; } + const DataLayout* data() const { return _data; } enum { cell_size = DataLayout::cell_size @@ -287,7 +296,7 @@ protected: public: // How many cells are in this? - virtual int cell_count() { + virtual int cell_count() const { ShouldNotReachHere(); return -1; } @@ -307,7 +316,7 @@ protected: assert(0 <= index && index < cell_count(), "oob"); data()->release_set_cell_at(index, value); } - intptr_t intptr_at(int index) { + intptr_t intptr_at(int index) const { assert(0 <= index && index < cell_count(), "oob"); return data()->cell_at(index); } @@ -317,7 +326,7 @@ protected: void release_set_uint_at(int index, uint value) { release_set_intptr_at(index, (intptr_t) value); } - uint uint_at(int index) { + uint uint_at(int index) const { return (uint)intptr_at(index); } void set_int_at(int index, int value) { @@ -326,23 +335,23 @@ protected: void release_set_int_at(int index, int value) { release_set_intptr_at(index, (intptr_t) value); } - int int_at(int index) { + int int_at(int index) const { return (int)intptr_at(index); } - int int_at_unchecked(int index) { + int int_at_unchecked(int index) const { return (int)data()->cell_at(index); } void set_oop_at(int index, oop value) { - set_intptr_at(index, (intptr_t) value); + set_intptr_at(index, cast_from_oop(value)); } - oop oop_at(int index) { - return (oop)intptr_at(index); + oop oop_at(int index) const { + return cast_to_oop(intptr_at(index)); } void set_flag_at(int flag_number) { data()->set_flag_at(flag_number); } - bool flag_at(int flag_number) { + bool flag_at(int flag_number) const { return data()->flag_at(flag_number); } @@ -362,7 +371,7 @@ public: // Constructor for invalid ProfileData. ProfileData(); - u2 bci() { + u2 bci() const { return data()->bci(); } @@ -370,7 +379,7 @@ public: return (address)_data; } - int trap_state() { + int trap_state() const { return data()->trap_state(); } void set_trap_state(int new_state) { @@ -378,58 +387,73 @@ public: } // Type checking - virtual bool is_BitData() { return false; } - virtual bool is_CounterData() { return false; } - virtual bool is_JumpData() { return false; } - virtual bool is_ReceiverTypeData(){ return false; } - virtual bool is_VirtualCallData() { return false; } - virtual bool is_RetData() { return false; } - virtual bool is_BranchData() { return false; } - virtual bool is_ArrayData() { return false; } - virtual bool is_MultiBranchData() { return false; } - virtual bool is_ArgInfoData() { return false; } + virtual bool is_BitData() const { return false; } + virtual bool is_CounterData() const { return false; } + virtual bool is_JumpData() const { return false; } + virtual bool is_ReceiverTypeData()const { return false; } + virtual bool is_VirtualCallData() const { return false; } + virtual bool is_RetData() const { return false; } + virtual bool is_BranchData() const { return false; } + virtual bool is_ArrayData() const { return false; } + virtual bool is_MultiBranchData() const { return false; } + virtual bool is_ArgInfoData() const { return false; } + virtual bool is_CallTypeData() const { return false; } + virtual bool is_VirtualCallTypeData()const { return false; } + virtual bool is_ParametersTypeData() const { return false; } - BitData* as_BitData() { + BitData* as_BitData() const { assert(is_BitData(), "wrong type"); return is_BitData() ? (BitData*) this : NULL; } - CounterData* as_CounterData() { + CounterData* as_CounterData() const { assert(is_CounterData(), "wrong type"); return is_CounterData() ? (CounterData*) this : NULL; } - JumpData* as_JumpData() { + JumpData* as_JumpData() const { assert(is_JumpData(), "wrong type"); return is_JumpData() ? (JumpData*) this : NULL; } - ReceiverTypeData* as_ReceiverTypeData() { + ReceiverTypeData* as_ReceiverTypeData() const { assert(is_ReceiverTypeData(), "wrong type"); return is_ReceiverTypeData() ? (ReceiverTypeData*)this : NULL; } - VirtualCallData* as_VirtualCallData() { + VirtualCallData* as_VirtualCallData() const { assert(is_VirtualCallData(), "wrong type"); return is_VirtualCallData() ? (VirtualCallData*)this : NULL; } - RetData* as_RetData() { + RetData* as_RetData() const { assert(is_RetData(), "wrong type"); return is_RetData() ? (RetData*) this : NULL; } - BranchData* as_BranchData() { + BranchData* as_BranchData() const { assert(is_BranchData(), "wrong type"); return is_BranchData() ? (BranchData*) this : NULL; } - ArrayData* as_ArrayData() { + ArrayData* as_ArrayData() const { assert(is_ArrayData(), "wrong type"); return is_ArrayData() ? (ArrayData*) this : NULL; } - MultiBranchData* as_MultiBranchData() { + MultiBranchData* as_MultiBranchData() const { assert(is_MultiBranchData(), "wrong type"); return is_MultiBranchData() ? (MultiBranchData*)this : NULL; } - ArgInfoData* as_ArgInfoData() { + ArgInfoData* as_ArgInfoData() const { assert(is_ArgInfoData(), "wrong type"); return is_ArgInfoData() ? (ArgInfoData*)this : NULL; } + CallTypeData* as_CallTypeData() const { + assert(is_CallTypeData(), "wrong type"); + return is_CallTypeData() ? (CallTypeData*)this : NULL; + } + VirtualCallTypeData* as_VirtualCallTypeData() const { + assert(is_VirtualCallTypeData(), "wrong type"); + return is_VirtualCallTypeData() ? (VirtualCallTypeData*)this : NULL; + } + ParametersTypeData* as_ParametersTypeData() const { + assert(is_ParametersTypeData(), "wrong type"); + return is_ParametersTypeData() ? (ParametersTypeData*)this : NULL; + } // Subclass specific initialization @@ -443,15 +467,15 @@ public: // an oop in a ProfileData to the ci equivalent. Generally speaking, // most ProfileData don't require any translation, so we provide the null // translation here, and the required translators are in the ci subclasses. - virtual void translate_from(ProfileData* data) {} + virtual void translate_from(const ProfileData* data) {} - virtual void print_data_on(outputStream* st) { + virtual void print_data_on(outputStream* st) const { ShouldNotReachHere(); } #ifndef PRODUCT - void print_shared(outputStream* st, const char* name); - void tab(outputStream* st); + void print_shared(outputStream* st, const char* name) const; + void tab(outputStream* st, bool first = false) const; #endif }; @@ -470,13 +494,13 @@ public: BitData(DataLayout* layout) : ProfileData(layout) { } - virtual bool is_BitData() { return true; } + virtual bool is_BitData() const { return true; } static int static_cell_count() { return bit_cell_count; } - virtual int cell_count() { + virtual int cell_count() const { return static_cell_count(); } @@ -498,7 +522,7 @@ public: } #ifndef PRODUCT - void print_data_on(outputStream* st); + void print_data_on(outputStream* st) const; #endif }; @@ -514,18 +538,18 @@ protected: public: CounterData(DataLayout* layout) : BitData(layout) {} - virtual bool is_CounterData() { return true; } + virtual bool is_CounterData() const { return true; } static int static_cell_count() { return counter_cell_count; } - virtual int cell_count() { + virtual int cell_count() const { return static_cell_count(); } // Direct accessor - uint count() { + uint count() const { return uint_at(count_off); } @@ -542,7 +566,7 @@ public: } #ifndef PRODUCT - void print_data_on(outputStream* st); + void print_data_on(outputStream* st) const; #endif }; @@ -570,18 +594,18 @@ public: layout->tag() == DataLayout::branch_data_tag, "wrong type"); } - virtual bool is_JumpData() { return true; } + virtual bool is_JumpData() const { return true; } static int static_cell_count() { return jump_cell_count; } - virtual int cell_count() { + virtual int cell_count() const { return static_cell_count(); } // Direct accessor - uint taken() { + uint taken() const { return uint_at(taken_off_set); } @@ -598,7 +622,7 @@ public: return cnt; } - int displacement() { + int displacement() const { return int_at(displacement_off_set); } @@ -615,7 +639,417 @@ public: void post_initialize(BytecodeStream* stream, MethodData* mdo); #ifndef PRODUCT - void print_data_on(outputStream* st); + void print_data_on(outputStream* st) const; +#endif +}; + +// Entries in a ProfileData object to record types: it can either be +// none (no profile), unknown (conflicting profile data) or a klass if +// a single one is seen. Whether a null reference was seen is also +// recorded. No counter is associated with the type and a single type +// is tracked (unlike VirtualCallData). +class TypeEntries { + +public: + + // A single cell is used to record information for a type: + // - the cell is initialized to 0 + // - when a type is discovered it is stored in the cell + // - bit zero of the cell is used to record whether a null reference + // was encountered or not + // - bit 1 is set to record a conflict in the type information + + enum { + null_seen = 1, + type_mask = ~null_seen, + type_unknown = 2, + status_bits = null_seen | type_unknown, + type_klass_mask = ~status_bits + }; + + // what to initialize a cell to + static intptr_t type_none() { + return 0; + } + + // null seen = bit 0 set? + static bool was_null_seen(intptr_t v) { + return (v & null_seen) != 0; + } + + // conflicting type information = bit 1 set? + static bool is_type_unknown(intptr_t v) { + return (v & type_unknown) != 0; + } + + // not type information yet = all bits cleared, ignoring bit 0? + static bool is_type_none(intptr_t v) { + return (v & type_mask) == 0; + } + + // recorded type: cell without bit 0 and 1 + static intptr_t klass_part(intptr_t v) { + intptr_t r = v & type_klass_mask; + assert (r != 0, "invalid"); + return r; + } + + // type recorded + static Klass* valid_klass(intptr_t k) { + if (!is_type_none(k) && + !is_type_unknown(k)) { + return (Klass*)klass_part(k); + } else { + return NULL; + } + } + + static intptr_t with_status(intptr_t k, intptr_t in) { + return k | (in & status_bits); + } + + static intptr_t with_status(Klass* k, intptr_t in) { + return with_status((intptr_t)k, in); + } + +#ifndef PRODUCT + static void print_klass(outputStream* st, intptr_t k); +#endif + + // GC support + static bool is_loader_alive(BoolObjectClosure* is_alive_cl, intptr_t p); + +protected: + // ProfileData object these entries are part of + ProfileData* _pd; + // offset within the ProfileData object where the entries start + const int _base_off; + + TypeEntries(int base_off) + : _base_off(base_off), _pd(NULL) {} + + void set_intptr_at(int index, intptr_t value) { + _pd->set_intptr_at(index, value); + } + + intptr_t intptr_at(int index) const { + return _pd->intptr_at(index); + } + +public: + void set_profile_data(ProfileData* pd) { + _pd = pd; + } +}; + +// Type entries used for arguments passed at a call and parameters on +// method entry. 2 cells per entry: one for the type encoded as in +// TypeEntries and one initialized with the stack slot where the +// profiled object is to be found so that the interpreter can locate +// it quickly. +class TypeStackSlotEntries : public TypeEntries { + +private: + enum { + stack_slot_entry, + type_entry, + per_arg_cell_count + }; + + // offset of cell for stack slot for entry i within ProfileData object + int stack_slot_offset(int i) const { + return _base_off + stack_slot_local_offset(i); + } + +protected: + const int _number_of_entries; + + // offset of cell for type for entry i within ProfileData object + int type_offset(int i) const { + return _base_off + type_local_offset(i); + } + +public: + + TypeStackSlotEntries(int base_off, int nb_entries) + : TypeEntries(base_off), _number_of_entries(nb_entries) {} + + static int compute_cell_count(Symbol* signature, bool include_receiver, int max); + + void post_initialize(Symbol* signature, bool has_receiver, bool include_receiver); + + // offset of cell for stack slot for entry i within this block of cells for a TypeStackSlotEntries + static int stack_slot_local_offset(int i) { + return i * per_arg_cell_count + stack_slot_entry; + } + + // offset of cell for type for entry i within this block of cells for a TypeStackSlotEntries + static int type_local_offset(int i) { + return i * per_arg_cell_count + type_entry; + } + + // stack slot for entry i + uint stack_slot(int i) const { + assert(i >= 0 && i < _number_of_entries, "oob"); + return _pd->uint_at(stack_slot_offset(i)); + } + + // set stack slot for entry i + void set_stack_slot(int i, uint num) { + assert(i >= 0 && i < _number_of_entries, "oob"); + _pd->set_uint_at(stack_slot_offset(i), num); + } + + // type for entry i + intptr_t type(int i) const { + assert(i >= 0 && i < _number_of_entries, "oob"); + return _pd->intptr_at(type_offset(i)); + } + + // set type for entry i + void set_type(int i, intptr_t k) { + assert(i >= 0 && i < _number_of_entries, "oob"); + _pd->set_intptr_at(type_offset(i), k); + } + + static ByteSize per_arg_size() { + return in_ByteSize(per_arg_cell_count * DataLayout::cell_size); + } + + static int per_arg_count() { + return per_arg_cell_count ; + } + + // GC support + void clean_weak_klass_links(BoolObjectClosure* is_alive_closure); + +#ifndef PRODUCT + void print_data_on(outputStream* st) const; +#endif +}; + +// Type entry used for return from a call. A single cell to record the +// type. +class ReturnTypeEntry : public TypeEntries { + +private: + enum { + cell_count = 1 + }; + +public: + ReturnTypeEntry(int base_off) + : TypeEntries(base_off) {} + + void post_initialize() { + set_type(type_none()); + } + + intptr_t type() const { + return _pd->intptr_at(_base_off); + } + + void set_type(intptr_t k) { + _pd->set_intptr_at(_base_off, k); + } + + static int static_cell_count() { + return cell_count; + } + + static ByteSize size() { + return in_ByteSize(cell_count * DataLayout::cell_size); + } + + ByteSize type_offset() { + return DataLayout::cell_offset(_base_off); + } + + // GC support + void clean_weak_klass_links(BoolObjectClosure* is_alive_closure); + +#ifndef PRODUCT + void print_data_on(outputStream* st) const; +#endif +}; + +// Entries to collect type information at a call: contains arguments +// (TypeStackSlotEntries), a return type (ReturnTypeEntry) and a +// number of cells. Because the number of cells for the return type is +// smaller than the number of cells for the type of an arguments, the +// number of cells is used to tell how many arguments are profiled and +// whether a return value is profiled. See has_arguments() and +// has_return(). +class TypeEntriesAtCall { +private: + static int stack_slot_local_offset(int i) { + return header_cell_count() + TypeStackSlotEntries::stack_slot_local_offset(i); + } + + static int argument_type_local_offset(int i) { + return header_cell_count() + TypeStackSlotEntries::type_local_offset(i);; + } + +public: + + static int header_cell_count() { + return 1; + } + + static int cell_count_local_offset() { + return 0; + } + + static int compute_cell_count(BytecodeStream* stream); + + static void initialize(DataLayout* dl, int base, int cell_count) { + int off = base + cell_count_local_offset(); + dl->set_cell_at(off, cell_count - base - header_cell_count()); + } + + static bool arguments_profiling_enabled(); + static bool return_profiling_enabled(); + + // Code generation support + static ByteSize cell_count_offset() { + return in_ByteSize(cell_count_local_offset() * DataLayout::cell_size); + } + + static ByteSize args_data_offset() { + return in_ByteSize(header_cell_count() * DataLayout::cell_size); + } + + static ByteSize stack_slot_offset(int i) { + return in_ByteSize(stack_slot_local_offset(i) * DataLayout::cell_size); + } + + static ByteSize argument_type_offset(int i) { + return in_ByteSize(argument_type_local_offset(i) * DataLayout::cell_size); + } +}; + +// CallTypeData +// +// A CallTypeData is used to access profiling information about a non +// virtual call for which we collect type information about arguments +// and return value. +class CallTypeData : public CounterData { +private: + // entries for arguments if any + TypeStackSlotEntries _args; + // entry for return type if any + ReturnTypeEntry _ret; + + int cell_count_global_offset() const { + return CounterData::static_cell_count() + TypeEntriesAtCall::cell_count_local_offset(); + } + + // number of cells not counting the header + int cell_count_no_header() const { + return uint_at(cell_count_global_offset()); + } + + void check_number_of_arguments(int total) { + assert(number_of_arguments() == total, "should be set in DataLayout::initialize"); + } + +public: + CallTypeData(DataLayout* layout) : + CounterData(layout), + _args(CounterData::static_cell_count()+TypeEntriesAtCall::header_cell_count(), number_of_arguments()), + _ret(cell_count() - ReturnTypeEntry::static_cell_count()) + { + assert(layout->tag() == DataLayout::call_type_data_tag, "wrong type"); + // Some compilers (VC++) don't want this passed in member initialization list + _args.set_profile_data(this); + _ret.set_profile_data(this); + } + + const TypeStackSlotEntries* args() const { + assert(has_arguments(), "no profiling of arguments"); + return &_args; + } + + const ReturnTypeEntry* ret() const { + assert(has_return(), "no profiling of return value"); + return &_ret; + } + + virtual bool is_CallTypeData() const { return true; } + + static int static_cell_count() { + return -1; + } + + static int compute_cell_count(BytecodeStream* stream) { + return CounterData::static_cell_count() + TypeEntriesAtCall::compute_cell_count(stream); + } + + static void initialize(DataLayout* dl, int cell_count) { + TypeEntriesAtCall::initialize(dl, CounterData::static_cell_count(), cell_count); + } + + virtual void post_initialize(BytecodeStream* stream, MethodData* mdo); + + virtual int cell_count() const { + return CounterData::static_cell_count() + + TypeEntriesAtCall::header_cell_count() + + int_at_unchecked(cell_count_global_offset()); + } + + int number_of_arguments() const { + return cell_count_no_header() / TypeStackSlotEntries::per_arg_count(); + } + + void set_argument_type(int i, Klass* k) { + assert(has_arguments(), "no arguments!"); + intptr_t current = _args.type(i); + _args.set_type(i, TypeEntries::with_status(k, current)); + } + + void set_return_type(Klass* k) { + assert(has_return(), "no return!"); + intptr_t current = _ret.type(); + _ret.set_type(TypeEntries::with_status(k, current)); + } + + // An entry for a return value takes less space than an entry for an + // argument so if the number of cells exceeds the number of cells + // needed for an argument, this object contains type information for + // at least one argument. + bool has_arguments() const { + bool res = cell_count_no_header() >= TypeStackSlotEntries::per_arg_count(); + assert (!res || TypeEntriesAtCall::arguments_profiling_enabled(), "no profiling of arguments"); + return res; + } + + // An entry for a return value takes less space than an entry for an + // argument, so if the remainder of the number of cells divided by + // the number of cells for an argument is not null, a return value + // is profiled in this object. + bool has_return() const { + bool res = (cell_count_no_header() % TypeStackSlotEntries::per_arg_count()) != 0; + assert (!res || TypeEntriesAtCall::return_profiling_enabled(), "no profiling of return values"); + return res; + } + + // Code generation support + static ByteSize args_data_offset() { + return cell_offset(CounterData::static_cell_count()) + TypeEntriesAtCall::args_data_offset(); + } + + // GC support + virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure) { + if (has_arguments()) { + _args.clean_weak_klass_links(is_alive_closure); + } + if (has_return()) { + _ret.clean_weak_klass_links(is_alive_closure); + } + } + +#ifndef PRODUCT + virtual void print_data_on(outputStream* st) const; #endif }; @@ -636,16 +1070,17 @@ protected: public: ReceiverTypeData(DataLayout* layout) : CounterData(layout) { assert(layout->tag() == DataLayout::receiver_type_data_tag || - layout->tag() == DataLayout::virtual_call_data_tag, "wrong type"); + layout->tag() == DataLayout::virtual_call_data_tag || + layout->tag() == DataLayout::virtual_call_type_data_tag, "wrong type"); } - virtual bool is_ReceiverTypeData() { return true; } + virtual bool is_ReceiverTypeData() const { return true; } static int static_cell_count() { return counter_cell_count + (uint) TypeProfileWidth * receiver_type_row_cell_count; } - virtual int cell_count() { + virtual int cell_count() const { return static_cell_count(); } @@ -660,7 +1095,7 @@ public: return count0_offset + row * receiver_type_row_cell_count; } - Klass* receiver(uint row) { + Klass* receiver(uint row) const { assert(row < row_limit(), "oob"); Klass* recv = (Klass*)intptr_at(receiver_cell_index(row)); @@ -673,7 +1108,7 @@ public: set_intptr_at(receiver_cell_index(row), (uintptr_t)k); } - uint receiver_count(uint row) { + uint receiver_count(uint row) const { assert(row < row_limit(), "oob"); return uint_at(receiver_count_cell_index(row)); } @@ -721,8 +1156,8 @@ public: virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure); #ifndef PRODUCT - void print_receiver_data_on(outputStream* st); - void print_data_on(outputStream* st); + void print_receiver_data_on(outputStream* st) const; + void print_data_on(outputStream* st) const; #endif }; @@ -733,10 +1168,11 @@ public: class VirtualCallData : public ReceiverTypeData { public: VirtualCallData(DataLayout* layout) : ReceiverTypeData(layout) { - assert(layout->tag() == DataLayout::virtual_call_data_tag, "wrong type"); + assert(layout->tag() == DataLayout::virtual_call_data_tag || + layout->tag() == DataLayout::virtual_call_type_data_tag, "wrong type"); } - virtual bool is_VirtualCallData() { return true; } + virtual bool is_VirtualCallData() const { return true; } static int static_cell_count() { // At this point we could add more profile state, e.g., for arguments. @@ -744,7 +1180,7 @@ public: return ReceiverTypeData::static_cell_count(); } - virtual int cell_count() { + virtual int cell_count() const { return static_cell_count(); } @@ -754,7 +1190,133 @@ public: } #ifndef PRODUCT - void print_data_on(outputStream* st); + void print_data_on(outputStream* st) const; +#endif +}; + +// VirtualCallTypeData +// +// A VirtualCallTypeData is used to access profiling information about +// a virtual call for which we collect type information about +// arguments and return value. +class VirtualCallTypeData : public VirtualCallData { +private: + // entries for arguments if any + TypeStackSlotEntries _args; + // entry for return type if any + ReturnTypeEntry _ret; + + int cell_count_global_offset() const { + return VirtualCallData::static_cell_count() + TypeEntriesAtCall::cell_count_local_offset(); + } + + // number of cells not counting the header + int cell_count_no_header() const { + return uint_at(cell_count_global_offset()); + } + + void check_number_of_arguments(int total) { + assert(number_of_arguments() == total, "should be set in DataLayout::initialize"); + } + +public: + VirtualCallTypeData(DataLayout* layout) : + VirtualCallData(layout), + _args(VirtualCallData::static_cell_count()+TypeEntriesAtCall::header_cell_count(), number_of_arguments()), + _ret(cell_count() - ReturnTypeEntry::static_cell_count()) + { + assert(layout->tag() == DataLayout::virtual_call_type_data_tag, "wrong type"); + // Some compilers (VC++) don't want this passed in member initialization list + _args.set_profile_data(this); + _ret.set_profile_data(this); + } + + const TypeStackSlotEntries* args() const { + assert(has_arguments(), "no profiling of arguments"); + return &_args; + } + + const ReturnTypeEntry* ret() const { + assert(has_return(), "no profiling of return value"); + return &_ret; + } + + virtual bool is_VirtualCallTypeData() const { return true; } + + static int static_cell_count() { + return -1; + } + + static int compute_cell_count(BytecodeStream* stream) { + return VirtualCallData::static_cell_count() + TypeEntriesAtCall::compute_cell_count(stream); + } + + static void initialize(DataLayout* dl, int cell_count) { + TypeEntriesAtCall::initialize(dl, VirtualCallData::static_cell_count(), cell_count); + } + + virtual void post_initialize(BytecodeStream* stream, MethodData* mdo); + + virtual int cell_count() const { + return VirtualCallData::static_cell_count() + + TypeEntriesAtCall::header_cell_count() + + int_at_unchecked(cell_count_global_offset()); + } + + int number_of_arguments() const { + return cell_count_no_header() / TypeStackSlotEntries::per_arg_count(); + } + + void set_argument_type(int i, Klass* k) { + assert(has_arguments(), "no arguments!"); + intptr_t current = _args.type(i); + _args.set_type(i, TypeEntries::with_status(k, current)); + } + + void set_return_type(Klass* k) { + assert(has_return(), "no return!"); + intptr_t current = _ret.type(); + _ret.set_type(TypeEntries::with_status(k, current)); + } + + // An entry for a return value takes less space than an entry for an + // argument, so if the remainder of the number of cells divided by + // the number of cells for an argument is not null, a return value + // is profiled in this object. + bool has_return() const { + bool res = (cell_count_no_header() % TypeStackSlotEntries::per_arg_count()) != 0; + assert (!res || TypeEntriesAtCall::return_profiling_enabled(), "no profiling of return values"); + return res; + } + + // An entry for a return value takes less space than an entry for an + // argument so if the number of cells exceeds the number of cells + // needed for an argument, this object contains type information for + // at least one argument. + bool has_arguments() const { + bool res = cell_count_no_header() >= TypeStackSlotEntries::per_arg_count(); + assert (!res || TypeEntriesAtCall::arguments_profiling_enabled(), "no profiling of arguments"); + return res; + } + + // Code generation support + static ByteSize args_data_offset() { + return cell_offset(VirtualCallData::static_cell_count()) + TypeEntriesAtCall::args_data_offset(); + } + + // GC support + virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure) { + ReceiverTypeData::clean_weak_klass_links(is_alive_closure); + if (has_arguments()) { + _args.clean_weak_klass_links(is_alive_closure); + } + if (has_return()) { + _ret.clean_weak_klass_links(is_alive_closure); + } + } + +#ifndef PRODUCT + virtual void print_data_on(outputStream* st) const; #endif }; @@ -797,7 +1359,7 @@ public: assert(layout->tag() == DataLayout::ret_data_tag, "wrong type"); } - virtual bool is_RetData() { return true; } + virtual bool is_RetData() const { return true; } enum { no_bci = -1 // value of bci when bci1/2 are not in use. @@ -807,7 +1369,7 @@ public: return counter_cell_count + (uint) BciProfileWidth * ret_row_cell_count; } - virtual int cell_count() { + virtual int cell_count() const { return static_cell_count(); } @@ -825,13 +1387,13 @@ public: } // Direct accessors - int bci(uint row) { + int bci(uint row) const { return int_at(bci_cell_index(row)); } - uint bci_count(uint row) { + uint bci_count(uint row) const { return uint_at(bci_count_cell_index(row)); } - int bci_displacement(uint row) { + int bci_displacement(uint row) const { return int_at(bci_displacement_cell_index(row)); } @@ -853,7 +1415,7 @@ public: void post_initialize(BytecodeStream* stream, MethodData* mdo); #ifndef PRODUCT - void print_data_on(outputStream* st); + void print_data_on(outputStream* st) const; #endif }; @@ -878,18 +1440,18 @@ public: assert(layout->tag() == DataLayout::branch_data_tag, "wrong type"); } - virtual bool is_BranchData() { return true; } + virtual bool is_BranchData() const { return true; } static int static_cell_count() { return branch_cell_count; } - virtual int cell_count() { + virtual int cell_count() const { return static_cell_count(); } // Direct accessor - uint not_taken() { + uint not_taken() const { return uint_at(not_taken_off_set); } @@ -917,7 +1479,7 @@ public: void post_initialize(BytecodeStream* stream, MethodData* mdo); #ifndef PRODUCT - void print_data_on(outputStream* st); + void print_data_on(outputStream* st) const; #endif }; @@ -935,15 +1497,15 @@ protected: array_start_off_set }; - uint array_uint_at(int index) { + uint array_uint_at(int index) const { int aindex = index + array_start_off_set; return uint_at(aindex); } - int array_int_at(int index) { + int array_int_at(int index) const { int aindex = index + array_start_off_set; return int_at(aindex); } - oop array_oop_at(int index) { + oop array_oop_at(int index) const { int aindex = index + array_start_off_set; return oop_at(aindex); } @@ -960,17 +1522,17 @@ protected: public: ArrayData(DataLayout* layout) : ProfileData(layout) {} - virtual bool is_ArrayData() { return true; } + virtual bool is_ArrayData() const { return true; } static int static_cell_count() { return -1; } - int array_len() { + int array_len() const { return int_at_unchecked(array_len_off_set); } - virtual int cell_count() { + virtual int cell_count() const { return array_len() + 1; } @@ -1017,29 +1579,29 @@ public: assert(layout->tag() == DataLayout::multi_branch_data_tag, "wrong type"); } - virtual bool is_MultiBranchData() { return true; } + virtual bool is_MultiBranchData() const { return true; } static int compute_cell_count(BytecodeStream* stream); - int number_of_cases() { + int number_of_cases() const { int alen = array_len() - 2; // get rid of default case here. assert(alen % per_case_cell_count == 0, "must be even"); return (alen / per_case_cell_count); } - uint default_count() { + uint default_count() const { return array_uint_at(default_count_off_set); } - int default_displacement() { + int default_displacement() const { return array_int_at(default_disaplacement_off_set); } - uint count_at(int index) { + uint count_at(int index) const { return array_uint_at(case_array_start + index * per_case_cell_count + relative_count_off_set); } - int displacement_at(int index) { + int displacement_at(int index) const { return array_int_at(case_array_start + index * per_case_cell_count + relative_displacement_off_set); @@ -1074,7 +1636,7 @@ public: void post_initialize(BytecodeStream* stream, MethodData* mdo); #ifndef PRODUCT - void print_data_on(outputStream* st); + void print_data_on(outputStream* st) const; #endif }; @@ -1085,14 +1647,14 @@ public: assert(layout->tag() == DataLayout::arg_info_data_tag, "wrong type"); } - virtual bool is_ArgInfoData() { return true; } + virtual bool is_ArgInfoData() const { return true; } - int number_of_args() { + int number_of_args() const { return array_len(); } - uint arg_modified(int arg) { + uint arg_modified(int arg) const { return array_uint_at(arg); } @@ -1101,10 +1663,79 @@ public: } #ifndef PRODUCT - void print_data_on(outputStream* st); + void print_data_on(outputStream* st) const; #endif }; +// ParametersTypeData +// +// A ParametersTypeData is used to access profiling information about +// types of parameters to a method +class ParametersTypeData : public ArrayData { + +private: + TypeStackSlotEntries _parameters; + + static int stack_slot_local_offset(int i) { + assert_profiling_enabled(); + return array_start_off_set + TypeStackSlotEntries::stack_slot_local_offset(i); + } + + static int type_local_offset(int i) { + assert_profiling_enabled(); + return array_start_off_set + TypeStackSlotEntries::type_local_offset(i); + } + + static bool profiling_enabled(); + static void assert_profiling_enabled() { + assert(profiling_enabled(), "method parameters profiling should be on"); + } + +public: + ParametersTypeData(DataLayout* layout) : ArrayData(layout), _parameters(1, number_of_parameters()) { + assert(layout->tag() == DataLayout::parameters_type_data_tag, "wrong type"); + // Some compilers (VC++) don't want this passed in member initialization list + _parameters.set_profile_data(this); + } + + static int compute_cell_count(Method* m); + + virtual bool is_ParametersTypeData() const { return true; } + + virtual void post_initialize(BytecodeStream* stream, MethodData* mdo); + + int number_of_parameters() const { + return array_len() / TypeStackSlotEntries::per_arg_count(); + } + + const TypeStackSlotEntries* parameters() const { return &_parameters; } + + uint stack_slot(int i) const { + return _parameters.stack_slot(i); + } + + void set_type(int i, Klass* k) { + intptr_t current = _parameters.type(i); + _parameters.set_type(i, TypeEntries::with_status((intptr_t)k, current)); + } + + virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure) { + _parameters.clean_weak_klass_links(is_alive_closure); + } + +#ifndef PRODUCT + virtual void print_data_on(outputStream* st) const; +#endif + + static ByteSize stack_slot_offset(int i) { + return cell_offset(stack_slot_local_offset(i)); + } + + static ByteSize type_offset(int i) { + return cell_offset(type_local_offset(i)); + } +}; + // MethodData* // // A MethodData* holds information which has been collected about @@ -1216,6 +1847,10 @@ private: // Size of _data array in bytes. (Excludes header and extra_data fields.) int _data_size; + // data index for the area dedicated to parameters. -1 if no + // parameter profiling. + int _parameters_type_data_di; + // Beginning of the data entries intptr_t _data[1]; @@ -1271,6 +1906,24 @@ private: // return the argument info cell ArgInfoData *arg_info(); + enum { + no_type_profile = 0, + type_profile_jsr292 = 1, + type_profile_all = 2 + }; + + static bool profile_jsr292(methodHandle m, int bci); + static int profile_arguments_flag(); + static bool profile_arguments_jsr292_only(); + static bool profile_all_arguments(); + static bool profile_arguments_for_invoke(methodHandle m, int bci); + static int profile_return_flag(); + static bool profile_all_return(); + static bool profile_return_for_invoke(methodHandle m, int bci); + static int profile_parameters_flag(); + static bool profile_parameters_jsr292_only(); + static bool profile_all_parameters(); + public: static int header_size() { return sizeof(MethodData)/wordSize; @@ -1476,6 +2129,16 @@ public: } } + // Return pointer to area dedicated to parameters in MDO + ParametersTypeData* parameters_type_data() const { + return _parameters_type_data_di != -1 ? data_layout_at(_parameters_type_data_di)->data_in()->as_ParametersTypeData() : NULL; + } + + int parameters_type_data_di() const { + assert(_parameters_type_data_di != -1, "no args type data"); + return _parameters_type_data_di; + } + // Support for code generation static ByteSize data_offset() { return byte_offset_of(MethodData, _data[0]); @@ -1488,6 +2151,10 @@ public: return byte_offset_of(MethodData, _backedge_counter); } + static ByteSize parameters_type_data_di_offset() { + return byte_offset_of(MethodData, _parameters_type_data_di); + } + // Deallocation support - no pointer fields to deallocate void deallocate_contents(ClassLoaderData* loader_data) {} @@ -1510,6 +2177,12 @@ public: // verification void verify_on(outputStream* st); void verify_data_on(outputStream* st); + + static bool profile_parameters_for_method(methodHandle m); + static bool profile_arguments(); + static bool profile_return(); + static bool profile_parameters(); + static bool profile_return_jsr292_only(); }; #endif // SHARE_VM_OOPS_METHODDATAOOP_HPP diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp index f1823f2e2b1..0a297483486 100644 --- a/hotspot/src/share/vm/oops/oop.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.inline.hpp @@ -183,7 +183,7 @@ inline bool oopDesc::is_null(narrowOop obj) { return obj == 0; } // in inner GC loops so these are separated. inline bool check_obj_alignment(oop obj) { - return (intptr_t)obj % MinObjAlignmentInBytes == 0; + return cast_from_oop(obj) % MinObjAlignmentInBytes == 0; } inline narrowOop oopDesc::encode_heap_oop_not_null(oop v) { diff --git a/hotspot/src/share/vm/oops/oopsHierarchy.hpp b/hotspot/src/share/vm/oops/oopsHierarchy.hpp index ccf7a5f99e2..ef0d2ed2bba 100644 --- a/hotspot/src/share/vm/oops/oopsHierarchy.hpp +++ b/hotspot/src/share/vm/oops/oopsHierarchy.hpp @@ -55,11 +55,16 @@ typedef class typeArrayOopDesc* typeArrayOop; // to and from the underlying oopDesc pointer type. // // Because oop and its subclasses Oop are class types, arbitrary -// conversions are not accepted by the compiler, and you may get a message -// about overloading ambiguity (between long and int is common when converting -// from a constant in 64 bit mode), or unable to convert from type to 'oop'. -// Applying a cast to one of these conversion operators first will get to the -// underlying oopDesc* type if appropriate. +// conversions are not accepted by the compiler. Applying a cast to +// an oop will cause the best matched conversion operator to be +// invoked returning the underlying oopDesc* type if appropriate. +// No copy constructors, explicit user conversions or operators of +// numerical type should be defined within the oop class. Most C++ +// compilers will issue a compile time error concerning the overloading +// ambiguity between operators of numerical and pointer types. If +// a conversion to or from an oop to a numerical type is needed, +// use the inline template methods, cast_*_oop, defined below. +// // Converting NULL to oop to Handle implicit is no longer accepted by the // compiler because there are too many steps in the conversion. Use Handle() // instead, which generates less code anyway. @@ -83,12 +88,9 @@ public: void raw_set_obj(const void* p) { _o = (oopDesc*)p; } oop() { set_obj(NULL); } + oop(const oop& o) { set_obj(o.obj()); } oop(const volatile oop& o) { set_obj(o.obj()); } oop(const void* p) { set_obj(p); } - oop(intptr_t i) { set_obj((void *)i); } -#ifdef _LP64 - oop(int i) { set_obj((void *)i); } -#endif ~oop() { if (CheckUnhandledOops) unregister_oop(); } @@ -101,8 +103,6 @@ public: bool operator==(void *p) const { return obj() == p; } bool operator!=(const volatile oop o) const { return obj() != o.obj(); } bool operator!=(void *p) const { return obj() != p; } - bool operator==(intptr_t p) const { return obj() == (oopDesc*)p; } - bool operator!=(intptr_t p) const { return obj() != (oopDesc*)p; } bool operator<(oop o) const { return obj() < o.obj(); } bool operator>(oop o) const { return obj() > o.obj(); } @@ -110,8 +110,18 @@ public: bool operator>=(oop o) const { return obj() >= o.obj(); } bool operator!() const { return !obj(); } - // Cast + // Assignment + oop& operator=(const oop& o) { _o = o.obj(); return *this; } +#ifndef SOLARIS + volatile oop& operator=(const oop& o) volatile { _o = o.obj(); return *this; } +#endif + volatile oop& operator=(const volatile oop& o) volatile { _o = o.obj(); return *this; } + + // Explict user conversions operator void* () const { return (void *)obj(); } +#ifndef SOLARIS + operator void* () const volatile { return (void *)obj(); } +#endif operator HeapWord* () const { return (HeapWord*)obj(); } operator oopDesc* () const { return obj(); } operator intptr_t* () const { return (intptr_t*)obj(); } @@ -119,7 +129,6 @@ public: operator markOop () const { return markOop(obj()); } operator address () const { return (address)obj(); } - operator intptr_t () const volatile { return (intptr_t)obj(); } // from javaCalls.cpp operator jobject () const { return (jobject)obj(); } @@ -141,12 +150,26 @@ public: class type##Oop : public oop { \ public: \ type##Oop() : oop() {} \ + type##Oop(const oop& o) : oop(o) {} \ type##Oop(const volatile oop& o) : oop(o) {} \ type##Oop(const void* p) : oop(p) {} \ operator type##OopDesc* () const { return (type##OopDesc*)obj(); } \ type##OopDesc* operator->() const { \ return (type##OopDesc*)obj(); \ } \ + type##Oop& operator=(const type##Oop& o) { \ + oop::operator=(o); \ + return *this; \ + } \ + NOT_SOLARIS( \ + volatile type##Oop& operator=(const type##Oop& o) volatile { \ + (void)const_cast(oop::operator=(o)); \ + return *this; \ + }) \ + volatile type##Oop& operator=(const volatile type##Oop& o) volatile {\ + (void)const_cast(oop::operator=(o)); \ + return *this; \ + } \ }; DEF_OOP(instance); @@ -156,6 +179,16 @@ DEF_OOP(typeArray); #endif // CHECK_UNHANDLED_OOPS +// For CHECK_UNHANDLED_OOPS, it is ambiguous C++ behavior to have the oop +// structure contain explicit user defined conversions of both numerical +// and pointer type. Define inline methods to provide the numerical conversions. +template inline oop cast_to_oop(T value) { + return (oop)(CHECK_UNHANDLED_OOPS_ONLY((void *))(value)); +} +template inline T cast_from_oop(oop o) { + return (T)(CHECK_UNHANDLED_OOPS_ONLY((void*))o); +} + // The metadata hierarchy is separate from the oop hierarchy // class MetaspaceObj diff --git a/hotspot/src/share/vm/opto/bytecodeInfo.cpp b/hotspot/src/share/vm/opto/bytecodeInfo.cpp index 45ba8d758b0..885ed1de643 100644 --- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp +++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp @@ -123,7 +123,7 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method, // Allows targeted inlining if(callee_method->should_inline()) { *wci_result = *(WarmCallInfo::always_hot()); - if (PrintInlining && Verbose) { + if (C->print_inlining() && Verbose) { CompileTask::print_inline_indent(inline_level()); tty->print_cr("Inlined method is hot: "); } @@ -137,7 +137,7 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method, if(callee_method->interpreter_throwout_count() > InlineThrowCount && size < InlineThrowMaxSize ) { wci_result->set_profit(wci_result->profit() * 100); - if (PrintInlining && Verbose) { + if (C->print_inlining() && Verbose) { CompileTask::print_inline_indent(inline_level()); tty->print_cr("Inlined method with many throws (throws=%d):", callee_method->interpreter_throwout_count()); } @@ -197,6 +197,7 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method, // negative filter: should callee NOT be inlined? bool InlineTree::should_not_inline(ciMethod *callee_method, ciMethod* caller_method, + JVMState* jvms, WarmCallInfo* wci_result) { const char* fail_msg = NULL; @@ -226,7 +227,7 @@ bool InlineTree::should_not_inline(ciMethod *callee_method, // don't inline exception code unless the top method belongs to an // exception class if (callee_method->holder()->is_subclass_of(C->env()->Throwable_klass())) { - ciMethod* top_method = caller_jvms() ? caller_jvms()->of_depth(1)->method() : method(); + ciMethod* top_method = jvms->caller() != NULL ? jvms->caller()->of_depth(1)->method() : method(); if (!top_method->holder()->is_subclass_of(C->env()->Throwable_klass())) { wci_result->set_profit(wci_result->profit() * 0.1); } @@ -328,7 +329,7 @@ bool InlineTree::should_not_inline(ciMethod *callee_method, // return true if ok // Relocated from "InliningClosure::try_to_inline" bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method, - int caller_bci, ciCallProfile& profile, + int caller_bci, JVMState* jvms, ciCallProfile& profile, WarmCallInfo* wci_result, bool& should_delay) { // Old algorithm had funny accumulating BC-size counters @@ -346,7 +347,7 @@ bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method, wci_result)) { return false; } - if (should_not_inline(callee_method, caller_method, wci_result)) { + if (should_not_inline(callee_method, caller_method, jvms, wci_result)) { return false; } @@ -397,24 +398,35 @@ bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method, } // detect direct and indirect recursive inlining - if (!callee_method->is_compiled_lambda_form()) { + { // count the current method and the callee - int inline_level = (method() == callee_method) ? 1 : 0; - if (inline_level > MaxRecursiveInlineLevel) { - set_msg("recursively inlining too deep"); - return false; + const bool is_compiled_lambda_form = callee_method->is_compiled_lambda_form(); + int inline_level = 0; + if (!is_compiled_lambda_form) { + if (method() == callee_method) { + inline_level++; + } } // count callers of current method and callee - JVMState* jvms = caller_jvms(); - while (jvms != NULL && jvms->has_method()) { - if (jvms->method() == callee_method) { - inline_level++; - if (inline_level > MaxRecursiveInlineLevel) { - set_msg("recursively inlining too deep"); - return false; + Node* callee_argument0 = is_compiled_lambda_form ? jvms->map()->argument(jvms, 0)->uncast() : NULL; + for (JVMState* j = jvms->caller(); j != NULL && j->has_method(); j = j->caller()) { + if (j->method() == callee_method) { + if (is_compiled_lambda_form) { + // Since compiled lambda forms are heavily reused we allow recursive inlining. If it is truly + // a recursion (using the same "receiver") we limit inlining otherwise we can easily blow the + // compiler stack. + Node* caller_argument0 = j->map()->argument(j, 0)->uncast(); + if (caller_argument0 == callee_argument0) { + inline_level++; + } + } else { + inline_level++; } } - jvms = jvms->caller(); + } + if (inline_level > MaxRecursiveInlineLevel) { + set_msg("recursive inlining is too deep"); + return false; } } @@ -491,7 +503,7 @@ void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci, C->log()->inline_fail(inline_msg); } } - if (PrintInlining) { + if (C->print_inlining()) { C->print_inlining(callee_method, inline_level(), caller_bci, inline_msg); if (callee_method == NULL) tty->print(" callee not monotonic or profiled"); if (Verbose && callee_method) { @@ -536,11 +548,11 @@ WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, // Check if inlining policy says no. WarmCallInfo wci = *(initial_wci); bool success = try_to_inline(callee_method, caller_method, caller_bci, - profile, &wci, should_delay); + jvms, profile, &wci, should_delay); #ifndef PRODUCT if (UseOldInlining && InlineWarmCalls - && (PrintOpto || PrintOptoInlining || PrintInlining)) { + && (PrintOpto || C->print_inlining())) { bool cold = wci.is_cold(); bool hot = !cold && wci.is_hot(); bool old_cold = !success; @@ -617,7 +629,7 @@ InlineTree *InlineTree::build_inline_tree_for_callee( ciMethod* callee_method, J callee_method->is_compiled_lambda_form()) { max_inline_level_adjust += 1; // don't count method handle calls from java.lang.invoke implem } - if (max_inline_level_adjust != 0 && PrintInlining && (Verbose || WizardMode)) { + if (max_inline_level_adjust != 0 && C->print_inlining() && (Verbose || WizardMode)) { CompileTask::print_inline_indent(inline_level()); tty->print_cr(" \\-> discounting inline depth"); } diff --git a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp index cf9a82092fd..d1c4b2ca066 100644 --- a/hotspot/src/share/vm/opto/c2_globals.hpp +++ b/hotspot/src/share/vm/opto/c2_globals.hpp @@ -636,7 +636,15 @@ \ diagnostic(bool, OptimizeExpensiveOps, true, \ "Find best control for expensive operations") \ - + \ + product(bool, UseMathExactIntrinsics, true, \ + "Enables intrinsification of various java.lang.Math functions") \ + \ + experimental(bool, ReplaceInParentMaps, false, \ + "Propagate type improvements in callers of inlinee if possible") \ + \ + experimental(bool, UseTypeSpeculation, false, \ + "Speculatively propagate types from profiles") C2_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_EXPERIMENTAL_FLAG, DECLARE_NOTPRODUCT_FLAG) diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp index 85f30a5ac1e..91653bd3ce3 100644 --- a/hotspot/src/share/vm/opto/c2compiler.cpp +++ b/hotspot/src/share/vm/opto/c2compiler.cpp @@ -44,9 +44,6 @@ # include "adfiles/ad_ppc.hpp" #endif - -volatile int C2Compiler::_runtimes = uninitialized; - // register information defined by ADLC extern const char register_save_policy[]; extern const int register_save_type[]; @@ -57,7 +54,7 @@ const char* C2Compiler::retry_no_subsuming_loads() { const char* C2Compiler::retry_no_escape_analysis() { return "retry without escape analysis"; } -void C2Compiler::initialize_runtime() { +bool C2Compiler::init_c2_runtime() { // Check assumptions used while running ADLC Compile::adlc_verification(); @@ -90,41 +87,31 @@ void C2Compiler::initialize_runtime() { CompilerThread* thread = CompilerThread::current(); - HandleMark handle_mark(thread); - - OptoRuntime::generate(thread->env()); - + HandleMark handle_mark(thread); + return OptoRuntime::generate(thread->env()); } void C2Compiler::initialize() { - - // This method can only be called once per C2Compiler object // The first compiler thread that gets here will initialize the - // small amount of global state (and runtime stubs) that c2 needs. + // small amount of global state (and runtime stubs) that C2 needs. // There is a race possible once at startup and then we're fine // Note that this is being called from a compiler thread not the // main startup thread. - - if (_runtimes != initialized) { - initialize_runtimes( initialize_runtime, &_runtimes); + if (should_perform_init()) { + bool successful = C2Compiler::init_c2_runtime(); + int new_state = (successful) ? initialized : failed; + set_state(new_state); } - - // Mark this compiler object as ready to roll - mark_initialized(); } -void C2Compiler::compile_method(ciEnv* env, - ciMethod* target, - int entry_bci) { - if (!is_initialized()) { - initialize(); - } +void C2Compiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) { + assert(is_initialized(), "Compiler thread must be initialized"); + bool subsume_loads = SubsumeLoads; - bool do_escape_analysis = DoEscapeAnalysis && - !env->jvmti_can_access_local_variables(); + bool do_escape_analysis = DoEscapeAnalysis && !env->jvmti_can_access_local_variables(); bool eliminate_boxing = EliminateAutoBox; while (!env->failing()) { // Attempt to compile while subsuming loads into machine instructions. diff --git a/hotspot/src/share/vm/opto/c2compiler.hpp b/hotspot/src/share/vm/opto/c2compiler.hpp index c25f2ea926a..48ccc1b5105 100644 --- a/hotspot/src/share/vm/opto/c2compiler.hpp +++ b/hotspot/src/share/vm/opto/c2compiler.hpp @@ -28,24 +28,17 @@ #include "compiler/abstractCompiler.hpp" class C2Compiler : public AbstractCompiler { -private: - - static void initialize_runtime(); + private: + static bool init_c2_runtime(); public: // Name const char *name() { return "C2"; } - static volatile int _runtimes; - #ifdef TIERED virtual bool is_c2() { return true; }; #endif // TIERED - // Customization - bool needs_adapters () { return true; } - bool needs_stubs () { return true; } - void initialize(); // Compilation entry point for methods diff --git a/hotspot/src/share/vm/opto/callGenerator.cpp b/hotspot/src/share/vm/opto/callGenerator.cpp index 470a36e5c9f..33a13c83190 100644 --- a/hotspot/src/share/vm/opto/callGenerator.cpp +++ b/hotspot/src/share/vm/opto/callGenerator.cpp @@ -63,12 +63,12 @@ public: } virtual bool is_parse() const { return true; } - virtual JVMState* generate(JVMState* jvms); + virtual JVMState* generate(JVMState* jvms, Parse* parent_parser); int is_osr() { return _is_osr; } }; -JVMState* ParseGenerator::generate(JVMState* jvms) { +JVMState* ParseGenerator::generate(JVMState* jvms, Parse* parent_parser) { Compile* C = Compile::current(); if (is_osr()) { @@ -80,7 +80,7 @@ JVMState* ParseGenerator::generate(JVMState* jvms) { return NULL; // bailing out of the compile; do not try to parse } - Parse parser(jvms, method(), _expected_uses); + Parse parser(jvms, method(), _expected_uses, parent_parser); // Grab signature for matching/allocation #ifdef ASSERT if (parser.tf() != (parser.depth() == 1 ? C->tf() : tf())) { @@ -119,12 +119,12 @@ class DirectCallGenerator : public CallGenerator { _separate_io_proj(separate_io_proj) { } - virtual JVMState* generate(JVMState* jvms); + virtual JVMState* generate(JVMState* jvms, Parse* parent_parser); CallStaticJavaNode* call_node() const { return _call_node; } }; -JVMState* DirectCallGenerator::generate(JVMState* jvms) { +JVMState* DirectCallGenerator::generate(JVMState* jvms, Parse* parent_parser) { GraphKit kit(jvms); bool is_static = method()->is_static(); address target = is_static ? SharedRuntime::get_resolve_static_call_stub() @@ -171,10 +171,10 @@ public: vtable_index >= 0, "either invalid or usable"); } virtual bool is_virtual() const { return true; } - virtual JVMState* generate(JVMState* jvms); + virtual JVMState* generate(JVMState* jvms, Parse* parent_parser); }; -JVMState* VirtualCallGenerator::generate(JVMState* jvms) { +JVMState* VirtualCallGenerator::generate(JVMState* jvms, Parse* parent_parser) { GraphKit kit(jvms); Node* receiver = kit.argument(0); @@ -276,7 +276,7 @@ class LateInlineCallGenerator : public DirectCallGenerator { // Convert the CallStaticJava into an inline virtual void do_late_inline(); - virtual JVMState* generate(JVMState* jvms) { + virtual JVMState* generate(JVMState* jvms, Parse* parent_parser) { Compile *C = Compile::current(); C->print_inlining_skip(this); @@ -290,7 +290,7 @@ class LateInlineCallGenerator : public DirectCallGenerator { // that the late inlining logic can distinguish between fall // through and exceptional uses of the memory and io projections // as is done for allocations and macro expansion. - return DirectCallGenerator::generate(jvms); + return DirectCallGenerator::generate(jvms, parent_parser); } virtual void print_inlining_late(const char* msg) { @@ -389,7 +389,7 @@ void LateInlineCallGenerator::do_late_inline() { } // Now perform the inling using the synthesized JVMState - JVMState* new_jvms = _inline_cg->generate(jvms); + JVMState* new_jvms = _inline_cg->generate(jvms, NULL); if (new_jvms == NULL) return; // no change if (C->failing()) return; @@ -429,8 +429,8 @@ class LateInlineMHCallGenerator : public LateInlineCallGenerator { virtual bool is_mh_late_inline() const { return true; } - virtual JVMState* generate(JVMState* jvms) { - JVMState* new_jvms = LateInlineCallGenerator::generate(jvms); + virtual JVMState* generate(JVMState* jvms, Parse* parent_parser) { + JVMState* new_jvms = LateInlineCallGenerator::generate(jvms, parent_parser); if (_input_not_const) { // inlining won't be possible so no need to enqueue right now. call_node()->set_generator(this); @@ -477,15 +477,17 @@ class LateInlineStringCallGenerator : public LateInlineCallGenerator { LateInlineStringCallGenerator(ciMethod* method, CallGenerator* inline_cg) : LateInlineCallGenerator(method, inline_cg) {} - virtual JVMState* generate(JVMState* jvms) { + virtual JVMState* generate(JVMState* jvms, Parse* parent_parser) { Compile *C = Compile::current(); C->print_inlining_skip(this); C->add_string_late_inline(this); - JVMState* new_jvms = DirectCallGenerator::generate(jvms); + JVMState* new_jvms = DirectCallGenerator::generate(jvms, parent_parser); return new_jvms; } + + virtual bool is_string_late_inline() const { return true; } }; CallGenerator* CallGenerator::for_string_late_inline(ciMethod* method, CallGenerator* inline_cg) { @@ -498,13 +500,13 @@ class LateInlineBoxingCallGenerator : public LateInlineCallGenerator { LateInlineBoxingCallGenerator(ciMethod* method, CallGenerator* inline_cg) : LateInlineCallGenerator(method, inline_cg) {} - virtual JVMState* generate(JVMState* jvms) { + virtual JVMState* generate(JVMState* jvms, Parse* parent_parser) { Compile *C = Compile::current(); C->print_inlining_skip(this); C->add_boxing_late_inline(this); - JVMState* new_jvms = DirectCallGenerator::generate(jvms); + JVMState* new_jvms = DirectCallGenerator::generate(jvms, parent_parser); return new_jvms; } }; @@ -540,7 +542,7 @@ public: virtual bool is_virtual() const { return _is_virtual; } virtual bool is_deferred() const { return true; } - virtual JVMState* generate(JVMState* jvms); + virtual JVMState* generate(JVMState* jvms, Parse* parent_parser); }; @@ -550,12 +552,12 @@ CallGenerator* CallGenerator::for_warm_call(WarmCallInfo* ci, return new WarmCallGenerator(ci, if_cold, if_hot); } -JVMState* WarmCallGenerator::generate(JVMState* jvms) { +JVMState* WarmCallGenerator::generate(JVMState* jvms, Parse* parent_parser) { Compile* C = Compile::current(); if (C->log() != NULL) { C->log()->elem("warm_call bci='%d'", jvms->bci()); } - jvms = _if_cold->generate(jvms); + jvms = _if_cold->generate(jvms, parent_parser); if (jvms != NULL) { Node* m = jvms->map()->control(); if (m->is_CatchProj()) m = m->in(0); else m = C->top(); @@ -616,7 +618,7 @@ public: virtual bool is_inline() const { return _if_hit->is_inline(); } virtual bool is_deferred() const { return _if_hit->is_deferred(); } - virtual JVMState* generate(JVMState* jvms); + virtual JVMState* generate(JVMState* jvms, Parse* parent_parser); }; @@ -628,7 +630,7 @@ CallGenerator* CallGenerator::for_predicted_call(ciKlass* predicted_receiver, } -JVMState* PredictedCallGenerator::generate(JVMState* jvms) { +JVMState* PredictedCallGenerator::generate(JVMState* jvms, Parse* parent_parser) { GraphKit kit(jvms); PhaseGVN& gvn = kit.gvn(); // We need an explicit receiver null_check before checking its type. @@ -656,7 +658,7 @@ JVMState* PredictedCallGenerator::generate(JVMState* jvms) { { PreserveJVMState pjvms(&kit); kit.set_control(slow_ctl); if (!kit.stopped()) { - slow_jvms = _if_missed->generate(kit.sync_jvms()); + slow_jvms = _if_missed->generate(kit.sync_jvms(), parent_parser); if (kit.failing()) return NULL; // might happen because of NodeCountInliningCutoff assert(slow_jvms != NULL, "must be"); @@ -677,12 +679,12 @@ JVMState* PredictedCallGenerator::generate(JVMState* jvms) { kit.replace_in_map(receiver, exact_receiver); // Make the hot call: - JVMState* new_jvms = _if_hit->generate(kit.sync_jvms()); + JVMState* new_jvms = _if_hit->generate(kit.sync_jvms(), parent_parser); if (new_jvms == NULL) { // Inline failed, so make a direct call. assert(_if_hit->is_inline(), "must have been a failed inline"); CallGenerator* cg = CallGenerator::for_direct_call(_if_hit->method()); - new_jvms = cg->generate(kit.sync_jvms()); + new_jvms = cg->generate(kit.sync_jvms(), parent_parser); } kit.add_exception_states_from(new_jvms); kit.set_jvms(new_jvms); @@ -773,7 +775,7 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod* ciMethod* target = oop_ptr->const_oop()->as_method_handle()->get_vmtarget(); guarantee(!target->is_method_handle_intrinsic(), "should not happen"); // XXX remove const int vtable_index = Method::invalid_vtable_index; - CallGenerator* cg = C->call_generator(target, vtable_index, false, jvms, true, PROB_ALWAYS, true, true); + CallGenerator* cg = C->call_generator(target, vtable_index, false, jvms, true, PROB_ALWAYS, NULL, true, true); assert(!cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here"); if (cg != NULL && cg->is_inline()) return cg; @@ -829,6 +831,7 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod* int vtable_index = Method::invalid_vtable_index; bool call_does_dispatch = false; + ciKlass* speculative_receiver_type = NULL; if (is_virtual_or_interface) { ciInstanceKlass* klass = target->holder(); Node* receiver_node = kit.argument(0); @@ -837,9 +840,12 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod* target = C->optimize_virtual_call(caller, jvms->bci(), klass, target, receiver_type, is_virtual, call_does_dispatch, vtable_index); // out-parameters + // We lack profiling at this call but type speculation may + // provide us with a type + speculative_receiver_type = receiver_type->speculative_type(); } - CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms, true, PROB_ALWAYS, true, true); + CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms, true, PROB_ALWAYS, speculative_receiver_type, true, true); assert(!cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here"); if (cg != NULL && cg->is_inline()) return cg; @@ -874,7 +880,7 @@ public: virtual bool is_inlined() const { return true; } virtual bool is_intrinsic() const { return true; } - virtual JVMState* generate(JVMState* jvms); + virtual JVMState* generate(JVMState* jvms, Parse* parent_parser); }; @@ -884,7 +890,7 @@ CallGenerator* CallGenerator::for_predicted_intrinsic(CallGenerator* intrinsic, } -JVMState* PredictedIntrinsicGenerator::generate(JVMState* jvms) { +JVMState* PredictedIntrinsicGenerator::generate(JVMState* jvms, Parse* parent_parser) { GraphKit kit(jvms); PhaseGVN& gvn = kit.gvn(); @@ -904,7 +910,7 @@ JVMState* PredictedIntrinsicGenerator::generate(JVMState* jvms) { PreserveJVMState pjvms(&kit); kit.set_control(slow_ctl); if (!kit.stopped()) { - slow_jvms = _cg->generate(kit.sync_jvms()); + slow_jvms = _cg->generate(kit.sync_jvms(), parent_parser); if (kit.failing()) return NULL; // might happen because of NodeCountInliningCutoff assert(slow_jvms != NULL, "must be"); @@ -922,12 +928,12 @@ JVMState* PredictedIntrinsicGenerator::generate(JVMState* jvms) { } // Generate intrinsic code: - JVMState* new_jvms = _intrinsic->generate(kit.sync_jvms()); + JVMState* new_jvms = _intrinsic->generate(kit.sync_jvms(), parent_parser); if (new_jvms == NULL) { // Intrinsic failed, so use slow code or make a direct call. if (slow_map == NULL) { CallGenerator* cg = CallGenerator::for_direct_call(method()); - new_jvms = cg->generate(kit.sync_jvms()); + new_jvms = cg->generate(kit.sync_jvms(), parent_parser); } else { kit.set_jvms(slow_jvms); return kit.transfer_exceptions_into_jvms(); @@ -997,7 +1003,7 @@ public: virtual bool is_virtual() const { ShouldNotReachHere(); return false; } virtual bool is_trap() const { return true; } - virtual JVMState* generate(JVMState* jvms); + virtual JVMState* generate(JVMState* jvms, Parse* parent_parser); }; @@ -1009,7 +1015,7 @@ CallGenerator::for_uncommon_trap(ciMethod* m, } -JVMState* UncommonTrapCallGenerator::generate(JVMState* jvms) { +JVMState* UncommonTrapCallGenerator::generate(JVMState* jvms, Parse* parent_parser) { GraphKit kit(jvms); // Take the trap with arguments pushed on the stack. (Cf. null_check_receiver). int nargs = method()->arg_size(); diff --git a/hotspot/src/share/vm/opto/callGenerator.hpp b/hotspot/src/share/vm/opto/callGenerator.hpp index 0f6b2d16590..d03555fefdb 100644 --- a/hotspot/src/share/vm/opto/callGenerator.hpp +++ b/hotspot/src/share/vm/opto/callGenerator.hpp @@ -31,6 +31,8 @@ #include "opto/type.hpp" #include "runtime/deoptimization.hpp" +class Parse; + //---------------------------CallGenerator------------------------------------- // The subclasses of this class handle generation of ideal nodes for // call sites and method entry points. @@ -65,11 +67,14 @@ class CallGenerator : public ResourceObj { virtual bool is_predicted() const { return false; } // is_trap: Does not return to the caller. (E.g., uncommon trap.) virtual bool is_trap() const { return false; } + // does_virtual_dispatch: Should try inlining as normal method first. + virtual bool does_virtual_dispatch() const { return false; } // is_late_inline: supports conversion of call into an inline virtual bool is_late_inline() const { return false; } // same but for method handle calls virtual bool is_mh_late_inline() const { return false; } + virtual bool is_string_late_inline() const{ return false; } // for method handle calls: have we tried inlinining the call already? virtual bool already_attempted() const { ShouldNotReachHere(); return false; } @@ -106,7 +111,7 @@ class CallGenerator : public ResourceObj { // // If the result is NULL, it means that this CallGenerator was unable // to handle the given call, and another CallGenerator should be consulted. - virtual JVMState* generate(JVMState* jvms) = 0; + virtual JVMState* generate(JVMState* jvms, Parse* parent_parser) = 0; // How to generate a call site that is inlined: static CallGenerator* for_inline(ciMethod* m, float expected_uses = -1); @@ -159,8 +164,9 @@ class CallGenerator : public ResourceObj { virtual void print_inlining_late(const char* msg) { ShouldNotReachHere(); } static void print_inlining(Compile* C, ciMethod* callee, int inline_level, int bci, const char* msg) { - if (PrintInlining) + if (C->print_inlining()) { C->print_inlining(callee, inline_level, bci, msg); + } } }; diff --git a/hotspot/src/share/vm/opto/chaitin.hpp b/hotspot/src/share/vm/opto/chaitin.hpp index 41276efa5ca..da98d16e29c 100644 --- a/hotspot/src/share/vm/opto/chaitin.hpp +++ b/hotspot/src/share/vm/opto/chaitin.hpp @@ -52,6 +52,7 @@ class PhaseChaitin; class LRG : public ResourceObj { friend class VMStructs; public: + static const uint AllStack_size = 0xFFFFF; // This mask size is used to tell that the mask of this LRG supports stack positions enum { SPILL_REG=29999 }; // Register number of a spilled LRG double _cost; // 2 for loads/1 for stores times block freq @@ -80,14 +81,21 @@ public: private: uint _eff_degree; // Effective degree: Sum of neighbors _num_regs public: - int degree() const { assert( _degree_valid, "" ); return _eff_degree; } + int degree() const { assert( _degree_valid , "" ); return _eff_degree; } // Degree starts not valid and any change to the IFG neighbor // set makes it not valid. - void set_degree( uint degree ) { _eff_degree = degree; debug_only(_degree_valid = 1;) } + void set_degree( uint degree ) { + _eff_degree = degree; + debug_only(_degree_valid = 1;) + assert(!_mask.is_AllStack() || (_mask.is_AllStack() && lo_degree()), "_eff_degree can't be bigger than AllStack_size - _num_regs if the mask supports stack registers"); + } // Made a change that hammered degree void invalid_degree() { debug_only(_degree_valid=0;) } // Incrementally modify degree. If it was correct, it should remain correct - void inc_degree( uint mod ) { _eff_degree += mod; } + void inc_degree( uint mod ) { + _eff_degree += mod; + assert(!_mask.is_AllStack() || (_mask.is_AllStack() && lo_degree()), "_eff_degree can't be bigger than AllStack_size - _num_regs if the mask supports stack registers"); + } // Compute the degree between 2 live ranges int compute_degree( LRG &l ) const; @@ -95,9 +103,9 @@ private: RegMask _mask; // Allowed registers for this LRG uint _mask_size; // cache of _mask.Size(); public: - int compute_mask_size() const { return _mask.is_AllStack() ? 65535 : _mask.Size(); } + int compute_mask_size() const { return _mask.is_AllStack() ? AllStack_size : _mask.Size(); } void set_mask_size( int size ) { - assert((size == 65535) || (size == (int)_mask.Size()), ""); + assert((size == (int)AllStack_size) || (size == (int)_mask.Size()), ""); _mask_size = size; #ifdef ASSERT _msize_valid=1; diff --git a/hotspot/src/share/vm/opto/classes.cpp b/hotspot/src/share/vm/opto/classes.cpp index 0dbe9a7e9a7..78529511f31 100644 --- a/hotspot/src/share/vm/opto/classes.cpp +++ b/hotspot/src/share/vm/opto/classes.cpp @@ -32,6 +32,7 @@ #include "opto/loopnode.hpp" #include "opto/machnode.hpp" #include "opto/memnode.hpp" +#include "opto/mathexactnode.hpp" #include "opto/mulnode.hpp" #include "opto/multnode.hpp" #include "opto/node.hpp" diff --git a/hotspot/src/share/vm/opto/classes.hpp b/hotspot/src/share/vm/opto/classes.hpp index f97b385f422..002d2db636d 100644 --- a/hotspot/src/share/vm/opto/classes.hpp +++ b/hotspot/src/share/vm/opto/classes.hpp @@ -29,6 +29,8 @@ macro(AbsD) macro(AbsF) macro(AbsI) macro(AddD) +macro(AddExactI) +macro(AddExactL) macro(AddF) macro(AddI) macro(AddL) @@ -133,6 +135,7 @@ macro(EncodePKlass) macro(ExpD) macro(FastLock) macro(FastUnlock) +macro(FlagsProj) macro(Goto) macro(Halt) macro(If) @@ -167,6 +170,9 @@ macro(Loop) macro(LoopLimit) macro(Mach) macro(MachProj) +macro(MathExact) +macro(MathExactI) +macro(MathExactL) macro(MaxI) macro(MemBarAcquire) macro(MemBarAcquireLock) @@ -186,12 +192,16 @@ macro(MoveF2I) macro(MoveL2D) macro(MoveD2L) macro(MulD) +macro(MulExactI) +macro(MulExactL) macro(MulF) macro(MulHiL) macro(MulI) macro(MulL) macro(Multi) macro(NegD) +macro(NegExactI) +macro(NegExactL) macro(NegF) macro(NeverBranch) macro(Opaque1) @@ -241,6 +251,8 @@ macro(StrComp) macro(StrEquals) macro(StrIndexOf) macro(SubD) +macro(SubExactI) +macro(SubExactL) macro(SubF) macro(SubI) macro(SubL) diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index 1c625d679b3..99d3cec271b 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -47,6 +47,7 @@ #include "opto/machnode.hpp" #include "opto/macro.hpp" #include "opto/matcher.hpp" +#include "opto/mathexactnode.hpp" #include "opto/memnode.hpp" #include "opto/mulnode.hpp" #include "opto/node.hpp" @@ -654,7 +655,8 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr _inlining_progress(false), _inlining_incrementally(false), _print_inlining_list(NULL), - _print_inlining(0) { + _print_inlining_idx(0), + _preserve_jvm_state(0) { C = this; CompileWrapper cw(this); @@ -679,6 +681,8 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr set_print_assembly(print_opto_assembly); set_parsed_irreducible_loop(false); #endif + set_print_inlining(PrintInlining || method()->has_option("PrintInlining") NOT_PRODUCT( || PrintOptoInlining)); + set_print_intrinsics(PrintIntrinsics || method()->has_option("PrintIntrinsics")); if (ProfileTraps) { // Make sure the method being compiled gets its own MDO, @@ -710,7 +714,7 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr PhaseGVN gvn(node_arena(), estimated_size); set_initial_gvn(&gvn); - if (PrintInlining || PrintIntrinsics NOT_PRODUCT( || PrintOptoInlining)) { + if (print_inlining() || print_intrinsics()) { _print_inlining_list = new (comp_arena())GrowableArray(comp_arena(), 1, 1, PrintInliningBuffer()); } { // Scope for timing the parser @@ -760,7 +764,7 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr return; } JVMState* jvms = build_start_state(start(), tf()); - if ((jvms = cg->generate(jvms)) == NULL) { + if ((jvms = cg->generate(jvms, NULL)) == NULL) { record_method_not_compilable("method parse failed"); return; } @@ -844,6 +848,7 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr } #endif + NOT_PRODUCT( verify_barriers(); ) // Now that we know the size of all the monitors we can add a fixed slot // for the original deopt pc. @@ -937,7 +942,8 @@ Compile::Compile( ciEnv* ci_env, _inlining_progress(false), _inlining_incrementally(false), _print_inlining_list(NULL), - _print_inlining(0) { + _print_inlining_idx(0), + _preserve_jvm_state(0) { C = this; #ifndef PRODUCT @@ -1355,7 +1361,7 @@ const TypePtr *Compile::flatten_alias_type( const TypePtr *tj ) const { // During the 2nd round of IterGVN, NotNull castings are removed. // Make sure the Bottom and NotNull variants alias the same. // Also, make sure exact and non-exact variants alias the same. - if( ptr == TypePtr::NotNull || ta->klass_is_exact() ) { + if (ptr == TypePtr::NotNull || ta->klass_is_exact() || ta->speculative() != NULL) { tj = ta = TypeAryPtr::make(TypePtr::BotPTR,ta->ary(),ta->klass(),false,offset); } } @@ -1380,6 +1386,9 @@ const TypePtr *Compile::flatten_alias_type( const TypePtr *tj ) const { // Also, make sure exact and non-exact variants alias the same. tj = to = TypeInstPtr::make(TypePtr::BotPTR,to->klass(),false,0,offset); } + if (to->speculative() != NULL) { + tj = to = TypeInstPtr::make(to->ptr(),to->klass(),to->klass_is_exact(),to->const_oop(),to->offset(), to->instance_id()); + } // Canonicalize the holder of this field if (offset >= 0 && offset < instanceOopDesc::base_offset_in_bytes()) { // First handle header references such as a LoadKlassNode, even if the @@ -2008,6 +2017,12 @@ void Compile::Optimize() { if (failing()) return; } + // Remove the speculative part of types and clean up the graph from + // the extra CastPP nodes whose only purpose is to carry them. Do + // that early so that optimizations are not disrupted by the extra + // CastPP nodes. + remove_speculative_types(igvn); + // No more new expensive nodes will be added to the list from here // so keep only the actual candidates for optimizations. cleanup_expensive_nodes(igvn); @@ -2984,6 +2999,42 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) { n->set_req(MemBarNode::Precedent, top()); } break; + // Must set a control edge on all nodes that produce a FlagsProj + // so they can't escape the block that consumes the flags. + // Must also set the non throwing branch as the control + // for all nodes that depends on the result. Unless the node + // already have a control that isn't the control of the + // flag producer + case Op_FlagsProj: + { + MathExactNode* math = (MathExactNode*) n->in(0); + Node* ctrl = math->control_node(); + Node* non_throwing = math->non_throwing_branch(); + math->set_req(0, ctrl); + + Node* result = math->result_node(); + if (result != NULL) { + for (DUIterator_Fast jmax, j = result->fast_outs(jmax); j < jmax; j++) { + Node* out = result->fast_out(j); + // Phi nodes shouldn't be moved. They would only match below if they + // had the same control as the MathExactNode. The only time that + // would happen is if the Phi is also an input to the MathExact + // + // Cmp nodes shouldn't have control set at all. + if (out->is_Phi() || + out->is_Cmp()) { + continue; + } + + if (out->in(0) == NULL) { + out->set_req(0, non_throwing); + } else if (out->in(0) == ctrl) { + out->set_req(0, non_throwing); + } + } + } + } + break; default: assert( !n->is_Call(), "" ); assert( !n->is_Mem(), "" ); @@ -3323,6 +3374,72 @@ void Compile::verify_graph_edges(bool no_dead_code) { } } } + +// Verify GC barriers consistency +// Currently supported: +// - G1 pre-barriers (see GraphKit::g1_write_barrier_pre()) +void Compile::verify_barriers() { + if (UseG1GC) { + // Verify G1 pre-barriers + const int marking_offset = in_bytes(JavaThread::satb_mark_queue_offset() + PtrQueue::byte_offset_of_active()); + + ResourceArea *area = Thread::current()->resource_area(); + Unique_Node_List visited(area); + Node_List worklist(area); + // We're going to walk control flow backwards starting from the Root + worklist.push(_root); + while (worklist.size() > 0) { + Node* x = worklist.pop(); + if (x == NULL || x == top()) continue; + if (visited.member(x)) { + continue; + } else { + visited.push(x); + } + + if (x->is_Region()) { + for (uint i = 1; i < x->req(); i++) { + worklist.push(x->in(i)); + } + } else { + worklist.push(x->in(0)); + // We are looking for the pattern: + // /->ThreadLocal + // If->Bool->CmpI->LoadB->AddP->ConL(marking_offset) + // \->ConI(0) + // We want to verify that the If and the LoadB have the same control + // See GraphKit::g1_write_barrier_pre() + if (x->is_If()) { + IfNode *iff = x->as_If(); + if (iff->in(1)->is_Bool() && iff->in(1)->in(1)->is_Cmp()) { + CmpNode *cmp = iff->in(1)->in(1)->as_Cmp(); + if (cmp->Opcode() == Op_CmpI && cmp->in(2)->is_Con() && cmp->in(2)->bottom_type()->is_int()->get_con() == 0 + && cmp->in(1)->is_Load()) { + LoadNode* load = cmp->in(1)->as_Load(); + if (load->Opcode() == Op_LoadB && load->in(2)->is_AddP() && load->in(2)->in(2)->Opcode() == Op_ThreadLocal + && load->in(2)->in(3)->is_Con() + && load->in(2)->in(3)->bottom_type()->is_intptr_t()->get_con() == marking_offset) { + + Node* if_ctrl = iff->in(0); + Node* load_ctrl = load->in(0); + + if (if_ctrl != load_ctrl) { + // Skip possible CProj->NeverBranch in infinite loops + if ((if_ctrl->is_Proj() && if_ctrl->Opcode() == Op_CProj) + && (if_ctrl->in(0)->is_MultiBranch() && if_ctrl->in(0)->Opcode() == Op_NeverBranch)) { + if_ctrl = if_ctrl->in(0)->in(0); + } + } + assert(load_ctrl != NULL && if_ctrl == load_ctrl, "controls must match"); + } + } + } + } + } + } + } +} + #endif // The Compile object keeps track of failure reasons separately from the ciEnv. @@ -3611,7 +3728,7 @@ void Compile::ConstantTable::fill_jump_table(CodeBuffer& cb, MachConstantNode* n } void Compile::dump_inlining() { - if (PrintInlining || PrintIntrinsics NOT_PRODUCT( || PrintOptoInlining)) { + if (print_inlining() || print_intrinsics()) { // Print inlining message for candidates that we couldn't inline // for lack of space or non constant receiver for (int i = 0; i < _late_inlines.length(); i++) { @@ -3635,7 +3752,7 @@ void Compile::dump_inlining() { } } for (int i = 0; i < _print_inlining_list->length(); i++) { - tty->print(_print_inlining_list->at(i).ss()->as_string()); + tty->print(_print_inlining_list->adr_at(i)->ss()->as_string()); } } } @@ -3763,6 +3880,45 @@ void Compile::add_expensive_node(Node * n) { } } +/** + * Remove the speculative part of types and clean up the graph + */ +void Compile::remove_speculative_types(PhaseIterGVN &igvn) { + if (UseTypeSpeculation) { + Unique_Node_List worklist; + worklist.push(root()); + int modified = 0; + // Go over all type nodes that carry a speculative type, drop the + // speculative part of the type and enqueue the node for an igvn + // which may optimize it out. + for (uint next = 0; next < worklist.size(); ++next) { + Node *n = worklist.at(next); + if (n->is_Type() && n->as_Type()->type()->isa_oopptr() != NULL && + n->as_Type()->type()->is_oopptr()->speculative() != NULL) { + TypeNode* tn = n->as_Type(); + const TypeOopPtr* t = tn->type()->is_oopptr(); + bool in_hash = igvn.hash_delete(n); + assert(in_hash, "node should be in igvn hash table"); + tn->set_type(t->remove_speculative()); + igvn.hash_insert(n); + igvn._worklist.push(n); // give it a chance to go away + modified++; + } + uint max = n->len(); + for( uint i = 0; i < max; ++i ) { + Node *m = n->in(i); + if (not_a_node(m)) continue; + worklist.push(m); + } + } + // Drop the speculative part of all types in the igvn's type table + igvn.remove_speculative_types(); + if (modified > 0) { + igvn.optimize(); + } + } +} + // Auxiliary method to support randomized stressing/fuzzing. // // This method can be called the arbitrary number of times, with current count diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp index 8d862c24125..5ad53e5d163 100644 --- a/hotspot/src/share/vm/opto/compile.hpp +++ b/hotspot/src/share/vm/opto/compile.hpp @@ -312,6 +312,8 @@ class Compile : public Phase { bool _do_method_data_update; // True if we generate code to update MethodData*s int _AliasLevel; // Locally-adjusted version of AliasLevel flag. bool _print_assembly; // True if we should dump assembly code for this compilation + bool _print_inlining; // True if we should print inlining for this compilation + bool _print_intrinsics; // True if we should print intrinsics for this compilation #ifndef PRODUCT bool _trace_opto_output; bool _parsed_irreducible_loop; // True if ciTypeFlow detected irreducible loops during parsing @@ -414,7 +416,7 @@ class Compile : public Phase { }; GrowableArray* _print_inlining_list; - int _print_inlining; + int _print_inlining_idx; // Only keep nodes in the expensive node list that need to be optimized void cleanup_expensive_nodes(PhaseIterGVN &igvn); @@ -422,28 +424,33 @@ class Compile : public Phase { static int cmp_expensive_nodes(Node** n1, Node** n2); // Expensive nodes list already sorted? bool expensive_nodes_sorted() const; + // Remove the speculative part of types and clean up the graph + void remove_speculative_types(PhaseIterGVN &igvn); + + // Are we within a PreserveJVMState block? + int _preserve_jvm_state; public: outputStream* print_inlining_stream() const { - return _print_inlining_list->at(_print_inlining).ss(); + return _print_inlining_list->adr_at(_print_inlining_idx)->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()); + if (_print_inlining) { + _print_inlining_list->adr_at(_print_inlining_idx)->set_cg(cg); + _print_inlining_idx++; + _print_inlining_list->insert_before(_print_inlining_idx, PrintInliningBuffer()); } } void print_inlining_insert(CallGenerator* cg) { - if (PrintInlining) { + if (_print_inlining) { for (int i = 0; i < _print_inlining_list->length(); i++) { - if (_print_inlining_list->at(i).cg() == cg) { + if (_print_inlining_list->adr_at(i)->cg() == cg) { _print_inlining_list->insert_before(i+1, PrintInliningBuffer()); - _print_inlining = i+1; - _print_inlining_list->at(i).set_cg(NULL); + _print_inlining_idx = i+1; + _print_inlining_list->adr_at(i)->set_cg(NULL); return; } } @@ -572,6 +579,10 @@ class Compile : public Phase { int AliasLevel() const { return _AliasLevel; } bool print_assembly() const { return _print_assembly; } void set_print_assembly(bool z) { _print_assembly = z; } + bool print_inlining() const { return _print_inlining; } + void set_print_inlining(bool z) { _print_inlining = z; } + bool print_intrinsics() const { return _print_intrinsics; } + void set_print_intrinsics(bool z) { _print_intrinsics = z; } // check the CompilerOracle for special behaviours for this compile bool method_has_option(const char * option) { return method() != NULL && method()->has_option(option); @@ -814,7 +825,9 @@ class Compile : public Phase { // Decide how to build a call. // The profile factor is a discount to apply to this site's interp. profile. - CallGenerator* call_generator(ciMethod* call_method, int vtable_index, bool call_does_dispatch, JVMState* jvms, bool allow_inline, float profile_factor, bool allow_intrinsics = true, bool delayed_forbidden = false); + CallGenerator* call_generator(ciMethod* call_method, int vtable_index, bool call_does_dispatch, + JVMState* jvms, bool allow_inline, float profile_factor, ciKlass* speculative_receiver_type = NULL, + bool allow_intrinsics = true, bool delayed_forbidden = false); bool should_delay_inlining(ciMethod* call_method, JVMState* jvms) { return should_delay_string_inlining(call_method, jvms) || should_delay_boxing_inlining(call_method, jvms); @@ -1135,6 +1148,9 @@ class Compile : public Phase { // graph is strongly connected from root in both directions. void verify_graph_edges(bool no_dead_code = false) PRODUCT_RETURN; + // Verify GC barrier patterns + void verify_barriers() PRODUCT_RETURN; + // End-of-run dumps. static void print_statistics() PRODUCT_RETURN; @@ -1150,6 +1166,21 @@ class Compile : public Phase { // Auxiliary method for randomized fuzzing/stressing static bool randomized_select(int count); + + // enter a PreserveJVMState block + void inc_preserve_jvm_state() { + _preserve_jvm_state++; + } + + // exit a PreserveJVMState block + void dec_preserve_jvm_state() { + _preserve_jvm_state--; + assert(_preserve_jvm_state >= 0, "_preserve_jvm_state shouldn't be negative"); + } + + bool has_preserve_jvm_state() const { + return _preserve_jvm_state > 0; + } }; #endif // SHARE_VM_OPTO_COMPILE_HPP diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp index e55a01ba638..6768968bebd 100644 --- a/hotspot/src/share/vm/opto/doCall.cpp +++ b/hotspot/src/share/vm/opto/doCall.cpp @@ -41,9 +41,9 @@ #include "runtime/sharedRuntime.hpp" 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)) { + if (TraceTypeProfile || C->print_inlining()) { outputStream* out = tty; - if (!PrintInlining) { + if (!C->print_inlining()) { if (NOT_PRODUCT(!PrintOpto &&) !PrintCompilation) { method->print_short_name(); tty->cr(); @@ -63,7 +63,8 @@ void trace_type_profile(Compile* C, ciMethod *method, int depth, int bci, ciMeth CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool call_does_dispatch, JVMState* jvms, bool allow_inline, - float prof_factor, bool allow_intrinsics, bool delayed_forbidden) { + float prof_factor, ciKlass* speculative_receiver_type, + bool allow_intrinsics, bool delayed_forbidden) { ciMethod* caller = jvms->method(); int bci = jvms->bci(); Bytecodes::Code bytecode = caller->java_code_at_bci(bci); @@ -110,18 +111,28 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool // then we return it as the inlined version of the call. // We do this before the strict f.p. check below because the // intrinsics handle strict f.p. correctly. + CallGenerator* cg_intrinsic = NULL; if (allow_inline && allow_intrinsics) { CallGenerator* cg = find_intrinsic(callee, call_does_dispatch); if (cg != NULL) { if (cg->is_predicted()) { // Code without intrinsic but, hopefully, inlined. CallGenerator* inline_cg = this->call_generator(callee, - vtable_index, call_does_dispatch, jvms, allow_inline, prof_factor, false); + vtable_index, call_does_dispatch, jvms, allow_inline, prof_factor, speculative_receiver_type, false); if (inline_cg != NULL) { cg = CallGenerator::for_predicted_intrinsic(cg, inline_cg); } } - return cg; + + // If intrinsic does the virtual dispatch, we try to use the type profile + // first, and hopefully inline it as the regular virtual call below. + // We will retry the intrinsic if nothing had claimed it afterwards. + if (cg->does_virtual_dispatch()) { + cg_intrinsic = cg; + cg = NULL; + } else { + return cg; + } } } @@ -202,8 +213,24 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool // The major receiver's count >= TypeProfileMajorReceiverPercent of site_count. bool have_major_receiver = (100.*profile.receiver_prob(0) >= (float)TypeProfileMajorReceiverPercent); ciMethod* receiver_method = NULL; - if (have_major_receiver || profile.morphism() == 1 || - (profile.morphism() == 2 && UseBimorphicInlining)) { + + int morphism = profile.morphism(); + if (speculative_receiver_type != NULL) { + // We have a speculative type, we should be able to resolve + // the call. We do that before looking at the profiling at + // this invoke because it may lead to bimorphic inlining which + // a speculative type should help us avoid. + receiver_method = callee->resolve_invoke(jvms->method()->holder(), + speculative_receiver_type); + if (receiver_method == NULL) { + speculative_receiver_type = NULL; + } else { + morphism = 1; + } + } + if (receiver_method == NULL && + (have_major_receiver || morphism == 1 || + (morphism == 2 && UseBimorphicInlining))) { // receiver_method = profile.method(); // Profiles do not suggest methods now. Look it up in the major receiver. receiver_method = callee->resolve_invoke(jvms->method()->holder(), @@ -217,7 +244,7 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool // Look up second receiver. CallGenerator* next_hit_cg = NULL; ciMethod* next_receiver_method = NULL; - if (profile.morphism() == 2 && UseBimorphicInlining) { + if (morphism == 2 && UseBimorphicInlining) { next_receiver_method = callee->resolve_invoke(jvms->method()->holder(), profile.receiver(1)); if (next_receiver_method != NULL) { @@ -232,11 +259,10 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool } } CallGenerator* miss_cg; - Deoptimization::DeoptReason reason = (profile.morphism() == 2) ? + Deoptimization::DeoptReason reason = morphism == 2 ? Deoptimization::Reason_bimorphic : Deoptimization::Reason_class_check; - if (( profile.morphism() == 1 || - (profile.morphism() == 2 && next_hit_cg != NULL) ) && + if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) && !too_many_traps(jvms->method(), jvms->bci(), reason) ) { // Generate uncommon trap for class check failure path @@ -250,6 +276,7 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool } if (miss_cg != NULL) { if (next_hit_cg != NULL) { + assert(speculative_receiver_type == NULL, "shouldn't end up here if we used speculation"); 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(). @@ -257,7 +284,9 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool } if (miss_cg != NULL) { 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)); + ciKlass* k = speculative_receiver_type != NULL ? speculative_receiver_type : profile.receiver(0); + float hit_prob = speculative_receiver_type != NULL ? 1.0 : profile.receiver_prob(0); + CallGenerator* cg = CallGenerator::for_predicted_call(k, miss_cg, hit_cg, hit_prob); if (cg != NULL) return cg; } } @@ -266,6 +295,13 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool } } + // Nothing claimed the intrinsic, we go with straight-forward inlining + // for already discovered intrinsic. + if (allow_inline && allow_intrinsics && cg_intrinsic != NULL) { + assert(cg_intrinsic->does_virtual_dispatch(), "sanity"); + return cg_intrinsic; + } + // There was no special inlining tactic, or it bailed out. // Use a more generic tactic, like a simple call. if (call_does_dispatch) { @@ -429,13 +465,16 @@ void Parse::do_call() { int vtable_index = Method::invalid_vtable_index; bool call_does_dispatch = false; + // Speculative type of the receiver if any + ciKlass* speculative_receiver_type = NULL; if (is_virtual_or_interface) { - Node* receiver_node = stack(sp() - nargs); + Node* receiver_node = stack(sp() - nargs); const TypeOopPtr* receiver_type = _gvn.type(receiver_node)->isa_oopptr(); // call_does_dispatch and vtable_index are out-parameters. They might be changed. callee = C->optimize_virtual_call(method(), bci(), klass, orig_callee, receiver_type, is_virtual, call_does_dispatch, vtable_index); // out-parameters + speculative_receiver_type = receiver_type != NULL ? receiver_type->speculative_type() : NULL; } // Note: It's OK to try to inline a virtual call. @@ -451,7 +490,7 @@ void Parse::do_call() { // Decide call tactic. // This call checks with CHA, the interpreter profile, intrinsics table, etc. // It decides whether inlining is desirable or not. - CallGenerator* cg = C->call_generator(callee, vtable_index, call_does_dispatch, jvms, try_inline, prof_factor()); + CallGenerator* cg = C->call_generator(callee, vtable_index, call_does_dispatch, jvms, try_inline, prof_factor(), speculative_receiver_type); // NOTE: Don't use orig_callee and callee after this point! Use cg->method() instead. orig_callee = callee = NULL; @@ -460,6 +499,10 @@ void Parse::do_call() { // Round double arguments before call round_double_arguments(cg->method()); + // Feed profiling data for arguments to the type system so it can + // propagate it as speculative types + record_profiled_arguments_for_speculation(cg->method(), bc()); + #ifndef PRODUCT // bump global counters for calls count_compiled_calls(/*at_method_entry*/ false, cg->is_inline()); @@ -474,11 +517,18 @@ void Parse::do_call() { // save across call, for a subsequent cast_not_null. Node* receiver = has_receiver ? argument(0) : NULL; + // The extra CheckCastPP for speculative types mess with PhaseStringOpts + if (receiver != NULL && !call_does_dispatch && !cg->is_string_late_inline()) { + // Feed profiling data for a single receiver to the type system so + // it can propagate it as a speculative type + receiver = record_profiled_receiver_for_speculation(receiver); + } + // Bump method data counters (We profile *before* the call is made // because exceptions don't return to the call site.) profile_call(receiver); - JVMState* new_jvms = cg->generate(jvms); + JVMState* new_jvms = cg->generate(jvms, this); if (new_jvms == NULL) { // When inlining attempt fails (e.g., too many arguments), // it may contaminate the current compile state, making it @@ -491,8 +541,8 @@ void Parse::do_call() { // the call site, perhaps because it did not match a pattern the // intrinsic was expecting to optimize. Should always be possible to // get a normal java call that may inline in that case - cg = C->call_generator(cg->method(), vtable_index, call_does_dispatch, jvms, try_inline, prof_factor(), /* allow_intrinsics= */ false); - if ((new_jvms = cg->generate(jvms)) == NULL) { + cg = C->call_generator(cg->method(), vtable_index, call_does_dispatch, jvms, try_inline, prof_factor(), speculative_receiver_type, /* allow_intrinsics= */ false); + if ((new_jvms = cg->generate(jvms, this)) == NULL) { guarantee(failing(), "call failed to generate: calls should work"); return; } @@ -590,6 +640,16 @@ void Parse::do_call() { null_assert(peek()); set_bci(iter().cur_bci()); // put it back } + BasicType ct = ctype->basic_type(); + if (ct == T_OBJECT || ct == T_ARRAY) { + ciKlass* better_type = method()->return_profiled_type(bci()); + if (UseTypeSpeculation && better_type != NULL) { + // If profiling reports a single type for the return value, + // feed it to the type system so it can propagate it as a + // speculative type + record_profile_for_speculation(stack(sp()-1), better_type); + } + } } // Restart record of parsing work after possible inlining of call diff --git a/hotspot/src/share/vm/opto/escape.cpp b/hotspot/src/share/vm/opto/escape.cpp index c95226f110c..50afded6a92 100644 --- a/hotspot/src/share/vm/opto/escape.cpp +++ b/hotspot/src/share/vm/opto/escape.cpp @@ -780,6 +780,7 @@ void ConnectionGraph::add_call_node(CallNode* call) { } } else { // Allocate instance if (cik->is_subclass_of(_compile->env()->Thread_klass()) || + cik->is_subclass_of(_compile->env()->Reference_klass()) || !cik->is_instance_klass() || // StressReflectiveCode cik->as_instance_klass()->has_finalizer()) { es = PointsToNode::GlobalEscape; diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp index dcdd104ee72..8c5e05c3ac7 100644 --- a/hotspot/src/share/vm/opto/graphKit.cpp +++ b/hotspot/src/share/vm/opto/graphKit.cpp @@ -639,6 +639,7 @@ PreserveJVMState::PreserveJVMState(GraphKit* kit, bool clone_map) { _map = kit->map(); // preserve the map _sp = kit->sp(); kit->set_map(clone_map ? kit->clone_map() : NULL); + Compile::current()->inc_preserve_jvm_state(); #ifdef ASSERT _bci = kit->bci(); Parse* parser = kit->is_Parse(); @@ -656,6 +657,7 @@ PreserveJVMState::~PreserveJVMState() { #endif kit->set_map(_map); kit->set_sp(_sp); + Compile::current()->dec_preserve_jvm_state(); } @@ -1373,17 +1375,70 @@ Node* GraphKit::cast_not_null(Node* obj, bool do_replace_in_map) { //--------------------------replace_in_map------------------------------------- void GraphKit::replace_in_map(Node* old, Node* neww) { - this->map()->replace_edge(old, neww); + if (old == neww) { + return; + } + + map()->replace_edge(old, neww); // Note: This operation potentially replaces any edge // on the map. This includes locals, stack, and monitors // of the current (innermost) JVM state. - // We can consider replacing in caller maps. - // The idea would be that an inlined function's null checks - // can be shared with the entire inlining tree. - // The expense of doing this is that the PreserveJVMState class - // would have to preserve caller states too, with a deep copy. + if (!ReplaceInParentMaps) { + return; + } + + // PreserveJVMState doesn't do a deep copy so we can't modify + // parents + if (Compile::current()->has_preserve_jvm_state()) { + return; + } + + Parse* parser = is_Parse(); + bool progress = true; + Node* ctrl = map()->in(0); + // Follow the chain of parsers and see whether the update can be + // done in the map of callers. We can do the replace for a caller if + // the current control post dominates the control of a caller. + while (parser != NULL && parser->caller() != NULL && progress) { + progress = false; + Node* parent_map = parser->caller()->map(); + assert(parser->exits().map()->jvms()->depth() == parser->caller()->depth(), "map mismatch"); + + Node* parent_ctrl = parent_map->in(0); + + while (parent_ctrl->is_Region()) { + Node* n = parent_ctrl->as_Region()->is_copy(); + if (n == NULL) { + break; + } + parent_ctrl = n; + } + + for (;;) { + if (ctrl == parent_ctrl) { + // update the map of the exits which is the one that will be + // used when compilation resume after inlining + parser->exits().map()->replace_edge(old, neww); + progress = true; + break; + } + if (ctrl->is_Proj() && ctrl->as_Proj()->is_uncommon_trap_if_pattern(Deoptimization::Reason_none)) { + ctrl = ctrl->in(0)->in(0); + } else if (ctrl->is_Region()) { + Node* n = ctrl->as_Region()->is_copy(); + if (n == NULL) { + break; + } + ctrl = n; + } else { + break; + } + } + + parser = parser->parent_parser(); + } } @@ -2043,6 +2098,104 @@ void GraphKit::round_double_arguments(ciMethod* dest_method) { } } +/** + * Record profiling data exact_kls for Node n with the type system so + * that it can propagate it (speculation) + * + * @param n node that the type applies to + * @param exact_kls type from profiling + * + * @return node with improved type + */ +Node* GraphKit::record_profile_for_speculation(Node* n, ciKlass* exact_kls) { + const TypeOopPtr* current_type = _gvn.type(n)->isa_oopptr(); + assert(UseTypeSpeculation, "type speculation must be on"); + if (exact_kls != NULL && + // nothing to improve if type is already exact + (current_type == NULL || + (!current_type->klass_is_exact() && + (current_type->speculative() == NULL || + !current_type->speculative()->klass_is_exact())))) { + const TypeKlassPtr* tklass = TypeKlassPtr::make(exact_kls); + const TypeOopPtr* xtype = tklass->as_instance_type(); + assert(xtype->klass_is_exact(), "Should be exact"); + + // Build a type with a speculative type (what we think we know + // about the type but will need a guard when we use it) + const TypeOopPtr* spec_type = TypeOopPtr::make(TypePtr::BotPTR, Type::OffsetBot, TypeOopPtr::InstanceBot, xtype); + // We're changing the type, we need a new cast node to carry the + // new type. The new type depends on the control: what profiling + // tells us is only valid from here as far as we can tell. + Node* cast = new(C) CastPPNode(n, spec_type); + cast->init_req(0, control()); + cast = _gvn.transform(cast); + replace_in_map(n, cast); + n = cast; + } + return n; +} + +/** + * Record profiling data from receiver profiling at an invoke with the + * type system so that it can propagate it (speculation) + * + * @param n receiver node + * + * @return node with improved type + */ +Node* GraphKit::record_profiled_receiver_for_speculation(Node* n) { + if (!UseTypeSpeculation) { + return n; + } + ciKlass* exact_kls = profile_has_unique_klass(); + return record_profile_for_speculation(n, exact_kls); +} + +/** + * Record profiling data from argument profiling at an invoke with the + * type system so that it can propagate it (speculation) + * + * @param dest_method target method for the call + * @param bc what invoke bytecode is this? + */ +void GraphKit::record_profiled_arguments_for_speculation(ciMethod* dest_method, Bytecodes::Code bc) { + if (!UseTypeSpeculation) { + return; + } + const TypeFunc* tf = TypeFunc::make(dest_method); + int nargs = tf->_domain->_cnt - TypeFunc::Parms; + int skip = Bytecodes::has_receiver(bc) ? 1 : 0; + for (int j = skip, i = 0; j < nargs && i < TypeProfileArgsLimit; j++) { + const Type *targ = tf->_domain->field_at(j + TypeFunc::Parms); + if (targ->basic_type() == T_OBJECT || targ->basic_type() == T_ARRAY) { + ciKlass* better_type = method()->argument_profiled_type(bci(), i); + if (better_type != NULL) { + record_profile_for_speculation(argument(j), better_type); + } + i++; + } + } +} + +/** + * Record profiling data from parameter profiling at an invoke with + * the type system so that it can propagate it (speculation) + */ +void GraphKit::record_profiled_parameters_for_speculation() { + if (!UseTypeSpeculation) { + return; + } + for (int i = 0, j = 0; i < method()->arg_size() ; i++) { + if (_gvn.type(local(i))->isa_oopptr()) { + ciKlass* better_type = method()->parameter_profiled_type(j); + if (better_type != NULL) { + record_profile_for_speculation(local(i), better_type); + } + j++; + } + } +} + void GraphKit::round_double_result(ciMethod* dest_method) { // A non-strict method may return a double value which has an extended // exponent, but this must not be visible in a caller which is 'strict' @@ -2122,7 +2275,7 @@ Node* GraphKit::dstore_rounding(Node* n) { // Null check oop. Set null-path control into Region in slot 3. // Make a cast-not-nullness use the other not-null control. Return cast. Node* GraphKit::null_check_oop(Node* value, Node* *null_control, - bool never_see_null) { + bool never_see_null, bool safe_for_replace) { // Initial NULL check taken path (*null_control) = top(); Node* cast = null_check_common(value, T_OBJECT, false, null_control); @@ -2140,6 +2293,9 @@ Node* GraphKit::null_check_oop(Node* value, Node* *null_control, Deoptimization::Action_make_not_entrant); (*null_control) = top(); // NULL path is dead } + if ((*null_control) == top() && safe_for_replace) { + replace_in_map(value, cast); + } // Cast away null-ness on the result return cast; @@ -2577,10 +2733,10 @@ bool GraphKit::seems_never_null(Node* obj, ciProfileData* data) { // If the profile has seen exactly one type, narrow to exactly that type. // Subsequent type checks will always fold up. Node* GraphKit::maybe_cast_profiled_receiver(Node* not_null_obj, - ciProfileData* data, - ciKlass* require_klass) { + ciKlass* require_klass, + ciKlass* spec_klass, + bool safe_for_replace) { if (!UseTypeProfile || !TypeProfileCasts) return NULL; - if (data == NULL) return NULL; // Make sure we haven't already deoptimized from this tactic. if (too_many_traps(Deoptimization::Reason_class_check)) @@ -2588,15 +2744,15 @@ Node* GraphKit::maybe_cast_profiled_receiver(Node* not_null_obj, // (No, this isn't a call, but it's enough like a virtual call // to use the same ciMethod accessor to get the profile info...) - ciCallProfile profile = method()->call_profile_at_bci(bci()); - if (profile.count() >= 0 && // no cast failures here - profile.has_receiver(0) && - profile.morphism() == 1) { - ciKlass* exact_kls = profile.receiver(0); + // If we have a speculative type use it instead of profiling (which + // may not help us) + ciKlass* exact_kls = spec_klass == NULL ? profile_has_unique_klass() : spec_klass; + if (exact_kls != NULL) {// no cast failures here if (require_klass == NULL || static_subtype_check(require_klass, exact_kls) == SSC_always_true) { - // If we narrow the type to match what the type profile sees, - // we can then remove the rest of the cast. + // If we narrow the type to match what the type profile sees or + // the speculative type, we can then remove the rest of the + // cast. // This is a win, even if the exact_kls is very specific, // because downstream operations, such as method calls, // will often benefit from the sharper type. @@ -2608,7 +2764,9 @@ Node* GraphKit::maybe_cast_profiled_receiver(Node* not_null_obj, uncommon_trap(Deoptimization::Reason_class_check, Deoptimization::Action_maybe_recompile); } - replace_in_map(not_null_obj, exact_obj); + if (safe_for_replace) { + replace_in_map(not_null_obj, exact_obj); + } return exact_obj; } // assert(ssc == SSC_always_true)... except maybe the profile lied to us. @@ -2617,11 +2775,59 @@ Node* GraphKit::maybe_cast_profiled_receiver(Node* not_null_obj, return NULL; } +/** + * Cast obj to type and emit guard unless we had too many traps here + * already + * + * @param obj node being casted + * @param type type to cast the node to + * @param not_null true if we know node cannot be null + */ +Node* GraphKit::maybe_cast_profiled_obj(Node* obj, + ciKlass* type, + bool not_null) { + // type == NULL if profiling tells us this object is always null + if (type != NULL) { + if (!too_many_traps(Deoptimization::Reason_null_check) && + !too_many_traps(Deoptimization::Reason_class_check)) { + Node* not_null_obj = NULL; + // not_null is true if we know the object is not null and + // there's no need for a null check + if (!not_null) { + Node* null_ctl = top(); + not_null_obj = null_check_oop(obj, &null_ctl, true, true); + assert(null_ctl->is_top(), "no null control here"); + } else { + not_null_obj = obj; + } + + Node* exact_obj = not_null_obj; + ciKlass* exact_kls = type; + Node* slow_ctl = type_check_receiver(exact_obj, exact_kls, 1.0, + &exact_obj); + { + PreserveJVMState pjvms(this); + set_control(slow_ctl); + uncommon_trap(Deoptimization::Reason_class_check, + Deoptimization::Action_maybe_recompile); + } + replace_in_map(not_null_obj, exact_obj); + obj = exact_obj; + } + } else { + if (!too_many_traps(Deoptimization::Reason_null_assert)) { + Node* exact_obj = null_assert(obj); + replace_in_map(obj, exact_obj); + obj = exact_obj; + } + } + return obj; +} //-------------------------------gen_instanceof-------------------------------- // Generate an instance-of idiom. Used by both the instance-of bytecode // and the reflective instance-of call. -Node* GraphKit::gen_instanceof(Node* obj, Node* superklass) { +Node* GraphKit::gen_instanceof(Node* obj, Node* superklass, bool safe_for_replace) { kill_dead_locals(); // Benefit all the uncommon traps assert( !stopped(), "dead parse path should be checked in callers" ); assert(!TypePtr::NULL_PTR->higher_equal(_gvn.type(superklass)->is_klassptr()), @@ -2642,7 +2848,7 @@ Node* GraphKit::gen_instanceof(Node* obj, Node* superklass) { // Null check; get casted pointer; set region slot 3 Node* null_ctl = top(); - Node* not_null_obj = null_check_oop(obj, &null_ctl, never_see_null); + Node* not_null_obj = null_check_oop(obj, &null_ctl, never_see_null, safe_for_replace); // If not_null_obj is dead, only null-path is taken if (stopped()) { // Doing instance-of on a NULL? @@ -2659,14 +2865,37 @@ Node* GraphKit::gen_instanceof(Node* obj, Node* superklass) { phi ->del_req(_null_path); } - if (ProfileDynamicTypes && data != NULL) { - Node* cast_obj = maybe_cast_profiled_receiver(not_null_obj, data, NULL); - if (stopped()) { // Profile disagrees with this path. - set_control(null_ctl); // Null is the only remaining possibility. - return intcon(0); + // Do we know the type check always succeed? + bool known_statically = false; + if (_gvn.type(superklass)->singleton()) { + ciKlass* superk = _gvn.type(superklass)->is_klassptr()->klass(); + ciKlass* subk = _gvn.type(obj)->is_oopptr()->klass(); + if (subk != NULL && subk->is_loaded()) { + int static_res = static_subtype_check(superk, subk); + known_statically = (static_res == SSC_always_true || static_res == SSC_always_false); + } + } + + if (known_statically && UseTypeSpeculation) { + // If we know the type check always succeed then we don't use the + // profiling data at this bytecode. Don't lose it, feed it to the + // type system as a speculative type. + not_null_obj = record_profiled_receiver_for_speculation(not_null_obj); + } else { + const TypeOopPtr* obj_type = _gvn.type(obj)->is_oopptr(); + // We may not have profiling here or it may not help us. If we + // have a speculative type use it to perform an exact cast. + ciKlass* spec_obj_type = obj_type->speculative_type(); + if (spec_obj_type != NULL || (ProfileDynamicTypes && data != NULL)) { + Node* cast_obj = maybe_cast_profiled_receiver(not_null_obj, NULL, spec_obj_type, safe_for_replace); + if (stopped()) { // Profile disagrees with this path. + set_control(null_ctl); // Null is the only remaining possibility. + return intcon(0); + } + if (cast_obj != NULL) { + not_null_obj = cast_obj; + } } - if (cast_obj != NULL) - not_null_obj = cast_obj; } // Load the object's klass @@ -2713,7 +2942,10 @@ Node* GraphKit::gen_checkcast(Node *obj, Node* superklass, if (objtp != NULL && objtp->klass() != NULL) { switch (static_subtype_check(tk->klass(), objtp->klass())) { case SSC_always_true: - return obj; + // If we know the type check always succeed then we don't use + // the profiling data at this bytecode. Don't lose it, feed it + // to the type system as a speculative type. + return record_profiled_receiver_for_speculation(obj); case SSC_always_false: // It needs a null check because a null will *pass* the cast check. // A non-null value will always produce an exception. @@ -2723,11 +2955,13 @@ Node* GraphKit::gen_checkcast(Node *obj, Node* superklass, } ciProfileData* data = NULL; + bool safe_for_replace = false; if (failure_control == NULL) { // use MDO in regular case only assert(java_bc() == Bytecodes::_aastore || java_bc() == Bytecodes::_checkcast, "interpreter profiles type checks only for these BCs"); data = method()->method_data()->bci_to_data(bci()); + safe_for_replace = true; } // Make the merge point @@ -2742,7 +2976,7 @@ Node* GraphKit::gen_checkcast(Node *obj, Node* superklass, // Null check; get casted pointer; set region slot 3 Node* null_ctl = top(); - Node* not_null_obj = null_check_oop(obj, &null_ctl, never_see_null); + Node* not_null_obj = null_check_oop(obj, &null_ctl, never_see_null, safe_for_replace); // If not_null_obj is dead, only null-path is taken if (stopped()) { // Doing instance-of on a NULL? @@ -2760,12 +2994,17 @@ Node* GraphKit::gen_checkcast(Node *obj, Node* superklass, } Node* cast_obj = NULL; - if (data != NULL && - // Counter has never been decremented (due to cast failure). - // ...This is a reasonable thing to expect. It is true of - // all casts inserted by javac to implement generic types. - data->as_CounterData()->count() >= 0) { - cast_obj = maybe_cast_profiled_receiver(not_null_obj, data, tk->klass()); + const TypeOopPtr* obj_type = _gvn.type(obj)->is_oopptr(); + // We may not have profiling here or it may not help us. If we have + // a speculative type use it to perform an exact cast. + ciKlass* spec_obj_type = obj_type->speculative_type(); + if (spec_obj_type != NULL || + (data != NULL && + // Counter has never been decremented (due to cast failure). + // ...This is a reasonable thing to expect. It is true of + // all casts inserted by javac to implement generic types. + data->as_CounterData()->count() >= 0)) { + cast_obj = maybe_cast_profiled_receiver(not_null_obj, tk->klass(), spec_obj_type, safe_for_replace); if (cast_obj != NULL) { if (failure_control != NULL) // failure is now impossible (*failure_control) = top(); @@ -3608,7 +3847,7 @@ void GraphKit::g1_write_barrier_pre(bool do_load, Node* marking = __ load(__ ctrl(), marking_adr, TypeInt::INT, active_type, Compile::AliasIdxRaw); // if (!marking) - __ if_then(marking, BoolTest::ne, zero); { + __ if_then(marking, BoolTest::ne, zero, unlikely); { BasicType index_bt = TypeX_X->basic_type(); assert(sizeof(size_t) == type2aelembytes(index_bt), "Loading G1 PtrQueue::_index with wrong size."); Node* index = __ load(__ ctrl(), index_adr, TypeX_X, index_bt, Compile::AliasIdxRaw); @@ -3713,7 +3952,8 @@ void GraphKit::g1_write_barrier_post(Node* oop_store, Node* no_base = __ top(); float likely = PROB_LIKELY(0.999); float unlikely = PROB_UNLIKELY(0.999); - Node* zero = __ ConI(0); + Node* young_card = __ ConI((jint)G1SATBCardTableModRefBS::g1_young_card_val()); + Node* dirty_card = __ ConI((jint)CardTableModRefBS::dirty_card_val()); Node* zeroX = __ ConX(0); // Get the alias_index for raw card-mark memory @@ -3769,8 +4009,16 @@ void GraphKit::g1_write_barrier_post(Node* oop_store, // load the original value of the card Node* card_val = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); - __ if_then(card_val, BoolTest::ne, zero); { - g1_mark_card(ideal, card_adr, oop_store, alias_idx, index, index_adr, buffer, tf); + __ if_then(card_val, BoolTest::ne, young_card); { + sync_kit(ideal); + // Use Op_MemBarVolatile to achieve the effect of a StoreLoad barrier. + insert_mem_bar(Op_MemBarVolatile, oop_store); + __ sync_kit(this); + + Node* card_val_reload = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); + __ if_then(card_val_reload, BoolTest::ne, dirty_card); { + g1_mark_card(ideal, card_adr, oop_store, alias_idx, index, index_adr, buffer, tf); + } __ end_if(); } __ end_if(); } __ end_if(); } __ end_if(); @@ -3849,9 +4097,9 @@ void GraphKit::store_String_value(Node* ctrl, Node* str, Node* value) { const TypeInstPtr* string_type = TypeInstPtr::make(TypePtr::NotNull, C->env()->String_klass(), false, NULL, 0); const TypePtr* value_field_type = string_type->add_offset(value_offset); - int value_field_idx = C->get_alias_index(value_field_type); - store_to_memory(ctrl, basic_plus_adr(str, value_offset), - value, T_OBJECT, value_field_idx); + + store_oop_to_object(ctrl, str, basic_plus_adr(str, value_offset), value_field_type, + value, TypeAryPtr::CHARS, T_OBJECT); } void GraphKit::store_String_length(Node* ctrl, Node* str, Node* value) { diff --git a/hotspot/src/share/vm/opto/graphKit.hpp b/hotspot/src/share/vm/opto/graphKit.hpp index 1fd4e86d2e7..75e01784e4c 100644 --- a/hotspot/src/share/vm/opto/graphKit.hpp +++ b/hotspot/src/share/vm/opto/graphKit.hpp @@ -378,16 +378,41 @@ class GraphKit : public Phase { // Return a cast-not-null node which depends on the not-null control. // If never_see_null, use an uncommon trap (*null_control sees a top). // The cast is not valid along the null path; keep a copy of the original. + // If safe_for_replace, then we can replace the value with the cast + // in the parsing map (the cast is guaranteed to dominate the map) Node* null_check_oop(Node* value, Node* *null_control, - bool never_see_null = false); + bool never_see_null = false, bool safe_for_replace = false); // Check the null_seen bit. bool seems_never_null(Node* obj, ciProfileData* data); + // Check for unique class for receiver at call + ciKlass* profile_has_unique_klass() { + ciCallProfile profile = method()->call_profile_at_bci(bci()); + if (profile.count() >= 0 && // no cast failures here + profile.has_receiver(0) && + profile.morphism() == 1) { + return profile.receiver(0); + } + return NULL; + } + + // record type from profiling with the type system + Node* record_profile_for_speculation(Node* n, ciKlass* exact_kls); + Node* record_profiled_receiver_for_speculation(Node* n); + void record_profiled_arguments_for_speculation(ciMethod* dest_method, Bytecodes::Code bc); + void record_profiled_parameters_for_speculation(); + // Use the type profile to narrow an object type. Node* maybe_cast_profiled_receiver(Node* not_null_obj, - ciProfileData* data, - ciKlass* require_klass); + ciKlass* require_klass, + ciKlass* spec, + bool safe_for_replace); + + // Cast obj to type and emit guard unless we had too many traps here already + Node* maybe_cast_profiled_obj(Node* obj, + ciKlass* type, + bool not_null = false); // Cast obj to not-null on this path Node* cast_not_null(Node* obj, bool do_replace_in_map = true); @@ -773,7 +798,7 @@ class GraphKit : public Phase { // Generate an instance-of idiom. Used by both the instance-of bytecode // and the reflective instance-of call. - Node* gen_instanceof( Node *subobj, Node* superkls ); + Node* gen_instanceof(Node *subobj, Node* superkls, bool safe_for_replace = false); // Generate a check-cast idiom. Used by both the check-cast bytecode // and the array-store bytecode diff --git a/hotspot/src/share/vm/opto/idealGraphPrinter.cpp b/hotspot/src/share/vm/opto/idealGraphPrinter.cpp index 9f67a652eec..4589f6e4a8d 100644 --- a/hotspot/src/share/vm/opto/idealGraphPrinter.cpp +++ b/hotspot/src/share/vm/opto/idealGraphPrinter.cpp @@ -616,7 +616,11 @@ void IdealGraphPrinter::visit_node(Node *n, bool edges, VectorSet* temp_set) { buffer[0] = 0; _chaitin->dump_register(node, buffer); print_prop("reg", buffer); - print_prop("lrg", _chaitin->_lrg_map.live_range_id(node)); + uint lrg_id = 0; + if (node->_idx < _chaitin->_lrg_map.size()) { + lrg_id = _chaitin->_lrg_map.live_range_id(node); + } + print_prop("lrg", lrg_id); } node->_in_dump_cnt--; diff --git a/hotspot/src/share/vm/opto/ifg.cpp b/hotspot/src/share/vm/opto/ifg.cpp index db8dbea84d7..89ed5b33102 100644 --- a/hotspot/src/share/vm/opto/ifg.cpp +++ b/hotspot/src/share/vm/opto/ifg.cpp @@ -677,7 +677,7 @@ uint PhaseChaitin::build_ifg_physical( ResourceArea *a ) { } else { // Common case: size 1 bound removal if( lrg.mask().Member(r_reg) ) { lrg.Remove(r_reg); - lrg.set_mask_size(lrg.mask().is_AllStack() ? 65535:old_size-1); + lrg.set_mask_size(lrg.mask().is_AllStack() ? LRG::AllStack_size : old_size - 1); } } // If 'l' goes completely dry, it must spill. diff --git a/hotspot/src/share/vm/opto/ifnode.cpp b/hotspot/src/share/vm/opto/ifnode.cpp index 3995446485b..029a9f64adc 100644 --- a/hotspot/src/share/vm/opto/ifnode.cpp +++ b/hotspot/src/share/vm/opto/ifnode.cpp @@ -76,6 +76,7 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) { if( !i1->is_Bool() ) return NULL; BoolNode *b = i1->as_Bool(); Node *cmp = b->in(1); + if( cmp->is_FlagsProj() ) return NULL; if( !cmp->is_Cmp() ) return NULL; i1 = cmp->in(1); if( i1 == NULL || !i1->is_Phi() ) return NULL; @@ -688,6 +689,7 @@ Node* IfNode::fold_compares(PhaseGVN* phase) { ctrl->in(0)->in(1)->is_Bool() && ctrl->in(0)->in(1)->in(1)->Opcode() == Op_CmpI && ctrl->in(0)->in(1)->in(1)->in(2)->is_Con() && + ctrl->in(0)->in(1)->in(1)->in(2) != phase->C->top() && ctrl->in(0)->in(1)->in(1)->in(1) == n) { IfNode* dom_iff = ctrl->in(0)->as_If(); Node* otherproj = dom_iff->proj_out(!ctrl->as_Proj()->_con); @@ -1017,7 +1019,7 @@ void IfNode::dominated_by( Node *prev_dom, PhaseIterGVN *igvn ) { // be skipped. For example, range check predicate has two checks // for lower and upper bounds. ProjNode* unc_proj = proj_out(1 - prev_dom->as_Proj()->_con)->as_Proj(); - if (PhaseIdealLoop::is_uncommon_trap_proj(unc_proj, Deoptimization::Reason_predicate)) + if (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate)) prev_dom = idom; // Now walk the current IfNode's projections. diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp index 63deec31b3f..c497abdb578 100644 --- a/hotspot/src/share/vm/opto/lcm.cpp +++ b/hotspot/src/share/vm/opto/lcm.cpp @@ -472,6 +472,13 @@ Node* PhaseCFG::select(Block* block, Node_List &worklist, GrowableArray &re break; } + // For nodes that produce a FlagsProj, make the node adjacent to the + // use of the FlagsProj + if (use->is_FlagsProj() && get_block_for_node(use) == block) { + found_machif = true; + break; + } + // More than this instruction pending for successor to be ready, // don't choose this if other opportunities are ready if (ready_cnt.at(use->_idx) > 1) diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 2bfa25fa9c2..df6c29f5766 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -32,6 +32,7 @@ #include "opto/callGenerator.hpp" #include "opto/cfgnode.hpp" #include "opto/idealKit.hpp" +#include "opto/mathexactnode.hpp" #include "opto/mulnode.hpp" #include "opto/parse.hpp" #include "opto/runtime.hpp" @@ -46,20 +47,23 @@ class LibraryIntrinsic : public InlineCallGenerator { private: bool _is_virtual; bool _is_predicted; + bool _does_virtual_dispatch; vmIntrinsics::ID _intrinsic_id; public: - LibraryIntrinsic(ciMethod* m, bool is_virtual, bool is_predicted, vmIntrinsics::ID id) + LibraryIntrinsic(ciMethod* m, bool is_virtual, bool is_predicted, bool does_virtual_dispatch, vmIntrinsics::ID id) : InlineCallGenerator(m), _is_virtual(is_virtual), _is_predicted(is_predicted), + _does_virtual_dispatch(does_virtual_dispatch), _intrinsic_id(id) { } virtual bool is_intrinsic() const { return true; } virtual bool is_virtual() const { return _is_virtual; } virtual bool is_predicted() const { return _is_predicted; } - virtual JVMState* generate(JVMState* jvms); + virtual bool does_virtual_dispatch() const { return _does_virtual_dispatch; } + virtual JVMState* generate(JVMState* jvms, Parse* parent_parser); virtual Node* generate_predicate(JVMState* jvms); vmIntrinsics::ID intrinsic_id() const { return _intrinsic_id; } }; @@ -199,6 +203,15 @@ class LibraryCallKit : public GraphKit { bool inline_math_native(vmIntrinsics::ID id); bool inline_trig(vmIntrinsics::ID id); bool inline_math(vmIntrinsics::ID id); + void inline_math_mathExact(Node* math); + bool inline_math_addExactI(bool is_increment); + bool inline_math_addExactL(bool is_increment); + bool inline_math_multiplyExactI(); + bool inline_math_multiplyExactL(); + bool inline_math_negateExactI(); + bool inline_math_negateExactL(); + bool inline_math_subtractExactI(bool is_decrement); + bool inline_math_subtractExactL(bool is_decrement); bool inline_exp(); bool inline_pow(); void finish_pow_exp(Node* result, Node* x, Node* y, const TypeFunc* call_type, address funcAddr, const char* funcName); @@ -352,6 +365,7 @@ CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) { } bool is_predicted = false; + bool does_virtual_dispatch = false; switch (id) { case vmIntrinsics::_compareTo: @@ -378,8 +392,10 @@ CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) { break; case vmIntrinsics::_hashCode: if (!InlineObjectHash) return NULL; + does_virtual_dispatch = true; break; case vmIntrinsics::_clone: + does_virtual_dispatch = true; case vmIntrinsics::_copyOf: case vmIntrinsics::_copyOfRange: if (!InlineObjectCopy) return NULL; @@ -498,6 +514,35 @@ CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) { if (!UseCRC32Intrinsics) return NULL; break; + case vmIntrinsics::_incrementExactI: + case vmIntrinsics::_addExactI: + if (!Matcher::match_rule_supported(Op_AddExactI) || !UseMathExactIntrinsics) return NULL; + break; + case vmIntrinsics::_incrementExactL: + case vmIntrinsics::_addExactL: + if (!Matcher::match_rule_supported(Op_AddExactL) || !UseMathExactIntrinsics) return NULL; + break; + case vmIntrinsics::_decrementExactI: + case vmIntrinsics::_subtractExactI: + if (!Matcher::match_rule_supported(Op_SubExactI) || !UseMathExactIntrinsics) return NULL; + break; + case vmIntrinsics::_decrementExactL: + case vmIntrinsics::_subtractExactL: + if (!Matcher::match_rule_supported(Op_SubExactL) || !UseMathExactIntrinsics) return NULL; + break; + case vmIntrinsics::_negateExactI: + if (!Matcher::match_rule_supported(Op_NegExactI) || !UseMathExactIntrinsics) return NULL; + break; + case vmIntrinsics::_negateExactL: + if (!Matcher::match_rule_supported(Op_NegExactL) || !UseMathExactIntrinsics) return NULL; + break; + case vmIntrinsics::_multiplyExactI: + if (!Matcher::match_rule_supported(Op_MulExactI) || !UseMathExactIntrinsics) return NULL; + break; + case vmIntrinsics::_multiplyExactL: + if (!Matcher::match_rule_supported(Op_MulExactL) || !UseMathExactIntrinsics) return NULL; + break; + default: assert(id <= vmIntrinsics::LAST_COMPILER_INLINE, "caller responsibility"); assert(id != vmIntrinsics::_Object_init && id != vmIntrinsics::_invoke, "enum out of order?"); @@ -529,7 +574,7 @@ CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) { if (!InlineUnsafeOps) return NULL; } - return new LibraryIntrinsic(m, is_virtual, is_predicted, (vmIntrinsics::ID) id); + return new LibraryIntrinsic(m, is_virtual, is_predicted, does_virtual_dispatch, (vmIntrinsics::ID) id); } //----------------------register_library_intrinsics----------------------- @@ -538,12 +583,12 @@ void Compile::register_library_intrinsics() { // Nothing to do here. } -JVMState* LibraryIntrinsic::generate(JVMState* jvms) { +JVMState* LibraryIntrinsic::generate(JVMState* jvms, Parse* parent_parser) { LibraryCallKit kit(jvms, this); Compile* C = kit.C; int nodes = C->unique(); #ifndef PRODUCT - if ((PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) && Verbose) { + if ((C->print_intrinsics() || C->print_inlining()) && Verbose) { char buf[1000]; const char* str = vmIntrinsics::short_name_as_C_string(intrinsic_id(), buf, sizeof(buf)); tty->print_cr("Intrinsic %s", str); @@ -554,7 +599,7 @@ JVMState* LibraryIntrinsic::generate(JVMState* jvms) { // Try to inline the intrinsic. if (kit.try_to_inline()) { - if (PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) { + if (C->print_intrinsics() || C->print_inlining()) { C->print_inlining(callee, jvms->depth() - 1, bci, is_virtual() ? "(intrinsic, virtual)" : "(intrinsic)"); } C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_worked); @@ -570,7 +615,7 @@ JVMState* LibraryIntrinsic::generate(JVMState* jvms) { } // The intrinsic bailed out - if (PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) { + if (C->print_intrinsics() || C->print_inlining()) { if (jvms->has_method()) { // Not a root compile. const char* msg = is_virtual() ? "failed to inline (intrinsic, virtual)" : "failed to inline (intrinsic)"; @@ -592,7 +637,7 @@ Node* LibraryIntrinsic::generate_predicate(JVMState* jvms) { int nodes = C->unique(); #ifndef PRODUCT assert(is_predicted(), "sanity"); - if ((PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) && Verbose) { + if ((C->print_intrinsics() || C->print_inlining()) && Verbose) { char buf[1000]; const char* str = vmIntrinsics::short_name_as_C_string(intrinsic_id(), buf, sizeof(buf)); tty->print_cr("Predicate for intrinsic %s", str); @@ -603,7 +648,7 @@ Node* LibraryIntrinsic::generate_predicate(JVMState* jvms) { Node* slow_ctl = kit.try_to_predicate(); if (!kit.failing()) { - if (PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) { + if (C->print_intrinsics() || C->print_inlining()) { C->print_inlining(callee, jvms->depth() - 1, bci, is_virtual() ? "(intrinsic, virtual)" : "(intrinsic)"); } C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_worked); @@ -617,7 +662,7 @@ Node* LibraryIntrinsic::generate_predicate(JVMState* jvms) { } // The intrinsic bailed out - if (PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) { + if (C->print_intrinsics() || C->print_inlining()) { if (jvms->has_method()) { // Not a root compile. const char* msg = "failed to generate predicate for intrinsic"; @@ -668,6 +713,19 @@ bool LibraryCallKit::try_to_inline() { case vmIntrinsics::_min: case vmIntrinsics::_max: return inline_min_max(intrinsic_id()); + case vmIntrinsics::_addExactI: return inline_math_addExactI(false /* add */); + case vmIntrinsics::_addExactL: return inline_math_addExactL(false /* add */); + case vmIntrinsics::_decrementExactI: return inline_math_subtractExactI(true /* decrement */); + case vmIntrinsics::_decrementExactL: return inline_math_subtractExactL(true /* decrement */); + case vmIntrinsics::_incrementExactI: return inline_math_addExactI(true /* increment */); + case vmIntrinsics::_incrementExactL: return inline_math_addExactL(true /* increment */); + case vmIntrinsics::_multiplyExactI: return inline_math_multiplyExactI(); + case vmIntrinsics::_multiplyExactL: return inline_math_multiplyExactL(); + case vmIntrinsics::_negateExactI: return inline_math_negateExactI(); + case vmIntrinsics::_negateExactL: return inline_math_negateExactL(); + case vmIntrinsics::_subtractExactI: return inline_math_subtractExactI(false /* subtract */); + case vmIntrinsics::_subtractExactL: return inline_math_subtractExactL(false /* subtract */); + case vmIntrinsics::_arraycopy: return inline_arraycopy(); case vmIntrinsics::_compareTo: return inline_string_compareTo(); @@ -1911,6 +1969,139 @@ bool LibraryCallKit::inline_min_max(vmIntrinsics::ID id) { return true; } +void LibraryCallKit::inline_math_mathExact(Node* math) { + // If we didn't get the expected opcode it means we have optimized + // the node to something else and don't need the exception edge. + if (!math->is_MathExact()) { + set_result(math); + return; + } + + Node* result = _gvn.transform( new(C) ProjNode(math, MathExactNode::result_proj_node)); + Node* flags = _gvn.transform( new(C) FlagsProjNode(math, MathExactNode::flags_proj_node)); + + Node* bol = _gvn.transform( new (C) BoolNode(flags, BoolTest::overflow) ); + IfNode* check = create_and_map_if(control(), bol, PROB_UNLIKELY_MAG(3), COUNT_UNKNOWN); + Node* fast_path = _gvn.transform( new (C) IfFalseNode(check)); + Node* slow_path = _gvn.transform( new (C) IfTrueNode(check) ); + + { + PreserveJVMState pjvms(this); + PreserveReexecuteState preexecs(this); + jvms()->set_should_reexecute(true); + + set_control(slow_path); + set_i_o(i_o()); + + uncommon_trap(Deoptimization::Reason_intrinsic, + Deoptimization::Action_none); + } + + set_control(fast_path); + set_result(result); +} + +bool LibraryCallKit::inline_math_addExactI(bool is_increment) { + Node* arg1 = argument(0); + Node* arg2 = NULL; + + if (is_increment) { + arg2 = intcon(1); + } else { + arg2 = argument(1); + } + + Node* add = _gvn.transform( new(C) AddExactINode(NULL, arg1, arg2) ); + inline_math_mathExact(add); + return true; +} + +bool LibraryCallKit::inline_math_addExactL(bool is_increment) { + Node* arg1 = argument(0); // type long + // argument(1) == TOP + Node* arg2 = NULL; + + if (is_increment) { + arg2 = longcon(1); + } else { + arg2 = argument(2); // type long + // argument(3) == TOP + } + + Node* add = _gvn.transform(new(C) AddExactLNode(NULL, arg1, arg2)); + inline_math_mathExact(add); + return true; +} + +bool LibraryCallKit::inline_math_subtractExactI(bool is_decrement) { + Node* arg1 = argument(0); + Node* arg2 = NULL; + + if (is_decrement) { + arg2 = intcon(1); + } else { + arg2 = argument(1); + } + + Node* sub = _gvn.transform(new(C) SubExactINode(NULL, arg1, arg2)); + inline_math_mathExact(sub); + return true; +} + +bool LibraryCallKit::inline_math_subtractExactL(bool is_decrement) { + Node* arg1 = argument(0); // type long + // argument(1) == TOP + Node* arg2 = NULL; + + if (is_decrement) { + arg2 = longcon(1); + } else { + arg2 = argument(2); // type long + // argument(3) == TOP + } + + Node* sub = _gvn.transform(new(C) SubExactLNode(NULL, arg1, arg2)); + inline_math_mathExact(sub); + return true; +} + +bool LibraryCallKit::inline_math_negateExactI() { + Node* arg1 = argument(0); + + Node* neg = _gvn.transform(new(C) NegExactINode(NULL, arg1)); + inline_math_mathExact(neg); + return true; +} + +bool LibraryCallKit::inline_math_negateExactL() { + Node* arg1 = argument(0); + // argument(1) == TOP + + Node* neg = _gvn.transform(new(C) NegExactLNode(NULL, arg1)); + inline_math_mathExact(neg); + return true; +} + +bool LibraryCallKit::inline_math_multiplyExactI() { + Node* arg1 = argument(0); + Node* arg2 = argument(1); + + Node* mul = _gvn.transform(new(C) MulExactINode(NULL, arg1, arg2)); + inline_math_mathExact(mul); + return true; +} + +bool LibraryCallKit::inline_math_multiplyExactL() { + Node* arg1 = argument(0); + // argument(1) == TOP + Node* arg2 = argument(2); + // argument(3) == TOP + + Node* mul = _gvn.transform(new(C) MulExactLNode(NULL, arg1, arg2)); + inline_math_mathExact(mul); + return true; +} + Node* LibraryCallKit::generate_min_max(vmIntrinsics::ID id, Node* x0, Node* y0) { // These are the candidate return value: @@ -2299,7 +2490,7 @@ const TypeOopPtr* LibraryCallKit::sharpen_unsafe_type(Compile::AliasType* alias_ const TypeOopPtr* tjp = TypeOopPtr::make_from_klass(sharpened_klass); #ifndef PRODUCT - if (PrintIntrinsics || PrintInlining || PrintOptoInlining) { + if (C->print_intrinsics() || C->print_inlining()) { tty->print(" from base type: "); adr_type->dump(); tty->print(" sharpened value: "); tjp->dump(); } @@ -3260,7 +3451,7 @@ bool LibraryCallKit::inline_native_Class_query(vmIntrinsics::ID id) { if (mirror_con == NULL) return false; // cannot happen? #ifndef PRODUCT - if (PrintIntrinsics || PrintInlining || PrintOptoInlining) { + if (C->print_intrinsics() || C->print_inlining()) { ciType* k = mirror_con->java_mirror_type(); if (k) { tty->print("Inlining %s on constant Class ", vmIntrinsics::name_at(intrinsic_id())); @@ -3294,6 +3485,7 @@ bool LibraryCallKit::inline_native_Class_query(vmIntrinsics::ID id) { // If kls is null, we have a primitive mirror. phi->init_req(_prim_path, prim_return_value); if (stopped()) { set_result(region, phi); return true; } + bool safe_for_replace = (region->in(_prim_path) == top()); Node* p; // handy temp Node* null_ctl; @@ -3304,7 +3496,7 @@ bool LibraryCallKit::inline_native_Class_query(vmIntrinsics::ID id) { switch (id) { case vmIntrinsics::_isInstance: // nothing is an instance of a primitive type - query_value = gen_instanceof(obj, kls); + query_value = gen_instanceof(obj, kls, safe_for_replace); break; case vmIntrinsics::_getModifiers: @@ -3952,14 +4144,14 @@ bool LibraryCallKit::inline_native_getClass() { // caller sensitive methods. bool LibraryCallKit::inline_native_Reflection_getCallerClass() { #ifndef PRODUCT - if ((PrintIntrinsics || PrintInlining || PrintOptoInlining) && Verbose) { + if ((C->print_intrinsics() || C->print_inlining()) && Verbose) { tty->print_cr("Attempting to inline sun.reflect.Reflection.getCallerClass"); } #endif if (!jvms()->has_method()) { #ifndef PRODUCT - if ((PrintIntrinsics || PrintInlining || PrintOptoInlining) && Verbose) { + if ((C->print_intrinsics() || C->print_inlining()) && Verbose) { tty->print_cr(" Bailing out because intrinsic was inlined at top level"); } #endif @@ -3983,7 +4175,7 @@ bool LibraryCallKit::inline_native_Reflection_getCallerClass() { // Frame 0 and 1 must be caller sensitive (see JVM_GetCallerClass). if (!m->caller_sensitive()) { #ifndef PRODUCT - if ((PrintIntrinsics || PrintInlining || PrintOptoInlining) && Verbose) { + if ((C->print_intrinsics() || C->print_inlining()) && Verbose) { tty->print_cr(" Bailing out: CallerSensitive annotation expected at frame %d", n); } #endif @@ -3999,7 +4191,7 @@ bool LibraryCallKit::inline_native_Reflection_getCallerClass() { set_result(makecon(TypeInstPtr::make(caller_mirror))); #ifndef PRODUCT - if ((PrintIntrinsics || PrintInlining || PrintOptoInlining) && Verbose) { + if ((C->print_intrinsics() || C->print_inlining()) && Verbose) { tty->print_cr(" Succeeded: caller = %d) %s.%s, JVMS depth = %d", n, caller_klass->name()->as_utf8(), caller_jvms->method()->name()->as_utf8(), jvms()->depth()); tty->print_cr(" JVM state at this point:"); for (int i = jvms()->depth(), n = 1; i >= 1; i--, n++) { @@ -4015,7 +4207,7 @@ bool LibraryCallKit::inline_native_Reflection_getCallerClass() { } #ifndef PRODUCT - if ((PrintIntrinsics || PrintInlining || PrintOptoInlining) && Verbose) { + if ((C->print_intrinsics() || C->print_inlining()) && Verbose) { tty->print_cr(" Bailing out because caller depth exceeded inlining depth = %d", jvms()->depth()); tty->print_cr(" JVM state at this point:"); for (int i = jvms()->depth(), n = 1; i >= 1; i--, n++) { @@ -4494,8 +4686,62 @@ bool LibraryCallKit::inline_arraycopy() { const Type* dest_type = dest->Value(&_gvn); const TypeAryPtr* top_src = src_type->isa_aryptr(); const TypeAryPtr* top_dest = dest_type->isa_aryptr(); - if (top_src == NULL || top_src->klass() == NULL || - top_dest == NULL || top_dest->klass() == NULL) { + + // Do we have the type of src? + bool has_src = (top_src != NULL && top_src->klass() != NULL); + // Do we have the type of dest? + bool has_dest = (top_dest != NULL && top_dest->klass() != NULL); + // Is the type for src from speculation? + bool src_spec = false; + // Is the type for dest from speculation? + bool dest_spec = false; + + if (!has_src || !has_dest) { + // We don't have sufficient type information, let's see if + // speculative types can help. We need to have types for both src + // and dest so that it pays off. + + // Do we already have or could we have type information for src + bool could_have_src = has_src; + // Do we already have or could we have type information for dest + bool could_have_dest = has_dest; + + ciKlass* src_k = NULL; + if (!has_src) { + src_k = src_type->speculative_type(); + if (src_k != NULL && src_k->is_array_klass()) { + could_have_src = true; + } + } + + ciKlass* dest_k = NULL; + if (!has_dest) { + dest_k = dest_type->speculative_type(); + if (dest_k != NULL && dest_k->is_array_klass()) { + could_have_dest = true; + } + } + + if (could_have_src && could_have_dest) { + // This is going to pay off so emit the required guards + if (!has_src) { + src = maybe_cast_profiled_obj(src, src_k); + src_type = _gvn.type(src); + top_src = src_type->isa_aryptr(); + has_src = (top_src != NULL && top_src->klass() != NULL); + src_spec = true; + } + if (!has_dest) { + dest = maybe_cast_profiled_obj(dest, dest_k); + dest_type = _gvn.type(dest); + top_dest = dest_type->isa_aryptr(); + has_dest = (top_dest != NULL && top_dest->klass() != NULL); + dest_spec = true; + } + } + } + + if (!has_src || !has_dest) { // Conservatively insert a memory barrier on all memory slices. // Do not let writes into the source float below the arraycopy. insert_mem_bar(Op_MemBarCPUOrder); @@ -4530,6 +4776,40 @@ bool LibraryCallKit::inline_arraycopy() { return true; } + if (src_elem == T_OBJECT) { + // If both arrays are object arrays then having the exact types + // for both will remove the need for a subtype check at runtime + // before the call and may make it possible to pick a faster copy + // routine (without a subtype check on every element) + // Do we have the exact type of src? + bool could_have_src = src_spec; + // Do we have the exact type of dest? + bool could_have_dest = dest_spec; + ciKlass* src_k = top_src->klass(); + ciKlass* dest_k = top_dest->klass(); + if (!src_spec) { + src_k = src_type->speculative_type(); + if (src_k != NULL && src_k->is_array_klass()) { + could_have_src = true; + } + } + if (!dest_spec) { + dest_k = dest_type->speculative_type(); + if (dest_k != NULL && dest_k->is_array_klass()) { + could_have_dest = true; + } + } + if (could_have_src && could_have_dest) { + // If we can have both exact types, emit the missing guards + if (could_have_src && !src_spec) { + src = maybe_cast_profiled_obj(src, src_k); + } + if (could_have_dest && !dest_spec) { + dest = maybe_cast_profiled_obj(dest, dest_k); + } + } + } + //--------------------------------------------------------------------------- // We will make a fast path for this call to arraycopy. diff --git a/hotspot/src/share/vm/opto/loopPredicate.cpp b/hotspot/src/share/vm/opto/loopPredicate.cpp index f29d9daab55..411226acffa 100644 --- a/hotspot/src/share/vm/opto/loopPredicate.cpp +++ b/hotspot/src/share/vm/opto/loopPredicate.cpp @@ -41,63 +41,6 @@ * checks (such as null checks). */ -//-------------------------------is_uncommon_trap_proj---------------------------- -// Return true if proj is the form of "proj->[region->..]call_uct" -bool PhaseIdealLoop::is_uncommon_trap_proj(ProjNode* proj, Deoptimization::DeoptReason reason) { - int path_limit = 10; - assert(proj, "invalid argument"); - Node* out = proj; - for (int ct = 0; ct < path_limit; ct++) { - out = out->unique_ctrl_out(); - if (out == NULL) - return false; - if (out->is_CallStaticJava()) { - int req = out->as_CallStaticJava()->uncommon_trap_request(); - if (req != 0) { - Deoptimization::DeoptReason trap_reason = Deoptimization::trap_request_reason(req); - if (trap_reason == reason || reason == Deoptimization::Reason_none) { - return true; - } - } - return false; // don't do further after call - } - if (out->Opcode() != Op_Region) - return false; - } - return false; -} - -//-------------------------------is_uncommon_trap_if_pattern------------------------- -// Return true for "if(test)-> proj -> ... -// | -// V -// other_proj->[region->..]call_uct" -// -// "must_reason_predicate" means the uct reason must be Reason_predicate -bool PhaseIdealLoop::is_uncommon_trap_if_pattern(ProjNode *proj, Deoptimization::DeoptReason reason) { - Node *in0 = proj->in(0); - if (!in0->is_If()) return false; - // Variation of a dead If node. - if (in0->outcnt() < 2) return false; - IfNode* iff = in0->as_If(); - - // we need "If(Conv2B(Opaque1(...)))" pattern for reason_predicate - if (reason != Deoptimization::Reason_none) { - if (iff->in(1)->Opcode() != Op_Conv2B || - iff->in(1)->in(1)->Opcode() != Op_Opaque1) { - return false; - } - } - - ProjNode* other_proj = iff->proj_out(1-proj->_con)->as_Proj(); - if (is_uncommon_trap_proj(other_proj, reason)) { - assert(reason == Deoptimization::Reason_none || - Compile::current()->is_predicate_opaq(iff->in(1)->in(1)), "should be on the list"); - return true; - } - return false; -} - //-------------------------------register_control------------------------- void PhaseIdealLoop::register_control(Node* n, IdealLoopTree *loop, Node* pred) { assert(n->is_CFG(), "must be control node"); @@ -147,7 +90,7 @@ void PhaseIdealLoop::register_control(Node* n, IdealLoopTree *loop, Node* pred) // This code is also used to clone predicates to clonned loops. ProjNode* PhaseIdealLoop::create_new_if_for_predicate(ProjNode* cont_proj, Node* new_entry, Deoptimization::DeoptReason reason) { - assert(is_uncommon_trap_if_pattern(cont_proj, reason), "must be a uct if pattern!"); + assert(cont_proj->is_uncommon_trap_if_pattern(reason), "must be a uct if pattern!"); IfNode* iff = cont_proj->in(0)->as_If(); ProjNode *uncommon_proj = iff->proj_out(1 - cont_proj->_con); @@ -235,7 +178,7 @@ ProjNode* PhaseIdealLoop::create_new_if_for_predicate(ProjNode* cont_proj, Node* ProjNode* PhaseIterGVN::create_new_if_for_predicate(ProjNode* cont_proj, Node* new_entry, Deoptimization::DeoptReason reason) { assert(new_entry != 0, "only used for clone predicate"); - assert(PhaseIdealLoop::is_uncommon_trap_if_pattern(cont_proj, reason), "must be a uct if pattern!"); + assert(cont_proj->is_uncommon_trap_if_pattern(reason), "must be a uct if pattern!"); IfNode* iff = cont_proj->in(0)->as_If(); ProjNode *uncommon_proj = iff->proj_out(1 - cont_proj->_con); @@ -422,7 +365,7 @@ Node* PhaseIdealLoop::skip_loop_predicates(Node* entry) { ProjNode* PhaseIdealLoop::find_predicate_insertion_point(Node* start_c, Deoptimization::DeoptReason reason) { if (start_c == NULL || !start_c->is_Proj()) return NULL; - if (is_uncommon_trap_if_pattern(start_c->as_Proj(), reason)) { + if (start_c->as_Proj()->is_uncommon_trap_if_pattern(reason)) { return start_c->as_Proj(); } return NULL; @@ -773,7 +716,7 @@ bool PhaseIdealLoop::loop_predication_impl(IdealLoopTree *loop) { ProjNode* proj = if_proj_list.pop()->as_Proj(); IfNode* iff = proj->in(0)->as_If(); - if (!is_uncommon_trap_if_pattern(proj, Deoptimization::Reason_none)) { + if (!proj->is_uncommon_trap_if_pattern(Deoptimization::Reason_none)) { if (loop->is_loop_exit(iff)) { // stop processing the remaining projs in the list because the execution of them // depends on the condition of "iff" (iff->in(1)). diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp index a30fc80df39..75f35b7d896 100644 --- a/hotspot/src/share/vm/opto/loopTransform.cpp +++ b/hotspot/src/share/vm/opto/loopTransform.cpp @@ -713,6 +713,10 @@ bool IdealLoopTree::policy_unroll( PhaseIdealLoop *phase ) const { case Op_ModL: body_size += 30; break; case Op_DivL: body_size += 30; break; case Op_MulL: body_size += 10; break; + case Op_FlagsProj: + // Can't handle unrolling of loops containing + // nodes that generate a FlagsProj at the moment + return false; case Op_StrComp: case Op_StrEquals: case Op_StrIndexOf: @@ -776,6 +780,9 @@ bool IdealLoopTree::policy_range_check( PhaseIdealLoop *phase ) const { continue; // not RC Node *cmp = bol->in(1); + if (cmp->is_FlagsProj()) { + continue; + } Node *rc_exp = cmp->in(1); Node *limit = cmp->in(2); @@ -1957,7 +1964,7 @@ void PhaseIdealLoop::do_range_check( IdealLoopTree *loop, Node_List &old_new ) { // Find loads off the surviving projection; remove their control edge for (DUIterator_Fast imax, i = dp->fast_outs(imax); i < imax; i++) { Node* cd = dp->fast_out(i); // Control-dependent node - if( cd->is_Load() ) { // Loads can now float around in the loop + if (cd->is_Load() && cd->depends_only_on_test()) { // Loads can now float around in the loop // Allow the load to float around in the loop, or before it // but NOT before the pre-loop. _igvn.replace_input_of(cd, 0, ctrl); // ctrl, not NULL diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp index ab05d186ba4..719a1fb34f1 100644 --- a/hotspot/src/share/vm/opto/loopnode.cpp +++ b/hotspot/src/share/vm/opto/loopnode.cpp @@ -167,7 +167,7 @@ Node *PhaseIdealLoop::get_early_ctrl_for_expensive(Node *n, Node* earliest) { // expensive nodes will notice the loop and skip over it to try to // move the node further up. if (ctl->is_CountedLoop() && ctl->in(1) != NULL && ctl->in(1)->in(0) != NULL && ctl->in(1)->in(0)->is_If()) { - if (!is_uncommon_trap_if_pattern(ctl->in(1)->as_Proj(), Deoptimization::Reason_none)) { + if (!ctl->in(1)->as_Proj()->is_uncommon_trap_if_pattern(Deoptimization::Reason_none)) { break; } next = idom(ctl->in(1)->in(0)); @@ -181,7 +181,7 @@ Node *PhaseIdealLoop::get_early_ctrl_for_expensive(Node *n, Node* earliest) { } else if (parent_ctl->is_CountedLoopEnd() && parent_ctl->as_CountedLoopEnd()->loopnode() != NULL) { next = parent_ctl->as_CountedLoopEnd()->loopnode()->init_control(); } else if (parent_ctl->is_If()) { - if (!is_uncommon_trap_if_pattern(ctl->as_Proj(), Deoptimization::Reason_none)) { + if (!ctl->as_Proj()->is_uncommon_trap_if_pattern(Deoptimization::Reason_none)) { break; } assert(idom(ctl) == parent_ctl, "strange"); diff --git a/hotspot/src/share/vm/opto/loopnode.hpp b/hotspot/src/share/vm/opto/loopnode.hpp index df3eb4c0520..6d4933893bb 100644 --- a/hotspot/src/share/vm/opto/loopnode.hpp +++ b/hotspot/src/share/vm/opto/loopnode.hpp @@ -876,13 +876,6 @@ public: // Return true if exp is a scaled induction var plus (or minus) constant bool is_scaled_iv_plus_offset(Node* exp, Node* iv, int* p_scale, Node** p_offset, int depth = 0); - // Return true if proj is for "proj->[region->..]call_uct" - static bool is_uncommon_trap_proj(ProjNode* proj, Deoptimization::DeoptReason reason); - // Return true for "if(test)-> proj -> ... - // | - // V - // other_proj->[region->..]call_uct" - static bool is_uncommon_trap_if_pattern(ProjNode* proj, Deoptimization::DeoptReason reason); // Create a new if above the uncommon_trap_if_pattern for the predicate to be promoted ProjNode* create_new_if_for_predicate(ProjNode* cont_proj, Node* new_entry, Deoptimization::DeoptReason reason); diff --git a/hotspot/src/share/vm/opto/loopopts.cpp b/hotspot/src/share/vm/opto/loopopts.cpp index 31b5d8a5b7b..6529d1919ab 100644 --- a/hotspot/src/share/vm/opto/loopopts.cpp +++ b/hotspot/src/share/vm/opto/loopopts.cpp @@ -238,7 +238,7 @@ void PhaseIdealLoop::dominated_by( Node *prevdom, Node *iff, bool flip, bool exc ProjNode* dp_proj = dp->as_Proj(); ProjNode* unc_proj = iff->as_If()->proj_out(1 - dp_proj->_con)->as_Proj(); if (exclude_loop_predicate && - is_uncommon_trap_proj(unc_proj, Deoptimization::Reason_predicate)) + unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate)) return; // Let IGVN transformation change control dependence. IdealLoopTree *old_loop = get_loop(dp); @@ -2355,7 +2355,8 @@ bool PhaseIdealLoop::partial_peel( IdealLoopTree *loop, Node_List &old_new ) { opc == Op_Catch || opc == Op_CatchProj || opc == Op_Jump || - opc == Op_JumpProj) { + opc == Op_JumpProj || + opc == Op_FlagsProj) { #if !defined(PRODUCT) if (TracePartialPeeling) { tty->print_cr("\nExit control too complex: lp: %d", head->_idx); diff --git a/hotspot/src/share/vm/opto/machnode.cpp b/hotspot/src/share/vm/opto/machnode.cpp index 0d6ddf9aeed..a9f00f8381c 100644 --- a/hotspot/src/share/vm/opto/machnode.cpp +++ b/hotspot/src/share/vm/opto/machnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -341,7 +341,7 @@ const class TypePtr *MachNode::adr_type() const { return TypePtr::BOTTOM; } // %%% make offset be intptr_t - assert(!Universe::heap()->is_in_reserved((oop)offset), "must be a raw ptr"); + assert(!Universe::heap()->is_in_reserved(cast_to_oop(offset)), "must be a raw ptr"); return TypeRawPtr::BOTTOM; } diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp index ae27f6ffa21..85474115f30 100644 --- a/hotspot/src/share/vm/opto/matcher.cpp +++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -1964,6 +1964,7 @@ void Matcher::find_shared( Node *n ) { case Op_Catch: case Op_CatchProj: case Op_CProj: + case Op_FlagsProj: case Op_JumpProj: case Op_JProj: case Op_NeverBranch: diff --git a/hotspot/src/share/vm/opto/matcher.hpp b/hotspot/src/share/vm/opto/matcher.hpp index 8435b0f997b..1131d09f1d5 100644 --- a/hotspot/src/share/vm/opto/matcher.hpp +++ b/hotspot/src/share/vm/opto/matcher.hpp @@ -337,6 +337,10 @@ public: // Register for MODL projection of divmodL static RegMask modL_proj_mask(); + static const RegMask mathExactI_result_proj_mask(); + static const RegMask mathExactL_result_proj_mask(); + static const RegMask mathExactI_flags_proj_mask(); + // Use hardware DIV instruction when it is faster than // a code which use multiply for division by constant. static bool use_asm_for_ldiv_by_con( jlong divisor ); diff --git a/hotspot/src/share/vm/opto/mathexactnode.cpp b/hotspot/src/share/vm/opto/mathexactnode.cpp new file mode 100644 index 00000000000..bb930b37d52 --- /dev/null +++ b/hotspot/src/share/vm/opto/mathexactnode.cpp @@ -0,0 +1,430 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "memory/allocation.inline.hpp" +#include "opto/addnode.hpp" +#include "opto/cfgnode.hpp" +#include "opto/machnode.hpp" +#include "opto/matcher.hpp" +#include "opto/mathexactnode.hpp" +#include "opto/subnode.hpp" + +MathExactNode::MathExactNode(Node* ctrl, Node* in1) : MultiNode(2) { + init_class_id(Class_MathExact); + init_req(0, ctrl); + init_req(1, in1); +} + +MathExactNode::MathExactNode(Node* ctrl, Node* in1, Node* in2) : MultiNode(3) { + init_class_id(Class_MathExact); + init_req(0, ctrl); + init_req(1, in1); + init_req(2, in2); +} + +BoolNode* MathExactNode::bool_node() const { + Node* flags = flags_node(); + BoolNode* boolnode = flags->unique_out()->as_Bool(); + assert(boolnode != NULL, "must have BoolNode"); + return boolnode; +} + +IfNode* MathExactNode::if_node() const { + BoolNode* boolnode = bool_node(); + IfNode* ifnode = boolnode->unique_out()->as_If(); + assert(ifnode != NULL, "must have IfNode"); + return ifnode; +} + +Node* MathExactNode::control_node() const { + IfNode* ifnode = if_node(); + return ifnode->in(0); +} + +Node* MathExactNode::non_throwing_branch() const { + IfNode* ifnode = if_node(); + if (bool_node()->_test._test == BoolTest::overflow) { + return ifnode->proj_out(0); + } + return ifnode->proj_out(1); +} + +// If the MathExactNode won't overflow we have to replace the +// FlagsProjNode and ProjNode that is generated by the MathExactNode +Node* MathExactNode::no_overflow(PhaseGVN* phase, Node* new_result) { + PhaseIterGVN* igvn = phase->is_IterGVN(); + if (igvn) { + ProjNode* result = result_node(); + ProjNode* flags = flags_node(); + + if (result != NULL) { + igvn->replace_node(result, new_result); + } + + if (flags != NULL) { + BoolNode* boolnode = bool_node(); + switch (boolnode->_test._test) { + case BoolTest::overflow: + // if the check is for overflow - never taken + igvn->replace_node(boolnode, phase->intcon(0)); + break; + case BoolTest::no_overflow: + // if the check is for no overflow - always taken + igvn->replace_node(boolnode, phase->intcon(1)); + break; + default: + fatal("Unexpected value of BoolTest"); + break; + } + flags->del_req(0); + } + } + return new_result; +} + +Node* MathExactINode::match(const ProjNode* proj, const Matcher* m) { + uint ideal_reg = proj->ideal_reg(); + RegMask rm; + if (proj->_con == result_proj_node) { + rm = m->mathExactI_result_proj_mask(); + } else { + assert(proj->_con == flags_proj_node, "must be result or flags"); + assert(ideal_reg == Op_RegFlags, "sanity"); + rm = m->mathExactI_flags_proj_mask(); + } + return new (m->C) MachProjNode(this, proj->_con, rm, ideal_reg); +} + +Node* MathExactLNode::match(const ProjNode* proj, const Matcher* m) { + uint ideal_reg = proj->ideal_reg(); + RegMask rm; + if (proj->_con == result_proj_node) { + rm = m->mathExactL_result_proj_mask(); + } else { + assert(proj->_con == flags_proj_node, "must be result or flags"); + assert(ideal_reg == Op_RegFlags, "sanity"); + rm = m->mathExactI_flags_proj_mask(); + } + return new (m->C) MachProjNode(this, proj->_con, rm, ideal_reg); +} + +Node* AddExactINode::Ideal(PhaseGVN* phase, bool can_reshape) { + Node* arg1 = in(1); + Node* arg2 = in(2); + + const Type* type1 = phase->type(arg1); + const Type* type2 = phase->type(arg2); + + if (type1 != Type::TOP && type1->singleton() && + type2 != Type::TOP && type2->singleton()) { + jint val1 = arg1->get_int(); + jint val2 = arg2->get_int(); + jint result = val1 + val2; + // Hacker's Delight 2-12 Overflow if both arguments have the opposite sign of the result + if ( (((val1 ^ result) & (val2 ^ result)) >= 0)) { + Node* con_result = ConINode::make(phase->C, result); + return no_overflow(phase, con_result); + } + return NULL; + } + + if (type1 == TypeInt::ZERO || type2 == TypeInt::ZERO) { // (Add 0 x) == x + Node* add_result = new (phase->C) AddINode(arg1, arg2); + return no_overflow(phase, add_result); + } + + if (type2->singleton()) { + return NULL; // no change - keep constant on the right + } + + if (type1->singleton()) { + // Make it x + Constant - move constant to the right + swap_edges(1, 2); + return this; + } + + if (arg2->is_Load()) { + return NULL; // no change - keep load on the right + } + + if (arg1->is_Load()) { + // Make it x + Load - move load to the right + swap_edges(1, 2); + return this; + } + + if (arg1->_idx > arg2->_idx) { + // Sort the edges + swap_edges(1, 2); + return this; + } + + return NULL; +} + +Node* AddExactLNode::Ideal(PhaseGVN* phase, bool can_reshape) { + Node* arg1 = in(1); + Node* arg2 = in(2); + + const Type* type1 = phase->type(arg1); + const Type* type2 = phase->type(arg2); + + if (type1 != Type::TOP && type1->singleton() && + type2 != Type::TOP && type2->singleton()) { + jlong val1 = arg1->get_long(); + jlong val2 = arg2->get_long(); + jlong result = val1 + val2; + // Hacker's Delight 2-12 Overflow if both arguments have the opposite sign of the result + if ( (((val1 ^ result) & (val2 ^ result)) >= 0)) { + Node* con_result = ConLNode::make(phase->C, result); + return no_overflow(phase, con_result); + } + return NULL; + } + + if (type1 == TypeLong::ZERO || type2 == TypeLong::ZERO) { // (Add 0 x) == x + Node* add_result = new (phase->C) AddLNode(arg1, arg2); + return no_overflow(phase, add_result); + } + + if (type2->singleton()) { + return NULL; // no change - keep constant on the right + } + + if (type1->singleton()) { + // Make it x + Constant - move constant to the right + swap_edges(1, 2); + return this; + } + + if (arg2->is_Load()) { + return NULL; // no change - keep load on the right + } + + if (arg1->is_Load()) { + // Make it x + Load - move load to the right + swap_edges(1, 2); + return this; + } + + if (arg1->_idx > arg2->_idx) { + // Sort the edges + swap_edges(1, 2); + return this; + } + + return NULL; +} + +Node* SubExactINode::Ideal(PhaseGVN* phase, bool can_reshape) { + Node* arg1 = in(1); + Node* arg2 = in(2); + + const Type* type1 = phase->type(arg1); + const Type* type2 = phase->type(arg2); + + if (type1 != Type::TOP && type1->singleton() && + type2 != Type::TOP && type2->singleton()) { + jint val1 = arg1->get_int(); + jint val2 = arg2->get_int(); + jint result = val1 - val2; + + // Hacker's Delight 2-12 Overflow iff the arguments have different signs and + // the sign of the result is different than the sign of arg1 + if (((val1 ^ val2) & (val1 ^ result)) >= 0) { + Node* con_result = ConINode::make(phase->C, result); + return no_overflow(phase, con_result); + } + return NULL; + } + + if (type1 == TypeInt::ZERO || type2 == TypeInt::ZERO) { + // Sub with zero is the same as add with zero + Node* add_result = new (phase->C) AddINode(arg1, arg2); + return no_overflow(phase, add_result); + } + + return NULL; +} + +Node* SubExactLNode::Ideal(PhaseGVN* phase, bool can_reshape) { + Node* arg1 = in(1); + Node* arg2 = in(2); + + const Type* type1 = phase->type(arg1); + const Type* type2 = phase->type(arg2); + + if (type1 != Type::TOP && type1->singleton() && + type2 != Type::TOP && type2->singleton()) { + jlong val1 = arg1->get_long(); + jlong val2 = arg2->get_long(); + jlong result = val1 - val2; + + // Hacker's Delight 2-12 Overflow iff the arguments have different signs and + // the sign of the result is different than the sign of arg1 + if (((val1 ^ val2) & (val1 ^ result)) >= 0) { + Node* con_result = ConLNode::make(phase->C, result); + return no_overflow(phase, con_result); + } + return NULL; + } + + if (type1 == TypeLong::ZERO || type2 == TypeLong::ZERO) { + // Sub with zero is the same as add with zero + Node* add_result = new (phase->C) AddLNode(arg1, arg2); + return no_overflow(phase, add_result); + } + + return NULL; +} + +Node* NegExactINode::Ideal(PhaseGVN* phase, bool can_reshape) { + Node *arg = in(1); + + const Type* type = phase->type(arg); + if (type != Type::TOP && type->singleton()) { + jint value = arg->get_int(); + if (value != min_jint) { + Node* neg_result = ConINode::make(phase->C, -value); + return no_overflow(phase, neg_result); + } + } + return NULL; +} + +Node* NegExactLNode::Ideal(PhaseGVN* phase, bool can_reshape) { + Node *arg = in(1); + + const Type* type = phase->type(arg); + if (type != Type::TOP && type->singleton()) { + jlong value = arg->get_long(); + if (value != min_jlong) { + Node* neg_result = ConLNode::make(phase->C, -value); + return no_overflow(phase, neg_result); + } + } + return NULL; +} + +Node* MulExactINode::Ideal(PhaseGVN* phase, bool can_reshape) { + Node* arg1 = in(1); + Node* arg2 = in(2); + + const Type* type1 = phase->type(arg1); + const Type* type2 = phase->type(arg2); + + if (type1 != Type::TOP && type1->singleton() && + type2 != Type::TOP && type2->singleton()) { + jint val1 = arg1->get_int(); + jint val2 = arg2->get_int(); + jlong result = (jlong) val1 * (jlong) val2; + if ((jint) result == result) { + // no overflow + Node* mul_result = ConINode::make(phase->C, result); + return no_overflow(phase, mul_result); + } + } + + if (type1 == TypeInt::ZERO || type2 == TypeInt::ZERO) { + return no_overflow(phase, ConINode::make(phase->C, 0)); + } + + if (type1 == TypeInt::ONE) { + Node* mul_result = new (phase->C) AddINode(arg2, phase->intcon(0)); + return no_overflow(phase, mul_result); + } + if (type2 == TypeInt::ONE) { + Node* mul_result = new (phase->C) AddINode(arg1, phase->intcon(0)); + return no_overflow(phase, mul_result); + } + + if (type1 == TypeInt::MINUS_1) { + return new (phase->C) NegExactINode(NULL, arg2); + } + + if (type2 == TypeInt::MINUS_1) { + return new (phase->C) NegExactINode(NULL, arg1); + } + + return NULL; +} + +Node* MulExactLNode::Ideal(PhaseGVN* phase, bool can_reshape) { + Node* arg1 = in(1); + Node* arg2 = in(2); + + const Type* type1 = phase->type(arg1); + const Type* type2 = phase->type(arg2); + + if (type1 != Type::TOP && type1->singleton() && + type2 != Type::TOP && type2->singleton()) { + jlong val1 = arg1->get_long(); + jlong val2 = arg2->get_long(); + + jlong result = val1 * val2; + jlong ax = (val1 < 0 ? -val1 : val1); + jlong ay = (val2 < 0 ? -val2 : val2); + + bool overflow = false; + if ((ax | ay) & CONST64(0xFFFFFFFF00000000)) { + // potential overflow if any bit in upper 32 bits are set + if ((val1 == min_jlong && val2 == -1) || (val2 == min_jlong && val1 == -1)) { + // -1 * Long.MIN_VALUE will overflow + overflow = true; + } else if (val2 != 0 && (result / val2 != val1)) { + overflow = true; + } + } + + if (!overflow) { + Node* mul_result = ConLNode::make(phase->C, result); + return no_overflow(phase, mul_result); + } + } + + if (type1 == TypeLong::ZERO || type2 == TypeLong::ZERO) { + return no_overflow(phase, ConLNode::make(phase->C, 0)); + } + + if (type1 == TypeLong::ONE) { + Node* mul_result = new (phase->C) AddLNode(arg2, phase->longcon(0)); + return no_overflow(phase, mul_result); + } + if (type2 == TypeLong::ONE) { + Node* mul_result = new (phase->C) AddLNode(arg1, phase->longcon(0)); + return no_overflow(phase, mul_result); + } + + if (type1 == TypeLong::MINUS_1) { + return new (phase->C) NegExactLNode(NULL, arg2); + } + + if (type2 == TypeLong::MINUS_1) { + return new (phase->C) NegExactLNode(NULL, arg1); + } + + return NULL; +} + diff --git a/hotspot/src/share/vm/opto/mathexactnode.hpp b/hotspot/src/share/vm/opto/mathexactnode.hpp new file mode 100644 index 00000000000..59983e10bcd --- /dev/null +++ b/hotspot/src/share/vm/opto/mathexactnode.hpp @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_OPTO_MATHEXACTNODE_HPP +#define SHARE_VM_OPTO_MATHEXACTNODE_HPP + +#include "opto/multnode.hpp" +#include "opto/node.hpp" +#include "opto/subnode.hpp" +#include "opto/type.hpp" + +class BoolNode; +class IfNode; +class Node; + +class PhaseGVN; +class PhaseTransform; + +class MathExactNode : public MultiNode { +public: + MathExactNode(Node* ctrl, Node* in1); + MathExactNode(Node* ctrl, Node* in1, Node* in2); + enum { + result_proj_node = 0, + flags_proj_node = 1 + }; + virtual int Opcode() const; + virtual Node* Identity(PhaseTransform* phase) { return this; } + virtual Node* Ideal(PhaseGVN* phase, bool can_reshape) { return NULL; } + virtual const Type* Value(PhaseTransform* phase) const { return bottom_type(); } + virtual uint hash() const { return Node::hash(); } + virtual bool is_CFG() const { return false; } + virtual uint ideal_reg() const { return NotAMachineReg; } + + ProjNode* result_node() const { return proj_out(result_proj_node); } + ProjNode* flags_node() const { return proj_out(flags_proj_node); } + Node* control_node() const; + Node* non_throwing_branch() const; +protected: + IfNode* if_node() const; + BoolNode* bool_node() const; + Node* no_overflow(PhaseGVN *phase, Node* new_result); +}; + +class MathExactINode : public MathExactNode { + public: + MathExactINode(Node* ctrl, Node* in1) : MathExactNode(ctrl, in1) {} + MathExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactNode(ctrl, in1, in2) {} + virtual int Opcode() const; + virtual Node* match(const ProjNode* proj, const Matcher* m); + virtual const Type* bottom_type() const { return TypeTuple::INT_CC_PAIR; } +}; + +class MathExactLNode : public MathExactNode { +public: + MathExactLNode(Node* ctrl, Node* in1) : MathExactNode(ctrl, in1) {} + MathExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactNode(ctrl, in1, in2) {} + virtual int Opcode() const; + virtual Node* match(const ProjNode* proj, const Matcher* m); + virtual const Type* bottom_type() const { return TypeTuple::LONG_CC_PAIR; } +}; + +class AddExactINode : public MathExactINode { +public: + AddExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactINode(ctrl, in1, in2) {} + virtual int Opcode() const; + virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); +}; + +class AddExactLNode : public MathExactLNode { +public: + AddExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactLNode(ctrl, in1, in2) {} + virtual int Opcode() const; + virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); +}; + +class SubExactINode : public MathExactINode { +public: + SubExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactINode(ctrl, in1, in2) {} + virtual int Opcode() const; + virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); +}; + +class SubExactLNode : public MathExactLNode { +public: + SubExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactLNode(ctrl, in1, in2) {} + virtual int Opcode() const; + virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); +}; + +class NegExactINode : public MathExactINode { +public: + NegExactINode(Node* ctrl, Node* in1) : MathExactINode(ctrl, in1) {} + virtual int Opcode() const; + virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); +}; + +class NegExactLNode : public MathExactLNode { +public: + NegExactLNode(Node* ctrl, Node* in1) : MathExactLNode(ctrl, in1) {} + virtual int Opcode() const; + virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); +}; + +class MulExactINode : public MathExactINode { +public: + MulExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactINode(ctrl, in1, in2) {} + virtual int Opcode() const; + virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); +}; + +class MulExactLNode : public MathExactLNode { +public: + MulExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactLNode(ctrl, in1, in2) {} + virtual int Opcode() const; + virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); +}; + +class FlagsProjNode : public ProjNode { +public: + FlagsProjNode(Node* src, uint con) : ProjNode(src, con) { + init_class_id(Class_FlagsProj); + } + + virtual int Opcode() const; + virtual bool is_CFG() const { return false; } + virtual const Type* bottom_type() const { return TypeInt::CC; } + virtual uint ideal_reg() const { return Op_RegFlags; } +}; + + +#endif + diff --git a/hotspot/src/share/vm/opto/memnode.hpp b/hotspot/src/share/vm/opto/memnode.hpp index 9a009908453..88a05ad134d 100644 --- a/hotspot/src/share/vm/opto/memnode.hpp +++ b/hotspot/src/share/vm/opto/memnode.hpp @@ -204,6 +204,17 @@ public: protected: const Type* load_array_final_field(const TypeKlassPtr *tkls, ciKlass* klass) const; + // depends_only_on_test is almost always true, and needs to be almost always + // true to enable key hoisting & commoning optimizations. However, for the + // special case of RawPtr loads from TLS top & end, and other loads performed by + // GC barriers, the control edge carries the dependence preventing hoisting past + // a Safepoint instead of the memory edge. (An unfortunate consequence of having + // Safepoints not set Raw Memory; itself an unfortunate consequence of having Nodes + // which produce results (new raw memory state) inside of loops preventing all + // manner of other optimizations). Basically, it's ugly but so is the alternative. + // See comment in macro.cpp, around line 125 expand_allocate_common(). + virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; } + }; //------------------------------LoadBNode-------------------------------------- @@ -370,16 +381,6 @@ public: virtual uint ideal_reg() const { return Op_RegP; } virtual int store_Opcode() const { return Op_StoreP; } virtual BasicType memory_type() const { return T_ADDRESS; } - // depends_only_on_test is almost always true, and needs to be almost always - // true to enable key hoisting & commoning optimizations. However, for the - // special case of RawPtr loads from TLS top & end, the control edge carries - // the dependence preventing hoisting past a Safepoint instead of the memory - // edge. (An unfortunate consequence of having Safepoints not set Raw - // Memory; itself an unfortunate consequence of having Nodes which produce - // results (new raw memory state) inside of loops preventing all manner of - // other optimizations). Basically, it's ugly but so is the alternative. - // See comment in macro.cpp, around line 125 expand_allocate_common(). - virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; } }; @@ -393,16 +394,6 @@ public: virtual uint ideal_reg() const { return Op_RegN; } virtual int store_Opcode() const { return Op_StoreN; } virtual BasicType memory_type() const { return T_NARROWOOP; } - // depends_only_on_test is almost always true, and needs to be almost always - // true to enable key hoisting & commoning optimizations. However, for the - // special case of RawPtr loads from TLS top & end, the control edge carries - // the dependence preventing hoisting past a Safepoint instead of the memory - // edge. (An unfortunate consequence of having Safepoints not set Raw - // Memory; itself an unfortunate consequence of having Nodes which produce - // results (new raw memory state) inside of loops preventing all manner of - // other optimizations). Basically, it's ugly but so is the alternative. - // See comment in macro.cpp, around line 125 expand_allocate_common(). - virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; } }; //------------------------------LoadKlassNode---------------------------------- diff --git a/hotspot/src/share/vm/opto/multnode.cpp b/hotspot/src/share/vm/opto/multnode.cpp index dca8dbe703c..bb3357abcf0 100644 --- a/hotspot/src/share/vm/opto/multnode.cpp +++ b/hotspot/src/share/vm/opto/multnode.cpp @@ -24,7 +24,9 @@ #include "precompiled.hpp" #include "opto/callnode.hpp" +#include "opto/cfgnode.hpp" #include "opto/matcher.hpp" +#include "opto/mathexactnode.hpp" #include "opto/multnode.hpp" #include "opto/opcodes.hpp" #include "opto/phaseX.hpp" @@ -46,15 +48,21 @@ ProjNode* MultiNode::proj_out(uint which_proj) const { assert(Opcode() != Op_If || outcnt() == 2, "bad if #1"); for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) { Node *p = fast_out(i); - if( !p->is_Proj() ) { + if (p->is_Proj()) { + ProjNode *proj = p->as_Proj(); + if (proj->_con == which_proj) { + assert(Opcode() != Op_If || proj->Opcode() == (which_proj?Op_IfTrue:Op_IfFalse), "bad if #2"); + return proj; + } + } else if (p->is_FlagsProj()) { + FlagsProjNode *proj = p->as_FlagsProj(); + if (proj->_con == which_proj) { + return proj; + } + } else { assert(p == this && this->is_Start(), "else must be proj"); continue; } - ProjNode *proj = p->as_Proj(); - if( proj->_con == which_proj ) { - assert(Opcode() != Op_If || proj->Opcode() == (which_proj?Op_IfTrue:Op_IfFalse), "bad if #2"); - return proj; - } } return NULL; } @@ -143,3 +151,59 @@ const RegMask &ProjNode::out_RegMask() const { uint ProjNode::ideal_reg() const { return bottom_type()->ideal_reg(); } + +//-------------------------------is_uncommon_trap_proj---------------------------- +// Return true if proj is the form of "proj->[region->..]call_uct" +bool ProjNode::is_uncommon_trap_proj(Deoptimization::DeoptReason reason) { + int path_limit = 10; + Node* out = this; + for (int ct = 0; ct < path_limit; ct++) { + out = out->unique_ctrl_out(); + if (out == NULL) + return false; + if (out->is_CallStaticJava()) { + int req = out->as_CallStaticJava()->uncommon_trap_request(); + if (req != 0) { + Deoptimization::DeoptReason trap_reason = Deoptimization::trap_request_reason(req); + if (trap_reason == reason || reason == Deoptimization::Reason_none) { + return true; + } + } + return false; // don't do further after call + } + if (out->Opcode() != Op_Region) + return false; + } + return false; +} + +//-------------------------------is_uncommon_trap_if_pattern------------------------- +// Return true for "if(test)-> proj -> ... +// | +// V +// other_proj->[region->..]call_uct" +// +// "must_reason_predicate" means the uct reason must be Reason_predicate +bool ProjNode::is_uncommon_trap_if_pattern(Deoptimization::DeoptReason reason) { + Node *in0 = in(0); + if (!in0->is_If()) return false; + // Variation of a dead If node. + if (in0->outcnt() < 2) return false; + IfNode* iff = in0->as_If(); + + // we need "If(Conv2B(Opaque1(...)))" pattern for reason_predicate + if (reason != Deoptimization::Reason_none) { + if (iff->in(1)->Opcode() != Op_Conv2B || + iff->in(1)->in(1)->Opcode() != Op_Opaque1) { + return false; + } + } + + ProjNode* other_proj = iff->proj_out(1-_con)->as_Proj(); + if (other_proj->is_uncommon_trap_proj(reason)) { + assert(reason == Deoptimization::Reason_none || + Compile::current()->is_predicate_opaq(iff->in(1)->in(1)), "should be on the list"); + return true; + } + return false; +} diff --git a/hotspot/src/share/vm/opto/multnode.hpp b/hotspot/src/share/vm/opto/multnode.hpp index 242e58f4850..e3866c8b9a1 100644 --- a/hotspot/src/share/vm/opto/multnode.hpp +++ b/hotspot/src/share/vm/opto/multnode.hpp @@ -88,6 +88,14 @@ public: #ifndef PRODUCT virtual void dump_spec(outputStream *st) const; #endif + + // Return true if proj is for "proj->[region->..]call_uct" + bool is_uncommon_trap_proj(Deoptimization::DeoptReason reason); + // Return true for "if(test)-> proj -> ... + // | + // V + // other_proj->[region->..]call_uct" + bool is_uncommon_trap_if_pattern(Deoptimization::DeoptReason reason); }; #endif // SHARE_VM_OPTO_MULTNODE_HPP diff --git a/hotspot/src/share/vm/opto/node.hpp b/hotspot/src/share/vm/opto/node.hpp index 1c695f5660b..924db1b37f9 100644 --- a/hotspot/src/share/vm/opto/node.hpp +++ b/hotspot/src/share/vm/opto/node.hpp @@ -69,6 +69,7 @@ class EncodePNode; class EncodePKlassNode; class FastLockNode; class FastUnlockNode; +class FlagsProjNode; class IfNode; class IfFalseNode; class IfTrueNode; @@ -99,6 +100,7 @@ class MachSafePointNode; class MachSpillCopyNode; class MachTempNode; class Matcher; +class MathExactNode; class MemBarNode; class MemBarStoreStoreNode; class MemNode; @@ -567,6 +569,7 @@ public: DEFINE_CLASS_ID(MemBar, Multi, 3) DEFINE_CLASS_ID(Initialize, MemBar, 0) DEFINE_CLASS_ID(MemBarStoreStore, MemBar, 1) + DEFINE_CLASS_ID(MathExact, Multi, 4) DEFINE_CLASS_ID(Mach, Node, 1) DEFINE_CLASS_ID(MachReturn, Mach, 0) @@ -623,6 +626,7 @@ public: DEFINE_CLASS_ID(Cmp, Sub, 0) DEFINE_CLASS_ID(FastLock, Cmp, 0) DEFINE_CLASS_ID(FastUnlock, Cmp, 1) + DEFINE_CLASS_ID(FlagsProj, Cmp, 2) DEFINE_CLASS_ID(MergeMem, Node, 7) DEFINE_CLASS_ID(Bool, Node, 8) @@ -726,6 +730,7 @@ public: DEFINE_CLASS_QUERY(EncodePKlass) DEFINE_CLASS_QUERY(FastLock) DEFINE_CLASS_QUERY(FastUnlock) + DEFINE_CLASS_QUERY(FlagsProj) DEFINE_CLASS_QUERY(If) DEFINE_CLASS_QUERY(IfFalse) DEFINE_CLASS_QUERY(IfTrue) @@ -754,6 +759,7 @@ public: DEFINE_CLASS_QUERY(MachSafePoint) DEFINE_CLASS_QUERY(MachSpillCopy) DEFINE_CLASS_QUERY(MachTemp) + DEFINE_CLASS_QUERY(MathExact) DEFINE_CLASS_QUERY(Mem) DEFINE_CLASS_QUERY(MemBar) DEFINE_CLASS_QUERY(MemBarStoreStore) diff --git a/hotspot/src/share/vm/opto/parse.hpp b/hotspot/src/share/vm/opto/parse.hpp index ea01b08475e..f60e6a540ea 100644 --- a/hotspot/src/share/vm/opto/parse.hpp +++ b/hotspot/src/share/vm/opto/parse.hpp @@ -73,6 +73,7 @@ protected: bool try_to_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, + JVMState* jvms, ciCallProfile& profile, WarmCallInfo* wci_result, bool& should_delay); @@ -83,6 +84,7 @@ protected: WarmCallInfo* wci_result); bool should_not_inline(ciMethod* callee_method, ciMethod* caller_method, + JVMState* jvms, WarmCallInfo* wci_result); void print_inlining(ciMethod* callee_method, int caller_bci, bool success) const; @@ -347,13 +349,15 @@ class Parse : public GraphKit { int _est_switch_depth; // Debugging SwitchRanges. #endif + // parser for the caller of the method of this object + Parse* const _parent; + public: // Constructor - Parse(JVMState* caller, ciMethod* parse_method, float expected_uses); + Parse(JVMState* caller, ciMethod* parse_method, float expected_uses, Parse* parent); virtual Parse* is_Parse() const { return (Parse*)this; } - public: // Accessors. JVMState* caller() const { return _caller; } float expected_uses() const { return _expected_uses; } @@ -405,6 +409,8 @@ class Parse : public GraphKit { return block()->successor_for_bci(bci); } + Parse* parent_parser() const { return _parent; } + private: // Create a JVMS & map for the initial state of this method. SafePointNode* create_entry_map(); @@ -601,6 +607,9 @@ class Parse : public GraphKit { // Assumes that there is no applicable local handler. void throw_to_exit(SafePointNode* ex_map); + // Use speculative type to optimize CmpP node + Node* optimize_cmp_with_klass(Node* c); + public: #ifndef PRODUCT // Handle PrintOpto, etc. diff --git a/hotspot/src/share/vm/opto/parse1.cpp b/hotspot/src/share/vm/opto/parse1.cpp index 10d98b92f08..808f64d2d9a 100644 --- a/hotspot/src/share/vm/opto/parse1.cpp +++ b/hotspot/src/share/vm/opto/parse1.cpp @@ -381,8 +381,8 @@ void Parse::load_interpreter_state(Node* osr_buf) { //------------------------------Parse------------------------------------------ // Main parser constructor. -Parse::Parse(JVMState* caller, ciMethod* parse_method, float expected_uses) - : _exits(caller) +Parse::Parse(JVMState* caller, ciMethod* parse_method, float expected_uses, Parse* parent) + : _exits(caller), _parent(parent) { // Init some variables _caller = caller; @@ -1102,6 +1102,10 @@ void Parse::do_method_entry() { _synch_lock = shared_lock(lock_obj); } + // Feed profiling data for parameters to the type system so it can + // propagate it as speculative types + record_profiled_parameters_for_speculation(); + if (depth() == 1) { increment_and_test_invocation_counter(Tier2CompileThreshold); } diff --git a/hotspot/src/share/vm/opto/parse2.cpp b/hotspot/src/share/vm/opto/parse2.cpp index c41ca257e62..74119ef9f51 100644 --- a/hotspot/src/share/vm/opto/parse2.cpp +++ b/hotspot/src/share/vm/opto/parse2.cpp @@ -268,7 +268,7 @@ public: return adjoinRange(value, value, dest, table_index); } - void print(ciEnv* env) { + void print() { if (is_singleton()) tty->print(" {%d}=>%d", lo(), dest()); else if (lo() == min_jint) @@ -471,8 +471,8 @@ bool Parse::create_jump_tables(Node* key_val, SwitchRange* lo, SwitchRange* hi) // These are the switch destinations hanging off the jumpnode int i = 0; for (SwitchRange* r = lo; r <= hi; r++) { - for (int j = r->lo(); j <= r->hi(); j++, i++) { - Node* input = _gvn.transform(new (C) JumpProjNode(jtn, i, r->dest(), j - lowval)); + for (int64 j = r->lo(); j <= r->hi(); j++, i++) { + Node* input = _gvn.transform(new (C) JumpProjNode(jtn, i, r->dest(), (int)(j - lowval))); { PreserveJVMState pjvms(this); set_control(input); @@ -632,7 +632,7 @@ void Parse::jump_switch_ranges(Node* key_val, SwitchRange *lo, SwitchRange *hi, } tty->print(" "); for( r = lo; r <= hi; r++ ) { - r->print(env()); + r->print(); } tty->print_cr(""); } @@ -1366,6 +1366,56 @@ void Parse::sharpen_type_after_if(BoolTest::mask btest, } } +/** + * Use speculative type to optimize CmpP node: if comparison is + * against the low level class, cast the object to the speculative + * type if any. CmpP should then go away. + * + * @param c expected CmpP node + * @return result of CmpP on object casted to speculative type + * + */ +Node* Parse::optimize_cmp_with_klass(Node* c) { + // If this is transformed by the _gvn to a comparison with the low + // level klass then we may be able to use speculation + if (c->Opcode() == Op_CmpP && + (c->in(1)->Opcode() == Op_LoadKlass || c->in(1)->Opcode() == Op_DecodeNKlass) && + c->in(2)->is_Con()) { + Node* load_klass = NULL; + Node* decode = NULL; + if (c->in(1)->Opcode() == Op_DecodeNKlass) { + decode = c->in(1); + load_klass = c->in(1)->in(1); + } else { + load_klass = c->in(1); + } + if (load_klass->in(2)->is_AddP()) { + Node* addp = load_klass->in(2); + Node* obj = addp->in(AddPNode::Address); + const TypeOopPtr* obj_type = _gvn.type(obj)->is_oopptr(); + if (obj_type->speculative_type() != NULL) { + ciKlass* k = obj_type->speculative_type(); + inc_sp(2); + obj = maybe_cast_profiled_obj(obj, k); + dec_sp(2); + // Make the CmpP use the casted obj + addp = basic_plus_adr(obj, addp->in(AddPNode::Offset)); + load_klass = load_klass->clone(); + load_klass->set_req(2, addp); + load_klass = _gvn.transform(load_klass); + if (decode != NULL) { + decode = decode->clone(); + decode->set_req(1, load_klass); + load_klass = _gvn.transform(decode); + } + c = c->clone(); + c->set_req(1, load_klass); + c = _gvn.transform(c); + } + } + } + return c; +} //------------------------------do_one_bytecode-------------------------------- // Parse this bytecode, and alter the Parsers JVM->Node mapping @@ -2239,6 +2289,7 @@ void Parse::do_one_bytecode() { a = pop(); b = pop(); c = _gvn.transform( new (C) CmpPNode(b, a) ); + c = optimize_cmp_with_klass(c); do_if(btest, c); break; diff --git a/hotspot/src/share/vm/opto/parseHelper.cpp b/hotspot/src/share/vm/opto/parseHelper.cpp index 5d0c2f7befe..43d58e79546 100644 --- a/hotspot/src/share/vm/opto/parseHelper.cpp +++ b/hotspot/src/share/vm/opto/parseHelper.cpp @@ -128,7 +128,7 @@ void Parse::do_instanceof() { } // Push the bool result back on stack - Node* res = gen_instanceof(peek(), makecon(TypeKlassPtr::make(klass))); + Node* res = gen_instanceof(peek(), makecon(TypeKlassPtr::make(klass)), true); // Pop from stack AFTER gen_instanceof because it can uncommon trap. pop(); @@ -343,10 +343,14 @@ void Parse::increment_and_test_invocation_counter(int limit) { // Get the Method* node. ciMethod* m = method(); - address counters_adr = m->ensure_method_counters(); + MethodCounters* counters_adr = m->ensure_method_counters(); + if (counters_adr == NULL) { + C->record_failure("method counters allocation failed"); + return; + } Node* ctrl = control(); - const TypePtr* adr_type = TypeRawPtr::make(counters_adr); + const TypePtr* adr_type = TypeRawPtr::make((address) counters_adr); Node *counters_node = makecon(adr_type); Node* adr_iic_node = basic_plus_adr(counters_node, counters_node, MethodCounters::interpreter_invocation_counter_offset_in_bytes()); diff --git a/hotspot/src/share/vm/opto/phaseX.cpp b/hotspot/src/share/vm/opto/phaseX.cpp index 71c8d8afcd8..15b9b778883 100644 --- a/hotspot/src/share/vm/opto/phaseX.cpp +++ b/hotspot/src/share/vm/opto/phaseX.cpp @@ -1385,6 +1385,20 @@ void PhaseIterGVN::add_users_to_worklist( Node *n ) { } } +/** + * Remove the speculative part of all types that we know of + */ +void PhaseIterGVN::remove_speculative_types() { + assert(UseTypeSpeculation, "speculation is off"); + for (uint i = 0; i < _types.Size(); i++) { + const Type* t = _types.fast_lookup(i); + if (t != NULL && t->isa_oopptr()) { + const TypeOopPtr* to = t->is_oopptr(); + _types.map(i, to->remove_speculative()); + } + } +} + //============================================================================= #ifndef PRODUCT uint PhaseCCP::_total_invokes = 0; diff --git a/hotspot/src/share/vm/opto/phaseX.hpp b/hotspot/src/share/vm/opto/phaseX.hpp index 60b1f82fa78..7f39e538154 100644 --- a/hotspot/src/share/vm/opto/phaseX.hpp +++ b/hotspot/src/share/vm/opto/phaseX.hpp @@ -500,6 +500,8 @@ public: ProjNode* create_new_if_for_predicate(ProjNode* cont_proj, Node* new_entry, Deoptimization::DeoptReason reason); + void remove_speculative_types(); + #ifndef PRODUCT protected: // Sub-quadratic implementation of VerifyIterativeGVN. diff --git a/hotspot/src/share/vm/opto/postaloc.cpp b/hotspot/src/share/vm/opto/postaloc.cpp index 76de2ed16a1..2ad809d1a58 100644 --- a/hotspot/src/share/vm/opto/postaloc.cpp +++ b/hotspot/src/share/vm/opto/postaloc.cpp @@ -97,7 +97,8 @@ int PhaseChaitin::yank( Node *old, Block *current_block, Node_List *value, Node_ static bool expected_yanked_node(Node *old, Node *orig_old) { // This code is expected only next original nodes: // - load from constant table node which may have next data input nodes: - // MachConstantBase, Phi, MachTemp, MachSpillCopy + // MachConstantBase, MachTemp, MachSpillCopy + // - Phi nodes that are considered Junk // - load constant node which may have next data input nodes: // MachTemp, MachSpillCopy // - MachSpillCopy @@ -112,7 +113,9 @@ static bool expected_yanked_node(Node *old, Node *orig_old) { return (old == orig_old); } else if (old->is_MachTemp()) { return orig_old->is_Con(); - } else if (old->is_Phi() || old->is_MachConstantBase()) { + } else if (old->is_Phi()) { // Junk phi's + return true; + } else if (old->is_MachConstantBase()) { return (orig_old->is_Con() && orig_old->is_MachConstant()); } return false; @@ -522,11 +525,9 @@ void PhaseChaitin::post_allocate_copy_removal() { u = u ? NodeSentinel : x; // Capture unique input, or NodeSentinel for 2nd input } if (u != NodeSentinel) { // Junk Phi. Remove - block->remove_node(j--); - phi_dex--; - _cfg.unmap_node_from_block(phi); phi->replace_by(u); - phi->disconnect_inputs(NULL, C); + j -= yank_if_dead(phi, block, &value, ®nd); + phi_dex--; continue; } // Note that if value[pidx] exists, then we merged no new values here diff --git a/hotspot/src/share/vm/opto/reg_split.cpp b/hotspot/src/share/vm/opto/reg_split.cpp index 2c4ad874ffe..842048f46f5 100644 --- a/hotspot/src/share/vm/opto/reg_split.cpp +++ b/hotspot/src/share/vm/opto/reg_split.cpp @@ -51,15 +51,6 @@ static const char out_of_nodes[] = "out of nodes during split"; -static bool contains_no_live_range_input(const Node* def) { - for (uint i = 1; i < def->req(); ++i) { - if (def->in(i) != NULL && def->in_RegMask(i).is_NotEmpty()) { - return false; - } - } - return true; -} - //------------------------------get_spillcopy_wide----------------------------- // Get a SpillCopy node with wide-enough masks. Use the 'wide-mask', the // wide ideal-register spill-mask if possible. If the 'wide-mask' does @@ -326,12 +317,11 @@ Node *PhaseChaitin::split_Rematerialize( Node *def, Block *b, uint insidx, uint if( def->req() > 1 ) { for( uint i = 1; i < def->req(); i++ ) { Node *in = def->in(i); - // Check for single-def (LRG cannot redefined) uint lidx = _lrg_map.live_range_id(in); - if (lidx >= _lrg_map.max_lrg_id()) { - continue; // Value is a recent spill-copy - } - if (lrgs(lidx).is_singledef()) { + // We do not need this for live ranges that are only defined once. + // However, this is not true for spill copies that are added in this + // Split() pass, since they might get coalesced later on in this pass. + if (lidx < _lrg_map.max_lrg_id() && lrgs(lidx).is_singledef()) { continue; } @@ -485,7 +475,6 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) { uint bidx, pidx, slidx, insidx, inpidx, twoidx; uint non_phi = 1, spill_cnt = 0; - Node **Reachblock; Node *n1, *n2, *n3; Node_List *defs,*phis; bool *UPblock; @@ -568,7 +557,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) { b = _cfg.get_block(bidx); // Reaches & UP arrays for this block - Reachblock = Reaches[b->_pre_order]; + Node** Reachblock = Reaches[b->_pre_order]; UPblock = UP[b->_pre_order]; // Reset counter of start of non-Phi nodes in block non_phi = 1; @@ -1324,9 +1313,10 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) { pidx = pred->_pre_order; // Grab reaching def Node *def = Reaches[pidx][slidx]; + Node** Reachblock = Reaches[pidx]; assert( def, "must have reaching def" ); // If input up/down sense and reg-pressure DISagree - if (def->rematerialize() && contains_no_live_range_input(def)) { + if (def->rematerialize()) { // Place the rematerialized node above any MSCs created during // phi node splitting. end_idx points at the insertion point // so look at the node before it. diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index 9a278c5ac1c..6e09cb7dff9 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -138,9 +138,10 @@ static bool check_compiled_frame(JavaThread* thread) { #define gen(env, var, type_func_gen, c_func, fancy_jump, pass_tls, save_arg_regs, return_pc) \ - var = generate_stub(env, type_func_gen, CAST_FROM_FN_PTR(address, c_func), #var, fancy_jump, pass_tls, save_arg_regs, return_pc) + var = generate_stub(env, type_func_gen, CAST_FROM_FN_PTR(address, c_func), #var, fancy_jump, pass_tls, save_arg_regs, return_pc); \ + if (var == NULL) { return false; } -void OptoRuntime::generate(ciEnv* env) { +bool OptoRuntime::generate(ciEnv* env) { generate_exception_blob(); @@ -158,7 +159,7 @@ void OptoRuntime::generate(ciEnv* env) { gen(env, _multianewarrayN_Java , multianewarrayN_Type , multianewarrayN_C , 0 , true , false, false); gen(env, _g1_wb_pre_Java , g1_wb_pre_Type , SharedRuntime::g1_wb_pre , 0 , false, false, false); gen(env, _g1_wb_post_Java , g1_wb_post_Type , SharedRuntime::g1_wb_post , 0 , false, false, false); - gen(env, _complete_monitor_locking_Java , complete_monitor_enter_Type , SharedRuntime::complete_monitor_locking_C , 0 , false, false, false); + gen(env, _complete_monitor_locking_Java , complete_monitor_enter_Type , SharedRuntime::complete_monitor_locking_C, 0, false, false, false); gen(env, _rethrow_Java , rethrow_Type , rethrow_C , 2 , true , false, true ); gen(env, _slow_arraycopy_Java , slow_arraycopy_Type , SharedRuntime::slow_arraycopy_C , 0 , false, false, false); @@ -168,7 +169,7 @@ void OptoRuntime::generate(ciEnv* env) { gen(env, _zap_dead_Java_locals_Java , zap_dead_locals_Type , zap_dead_Java_locals_C , 0 , false, true , false ); gen(env, _zap_dead_native_locals_Java , zap_dead_locals_Type , zap_dead_native_locals_C , 0 , false, true , false ); # endif - + return true; } #undef gen @@ -976,30 +977,36 @@ JRT_ENTRY_NO_ASYNC(address, OptoRuntime::handle_exception_C_helper(JavaThread* t address handler_address = NULL; Handle exception(thread, thread->exception_oop()); + address pc = thread->exception_pc(); + + // Clear out the exception oop and pc since looking up an + // exception handler can cause class loading, which might throw an + // exception and those fields are expected to be clear during + // normal bytecode execution. + thread->clear_exception_oop_and_pc(); if (TraceExceptions) { - trace_exception(exception(), thread->exception_pc(), ""); + trace_exception(exception(), pc, ""); } + // for AbortVMOnException flag NOT_PRODUCT(Exceptions::debug_check_abort(exception)); - #ifdef ASSERT - if (!(exception->is_a(SystemDictionary::Throwable_klass()))) { - // should throw an exception here - ShouldNotReachHere(); - } - #endif - +#ifdef ASSERT + if (!(exception->is_a(SystemDictionary::Throwable_klass()))) { + // should throw an exception here + ShouldNotReachHere(); + } +#endif // new exception handling: this method is entered only from adapters // exceptions from compiled java methods are handled in compiled code // using rethrow node - address pc = thread->exception_pc(); nm = CodeCache::find_nmethod(pc); assert(nm != NULL, "No NMethod found"); if (nm->is_native_method()) { - fatal("Native mathod should not have path to exception handling"); + fatal("Native method should not have path to exception handling"); } else { // we are switching to old paradigm: search for exception handler in caller_frame // instead in exception handler of caller_frame.sender() @@ -1346,7 +1353,8 @@ static void trace_exception(oop exception_oop, address exception_pc, const char* tty->print(" in "); CodeBlob* blob = CodeCache::find_blob(exception_pc); if (blob->is_nmethod()) { - ((nmethod*)blob)->method()->print_value(); + nmethod* nm = blob->as_nmethod_or_null(); + nm->method()->print_value(); } else if (blob->is_runtime_stub()) { tty->print(""); } else { diff --git a/hotspot/src/share/vm/opto/runtime.hpp b/hotspot/src/share/vm/opto/runtime.hpp index b3f7ff4cb1a..aecb97f6572 100644 --- a/hotspot/src/share/vm/opto/runtime.hpp +++ b/hotspot/src/share/vm/opto/runtime.hpp @@ -203,8 +203,10 @@ private: static bool is_callee_saved_register(MachRegisterNumbers reg); - // One time only generate runtime code stubs - static void generate(ciEnv* env); + // One time only generate runtime code stubs. Returns true + // when runtime stubs have been generated successfully and + // false otherwise. + static bool generate(ciEnv* env); // Returns the name of a stub static const char* stub_name(address entry); diff --git a/hotspot/src/share/vm/opto/stringopts.cpp b/hotspot/src/share/vm/opto/stringopts.cpp index 71abc31bae9..0306bc24a23 100644 --- a/hotspot/src/share/vm/opto/stringopts.cpp +++ b/hotspot/src/share/vm/opto/stringopts.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,10 +50,11 @@ class StringConcat : public ResourceObj { Node* _arguments; // The list of arguments to be concatenated GrowableArray _mode; // into a String along with a mode flag // indicating how to treat the value. - + Node_List _constructors; // List of constructors (many in case of stacked concat) Node_List _control; // List of control nodes that will be deleted Node_List _uncommon_traps; // Uncommon traps that needs to be rewritten // to restart at the initial JVMState. + public: // Mode for converting arguments to Strings enum { @@ -73,6 +74,7 @@ class StringConcat : public ResourceObj { _arguments->del_req(0); } + bool validate_mem_flow(); bool validate_control_flow(); void merge_add() { @@ -189,6 +191,10 @@ class StringConcat : public ResourceObj { assert(!_control.contains(ctrl), "only push once"); _control.push(ctrl); } + void add_constructor(Node* init) { + assert(!_constructors.contains(init), "only push once"); + _constructors.push(init); + } CallStaticJavaNode* end() { return _end; } AllocateNode* begin() { return _begin; } Node* string_alloc() { return _string_alloc; } @@ -301,6 +307,12 @@ StringConcat* StringConcat::merge(StringConcat* other, Node* arg) { } } result->set_allocation(other->_begin); + for (uint i = 0; i < _constructors.size(); i++) { + result->add_constructor(_constructors.at(i)); + } + for (uint i = 0; i < other->_constructors.size(); i++) { + result->add_constructor(other->_constructors.at(i)); + } result->_multiple = true; return result; } @@ -510,7 +522,8 @@ StringConcat* PhaseStringOpts::build_candidate(CallStaticJavaNode* call) { sc->add_control(constructor); sc->add_control(alloc); sc->set_allocation(alloc); - if (sc->validate_control_flow()) { + sc->add_constructor(constructor); + if (sc->validate_control_flow() && sc->validate_mem_flow()) { return sc; } else { return NULL; @@ -620,7 +633,7 @@ PhaseStringOpts::PhaseStringOpts(PhaseGVN* gvn, Unique_Node_List*): #endif StringConcat* merged = sc->merge(other, arg); - if (merged->validate_control_flow()) { + if (merged->validate_control_flow() && merged->validate_mem_flow()) { #ifndef PRODUCT if (PrintOptimizeStringConcat) { tty->print_cr("stacking would succeed"); @@ -708,6 +721,139 @@ void PhaseStringOpts::remove_dead_nodes() { } +bool StringConcat::validate_mem_flow() { + Compile* C = _stringopts->C; + + for (uint i = 0; i < _control.size(); i++) { +#ifndef PRODUCT + Node_List path; +#endif + Node* curr = _control.at(i); + if (curr->is_Call() && curr != _begin) { // For all calls except the first allocation + // Now here's the main invariant in our case: + // For memory between the constructor, and appends, and toString we should only see bottom memory, + // produced by the previous call we know about. + if (!_constructors.contains(curr)) { + NOT_PRODUCT(path.push(curr);) + Node* mem = curr->in(TypeFunc::Memory); + assert(mem != NULL, "calls should have memory edge"); + assert(!mem->is_Phi(), "should be handled by control flow validation"); + NOT_PRODUCT(path.push(mem);) + while (mem->is_MergeMem()) { + for (uint i = 1; i < mem->req(); i++) { + if (i != Compile::AliasIdxBot && mem->in(i) != C->top()) { +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print("fusion has incorrect memory flow (side effects) for "); + _begin->jvms()->dump_spec(tty); tty->cr(); + path.dump(); + } +#endif + return false; + } + } + // skip through a potential MergeMem chain, linked through Bot + mem = mem->in(Compile::AliasIdxBot); + NOT_PRODUCT(path.push(mem);) + } + // now let it fall through, and see if we have a projection + if (mem->is_Proj()) { + // Should point to a previous known call + Node *prev = mem->in(0); + NOT_PRODUCT(path.push(prev);) + if (!prev->is_Call() || !_control.contains(prev)) { +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print("fusion has incorrect memory flow (unknown call) for "); + _begin->jvms()->dump_spec(tty); tty->cr(); + path.dump(); + } +#endif + return false; + } + } else { + assert(mem->is_Store() || mem->is_LoadStore(), err_msg_res("unexpected node type: %s", mem->Name())); +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print("fusion has incorrect memory flow (unexpected source) for "); + _begin->jvms()->dump_spec(tty); tty->cr(); + path.dump(); + } +#endif + return false; + } + } else { + // For memory that feeds into constructors it's more complicated. + // However the advantage is that any side effect that happens between the Allocate/Initialize and + // the constructor will have to be control-dependent on Initialize. + // So we actually don't have to do anything, since it's going to be caught by the control flow + // analysis. +#ifdef ASSERT + // Do a quick verification of the control pattern between the constructor and the initialize node + assert(curr->is_Call(), "constructor should be a call"); + // Go up the control starting from the constructor call + Node* ctrl = curr->in(0); + IfNode* iff = NULL; + RegionNode* copy = NULL; + + while (true) { + // skip known check patterns + if (ctrl->is_Region()) { + if (ctrl->as_Region()->is_copy()) { + copy = ctrl->as_Region(); + ctrl = copy->is_copy(); + } else { // a cast + assert(ctrl->req() == 3 && + ctrl->in(1) != NULL && ctrl->in(1)->is_Proj() && + ctrl->in(2) != NULL && ctrl->in(2)->is_Proj() && + ctrl->in(1)->in(0) == ctrl->in(2)->in(0) && + ctrl->in(1)->in(0) != NULL && ctrl->in(1)->in(0)->is_If(), + "must be a simple diamond"); + Node* true_proj = ctrl->in(1)->is_IfTrue() ? ctrl->in(1) : ctrl->in(2); + for (SimpleDUIterator i(true_proj); i.has_next(); i.next()) { + Node* use = i.get(); + assert(use == ctrl || use->is_ConstraintCast(), + err_msg_res("unexpected user: %s", use->Name())); + } + + iff = ctrl->in(1)->in(0)->as_If(); + ctrl = iff->in(0); + } + } else if (ctrl->is_IfTrue()) { // null checks, class checks + iff = ctrl->in(0)->as_If(); + assert(iff->is_If(), "must be if"); + // Verify that the other arm is an uncommon trap + Node* otherproj = iff->proj_out(1 - ctrl->as_Proj()->_con); + CallStaticJavaNode* call = otherproj->unique_out()->isa_CallStaticJava(); + assert(strcmp(call->_name, "uncommon_trap") == 0, "must be uncommond trap"); + ctrl = iff->in(0); + } else { + break; + } + } + + assert(ctrl->is_Proj(), "must be a projection"); + assert(ctrl->in(0)->is_Initialize(), "should be initialize"); + for (SimpleDUIterator i(ctrl); i.has_next(); i.next()) { + Node* use = i.get(); + assert(use == copy || use == iff || use == curr || use->is_CheckCastPP() || use->is_Load(), + err_msg_res("unexpected user: %s", use->Name())); + } +#endif // ASSERT + } + } + } + +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print("fusion has correct memory flow for "); + _begin->jvms()->dump_spec(tty); tty->cr(); + tty->cr(); + } +#endif + return true; +} + bool StringConcat::validate_control_flow() { // We found all the calls and arguments now lets see if it's // safe to transform the graph as we would expect. @@ -753,7 +899,7 @@ bool StringConcat::validate_control_flow() { } } - // Skip backwards through the control checking for unexpected contro flow + // Skip backwards through the control checking for unexpected control flow Node* ptr = _end; bool fail = false; while (ptr != _begin) { @@ -936,7 +1082,7 @@ bool StringConcat::validate_control_flow() { if (PrintOptimizeStringConcat && !fail) { ttyLocker ttyl; tty->cr(); - tty->print("fusion would succeed (%d %d) for ", null_check_count, _uncommon_traps.size()); + tty->print("fusion has correct control flow (%d %d) for ", null_check_count, _uncommon_traps.size()); _begin->jvms()->dump_spec(tty); tty->cr(); for (int i = 0; i < num_arguments(); i++) { argument(i)->dump(); diff --git a/hotspot/src/share/vm/opto/subnode.cpp b/hotspot/src/share/vm/opto/subnode.cpp index 275b4d80dd1..4e2c8b7aef6 100644 --- a/hotspot/src/share/vm/opto/subnode.cpp +++ b/hotspot/src/share/vm/opto/subnode.cpp @@ -1064,7 +1064,7 @@ const Type *BoolTest::cc2logical( const Type *CC ) const { // Print special per-node info #ifndef PRODUCT void BoolTest::dump_on(outputStream *st) const { - const char *msg[] = {"eq","gt","??","lt","ne","le","??","ge"}; + const char *msg[] = {"eq","gt","of","lt","ne","le","nof","ge"}; st->print(msg[_test]); } #endif @@ -1126,7 +1126,7 @@ Node *BoolNode::Ideal(PhaseGVN *phase, bool can_reshape) { Node *cmp = in(1); if( !cmp->is_Sub() ) return NULL; int cop = cmp->Opcode(); - if( cop == Op_FastLock || cop == Op_FastUnlock ) return NULL; + if( cop == Op_FastLock || cop == Op_FastUnlock || cop == Op_FlagsProj) return NULL; Node *cmp1 = cmp->in(1); Node *cmp2 = cmp->in(2); if( !cmp1 ) return NULL; diff --git a/hotspot/src/share/vm/opto/subnode.hpp b/hotspot/src/share/vm/opto/subnode.hpp index 50c0bfac9c7..47eb5c65c05 100644 --- a/hotspot/src/share/vm/opto/subnode.hpp +++ b/hotspot/src/share/vm/opto/subnode.hpp @@ -263,16 +263,16 @@ public: // We pick the values as 3 bits; the low order 2 bits we compare against the // condition codes, the high bit flips the sense of the result. struct BoolTest VALUE_OBJ_CLASS_SPEC { - enum mask { eq = 0, ne = 4, le = 5, ge = 7, lt = 3, gt = 1, illegal = 8 }; + enum mask { eq = 0, ne = 4, le = 5, ge = 7, lt = 3, gt = 1, overflow = 2, no_overflow = 6, illegal = 8 }; mask _test; BoolTest( mask btm ) : _test(btm) {} const Type *cc2logical( const Type *CC ) const; // Commute the test. I use a small table lookup. The table is created as // a simple char array where each element is the ASCII version of a 'mask' // enum from above. - mask commute( ) const { return mask("038147858"[_test]-'0'); } + mask commute( ) const { return mask("032147658"[_test]-'0'); } mask negate( ) const { return mask(_test^4); } - bool is_canonical( ) const { return (_test == BoolTest::ne || _test == BoolTest::lt || _test == BoolTest::le); } + bool is_canonical( ) const { return (_test == BoolTest::ne || _test == BoolTest::lt || _test == BoolTest::le || _test == BoolTest::overflow); } #ifndef PRODUCT void dump_on(outputStream *st) const; #endif diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp index e25c529a886..3f628195f78 100644 --- a/hotspot/src/share/vm/opto/type.cpp +++ b/hotspot/src/share/vm/opto/type.cpp @@ -358,7 +358,7 @@ void Type::Initialize_shared(Compile* current) { false, 0, oopDesc::mark_offset_in_bytes()); TypeInstPtr::KLASS = TypeInstPtr::make(TypePtr::BotPTR, current->env()->Object_klass(), false, 0, oopDesc::klass_offset_in_bytes()); - TypeOopPtr::BOTTOM = TypeOopPtr::make(TypePtr::BotPTR, OffsetBot, TypeOopPtr::InstanceBot); + TypeOopPtr::BOTTOM = TypeOopPtr::make(TypePtr::BotPTR, OffsetBot, TypeOopPtr::InstanceBot, NULL); TypeMetadataPtr::BOTTOM = TypeMetadataPtr::make(TypePtr::BotPTR, NULL, OffsetBot); @@ -430,6 +430,16 @@ void Type::Initialize_shared(Compile* current) { longpair[1] = TypeLong::LONG; TypeTuple::LONG_PAIR = TypeTuple::make(2, longpair); + const Type **intccpair = TypeTuple::fields(2); + intccpair[0] = TypeInt::INT; + intccpair[1] = TypeInt::CC; + TypeTuple::INT_CC_PAIR = TypeTuple::make(2, intccpair); + + const Type **longccpair = TypeTuple::fields(2); + longccpair[0] = TypeLong::LONG; + longccpair[1] = TypeInt::CC; + TypeTuple::LONG_CC_PAIR = TypeTuple::make(2, longccpair); + _const_basic_type[T_NARROWOOP] = TypeNarrowOop::BOTTOM; _const_basic_type[T_NARROWKLASS] = Type::BOTTOM; _const_basic_type[T_BOOLEAN] = TypeInt::BOOL; @@ -572,7 +582,7 @@ bool Type::is_nan() const { //----------------------interface_vs_oop--------------------------------------- #ifdef ASSERT -bool Type::interface_vs_oop(const Type *t) const { +bool Type::interface_vs_oop_helper(const Type *t) const { bool result = false; const TypePtr* this_ptr = this->make_ptr(); // In case it is narrow_oop @@ -590,6 +600,29 @@ bool Type::interface_vs_oop(const Type *t) const { return result; } + +bool Type::interface_vs_oop(const Type *t) const { + if (interface_vs_oop_helper(t)) { + return true; + } + // Now check the speculative parts as well + const TypeOopPtr* this_spec = isa_oopptr() != NULL ? isa_oopptr()->speculative() : NULL; + const TypeOopPtr* t_spec = t->isa_oopptr() != NULL ? t->isa_oopptr()->speculative() : NULL; + if (this_spec != NULL && t_spec != NULL) { + if (this_spec->interface_vs_oop_helper(t_spec)) { + return true; + } + return false; + } + if (this_spec != NULL && this_spec->interface_vs_oop_helper(t)) { + return true; + } + if (t_spec != NULL && interface_vs_oop_helper(t_spec)) { + return true; + } + return false; +} + #endif //------------------------------meet------------------------------------------- @@ -1646,6 +1679,8 @@ const TypeTuple *TypeTuple::STORECONDITIONAL; const TypeTuple *TypeTuple::START_I2C; const TypeTuple *TypeTuple::INT_PAIR; const TypeTuple *TypeTuple::LONG_PAIR; +const TypeTuple *TypeTuple::INT_CC_PAIR; +const TypeTuple *TypeTuple::LONG_CC_PAIR; //------------------------------make------------------------------------------- @@ -2401,14 +2436,15 @@ void TypeRawPtr::dump2( Dict &d, uint depth, outputStream *st ) const { const TypeOopPtr *TypeOopPtr::BOTTOM; //------------------------------TypeOopPtr------------------------------------- -TypeOopPtr::TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id ) +TypeOopPtr::TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id, const TypeOopPtr* speculative) : TypePtr(t, ptr, offset), _const_oop(o), _klass(k), _klass_is_exact(xk), _is_ptr_to_narrowoop(false), _is_ptr_to_narrowklass(false), _is_ptr_to_boxed_value(false), - _instance_id(instance_id) { + _instance_id(instance_id), + _speculative(speculative) { if (Compile::current()->eliminate_boxing() && (t == InstPtr) && (offset > 0) && xk && (k != 0) && k->is_instance_klass()) { _is_ptr_to_boxed_value = k->as_instance_klass()->is_boxed_value_offset(offset); @@ -2475,12 +2511,12 @@ TypeOopPtr::TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int //------------------------------make------------------------------------------- const TypeOopPtr *TypeOopPtr::make(PTR ptr, - int offset, int instance_id) { + int offset, int instance_id, const TypeOopPtr* speculative) { assert(ptr != Constant, "no constant generic pointers"); ciKlass* k = Compile::current()->env()->Object_klass(); bool xk = false; ciObject* o = NULL; - return (TypeOopPtr*)(new TypeOopPtr(OopPtr, ptr, k, xk, o, offset, instance_id))->hashcons(); + return (TypeOopPtr*)(new TypeOopPtr(OopPtr, ptr, k, xk, o, offset, instance_id, speculative))->hashcons(); } @@ -2488,7 +2524,7 @@ const TypeOopPtr *TypeOopPtr::make(PTR ptr, const Type *TypeOopPtr::cast_to_ptr_type(PTR ptr) const { assert(_base == OopPtr, "subclass must override cast_to_ptr_type"); if( ptr == _ptr ) return this; - return make(ptr, _offset, _instance_id); + return make(ptr, _offset, _instance_id, _speculative); } //-----------------------------cast_to_instance_id---------------------------- @@ -2518,10 +2554,31 @@ const TypeKlassPtr* TypeOopPtr::as_klass_type() const { return TypeKlassPtr::make(xk? Constant: NotNull, k, 0); } +const Type *TypeOopPtr::xmeet(const Type *t) const { + const Type* res = xmeet_helper(t); + if (res->isa_oopptr() == NULL) { + return res; + } + + if (res->isa_oopptr() != NULL) { + // type->speculative() == NULL means that speculation is no better + // than type, i.e. type->speculative() == type. So there are 2 + // ways to represent the fact that we have no useful speculative + // data and we should use a single one to be able to test for + // equality between types. Check whether type->speculative() == + // type and set speculative to NULL if it is the case. + const TypeOopPtr* res_oopptr = res->is_oopptr(); + if (res_oopptr->remove_speculative() == res_oopptr->speculative()) { + return res_oopptr->remove_speculative(); + } + } + + return res; +} //------------------------------meet------------------------------------------- // Compute the MEET of two types. It returns a new Type object. -const Type *TypeOopPtr::xmeet( const Type *t ) const { +const Type *TypeOopPtr::xmeet_helper(const Type *t) const { // Perform a fast test for common case; meeting the same types together. if( this == t ) return this; // Meeting same type-rep? @@ -2563,7 +2620,8 @@ const Type *TypeOopPtr::xmeet( const Type *t ) const { case TopPTR: case AnyNull: { int instance_id = meet_instance_id(InstanceTop); - return make(ptr, offset, instance_id); + const TypeOopPtr* speculative = _speculative; + return make(ptr, offset, instance_id, speculative); } case BotPTR: case NotNull: @@ -2575,7 +2633,8 @@ const Type *TypeOopPtr::xmeet( const Type *t ) const { case OopPtr: { // Meeting to other OopPtrs const TypeOopPtr *tp = t->is_oopptr(); int instance_id = meet_instance_id(tp->instance_id()); - return make( meet_ptr(tp->ptr()), meet_offset(tp->offset()), instance_id ); + const TypeOopPtr* speculative = meet_speculative(tp); + return make(meet_ptr(tp->ptr()), meet_offset(tp->offset()), instance_id, speculative); } case InstPtr: // For these, flip the call around to cut down @@ -2592,7 +2651,7 @@ const Type *TypeOopPtr::xmeet( const Type *t ) const { const Type *TypeOopPtr::xdual() const { assert(klass() == Compile::current()->env()->Object_klass(), "no klasses here"); assert(const_oop() == NULL, "no constants here"); - return new TypeOopPtr(_base, dual_ptr(), klass(), klass_is_exact(), const_oop(), dual_offset(), dual_instance_id() ); + return new TypeOopPtr(_base, dual_ptr(), klass(), klass_is_exact(), const_oop(), dual_offset(), dual_instance_id(), dual_speculative()); } //--------------------------make_from_klass_common----------------------------- @@ -2683,7 +2742,7 @@ const TypeOopPtr* TypeOopPtr::make_from_constant(ciObject* o, } else if (!o->should_be_constant()) { return TypeAryPtr::make(TypePtr::NotNull, arr0, klass, true, 0); } - const TypeAryPtr* arr = TypeAryPtr::make(TypePtr::Constant, o, arr0, klass, true, 0, InstanceBot, is_autobox_cache); + const TypeAryPtr* arr = TypeAryPtr::make(TypePtr::Constant, o, arr0, klass, true, 0, InstanceBot, NULL, is_autobox_cache); return arr; } else if (klass->is_type_array_klass()) { // Element is an typeArray @@ -2728,13 +2787,11 @@ intptr_t TypeOopPtr::get_con() const { //-----------------------------filter------------------------------------------ // Do not allow interface-vs.-noninterface joins to collapse to top. -const Type *TypeOopPtr::filter( const Type *kills ) const { +const Type *TypeOopPtr::filter(const Type *kills) const { const Type* ft = join(kills); const TypeInstPtr* ftip = ft->isa_instptr(); const TypeInstPtr* ktip = kills->isa_instptr(); - const TypeKlassPtr* ftkp = ft->isa_klassptr(); - const TypeKlassPtr* ktkp = kills->isa_klassptr(); if (ft->empty()) { // Check for evil case of 'this' being a class and 'kills' expecting an @@ -2748,8 +2805,6 @@ const Type *TypeOopPtr::filter( const Type *kills ) const { // uplift the type. if (!empty() && ktip != NULL && ktip->is_loaded() && ktip->klass()->is_interface()) return kills; // Uplift to interface - if (!empty() && ktkp != NULL && ktkp->klass()->is_loaded() && ktkp->klass()->is_interface()) - return kills; // Uplift to interface return Type::TOP; // Canonical empty value } @@ -2766,14 +2821,6 @@ const Type *TypeOopPtr::filter( const Type *kills ) const { assert(!ftip->klass_is_exact(), "interface could not be exact"); return ktip->cast_to_ptr_type(ftip->ptr()); } - // Interface klass type could be exact in opposite to interface type, - // return it here instead of incorrect Constant ptr J/L/Object (6894807). - if (ftkp != NULL && ktkp != NULL && - ftkp->is_loaded() && ftkp->klass()->is_interface() && - !ftkp->klass_is_exact() && // Keep exact interface klass - ktkp->is_loaded() && !ktkp->klass()->is_interface()) { - return ktkp->cast_to_ptr_type(ftkp->ptr()); - } return ft; } @@ -2783,7 +2830,8 @@ const Type *TypeOopPtr::filter( const Type *kills ) const { bool TypeOopPtr::eq( const Type *t ) const { const TypeOopPtr *a = (const TypeOopPtr*)t; if (_klass_is_exact != a->_klass_is_exact || - _instance_id != a->_instance_id) return false; + _instance_id != a->_instance_id || + !eq_speculative(a)) return false; ciObject* one = const_oop(); ciObject* two = a->const_oop(); if (one == NULL || two == NULL) { @@ -2800,6 +2848,7 @@ int TypeOopPtr::hash(void) const { (const_oop() ? const_oop()->hash() : 0) + _klass_is_exact + _instance_id + + hash_speculative() + TypePtr::hash(); } @@ -2819,6 +2868,19 @@ void TypeOopPtr::dump2( Dict &d, uint depth, outputStream *st ) const { st->print(",iid=top"); else if (_instance_id != InstanceBot) st->print(",iid=%d",_instance_id); + + dump_speculative(st); +} + +/** + *dump the speculative part of the type + */ +void TypeOopPtr::dump_speculative(outputStream *st) const { + if (_speculative != NULL) { + st->print(" (speculative="); + _speculative->dump_on(st); + st->print(")"); + } } #endif @@ -2832,8 +2894,15 @@ bool TypeOopPtr::singleton(void) const { } //------------------------------add_offset------------------------------------- -const TypePtr *TypeOopPtr::add_offset( intptr_t offset ) const { - return make( _ptr, xadd_offset(offset), _instance_id); +const TypePtr *TypeOopPtr::add_offset(intptr_t offset) const { + return make(_ptr, xadd_offset(offset), _instance_id, add_offset_speculative(offset)); +} + +/** + * Return same type without a speculative part + */ +const TypeOopPtr* TypeOopPtr::remove_speculative() const { + return make(_ptr, _offset, _instance_id, NULL); } //------------------------------meet_instance_id-------------------------------- @@ -2853,6 +2922,89 @@ int TypeOopPtr::dual_instance_id( ) const { return _instance_id; // Map everything else into self } +/** + * meet of the speculative parts of 2 types + * + * @param other type to meet with + */ +const TypeOopPtr* TypeOopPtr::meet_speculative(const TypeOopPtr* other) const { + bool this_has_spec = (_speculative != NULL); + bool other_has_spec = (other->speculative() != NULL); + + if (!this_has_spec && !other_has_spec) { + return NULL; + } + + // If we are at a point where control flow meets and one branch has + // a speculative type and the other has not, we meet the speculative + // type of one branch with the actual type of the other. If the + // actual type is exact and the speculative is as well, then the + // result is a speculative type which is exact and we can continue + // speculation further. + const TypeOopPtr* this_spec = _speculative; + const TypeOopPtr* other_spec = other->speculative(); + + if (!this_has_spec) { + this_spec = this; + } + + if (!other_has_spec) { + other_spec = other; + } + + return this_spec->meet(other_spec)->is_oopptr(); +} + +/** + * dual of the speculative part of the type + */ +const TypeOopPtr* TypeOopPtr::dual_speculative() const { + if (_speculative == NULL) { + return NULL; + } + return _speculative->dual()->is_oopptr(); +} + +/** + * add offset to the speculative part of the type + * + * @param offset offset to add + */ +const TypeOopPtr* TypeOopPtr::add_offset_speculative(intptr_t offset) const { + if (_speculative == NULL) { + return NULL; + } + return _speculative->add_offset(offset)->is_oopptr(); +} + +/** + * Are the speculative parts of 2 types equal? + * + * @param other type to compare this one to + */ +bool TypeOopPtr::eq_speculative(const TypeOopPtr* other) const { + if (_speculative == NULL || other->speculative() == NULL) { + return _speculative == other->speculative(); + } + + if (_speculative->base() != other->speculative()->base()) { + return false; + } + + return _speculative->eq(other->speculative()); +} + +/** + * Hash of the speculative part of the type + */ +int TypeOopPtr::hash_speculative() const { + if (_speculative == NULL) { + return 0; + } + + return _speculative->hash(); +} + //============================================================================= // Convenience common pre-built types. @@ -2863,8 +3015,8 @@ const TypeInstPtr *TypeInstPtr::MARK; const TypeInstPtr *TypeInstPtr::KLASS; //------------------------------TypeInstPtr------------------------------------- -TypeInstPtr::TypeInstPtr(PTR ptr, ciKlass* k, bool xk, ciObject* o, int off, int instance_id) - : TypeOopPtr(InstPtr, ptr, k, xk, o, off, instance_id), _name(k->name()) { +TypeInstPtr::TypeInstPtr(PTR ptr, ciKlass* k, bool xk, ciObject* o, int off, int instance_id, const TypeOopPtr* speculative) + : TypeOopPtr(InstPtr, ptr, k, xk, o, off, instance_id, speculative), _name(k->name()) { assert(k != NULL && (k->is_loaded() || o == NULL), "cannot have constants with non-loaded klass"); @@ -2876,7 +3028,8 @@ const TypeInstPtr *TypeInstPtr::make(PTR ptr, bool xk, ciObject* o, int offset, - int instance_id) { + int instance_id, + const TypeOopPtr* speculative) { assert( !k->is_loaded() || k->is_instance_klass(), "Must be for instance"); // Either const_oop() is NULL or else ptr is Constant assert( (!o && ptr != Constant) || (o && ptr == Constant), @@ -2897,7 +3050,7 @@ const TypeInstPtr *TypeInstPtr::make(PTR ptr, // Now hash this baby TypeInstPtr *result = - (TypeInstPtr*)(new TypeInstPtr(ptr, k, xk, o ,offset, instance_id))->hashcons(); + (TypeInstPtr*)(new TypeInstPtr(ptr, k, xk, o ,offset, instance_id, speculative))->hashcons(); return result; } @@ -2930,7 +3083,7 @@ const Type *TypeInstPtr::cast_to_ptr_type(PTR ptr) const { if( ptr == _ptr ) return this; // Reconstruct _sig info here since not a problem with later lazy // construction, _sig will show up on demand. - return make(ptr, klass(), klass_is_exact(), const_oop(), _offset, _instance_id); + return make(ptr, klass(), klass_is_exact(), const_oop(), _offset, _instance_id, _speculative); } @@ -2942,13 +3095,13 @@ const Type *TypeInstPtr::cast_to_exactness(bool klass_is_exact) const { ciInstanceKlass* ik = _klass->as_instance_klass(); if( (ik->is_final() || _const_oop) ) return this; // cannot clear xk if( ik->is_interface() ) return this; // cannot set xk - return make(ptr(), klass(), klass_is_exact, const_oop(), _offset, _instance_id); + return make(ptr(), klass(), klass_is_exact, const_oop(), _offset, _instance_id, _speculative); } //-----------------------------cast_to_instance_id---------------------------- const TypeOopPtr *TypeInstPtr::cast_to_instance_id(int instance_id) const { if( instance_id == _instance_id ) return this; - return make(_ptr, klass(), _klass_is_exact, const_oop(), _offset, instance_id); + return make(_ptr, klass(), _klass_is_exact, const_oop(), _offset, instance_id, _speculative); } //------------------------------xmeet_unloaded--------------------------------- @@ -2958,6 +3111,7 @@ const TypeInstPtr *TypeInstPtr::xmeet_unloaded(const TypeInstPtr *tinst) const { int off = meet_offset(tinst->offset()); PTR ptr = meet_ptr(tinst->ptr()); int instance_id = meet_instance_id(tinst->instance_id()); + const TypeOopPtr* speculative = meet_speculative(tinst); const TypeInstPtr *loaded = is_loaded() ? this : tinst; const TypeInstPtr *unloaded = is_loaded() ? tinst : this; @@ -2978,7 +3132,7 @@ const TypeInstPtr *TypeInstPtr::xmeet_unloaded(const TypeInstPtr *tinst) const { assert(loaded->ptr() != TypePtr::Null, "insanity check"); // if( loaded->ptr() == TypePtr::TopPTR ) { return unloaded; } - else if (loaded->ptr() == TypePtr::AnyNull) { return TypeInstPtr::make( ptr, unloaded->klass(), false, NULL, off, instance_id ); } + else if (loaded->ptr() == TypePtr::AnyNull) { return TypeInstPtr::make(ptr, unloaded->klass(), false, NULL, off, instance_id, speculative); } else if (loaded->ptr() == TypePtr::BotPTR ) { return TypeInstPtr::BOTTOM; } else if (loaded->ptr() == TypePtr::Constant || loaded->ptr() == TypePtr::NotNull) { if (unloaded->ptr() == TypePtr::BotPTR ) { return TypeInstPtr::BOTTOM; } @@ -3000,7 +3154,7 @@ const TypeInstPtr *TypeInstPtr::xmeet_unloaded(const TypeInstPtr *tinst) const { //------------------------------meet------------------------------------------- // Compute the MEET of two types. It returns a new Type object. -const Type *TypeInstPtr::xmeet( const Type *t ) const { +const Type *TypeInstPtr::xmeet_helper(const Type *t) const { // Perform a fast test for common case; meeting the same types together. if( this == t ) return this; // Meeting same type-rep? @@ -3034,16 +3188,20 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { int offset = meet_offset(tp->offset()); PTR ptr = meet_ptr(tp->ptr()); int instance_id = meet_instance_id(tp->instance_id()); + const TypeOopPtr* speculative = meet_speculative(tp); switch (ptr) { case TopPTR: case AnyNull: // Fall 'down' to dual of object klass - if (klass()->equals(ciEnv::current()->Object_klass())) { - return TypeAryPtr::make(ptr, tp->ary(), tp->klass(), tp->klass_is_exact(), offset, instance_id); + // For instances when a subclass meets a superclass we fall + // below the centerline when the superclass is exact. We need to + // do the same here. + if (klass()->equals(ciEnv::current()->Object_klass()) && !klass_is_exact()) { + return TypeAryPtr::make(ptr, tp->ary(), tp->klass(), tp->klass_is_exact(), offset, instance_id, speculative); } else { // cannot subclass, so the meet has to fall badly below the centerline ptr = NotNull; instance_id = InstanceBot; - return TypeInstPtr::make( ptr, ciEnv::current()->Object_klass(), false, NULL, offset, instance_id); + return TypeInstPtr::make( ptr, ciEnv::current()->Object_klass(), false, NULL, offset, instance_id, speculative); } case Constant: case NotNull: @@ -3052,10 +3210,13 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { if( above_centerline(_ptr) ) { // if( _ptr == TopPTR || _ptr == AnyNull ) // If 'this' (InstPtr) is above the centerline and it is Object class // then we can subclass in the Java class hierarchy. - if (klass()->equals(ciEnv::current()->Object_klass())) { + // For instances when a subclass meets a superclass we fall + // below the centerline when the superclass is exact. We need + // to do the same here. + if (klass()->equals(ciEnv::current()->Object_klass()) && !klass_is_exact()) { // that is, tp's array type is a subtype of my klass return TypeAryPtr::make(ptr, (ptr == Constant ? tp->const_oop() : NULL), - tp->ary(), tp->klass(), tp->klass_is_exact(), offset, instance_id); + tp->ary(), tp->klass(), tp->klass_is_exact(), offset, instance_id, speculative); } } // The other case cannot happen, since I cannot be a subtype of an array. @@ -3063,7 +3224,7 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { if( ptr == Constant ) ptr = NotNull; instance_id = InstanceBot; - return make( ptr, ciEnv::current()->Object_klass(), false, NULL, offset, instance_id ); + return make(ptr, ciEnv::current()->Object_klass(), false, NULL, offset, instance_id, speculative); default: typerr(t); } } @@ -3077,13 +3238,15 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { case TopPTR: case AnyNull: { int instance_id = meet_instance_id(InstanceTop); + const TypeOopPtr* speculative = meet_speculative(tp); return make(ptr, klass(), klass_is_exact(), - (ptr == Constant ? const_oop() : NULL), offset, instance_id); + (ptr == Constant ? const_oop() : NULL), offset, instance_id, speculative); } case NotNull: case BotPTR: { int instance_id = meet_instance_id(tp->instance_id()); - return TypeOopPtr::make(ptr, offset, instance_id); + const TypeOopPtr* speculative = meet_speculative(tp); + return TypeOopPtr::make(ptr, offset, instance_id, speculative); } default: typerr(t); } @@ -3096,17 +3259,18 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { PTR ptr = meet_ptr(tp->ptr()); switch (tp->ptr()) { case Null: - if( ptr == Null ) return TypePtr::make( AnyPtr, ptr, offset ); + if( ptr == Null ) return TypePtr::make(AnyPtr, ptr, offset); // else fall through to AnyNull case TopPTR: case AnyNull: { int instance_id = meet_instance_id(InstanceTop); - return make( ptr, klass(), klass_is_exact(), - (ptr == Constant ? const_oop() : NULL), offset, instance_id); + const TypeOopPtr* speculative = _speculative; + return make(ptr, klass(), klass_is_exact(), + (ptr == Constant ? const_oop() : NULL), offset, instance_id, speculative); } case NotNull: case BotPTR: - return TypePtr::make( AnyPtr, ptr, offset ); + return TypePtr::make(AnyPtr, ptr, offset); default: typerr(t); } } @@ -3133,13 +3297,14 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { int off = meet_offset( tinst->offset() ); PTR ptr = meet_ptr( tinst->ptr() ); int instance_id = meet_instance_id(tinst->instance_id()); + const TypeOopPtr* speculative = meet_speculative(tinst); // Check for easy case; klasses are equal (and perhaps not loaded!) // If we have constants, then we created oops so classes are loaded // and we can handle the constants further down. This case handles // both-not-loaded or both-loaded classes if (ptr != Constant && klass()->equals(tinst->klass()) && klass_is_exact() == tinst->klass_is_exact()) { - return make( ptr, klass(), klass_is_exact(), NULL, off, instance_id ); + return make(ptr, klass(), klass_is_exact(), NULL, off, instance_id, speculative); } // Classes require inspection in the Java klass hierarchy. Must be loaded. @@ -3161,7 +3326,8 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { } // Handle mixing oops and interfaces first. - if( this_klass->is_interface() && !tinst_klass->is_interface() ) { + if( this_klass->is_interface() && !(tinst_klass->is_interface() || + tinst_klass == ciEnv::current()->Object_klass())) { ciKlass *tmp = tinst_klass; // Swap interface around tinst_klass = this_klass; this_klass = tmp; @@ -3202,7 +3368,7 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { // Find out which constant. o = (this_klass == klass()) ? const_oop() : tinst->const_oop(); } - return make( ptr, k, xk, o, off, instance_id ); + return make(ptr, k, xk, o, off, instance_id, speculative); } // Either oop vs oop or interface vs interface or interface vs Object @@ -3279,7 +3445,7 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { else ptr = NotNull; } - return make( ptr, this_klass, this_xk, o, off, instance_id ); + return make(ptr, this_klass, this_xk, o, off, instance_id, speculative); } // Else classes are not equal // Since klasses are different, we require a LCA in the Java @@ -3290,7 +3456,7 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { // Now we find the LCA of Java classes ciKlass* k = this_klass->least_common_ancestor(tinst_klass); - return make( ptr, k, false, NULL, off, instance_id ); + return make(ptr, k, false, NULL, off, instance_id, speculative); } // End of case InstPtr } // End of switch @@ -3314,7 +3480,7 @@ ciType* TypeInstPtr::java_mirror_type() const { // Dual: do NOT dual on klasses. This means I do NOT understand the Java // inheritance mechanism. const Type *TypeInstPtr::xdual() const { - return new TypeInstPtr( dual_ptr(), klass(), klass_is_exact(), const_oop(), dual_offset(), dual_instance_id() ); + return new TypeInstPtr(dual_ptr(), klass(), klass_is_exact(), const_oop(), dual_offset(), dual_instance_id(), dual_speculative()); } //------------------------------eq--------------------------------------------- @@ -3370,12 +3536,18 @@ void TypeInstPtr::dump2( Dict &d, uint depth, outputStream *st ) const { st->print(",iid=top"); else if (_instance_id != InstanceBot) st->print(",iid=%d",_instance_id); + + dump_speculative(st); } #endif //------------------------------add_offset------------------------------------- -const TypePtr *TypeInstPtr::add_offset( intptr_t offset ) const { - return make( _ptr, klass(), klass_is_exact(), const_oop(), xadd_offset(offset), _instance_id ); +const TypePtr *TypeInstPtr::add_offset(intptr_t offset) const { + return make(_ptr, klass(), klass_is_exact(), const_oop(), xadd_offset(offset), _instance_id, add_offset_speculative(offset)); +} + +const TypeOopPtr *TypeInstPtr::remove_speculative() const { + return make(_ptr, klass(), klass_is_exact(), const_oop(), _offset, _instance_id, NULL); } //============================================================================= @@ -3392,30 +3564,30 @@ const TypeAryPtr *TypeAryPtr::FLOATS; const TypeAryPtr *TypeAryPtr::DOUBLES; //------------------------------make------------------------------------------- -const TypeAryPtr *TypeAryPtr::make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id ) { +const TypeAryPtr *TypeAryPtr::make(PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id, const TypeOopPtr* speculative) { assert(!(k == NULL && ary->_elem->isa_int()), "integral arrays must be pre-equipped with a class"); if (!xk) xk = ary->ary_must_be_exact(); assert(instance_id <= 0 || xk || !UseExactTypes, "instances are always exactly typed"); if (!UseExactTypes) xk = (ptr == Constant); - return (TypeAryPtr*)(new TypeAryPtr(ptr, NULL, ary, k, xk, offset, instance_id, false))->hashcons(); + return (TypeAryPtr*)(new TypeAryPtr(ptr, NULL, ary, k, xk, offset, instance_id, false, speculative))->hashcons(); } //------------------------------make------------------------------------------- -const TypeAryPtr *TypeAryPtr::make( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id, bool is_autobox_cache) { +const TypeAryPtr *TypeAryPtr::make(PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id, const TypeOopPtr* speculative, bool is_autobox_cache) { assert(!(k == NULL && ary->_elem->isa_int()), "integral arrays must be pre-equipped with a class"); assert( (ptr==Constant && o) || (ptr!=Constant && !o), "" ); if (!xk) xk = (o != NULL) || ary->ary_must_be_exact(); assert(instance_id <= 0 || xk || !UseExactTypes, "instances are always exactly typed"); if (!UseExactTypes) xk = (ptr == Constant); - return (TypeAryPtr*)(new TypeAryPtr(ptr, o, ary, k, xk, offset, instance_id, is_autobox_cache))->hashcons(); + return (TypeAryPtr*)(new TypeAryPtr(ptr, o, ary, k, xk, offset, instance_id, is_autobox_cache, speculative))->hashcons(); } //------------------------------cast_to_ptr_type------------------------------- const Type *TypeAryPtr::cast_to_ptr_type(PTR ptr) const { if( ptr == _ptr ) return this; - return make(ptr, const_oop(), _ary, klass(), klass_is_exact(), _offset, _instance_id); + return make(ptr, const_oop(), _ary, klass(), klass_is_exact(), _offset, _instance_id, _speculative); } @@ -3424,13 +3596,13 @@ const Type *TypeAryPtr::cast_to_exactness(bool klass_is_exact) const { if( klass_is_exact == _klass_is_exact ) return this; if (!UseExactTypes) return this; if (_ary->ary_must_be_exact()) return this; // cannot clear xk - return make(ptr(), const_oop(), _ary, klass(), klass_is_exact, _offset, _instance_id); + return make(ptr(), const_oop(), _ary, klass(), klass_is_exact, _offset, _instance_id, _speculative); } //-----------------------------cast_to_instance_id---------------------------- const TypeOopPtr *TypeAryPtr::cast_to_instance_id(int instance_id) const { if( instance_id == _instance_id ) return this; - return make(_ptr, const_oop(), _ary, klass(), _klass_is_exact, _offset, instance_id); + return make(_ptr, const_oop(), _ary, klass(), _klass_is_exact, _offset, instance_id, _speculative); } //-----------------------------narrow_size_type------------------------------- @@ -3493,7 +3665,7 @@ const TypeAryPtr* TypeAryPtr::cast_to_size(const TypeInt* new_size) const { new_size = narrow_size_type(new_size); if (new_size == size()) return this; const TypeAry* new_ary = TypeAry::make(elem(), new_size, is_stable()); - return make(ptr(), const_oop(), new_ary, klass(), klass_is_exact(), _offset, _instance_id); + return make(ptr(), const_oop(), new_ary, klass(), klass_is_exact(), _offset, _instance_id, _speculative); } @@ -3542,7 +3714,7 @@ int TypeAryPtr::hash(void) const { //------------------------------meet------------------------------------------- // Compute the MEET of two types. It returns a new Type object. -const Type *TypeAryPtr::xmeet( const Type *t ) const { +const Type *TypeAryPtr::xmeet_helper(const Type *t) const { // Perform a fast test for common case; meeting the same types together. if( this == t ) return this; // Meeting same type-rep? // Current "this->_base" is Pointer @@ -3576,13 +3748,15 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { case TopPTR: case AnyNull: { int instance_id = meet_instance_id(InstanceTop); + const TypeOopPtr* speculative = meet_speculative(tp); return make(ptr, (ptr == Constant ? const_oop() : NULL), - _ary, _klass, _klass_is_exact, offset, instance_id); + _ary, _klass, _klass_is_exact, offset, instance_id, speculative); } case BotPTR: case NotNull: { int instance_id = meet_instance_id(tp->instance_id()); - return TypeOopPtr::make(ptr, offset, instance_id); + const TypeOopPtr* speculative = meet_speculative(tp); + return TypeOopPtr::make(ptr, offset, instance_id, speculative); } default: ShouldNotReachHere(); } @@ -3604,8 +3778,9 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { // else fall through to AnyNull case AnyNull: { int instance_id = meet_instance_id(InstanceTop); - return make( ptr, (ptr == Constant ? const_oop() : NULL), - _ary, _klass, _klass_is_exact, offset, instance_id); + const TypeOopPtr* speculative = _speculative; + return make(ptr, (ptr == Constant ? const_oop() : NULL), + _ary, _klass, _klass_is_exact, offset, instance_id, speculative); } default: ShouldNotReachHere(); } @@ -3621,6 +3796,7 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { const TypeAry *tary = _ary->meet(tap->_ary)->is_ary(); PTR ptr = meet_ptr(tap->ptr()); int instance_id = meet_instance_id(tap->instance_id()); + const TypeOopPtr* speculative = meet_speculative(tap); ciKlass* lazy_klass = NULL; if (tary->_elem->isa_int()) { // Integral array element types have irrelevant lattice relations. @@ -3648,7 +3824,7 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { // 'this' is exact and super or unrelated: (this->_klass_is_exact && !klass()->is_subtype_of(tap->klass())))) { tary = TypeAry::make(Type::BOTTOM, tary->_size, tary->_stable); - return make( NotNull, NULL, tary, lazy_klass, false, off, InstanceBot ); + return make(NotNull, NULL, tary, lazy_klass, false, off, InstanceBot); } bool xk = false; @@ -3656,8 +3832,12 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { case AnyNull: case TopPTR: // Compute new klass on demand, do not use tap->_klass - xk = (tap->_klass_is_exact | this->_klass_is_exact); - return make( ptr, const_oop(), tary, lazy_klass, xk, off, instance_id ); + if (below_centerline(this->_ptr)) { + xk = this->_klass_is_exact; + } else { + xk = (tap->_klass_is_exact | this->_klass_is_exact); + } + return make(ptr, const_oop(), tary, lazy_klass, xk, off, instance_id, speculative); case Constant: { ciObject* o = const_oop(); if( _ptr == Constant ) { @@ -3669,25 +3849,23 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { } else { xk = true; } - } else if( above_centerline(_ptr) ) { + } else if(above_centerline(_ptr)) { o = tap->const_oop(); xk = true; } else { // Only precise for identical arrays xk = this->_klass_is_exact && (klass() == tap->klass()); } - return TypeAryPtr::make( ptr, o, tary, lazy_klass, xk, off, instance_id ); + return TypeAryPtr::make(ptr, o, tary, lazy_klass, xk, off, instance_id, speculative); } case NotNull: case BotPTR: // Compute new klass on demand, do not use tap->_klass if (above_centerline(this->_ptr)) xk = tap->_klass_is_exact; - else if (above_centerline(tap->_ptr)) - xk = this->_klass_is_exact; else xk = (tap->_klass_is_exact & this->_klass_is_exact) && (klass() == tap->klass()); // Only precise for identical arrays - return TypeAryPtr::make( ptr, NULL, tary, lazy_klass, xk, off, instance_id ); + return TypeAryPtr::make(ptr, NULL, tary, lazy_klass, xk, off, instance_id, speculative); default: ShouldNotReachHere(); } } @@ -3698,16 +3876,20 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { int offset = meet_offset(tp->offset()); PTR ptr = meet_ptr(tp->ptr()); int instance_id = meet_instance_id(tp->instance_id()); + const TypeOopPtr* speculative = meet_speculative(tp); switch (ptr) { case TopPTR: case AnyNull: // Fall 'down' to dual of object klass - if( tp->klass()->equals(ciEnv::current()->Object_klass()) ) { - return TypeAryPtr::make( ptr, _ary, _klass, _klass_is_exact, offset, instance_id ); + // For instances when a subclass meets a superclass we fall + // below the centerline when the superclass is exact. We need to + // do the same here. + if (tp->klass()->equals(ciEnv::current()->Object_klass()) && !tp->klass_is_exact()) { + return TypeAryPtr::make(ptr, _ary, _klass, _klass_is_exact, offset, instance_id, speculative); } else { // cannot subclass, so the meet has to fall badly below the centerline ptr = NotNull; instance_id = InstanceBot; - return TypeInstPtr::make( ptr, ciEnv::current()->Object_klass(), false, NULL,offset, instance_id); + return TypeInstPtr::make(ptr, ciEnv::current()->Object_klass(), false, NULL,offset, instance_id, speculative); } case Constant: case NotNull: @@ -3716,10 +3898,13 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { if (above_centerline(tp->ptr())) { // If 'tp' is above the centerline and it is Object class // then we can subclass in the Java class hierarchy. - if( tp->klass()->equals(ciEnv::current()->Object_klass()) ) { + // For instances when a subclass meets a superclass we fall + // below the centerline when the superclass is exact. We need + // to do the same here. + if (tp->klass()->equals(ciEnv::current()->Object_klass()) && !tp->klass_is_exact()) { // that is, my array type is a subtype of 'tp' klass - return make( ptr, (ptr == Constant ? const_oop() : NULL), - _ary, _klass, _klass_is_exact, offset, instance_id ); + return make(ptr, (ptr == Constant ? const_oop() : NULL), + _ary, _klass, _klass_is_exact, offset, instance_id, speculative); } } // The other case cannot happen, since t cannot be a subtype of an array. @@ -3727,7 +3912,7 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { if( ptr == Constant ) ptr = NotNull; instance_id = InstanceBot; - return TypeInstPtr::make( ptr, ciEnv::current()->Object_klass(), false, NULL,offset, instance_id); + return TypeInstPtr::make(ptr, ciEnv::current()->Object_klass(), false, NULL,offset, instance_id, speculative); default: typerr(t); } } @@ -3738,7 +3923,7 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { //------------------------------xdual------------------------------------------ // Dual: compute field-by-field dual const Type *TypeAryPtr::xdual() const { - return new TypeAryPtr( dual_ptr(), _const_oop, _ary->dual()->is_ary(),_klass, _klass_is_exact, dual_offset(), dual_instance_id(), is_autobox_cache() ); + return new TypeAryPtr(dual_ptr(), _const_oop, _ary->dual()->is_ary(),_klass, _klass_is_exact, dual_offset(), dual_instance_id(), is_autobox_cache(), dual_speculative()); } //----------------------interface_vs_oop--------------------------------------- @@ -3790,6 +3975,8 @@ void TypeAryPtr::dump2( Dict &d, uint depth, outputStream *st ) const { st->print(",iid=top"); else if (_instance_id != InstanceBot) st->print(",iid=%d",_instance_id); + + dump_speculative(st); } #endif @@ -3799,10 +3986,13 @@ bool TypeAryPtr::empty(void) const { } //------------------------------add_offset------------------------------------- -const TypePtr *TypeAryPtr::add_offset( intptr_t offset ) const { - return make( _ptr, _const_oop, _ary, _klass, _klass_is_exact, xadd_offset(offset), _instance_id ); +const TypePtr *TypeAryPtr::add_offset(intptr_t offset) const { + return make(_ptr, _const_oop, _ary, _klass, _klass_is_exact, xadd_offset(offset), _instance_id, add_offset_speculative(offset)); } +const TypeOopPtr *TypeAryPtr::remove_speculative() const { + return make(_ptr, _const_oop, _ary, _klass, _klass_is_exact, _offset, _instance_id, NULL); +} //============================================================================= @@ -4183,6 +4373,33 @@ bool TypeKlassPtr::singleton(void) const { return (_offset == 0) && !below_centerline(_ptr); } +// Do not allow interface-vs.-noninterface joins to collapse to top. +const Type *TypeKlassPtr::filter(const Type *kills) const { + // logic here mirrors the one from TypeOopPtr::filter. See comments + // there. + const Type* ft = join(kills); + const TypeKlassPtr* ftkp = ft->isa_klassptr(); + const TypeKlassPtr* ktkp = kills->isa_klassptr(); + + if (ft->empty()) { + if (!empty() && ktkp != NULL && ktkp->klass()->is_loaded() && ktkp->klass()->is_interface()) + return kills; // Uplift to interface + + return Type::TOP; // Canonical empty value + } + + // Interface klass type could be exact in opposite to interface type, + // return it here instead of incorrect Constant ptr J/L/Object (6894807). + if (ftkp != NULL && ktkp != NULL && + ftkp->is_loaded() && ftkp->klass()->is_interface() && + !ftkp->klass_is_exact() && // Keep exact interface klass + ktkp->is_loaded() && !ktkp->klass()->is_interface()) { + return ktkp->cast_to_ptr_type(ftkp->ptr()); + } + + return ft; +} + //----------------------compute_klass------------------------------------------ // Compute the defining klass for this class ciKlass* TypeAryPtr::compute_klass(DEBUG_ONLY(bool verify)) const { diff --git a/hotspot/src/share/vm/opto/type.hpp b/hotspot/src/share/vm/opto/type.hpp index d4832591843..9810edfe724 100644 --- a/hotspot/src/share/vm/opto/type.hpp +++ b/hotspot/src/share/vm/opto/type.hpp @@ -63,7 +63,7 @@ class TypeRawPtr; class TypeOopPtr; class TypeInstPtr; class TypeAryPtr; -class TypeKlassPtr; +class TypeKlassPtr; class TypeMetadataPtr; //------------------------------Type------------------------------------------- @@ -159,6 +159,11 @@ private: // Table for efficient dualing of base types static const TYPES dual_type[lastype]; +#ifdef ASSERT + // One type is interface, the other is oop + virtual bool interface_vs_oop_helper(const Type *t) const; +#endif + protected: // Each class of type is also identified by its base. const TYPES _base; // Enum of Types type @@ -376,6 +381,9 @@ public: bool require_constant = false, bool is_autobox_cache = false); + // Speculative type. See TypeInstPtr + virtual ciKlass* speculative_type() const { return NULL; } + private: // support arrays static const BasicType _basic_type[]; @@ -584,6 +592,8 @@ public: static const TypeTuple *START_I2C; static const TypeTuple *INT_PAIR; static const TypeTuple *LONG_PAIR; + static const TypeTuple *INT_CC_PAIR; + static const TypeTuple *LONG_CC_PAIR; #ifndef PRODUCT virtual void dump2( Dict &d, uint, outputStream *st ) const; // Specialized per-Type dumping #endif @@ -783,7 +793,7 @@ public: // Some kind of oop (Java pointer), either klass or instance or array. class TypeOopPtr : public TypePtr { protected: - TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id ); + TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id, const TypeOopPtr* speculative); public: virtual bool eq( const Type *t ) const; virtual int hash() const; // Type specific hashing @@ -809,11 +819,27 @@ protected: // This is the the node index of the allocation node creating this instance. int _instance_id; + // Extra type information profiling gave us. We propagate it the + // same way the rest of the type info is propagated. If we want to + // use it, then we have to emit a guard: this part of the type is + // not something we know but something we speculate about the type. + const TypeOopPtr* _speculative; + static const TypeOopPtr* make_from_klass_common(ciKlass* klass, bool klass_change, bool try_for_exact); int dual_instance_id() const; int meet_instance_id(int uid) const; + // utility methods to work on the speculative part of the type + const TypeOopPtr* dual_speculative() const; + const TypeOopPtr* meet_speculative(const TypeOopPtr* other) const; + bool eq_speculative(const TypeOopPtr* other) const; + int hash_speculative() const; + const TypeOopPtr* add_offset_speculative(intptr_t offset) const; +#ifndef PRODUCT + void dump_speculative(outputStream *st) const; +#endif + public: // Creates a type given a klass. Correctly handles multi-dimensional arrays // Respects UseUniqueSubclasses. @@ -840,7 +866,7 @@ public: bool not_null_elements = false); // Make a generic (unclassed) pointer to an oop. - static const TypeOopPtr* make(PTR ptr, int offset, int instance_id); + static const TypeOopPtr* make(PTR ptr, int offset, int instance_id, const TypeOopPtr* speculative); ciObject* const_oop() const { return _const_oop; } virtual ciKlass* klass() const { return _klass; } @@ -854,6 +880,7 @@ public: bool is_known_instance() const { return _instance_id > 0; } int instance_id() const { return _instance_id; } bool is_known_instance_field() const { return is_known_instance() && _offset >= 0; } + const TypeOopPtr* speculative() const { return _speculative; } virtual intptr_t get_con() const; @@ -867,9 +894,13 @@ public: const TypeKlassPtr* as_klass_type() const; virtual const TypePtr *add_offset( intptr_t offset ) const; + // Return same type without a speculative part + virtual const TypeOopPtr* remove_speculative() const; - virtual const Type *xmeet( const Type *t ) const; + virtual const Type *xmeet(const Type *t) const; virtual const Type *xdual() const; // Compute dual right now. + // the core of the computation of the meet for TypeOopPtr and for its subclasses + virtual const Type *xmeet_helper(const Type *t) const; // Do not allow interface-vs.-noninterface joins to collapse to top. virtual const Type *filter( const Type *kills ) const; @@ -879,13 +910,24 @@ public: #ifndef PRODUCT virtual void dump2( Dict &d, uint depth, outputStream *st ) const; #endif + + // Return the speculative type if any + ciKlass* speculative_type() const { + if (_speculative != NULL) { + const TypeOopPtr* speculative = _speculative->join(this)->is_oopptr(); + if (speculative->klass_is_exact()) { + return speculative->klass(); + } + } + return NULL; + } }; //------------------------------TypeInstPtr------------------------------------ // Class of Java object pointers, pointing either to non-array Java instances // or to a Klass* (including array klasses). class TypeInstPtr : public TypeOopPtr { - TypeInstPtr( PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id ); + TypeInstPtr(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id, const TypeOopPtr* speculative); virtual bool eq( const Type *t ) const; virtual int hash() const; // Type specific hashing @@ -898,30 +940,30 @@ class TypeInstPtr : public TypeOopPtr { // Make a pointer to a constant oop. static const TypeInstPtr *make(ciObject* o) { - return make(TypePtr::Constant, o->klass(), true, o, 0); + return make(TypePtr::Constant, o->klass(), true, o, 0, InstanceBot); } // Make a pointer to a constant oop with offset. static const TypeInstPtr *make(ciObject* o, int offset) { - return make(TypePtr::Constant, o->klass(), true, o, offset); + return make(TypePtr::Constant, o->klass(), true, o, offset, InstanceBot); } // Make a pointer to some value of type klass. static const TypeInstPtr *make(PTR ptr, ciKlass* klass) { - return make(ptr, klass, false, NULL, 0); + return make(ptr, klass, false, NULL, 0, InstanceBot); } // Make a pointer to some non-polymorphic value of exactly type klass. static const TypeInstPtr *make_exact(PTR ptr, ciKlass* klass) { - return make(ptr, klass, true, NULL, 0); + return make(ptr, klass, true, NULL, 0, InstanceBot); } // Make a pointer to some value of type klass with offset. static const TypeInstPtr *make(PTR ptr, ciKlass* klass, int offset) { - return make(ptr, klass, false, NULL, offset); + return make(ptr, klass, false, NULL, offset, InstanceBot); } // Make a pointer to an oop. - static const TypeInstPtr *make(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id = InstanceBot ); + static const TypeInstPtr *make(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id = InstanceBot, const TypeOopPtr* speculative = NULL); /** Create constant type for a constant boxed value */ const Type* get_const_boxed_value() const; @@ -938,8 +980,11 @@ class TypeInstPtr : public TypeOopPtr { virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; virtual const TypePtr *add_offset( intptr_t offset ) const; + // Return same type without a speculative part + virtual const TypeOopPtr* remove_speculative() const; - virtual const Type *xmeet( const Type *t ) const; + // the core of the computation of the meet of 2 types + virtual const Type *xmeet_helper(const Type *t) const; virtual const TypeInstPtr *xmeet_unloaded( const TypeInstPtr *t ) const; virtual const Type *xdual() const; // Compute dual right now. @@ -958,8 +1003,8 @@ class TypeInstPtr : public TypeOopPtr { // Class of Java array pointers class TypeAryPtr : public TypeOopPtr { TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, - int offset, int instance_id, bool is_autobox_cache ) - : TypeOopPtr(AryPtr,ptr,k,xk,o,offset, instance_id), + int offset, int instance_id, bool is_autobox_cache, const TypeOopPtr* speculative) + : TypeOopPtr(AryPtr,ptr,k,xk,o,offset, instance_id, speculative), _ary(ary), _is_autobox_cache(is_autobox_cache) { @@ -997,9 +1042,9 @@ public: bool is_autobox_cache() const { return _is_autobox_cache; } - static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot); + static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot, const TypeOopPtr* speculative = NULL); // Constant pointer to array - static const TypeAryPtr *make( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot, bool is_autobox_cache = false); + static const TypeAryPtr *make( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot, const TypeOopPtr* speculative = NULL, bool is_autobox_cache = false); // Return a 'ptr' version of this type virtual const Type *cast_to_ptr_type(PTR ptr) const; @@ -1013,8 +1058,11 @@ public: virtual bool empty(void) const; // TRUE if type is vacuous virtual const TypePtr *add_offset( intptr_t offset ) const; + // Return same type without a speculative part + virtual const TypeOopPtr* remove_speculative() const; - virtual const Type *xmeet( const Type *t ) const; + // the core of the computation of the meet of 2 types + virtual const Type *xmeet_helper(const Type *t) const; virtual const Type *xdual() const; // Compute dual right now. const TypeAryPtr* cast_to_stable(bool stable, int stable_dimension = 1) const; @@ -1154,6 +1202,9 @@ public: virtual intptr_t get_con() const; + // Do not allow interface-vs.-noninterface joins to collapse to top. + virtual const Type *filter( const Type *kills ) const; + // Convenience common pre-built types. static const TypeKlassPtr* OBJECT; // Not-null object klass or below static const TypeKlassPtr* OBJECT_OR_NULL; // Maybe-null version of same diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index c7886920b3e..ab24446baf1 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -1591,10 +1591,8 @@ static jmethodID get_method_id(JNIEnv *env, jclass clazz, const char *name_str, } } else { m = klass->lookup_method(name, signature); - // Look up interfaces - if (m == NULL && klass->oop_is_instance()) { - m = InstanceKlass::cast(klass())->lookup_method_in_all_interfaces(name, - signature); + if (m == NULL && klass->oop_is_instance()) { + m = InstanceKlass::cast(klass())->lookup_method_in_ordered_interfaces(name, signature); } } if (m == NULL || (m->is_static() != is_static)) { @@ -3210,7 +3208,11 @@ JNI_QUICK_ENTRY(jsize, jni_GetStringLength(JNIEnv *env, jstring string)) HOTSPOT_JNI_GETSTRINGLENGTH_ENTRY( env, string); #endif /* USDT2 */ - jsize ret = java_lang_String::length(JNIHandles::resolve_non_null(string)); + jsize ret = 0; + oop s = JNIHandles::resolve_non_null(string); + if (java_lang_String::value(s) != NULL) { + ret = java_lang_String::length(s); + } #ifndef USDT2 DTRACE_PROBE1(hotspot_jni, GetStringLength__return, ret); #else /* USDT2 */ @@ -3230,20 +3232,23 @@ JNI_QUICK_ENTRY(const jchar*, jni_GetStringChars( HOTSPOT_JNI_GETSTRINGCHARS_ENTRY( env, string, (uintptr_t *) isCopy); #endif /* USDT2 */ + jchar* buf = NULL; oop s = JNIHandles::resolve_non_null(string); - int s_len = java_lang_String::length(s); typeArrayOop s_value = java_lang_String::value(s); - int s_offset = java_lang_String::offset(s); - jchar* buf = NEW_C_HEAP_ARRAY_RETURN_NULL(jchar, s_len + 1, mtInternal); // add one for zero termination - /* JNI Specification states return NULL on OOM */ - if (buf != NULL) { - if (s_len > 0) { - memcpy(buf, s_value->char_at_addr(s_offset), sizeof(jchar)*s_len); - } - buf[s_len] = 0; - //%note jni_5 - if (isCopy != NULL) { - *isCopy = JNI_TRUE; + if (s_value != NULL) { + int s_len = java_lang_String::length(s); + int s_offset = java_lang_String::offset(s); + buf = NEW_C_HEAP_ARRAY_RETURN_NULL(jchar, s_len + 1, mtInternal); // add one for zero termination + /* JNI Specification states return NULL on OOM */ + if (buf != NULL) { + if (s_len > 0) { + memcpy(buf, s_value->char_at_addr(s_offset), sizeof(jchar)*s_len); + } + buf[s_len] = 0; + //%note jni_5 + if (isCopy != NULL) { + *isCopy = JNI_TRUE; + } } } #ifndef USDT2 @@ -3313,7 +3318,11 @@ JNI_ENTRY(jsize, jni_GetStringUTFLength(JNIEnv *env, jstring string)) HOTSPOT_JNI_GETSTRINGUTFLENGTH_ENTRY( env, string); #endif /* USDT2 */ - jsize ret = java_lang_String::utf8_length(JNIHandles::resolve_non_null(string)); + jsize ret = 0; + oop java_string = JNIHandles::resolve_non_null(string); + if (java_lang_String::value(java_string) != NULL) { + ret = java_lang_String::utf8_length(java_string); + } #ifndef USDT2 DTRACE_PROBE1(hotspot_jni, GetStringUTFLength__return, ret); #else /* USDT2 */ @@ -3332,14 +3341,17 @@ JNI_ENTRY(const char*, jni_GetStringUTFChars(JNIEnv *env, jstring string, jboole HOTSPOT_JNI_GETSTRINGUTFCHARS_ENTRY( env, string, (uintptr_t *) isCopy); #endif /* USDT2 */ + char* result = NULL; oop java_string = JNIHandles::resolve_non_null(string); - size_t length = java_lang_String::utf8_length(java_string); - /* JNI Specification states return NULL on OOM */ - char* result = AllocateHeap(length + 1, mtInternal, 0, AllocFailStrategy::RETURN_NULL); - if (result != NULL) { - java_lang_String::as_utf8_string(java_string, result, (int) length + 1); - if (isCopy != NULL) { - *isCopy = JNI_TRUE; + if (java_lang_String::value(java_string) != NULL) { + size_t length = java_lang_String::utf8_length(java_string); + /* JNI Specification states return NULL on OOM */ + result = AllocateHeap(length + 1, mtInternal, 0, AllocFailStrategy::RETURN_NULL); + if (result != NULL) { + java_lang_String::as_utf8_string(java_string, result, (int) length + 1); + if (isCopy != NULL) { + *isCopy = JNI_TRUE; + } } } #ifndef USDT2 @@ -5046,7 +5058,12 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_GetDefaultJavaVMInitArgs(void *args_) { void TestReservedSpace_test(); void TestReserveMemorySpecial_test(); void TestVirtualSpace_test(); -void MetaspaceAux_test(); +void TestMetaspaceAux_test(); +void TestMetachunk_test(); +void TestVirtualSpaceNode_test(); +#if INCLUDE_ALL_GCS +void TestG1BiasedArray_test(); +#endif void execute_internal_vm_tests() { if (ExecuteInternalVMTests) { @@ -5054,7 +5071,9 @@ void execute_internal_vm_tests() { run_unit_test(TestReservedSpace_test()); run_unit_test(TestReserveMemorySpecial_test()); run_unit_test(TestVirtualSpace_test()); - run_unit_test(MetaspaceAux_test()); + run_unit_test(TestMetaspaceAux_test()); + run_unit_test(TestMetachunk_test()); + run_unit_test(TestVirtualSpaceNode_test()); run_unit_test(GlobalDefinitions::test_globals()); run_unit_test(GCTimerAllTest::all()); run_unit_test(arrayOopDesc::test_max_array_length()); @@ -5066,6 +5085,7 @@ void execute_internal_vm_tests() { run_unit_test(VMStructs::test()); #endif #if INCLUDE_ALL_GCS + run_unit_test(TestG1BiasedArray_test()); run_unit_test(HeapRegionRemSet::test_prt()); #endif tty->print_cr("All internal VM tests passed"); diff --git a/hotspot/src/share/vm/prims/jniCheck.cpp b/hotspot/src/share/vm/prims/jniCheck.cpp index c53bf392e6d..b829d14dd23 100644 --- a/hotspot/src/share/vm/prims/jniCheck.cpp +++ b/hotspot/src/share/vm/prims/jniCheck.cpp @@ -1324,18 +1324,19 @@ JNI_ENTRY_CHECKED(const jchar *, IN_VM( checkString(thr, str); ) + jchar* newResult = NULL; const jchar *result = UNCHECKED()->GetStringChars(env,str,isCopy); assert (isCopy == NULL || *isCopy == JNI_TRUE, "GetStringChars didn't return a copy as expected"); - - size_t len = UNCHECKED()->GetStringLength(env,str) + 1; // + 1 for NULL termination - jint* tagLocation = (jint*) AllocateHeap(len * sizeof(jchar) + sizeof(jint), mtInternal); - *tagLocation = STRING_TAG; - jchar* newResult = (jchar*) (tagLocation + 1); - memcpy(newResult, result, len * sizeof(jchar)); - // Avoiding call to UNCHECKED()->ReleaseStringChars() since that will fire unexpected dtrace probes - // Note that the dtrace arguments for the allocated memory will not match up with this solution. - FreeHeap((char*)result); - + if (result != NULL) { + size_t len = UNCHECKED()->GetStringLength(env,str) + 1; // + 1 for NULL termination + jint* tagLocation = (jint*) AllocateHeap(len * sizeof(jchar) + sizeof(jint), mtInternal); + *tagLocation = STRING_TAG; + newResult = (jchar*) (tagLocation + 1); + memcpy(newResult, result, len * sizeof(jchar)); + // Avoiding call to UNCHECKED()->ReleaseStringChars() since that will fire unexpected dtrace probes + // Note that the dtrace arguments for the allocated memory will not match up with this solution. + FreeHeap((char*)result); + } functionExit(env); return newResult; JNI_END @@ -1394,18 +1395,19 @@ JNI_ENTRY_CHECKED(const char *, IN_VM( checkString(thr, str); ) + char* newResult = NULL; const char *result = UNCHECKED()->GetStringUTFChars(env,str,isCopy); assert (isCopy == NULL || *isCopy == JNI_TRUE, "GetStringUTFChars didn't return a copy as expected"); - - size_t len = strlen(result) + 1; // + 1 for NULL termination - jint* tagLocation = (jint*) AllocateHeap(len + sizeof(jint), mtInternal); - *tagLocation = STRING_UTF_TAG; - char* newResult = (char*) (tagLocation + 1); - strcpy(newResult, result); - // Avoiding call to UNCHECKED()->ReleaseStringUTFChars() since that will fire unexpected dtrace probes - // Note that the dtrace arguments for the allocated memory will not match up with this solution. - FreeHeap((char*)result, mtInternal); - + if (result != NULL) { + size_t len = strlen(result) + 1; // + 1 for NULL termination + jint* tagLocation = (jint*) AllocateHeap(len + sizeof(jint), mtInternal); + *tagLocation = STRING_UTF_TAG; + newResult = (char*) (tagLocation + 1); + strcpy(newResult, result); + // Avoiding call to UNCHECKED()->ReleaseStringUTFChars() since that will fire unexpected dtrace probes + // Note that the dtrace arguments for the allocated memory will not match up with this solution. + FreeHeap((char*)result, mtInternal); + } functionExit(env); return newResult; JNI_END diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index d7a961edfbb..a757e194827 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -668,13 +668,12 @@ JVM_END JVM_ENTRY(jclass, JVM_GetCallerClass(JNIEnv* env, int depth)) JVMWrapper("JVM_GetCallerClass"); - // Pre-JDK 8 and early builds of JDK 8 don't have a CallerSensitive annotation. - if (SystemDictionary::reflect_CallerSensitive_klass() == NULL) { + // Pre-JDK 8 and early builds of JDK 8 don't have a CallerSensitive annotation; or + // sun.reflect.Reflection.getCallerClass with a depth parameter is provided + // temporarily for existing code to use until a replacement API is defined. + if (SystemDictionary::reflect_CallerSensitive_klass() == NULL || depth != JVM_CALLER_DEPTH) { Klass* k = thread->security_get_caller_class(depth); return (k == NULL) ? NULL : (jclass) JNIHandles::make_local(env, k->java_mirror()); - } else { - // Basic handshaking with Java_sun_reflect_Reflection_getCallerClass - assert(depth == -1, "wrong handshake depth"); } // Getting the class of the caller frame. @@ -1835,16 +1834,27 @@ JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass, } JVM_END -JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredMethods(JNIEnv *env, jclass ofClass, jboolean publicOnly)) -{ - JVMWrapper("JVM_GetClassDeclaredMethods"); +static bool select_method(methodHandle method, bool want_constructor) { + if (want_constructor) { + return (method->is_initializer() && !method->is_static()); + } else { + return (!method->is_initializer() && !method->is_overpass()); + } +} + +static jobjectArray get_class_declared_methods_helper( + JNIEnv *env, + jclass ofClass, jboolean publicOnly, + bool want_constructor, + Klass* klass, TRAPS) { + JvmtiVMObjectAllocEventCollector oam; // Exclude primitive types and array types if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass)) || java_lang_Class::as_Klass(JNIHandles::resolve_non_null(ofClass))->oop_is_array()) { // Return empty array - oop res = oopFactory::new_objArray(SystemDictionary::reflect_Method_klass(), 0, CHECK_NULL); + oop res = oopFactory::new_objArray(klass, 0, CHECK_NULL); return (jobjectArray) JNIHandles::make_local(env, res); } @@ -1855,87 +1865,67 @@ JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredMethods(JNIEnv *env, jclass ofClass, Array* methods = k->methods(); int methods_length = methods->length(); + + // Save original method_idnum in case of redefinition, which can change + // the idnum of obsolete methods. The new method will have the same idnum + // but if we refresh the methods array, the counts will be wrong. + ResourceMark rm(THREAD); + GrowableArray* idnums = new GrowableArray(methods_length); int num_methods = 0; - int i; - for (i = 0; i < methods_length; i++) { + for (int i = 0; i < methods_length; i++) { methodHandle method(THREAD, methods->at(i)); - if (!method->is_initializer() && !method->is_overpass()) { + if (select_method(method, want_constructor)) { if (!publicOnly || method->is_public()) { + idnums->push(method->method_idnum()); ++num_methods; } } } // Allocate result - objArrayOop r = oopFactory::new_objArray(SystemDictionary::reflect_Method_klass(), num_methods, CHECK_NULL); + objArrayOop r = oopFactory::new_objArray(klass, num_methods, CHECK_NULL); objArrayHandle result (THREAD, r); - int out_idx = 0; - for (i = 0; i < methods_length; i++) { - methodHandle method(THREAD, methods->at(i)); - if (!method->is_initializer() && !method->is_overpass()) { - if (!publicOnly || method->is_public()) { - oop m = Reflection::new_method(method, UseNewReflection, false, CHECK_NULL); - result->obj_at_put(out_idx, m); - ++out_idx; + // Now just put the methods that we selected above, but go by their idnum + // in case of redefinition. The methods can be redefined at any safepoint, + // so above when allocating the oop array and below when creating reflect + // objects. + for (int i = 0; i < num_methods; i++) { + methodHandle method(THREAD, k->method_with_idnum(idnums->at(i))); + if (method.is_null()) { + // Method may have been deleted and seems this API can handle null + // Otherwise should probably put a method that throws NSME + result->obj_at_put(i, NULL); + } else { + oop m; + if (want_constructor) { + m = Reflection::new_constructor(method, CHECK_NULL); + } else { + m = Reflection::new_method(method, UseNewReflection, false, CHECK_NULL); } + result->obj_at_put(i, m); } } - assert(out_idx == num_methods, "just checking"); + return (jobjectArray) JNIHandles::make_local(env, result()); } + +JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredMethods(JNIEnv *env, jclass ofClass, jboolean publicOnly)) +{ + JVMWrapper("JVM_GetClassDeclaredMethods"); + return get_class_declared_methods_helper(env, ofClass, publicOnly, + /*want_constructor*/ false, + SystemDictionary::reflect_Method_klass(), THREAD); +} JVM_END JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredConstructors(JNIEnv *env, jclass ofClass, jboolean publicOnly)) { JVMWrapper("JVM_GetClassDeclaredConstructors"); - JvmtiVMObjectAllocEventCollector oam; - - // Exclude primitive types and array types - if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass)) - || java_lang_Class::as_Klass(JNIHandles::resolve_non_null(ofClass))->oop_is_array()) { - // Return empty array - oop res = oopFactory::new_objArray(SystemDictionary::reflect_Constructor_klass(), 0 , CHECK_NULL); - return (jobjectArray) JNIHandles::make_local(env, res); - } - - instanceKlassHandle k(THREAD, java_lang_Class::as_Klass(JNIHandles::resolve_non_null(ofClass))); - - // Ensure class is linked - k->link_class(CHECK_NULL); - - Array* methods = k->methods(); - int methods_length = methods->length(); - int num_constructors = 0; - - int i; - for (i = 0; i < methods_length; i++) { - methodHandle method(THREAD, methods->at(i)); - if (method->is_initializer() && !method->is_static()) { - if (!publicOnly || method->is_public()) { - ++num_constructors; - } - } - } - - // Allocate result - objArrayOop r = oopFactory::new_objArray(SystemDictionary::reflect_Constructor_klass(), num_constructors, CHECK_NULL); - objArrayHandle result(THREAD, r); - - int out_idx = 0; - for (i = 0; i < methods_length; i++) { - methodHandle method(THREAD, methods->at(i)); - if (method->is_initializer() && !method->is_static()) { - if (!publicOnly || method->is_public()) { - oop m = Reflection::new_constructor(method, CHECK_NULL); - result->obj_at_put(out_idx, m); - ++out_idx; - } - } - } - assert(out_idx == num_constructors, "just checking"); - return (jobjectArray) JNIHandles::make_local(env, result()); + return get_class_declared_methods_helper(env, ofClass, publicOnly, + /*want_constructor*/ true, + SystemDictionary::reflect_Constructor_klass(), THREAD); } JVM_END @@ -3963,248 +3953,6 @@ void initialize_converter_functions() { } -// Serialization -JVM_ENTRY(void, JVM_SetPrimitiveFieldValues(JNIEnv *env, jclass cb, jobject obj, - jlongArray fieldIDs, jcharArray typecodes, jbyteArray data)) - assert(!JDK_Version::is_gte_jdk14x_version(), "should only be used in 1.3.1 and earlier"); - - typeArrayOop tcodes = typeArrayOop(JNIHandles::resolve(typecodes)); - typeArrayOop dbuf = typeArrayOop(JNIHandles::resolve(data)); - typeArrayOop fids = typeArrayOop(JNIHandles::resolve(fieldIDs)); - oop o = JNIHandles::resolve(obj); - - if (o == NULL || fids == NULL || dbuf == NULL || tcodes == NULL) { - THROW(vmSymbols::java_lang_NullPointerException()); - } - - jsize nfids = fids->length(); - if (nfids == 0) return; - - if (tcodes->length() < nfids) { - THROW(vmSymbols::java_lang_ArrayIndexOutOfBoundsException()); - } - - jsize off = 0; - /* loop through fields, setting values */ - for (jsize i = 0; i < nfids; i++) { - jfieldID fid = (jfieldID)(intptr_t) fids->long_at(i); - int field_offset; - if (fid != NULL) { - // NULL is a legal value for fid, but retrieving the field offset - // trigger assertion in that case - field_offset = jfieldIDWorkaround::from_instance_jfieldID(o->klass(), fid); - } - - switch (tcodes->char_at(i)) { - case 'Z': - if (fid != NULL) { - jboolean val = (dbuf->byte_at(off) != 0) ? JNI_TRUE : JNI_FALSE; - o->bool_field_put(field_offset, val); - } - off++; - break; - - case 'B': - if (fid != NULL) { - o->byte_field_put(field_offset, dbuf->byte_at(off)); - } - off++; - break; - - case 'C': - if (fid != NULL) { - jchar val = ((dbuf->byte_at(off + 0) & 0xFF) << 8) - + ((dbuf->byte_at(off + 1) & 0xFF) << 0); - o->char_field_put(field_offset, val); - } - off += 2; - break; - - case 'S': - if (fid != NULL) { - jshort val = ((dbuf->byte_at(off + 0) & 0xFF) << 8) - + ((dbuf->byte_at(off + 1) & 0xFF) << 0); - o->short_field_put(field_offset, val); - } - off += 2; - break; - - case 'I': - if (fid != NULL) { - jint ival = ((dbuf->byte_at(off + 0) & 0xFF) << 24) - + ((dbuf->byte_at(off + 1) & 0xFF) << 16) - + ((dbuf->byte_at(off + 2) & 0xFF) << 8) - + ((dbuf->byte_at(off + 3) & 0xFF) << 0); - o->int_field_put(field_offset, ival); - } - off += 4; - break; - - case 'F': - if (fid != NULL) { - jint ival = ((dbuf->byte_at(off + 0) & 0xFF) << 24) - + ((dbuf->byte_at(off + 1) & 0xFF) << 16) - + ((dbuf->byte_at(off + 2) & 0xFF) << 8) - + ((dbuf->byte_at(off + 3) & 0xFF) << 0); - jfloat fval = (*int_bits_to_float_fn)(env, NULL, ival); - o->float_field_put(field_offset, fval); - } - off += 4; - break; - - case 'J': - if (fid != NULL) { - jlong lval = (((jlong) dbuf->byte_at(off + 0) & 0xFF) << 56) - + (((jlong) dbuf->byte_at(off + 1) & 0xFF) << 48) - + (((jlong) dbuf->byte_at(off + 2) & 0xFF) << 40) - + (((jlong) dbuf->byte_at(off + 3) & 0xFF) << 32) - + (((jlong) dbuf->byte_at(off + 4) & 0xFF) << 24) - + (((jlong) dbuf->byte_at(off + 5) & 0xFF) << 16) - + (((jlong) dbuf->byte_at(off + 6) & 0xFF) << 8) - + (((jlong) dbuf->byte_at(off + 7) & 0xFF) << 0); - o->long_field_put(field_offset, lval); - } - off += 8; - break; - - case 'D': - if (fid != NULL) { - jlong lval = (((jlong) dbuf->byte_at(off + 0) & 0xFF) << 56) - + (((jlong) dbuf->byte_at(off + 1) & 0xFF) << 48) - + (((jlong) dbuf->byte_at(off + 2) & 0xFF) << 40) - + (((jlong) dbuf->byte_at(off + 3) & 0xFF) << 32) - + (((jlong) dbuf->byte_at(off + 4) & 0xFF) << 24) - + (((jlong) dbuf->byte_at(off + 5) & 0xFF) << 16) - + (((jlong) dbuf->byte_at(off + 6) & 0xFF) << 8) - + (((jlong) dbuf->byte_at(off + 7) & 0xFF) << 0); - jdouble dval = (*long_bits_to_double_fn)(env, NULL, lval); - o->double_field_put(field_offset, dval); - } - off += 8; - break; - - default: - // Illegal typecode - THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "illegal typecode"); - } - } -JVM_END - - -JVM_ENTRY(void, JVM_GetPrimitiveFieldValues(JNIEnv *env, jclass cb, jobject obj, - jlongArray fieldIDs, jcharArray typecodes, jbyteArray data)) - assert(!JDK_Version::is_gte_jdk14x_version(), "should only be used in 1.3.1 and earlier"); - - typeArrayOop tcodes = typeArrayOop(JNIHandles::resolve(typecodes)); - typeArrayOop dbuf = typeArrayOop(JNIHandles::resolve(data)); - typeArrayOop fids = typeArrayOop(JNIHandles::resolve(fieldIDs)); - oop o = JNIHandles::resolve(obj); - - if (o == NULL || fids == NULL || dbuf == NULL || tcodes == NULL) { - THROW(vmSymbols::java_lang_NullPointerException()); - } - - jsize nfids = fids->length(); - if (nfids == 0) return; - - if (tcodes->length() < nfids) { - THROW(vmSymbols::java_lang_ArrayIndexOutOfBoundsException()); - } - - /* loop through fields, fetching values */ - jsize off = 0; - for (jsize i = 0; i < nfids; i++) { - jfieldID fid = (jfieldID)(intptr_t) fids->long_at(i); - if (fid == NULL) { - THROW(vmSymbols::java_lang_NullPointerException()); - } - int field_offset = jfieldIDWorkaround::from_instance_jfieldID(o->klass(), fid); - - switch (tcodes->char_at(i)) { - case 'Z': - { - jboolean val = o->bool_field(field_offset); - dbuf->byte_at_put(off++, (val != 0) ? 1 : 0); - } - break; - - case 'B': - dbuf->byte_at_put(off++, o->byte_field(field_offset)); - break; - - case 'C': - { - jchar val = o->char_field(field_offset); - dbuf->byte_at_put(off++, (val >> 8) & 0xFF); - dbuf->byte_at_put(off++, (val >> 0) & 0xFF); - } - break; - - case 'S': - { - jshort val = o->short_field(field_offset); - dbuf->byte_at_put(off++, (val >> 8) & 0xFF); - dbuf->byte_at_put(off++, (val >> 0) & 0xFF); - } - break; - - case 'I': - { - jint val = o->int_field(field_offset); - dbuf->byte_at_put(off++, (val >> 24) & 0xFF); - dbuf->byte_at_put(off++, (val >> 16) & 0xFF); - dbuf->byte_at_put(off++, (val >> 8) & 0xFF); - dbuf->byte_at_put(off++, (val >> 0) & 0xFF); - } - break; - - case 'F': - { - jfloat fval = o->float_field(field_offset); - jint ival = (*float_to_int_bits_fn)(env, NULL, fval); - dbuf->byte_at_put(off++, (ival >> 24) & 0xFF); - dbuf->byte_at_put(off++, (ival >> 16) & 0xFF); - dbuf->byte_at_put(off++, (ival >> 8) & 0xFF); - dbuf->byte_at_put(off++, (ival >> 0) & 0xFF); - } - break; - - case 'J': - { - jlong val = o->long_field(field_offset); - dbuf->byte_at_put(off++, (val >> 56) & 0xFF); - dbuf->byte_at_put(off++, (val >> 48) & 0xFF); - dbuf->byte_at_put(off++, (val >> 40) & 0xFF); - dbuf->byte_at_put(off++, (val >> 32) & 0xFF); - dbuf->byte_at_put(off++, (val >> 24) & 0xFF); - dbuf->byte_at_put(off++, (val >> 16) & 0xFF); - dbuf->byte_at_put(off++, (val >> 8) & 0xFF); - dbuf->byte_at_put(off++, (val >> 0) & 0xFF); - } - break; - - case 'D': - { - jdouble dval = o->double_field(field_offset); - jlong lval = (*double_to_long_bits_fn)(env, NULL, dval); - dbuf->byte_at_put(off++, (lval >> 56) & 0xFF); - dbuf->byte_at_put(off++, (lval >> 48) & 0xFF); - dbuf->byte_at_put(off++, (lval >> 40) & 0xFF); - dbuf->byte_at_put(off++, (lval >> 32) & 0xFF); - dbuf->byte_at_put(off++, (lval >> 24) & 0xFF); - dbuf->byte_at_put(off++, (lval >> 16) & 0xFF); - dbuf->byte_at_put(off++, (lval >> 8) & 0xFF); - dbuf->byte_at_put(off++, (lval >> 0) & 0xFF); - } - break; - - default: - // Illegal typecode - THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "illegal typecode"); - } - } -JVM_END - // Shared JNI/JVM entry points ////////////////////////////////////////////////////////////// @@ -4235,13 +3983,13 @@ extern "C" { JVM_LEAF(jboolean, JVM_AccessVMBooleanFlag(const char* name, jboolean* value, jboolean is_get)) JVMWrapper("JVM_AccessBoolVMFlag"); - return is_get ? CommandLineFlags::boolAt((char*) name, (bool*) value) : CommandLineFlags::boolAtPut((char*) name, (bool*) value, INTERNAL); + return is_get ? CommandLineFlags::boolAt((char*) name, (bool*) value) : CommandLineFlags::boolAtPut((char*) name, (bool*) value, Flag::INTERNAL); JVM_END JVM_LEAF(jboolean, JVM_AccessVMIntFlag(const char* name, jint* value, jboolean is_get)) JVMWrapper("JVM_AccessVMIntFlag"); intx v; - jboolean result = is_get ? CommandLineFlags::intxAt((char*) name, &v) : CommandLineFlags::intxAtPut((char*) name, &v, INTERNAL); + jboolean result = is_get ? CommandLineFlags::intxAt((char*) name, &v) : CommandLineFlags::intxAtPut((char*) name, &v, Flag::INTERNAL); *value = (jint)v; return result; JVM_END diff --git a/hotspot/src/share/vm/prims/jvm.h b/hotspot/src/share/vm/prims/jvm.h index 6248f4d793d..ef57a9d2b53 100644 --- a/hotspot/src/share/vm/prims/jvm.h +++ b/hotspot/src/share/vm/prims/jvm.h @@ -374,6 +374,9 @@ JVM_NewMultiArray(JNIEnv *env, jclass eltClass, jintArray dim); /* * java.lang.Class and java.lang.ClassLoader */ + +#define JVM_CALLER_DEPTH -1 + /* * Returns the class in which the code invoking the native method * belongs. diff --git a/hotspot/src/share/vm/prims/jvm_misc.hpp b/hotspot/src/share/vm/prims/jvm_misc.hpp index 07844b1109c..266ed8690db 100644 --- a/hotspot/src/share/vm/prims/jvm_misc.hpp +++ b/hotspot/src/share/vm/prims/jvm_misc.hpp @@ -35,22 +35,6 @@ jclass find_class_from_class_loader(JNIEnv* env, Symbol* name, jboolean init, Ha void trace_class_resolution(Klass* to_class); -/* - * Support for Serialization and RMI. Currently used by HotSpot only. - */ - -extern "C" { - -void JNICALL -JVM_SetPrimitiveFieldValues(JNIEnv *env, jclass cb, jobject obj, - jlongArray fieldIDs, jcharArray typecodes, jbyteArray data); - -void JNICALL -JVM_GetPrimitiveFieldValues(JNIEnv *env, jclass cb, jobject obj, - jlongArray fieldIDs, jcharArray typecodes, jbyteArray data); - -} - /* * Support for -Xcheck:jni */ diff --git a/hotspot/src/share/vm/prims/jvmtiEnv.cpp b/hotspot/src/share/vm/prims/jvmtiEnv.cpp index f24c80f4339..318fe4e0b7e 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp @@ -259,8 +259,7 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) { // bytes to the InstanceKlass here because they have not been // validated and we're not at a safepoint. constantPoolHandle constants(current_thread, ikh->constants()); - oop cplock = constants->lock(); - ObjectLocker ol(cplock, current_thread, cplock != NULL); // lock constant pool while we query it + MonitorLockerEx ml(constants->lock()); // lock constant pool while we query it JvmtiClassFileReconstituter reconstituter(ikh); if (reconstituter.get_error() != JVMTI_ERROR_NONE) { @@ -2418,8 +2417,7 @@ JvmtiEnv::GetConstantPool(oop k_mirror, jint* constant_pool_count_ptr, jint* con instanceKlassHandle ikh(thread, k_oop); constantPoolHandle constants(thread, ikh->constants()); - oop cplock = constants->lock(); - ObjectLocker ol(cplock, thread, cplock != NULL); // lock constant pool while we query it + MonitorLockerEx ml(constants->lock()); // lock constant pool while we query it JvmtiConstantPoolReconstituter reconstituter(ikh); if (reconstituter.get_error() != JVMTI_ERROR_NONE) { diff --git a/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp b/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp index 929dcf22260..265154683ba 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp +++ b/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp @@ -406,7 +406,11 @@ public: VMOp_Type type() const { return VMOp_GetCurrentContendedMonitor; } jvmtiError result() { return _result; } void doit() { - _result = ((JvmtiEnvBase *)_env)->get_current_contended_monitor(_calling_thread,_java_thread,_owned_monitor_ptr); + _result = JVMTI_ERROR_THREAD_NOT_ALIVE; + if (Threads::includes(_java_thread) && !_java_thread->is_exiting() && + _java_thread->threadObj() != NULL) { + _result = ((JvmtiEnvBase *)_env)->get_current_contended_monitor(_calling_thread,_java_thread,_owned_monitor_ptr); + } } }; diff --git a/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp b/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp index 51cfb384ac9..f58a5a3d532 100644 --- a/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp +++ b/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp @@ -29,8 +29,43 @@ #include "runtime/thread.hpp" +// The closure for GetLoadedClasses +class LoadedClassesClosure : public KlassClosure { +private: + Stack _classStack; + JvmtiEnv* _env; -// The closure for GetLoadedClasses and GetClassLoaderClasses +public: + LoadedClassesClosure(JvmtiEnv* env) { + _env = env; + } + + void do_klass(Klass* k) { + // Collect all jclasses + _classStack.push((jclass) _env->jni_reference(k->java_mirror())); + } + + int extract(jclass* result_list) { + // The size of the Stack will be 0 after extract, so get it here + int count = (int)_classStack.size(); + int i = count; + + // Pop all jclasses, fill backwards + while (!_classStack.is_empty()) { + result_list[--i] = _classStack.pop(); + } + + // Return the number of elements written + return count; + } + + // Return current size of the Stack + int get_count() { + return (int)_classStack.size(); + } +}; + +// The closure for GetClassLoaderClasses class JvmtiGetLoadedClassesClosure : public StackObj { // Since the SystemDictionary::classes_do callback // doesn't pass a closureData pointer, @@ -165,19 +200,6 @@ class JvmtiGetLoadedClassesClosure : public StackObj { } } - // Finally, the static methods that are the callbacks - static void increment(Klass* k) { - JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); - if (that->get_initiatingLoader() == NULL) { - for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) { - that->set_count(that->get_count() + 1); - } - } else if (k != NULL) { - // if initiating loader not null, just include the instance with 1 dimension - that->set_count(that->get_count() + 1); - } - } - static void increment_with_loader(Klass* k, ClassLoaderData* loader_data) { JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); oop class_loader = loader_data->class_loader(); @@ -196,24 +218,6 @@ class JvmtiGetLoadedClassesClosure : public StackObj { } } - static void add(Klass* k) { - JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); - if (that->available()) { - if (that->get_initiatingLoader() == NULL) { - for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) { - oop mirror = l->java_mirror(); - that->set_element(that->get_index(), mirror); - that->set_index(that->get_index() + 1); - } - } else if (k != NULL) { - // if initiating loader not null, just include the instance with 1 dimension - oop mirror = k->java_mirror(); - that->set_element(that->get_index(), mirror); - that->set_index(that->get_index() + 1); - } - } - } - static void add_with_loader(Klass* k, ClassLoaderData* loader_data) { JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); if (that->available()) { @@ -255,39 +259,30 @@ class JvmtiGetLoadedClassesClosure : public StackObj { jvmtiError JvmtiGetLoadedClasses::getLoadedClasses(JvmtiEnv *env, jint* classCountPtr, jclass** classesPtr) { - // Since SystemDictionary::classes_do only takes a function pointer - // and doesn't call back with a closure data pointer, - // we can only pass static methods. - JvmtiGetLoadedClassesClosure closure; + LoadedClassesClosure closure(env); { // To get a consistent list of classes we need MultiArray_lock to ensure - // array classes aren't created, and SystemDictionary_lock to ensure that - // classes aren't added to the system dictionary, + // array classes aren't created. MutexLocker ma(MultiArray_lock); - MutexLocker sd(SystemDictionary_lock); - // First, count the classes - SystemDictionary::classes_do(&JvmtiGetLoadedClassesClosure::increment); - Universe::basic_type_classes_do(&JvmtiGetLoadedClassesClosure::increment); - // Next, fill in the classes - closure.allocate(); - SystemDictionary::classes_do(&JvmtiGetLoadedClassesClosure::add); - Universe::basic_type_classes_do(&JvmtiGetLoadedClassesClosure::add); - // Drop the SystemDictionary_lock, so the results could be wrong from here, - // but we still have a snapshot. + // Iterate through all classes in ClassLoaderDataGraph + // and collect them using the LoadedClassesClosure + ClassLoaderDataGraph::loaded_classes_do(&closure); } - // Post results + + // Return results by extracting the collected contents into a list + // allocated via JvmtiEnv jclass* result_list; - jvmtiError err = env->Allocate(closure.get_count() * sizeof(jclass), - (unsigned char**)&result_list); - if (err != JVMTI_ERROR_NONE) { - return err; + jvmtiError error = env->Allocate(closure.get_count() * sizeof(jclass), + (unsigned char**)&result_list); + + if (error == JVMTI_ERROR_NONE) { + int count = closure.extract(result_list); + *classCountPtr = count; + *classesPtr = result_list; } - closure.extract(env, result_list); - *classCountPtr = closure.get_count(); - *classesPtr = result_list; - return JVMTI_ERROR_NONE; + return error; } jvmtiError diff --git a/hotspot/src/share/vm/prims/jvmtiImpl.cpp b/hotspot/src/share/vm/prims/jvmtiImpl.cpp index 6f8b41297a4..ad90eeb9435 100644 --- a/hotspot/src/share/vm/prims/jvmtiImpl.cpp +++ b/hotspot/src/share/vm/prims/jvmtiImpl.cpp @@ -210,6 +210,14 @@ void GrowableCache::oops_do(OopClosure* f) { } } +void GrowableCache::metadata_do(void f(Metadata*)) { + int len = _elements->length(); + for (int i=0; iat(i); + e->metadata_do(f); + } +} + void GrowableCache::gc_epilogue() { int len = _elements->length(); for (int i=0; iis_in_stack((address)&_method)) { - thread->allow_unhandled_oop((oop*)&_method); - } -#endif // CHECK_UNHANDLED_OOPS + _class_holder = NULL; } JvmtiBreakpoint::JvmtiBreakpoint(Method* m_method, jlocation location) { _method = m_method; - _class_loader = _method->method_holder()->class_loader_data()->class_loader(); + _class_holder = _method->method_holder()->klass_holder(); +#ifdef CHECK_UNHANDLED_OOPS + // _class_holder can't be wrapped in a Handle, because JvmtiBreakpoints are + // sometimes allocated on the heap. + // + // The code handling JvmtiBreakpoints allocated on the stack can't be + // interrupted by a GC until _class_holder is reachable by the GC via the + // oops_do method. + Thread::current()->allow_unhandled_oop(&_class_holder); +#endif // CHECK_UNHANDLED_OOPS assert(_method != NULL, "_method != NULL"); _bci = (int) location; assert(_bci >= 0, "_bci >= 0"); @@ -245,7 +255,7 @@ JvmtiBreakpoint::JvmtiBreakpoint(Method* m_method, jlocation location) { void JvmtiBreakpoint::copy(JvmtiBreakpoint& bp) { _method = bp._method; _bci = bp._bci; - _class_loader = bp._class_loader; + _class_holder = bp._class_holder; } bool JvmtiBreakpoint::lessThan(JvmtiBreakpoint& bp) { @@ -273,59 +283,49 @@ void JvmtiBreakpoint::each_method_version_do(method_action meth_act) { // add/remove breakpoint to/from versions of the method that // are EMCP. Directly or transitively obsolete methods are - // not saved in the PreviousVersionInfo. + // not saved in the PreviousVersionNodes. Thread *thread = Thread::current(); instanceKlassHandle ikh = instanceKlassHandle(thread, _method->method_holder()); Symbol* m_name = _method->name(); Symbol* m_signature = _method->signature(); - { - ResourceMark rm(thread); - // PreviousVersionInfo objects returned via PreviousVersionWalker - // contain a GrowableArray of handles. We have to clean up the - // GrowableArray _after_ the PreviousVersionWalker destructor - // has destroyed the handles. - { - // search previous versions if they exist - PreviousVersionWalker pvw((InstanceKlass *)ikh()); - for (PreviousVersionInfo * pv_info = pvw.next_previous_version(); - pv_info != NULL; pv_info = pvw.next_previous_version()) { - GrowableArray* methods = - pv_info->prev_EMCP_method_handles(); + // search previous versions if they exist + PreviousVersionWalker pvw(thread, (InstanceKlass *)ikh()); + for (PreviousVersionNode * pv_node = pvw.next_previous_version(); + pv_node != NULL; pv_node = pvw.next_previous_version()) { + GrowableArray* methods = pv_node->prev_EMCP_methods(); - if (methods == NULL) { - // We have run into a PreviousVersion generation where - // all methods were made obsolete during that generation's - // RedefineClasses() operation. At the time of that - // operation, all EMCP methods were flushed so we don't - // have to go back any further. - // - // A NULL methods array is different than an empty methods - // array. We cannot infer any optimizations about older - // generations from an empty methods array for the current - // generation. - break; - } + if (methods == NULL) { + // We have run into a PreviousVersion generation where + // all methods were made obsolete during that generation's + // RedefineClasses() operation. At the time of that + // operation, all EMCP methods were flushed so we don't + // have to go back any further. + // + // A NULL methods array is different than an empty methods + // array. We cannot infer any optimizations about older + // generations from an empty methods array for the current + // generation. + break; + } - for (int i = methods->length() - 1; i >= 0; i--) { - methodHandle method = methods->at(i); - // obsolete methods that are running are not deleted from - // previous version array, but they are skipped here. - if (!method->is_obsolete() && - method->name() == m_name && - method->signature() == m_signature) { - RC_TRACE(0x00000800, ("%sing breakpoint in %s(%s)", - meth_act == &Method::set_breakpoint ? "sett" : "clear", - method->name()->as_C_string(), - method->signature()->as_C_string())); + for (int i = methods->length() - 1; i >= 0; i--) { + Method* method = methods->at(i); + // obsolete methods that are running are not deleted from + // previous version array, but they are skipped here. + if (!method->is_obsolete() && + method->name() == m_name && + method->signature() == m_signature) { + RC_TRACE(0x00000800, ("%sing breakpoint in %s(%s)", + meth_act == &Method::set_breakpoint ? "sett" : "clear", + method->name()->as_C_string(), + method->signature()->as_C_string())); - ((Method*)method()->*meth_act)(_bci); - break; - } - } + (method->*meth_act)(_bci); + break; } - } // pvw is cleaned up - } // rm is cleaned up + } + } } void JvmtiBreakpoint::set() { @@ -373,6 +373,13 @@ void VM_ChangeBreakpoints::oops_do(OopClosure* f) { } } +void VM_ChangeBreakpoints::metadata_do(void f(Metadata*)) { + // Walk metadata in breakpoints to keep from being deallocated with RedefineClasses + if (_bp != NULL) { + _bp->metadata_do(f); + } +} + // // class JvmtiBreakpoints // @@ -389,6 +396,10 @@ void JvmtiBreakpoints::oops_do(OopClosure* f) { _bps.oops_do(f); } +void JvmtiBreakpoints::metadata_do(void f(Metadata*)) { + _bps.metadata_do(f); +} + void JvmtiBreakpoints::gc_epilogue() { _bps.gc_epilogue(); } @@ -507,6 +518,12 @@ void JvmtiCurrentBreakpoints::oops_do(OopClosure* f) { } } +void JvmtiCurrentBreakpoints::metadata_do(void f(Metadata*)) { + if (_jvmti_breakpoints != NULL) { + _jvmti_breakpoints->metadata_do(f); + } +} + void JvmtiCurrentBreakpoints::gc_epilogue() { if (_jvmti_breakpoints != NULL) { _jvmti_breakpoints->gc_epilogue(); diff --git a/hotspot/src/share/vm/prims/jvmtiImpl.hpp b/hotspot/src/share/vm/prims/jvmtiImpl.hpp index c7beb176215..fc502c7387d 100644 --- a/hotspot/src/share/vm/prims/jvmtiImpl.hpp +++ b/hotspot/src/share/vm/prims/jvmtiImpl.hpp @@ -69,6 +69,7 @@ public: virtual bool lessThan(GrowableElement *e)=0; virtual GrowableElement *clone() =0; virtual void oops_do(OopClosure* f) =0; + virtual void metadata_do(void f(Metadata*)) =0; }; class GrowableCache VALUE_OBJ_CLASS_SPEC { @@ -115,6 +116,8 @@ public: void clear(); // apply f to every element and update the cache void oops_do(OopClosure* f); + // walk metadata to preserve for RedefineClasses + void metadata_do(void f(Metadata*)); // update the cache after a full gc void gc_epilogue(); }; @@ -148,6 +151,7 @@ public: void remove (int index) { _cache.remove(index); } void clear() { _cache.clear(); } void oops_do(OopClosure* f) { _cache.oops_do(f); } + void metadata_do(void f(Metadata*)) { _cache.metadata_do(f); } void gc_epilogue() { _cache.gc_epilogue(); } }; @@ -169,7 +173,7 @@ private: Method* _method; int _bci; Bytecodes::Code _orig_bytecode; - oop _class_loader; + oop _class_holder; // keeps _method memory from being deallocated public: JvmtiBreakpoint(); @@ -191,9 +195,15 @@ public: bool lessThan(GrowableElement* e) { Unimplemented(); return false; } bool equals(GrowableElement* e) { return equals((JvmtiBreakpoint&) *e); } void oops_do(OopClosure* f) { - // Mark the method loader as live - f->do_oop(&_class_loader); + // Mark the method loader as live so the Method* class loader doesn't get + // unloaded and Method* memory reclaimed. + f->do_oop(&_class_holder); } + void metadata_do(void f(Metadata*)) { + // walk metadata to preserve for RedefineClasses + f(_method); + } + GrowableElement *clone() { JvmtiBreakpoint *bp = new JvmtiBreakpoint(); bp->copy(*this); @@ -239,6 +249,7 @@ public: int length(); void oops_do(OopClosure* f); + void metadata_do(void f(Metadata*)); void print(); int set(JvmtiBreakpoint& bp); @@ -288,6 +299,7 @@ public: static inline bool is_breakpoint(address bcp); static void oops_do(OopClosure* f); + static void metadata_do(void f(Metadata*)); static void gc_epilogue(); }; @@ -332,6 +344,7 @@ public: VMOp_Type type() const { return VMOp_ChangeBreakpoints; } void doit(); void oops_do(OopClosure* f); + void metadata_do(void f(Metadata*)); }; diff --git a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp index 0e3bbc35c5b..1c3bbbfeed0 100644 --- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp +++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp @@ -2755,13 +2755,26 @@ void VM_RedefineClasses::AdjustCpoolCacheAndVtable::do_klass(Klass* k) { // InstanceKlass around to hold obsolete methods so we don't have // any other InstanceKlass embedded vtables to update. The vtable // holds the Method*s for virtual (but not final) methods. - if (ik->vtable_length() > 0 && ik->is_subtype_of(_the_class_oop)) { + // Default methods, or concrete methods in interfaces are stored + // in the vtable, so if an interface changes we need to check + // adjust_method_entries() for every InstanceKlass, which will also + // adjust the default method vtable indices. + // We also need to adjust any default method entries that are + // not yet in the vtable, because the vtable setup is in progress. + // This must be done after we adjust the default_methods and + // default_vtable_indices for methods already in the vtable. + if (ik->vtable_length() > 0 && (_the_class_oop->is_interface() + || ik->is_subtype_of(_the_class_oop))) { // ik->vtable() creates a wrapper object; rm cleans it up ResourceMark rm(_thread); ik->vtable()->adjust_method_entries(_matching_old_methods, _matching_new_methods, _matching_methods_length, &trace_name_printed); + ik->adjust_default_methods(_matching_old_methods, + _matching_new_methods, + _matching_methods_length, + &trace_name_printed); } // If the current class has an itable and we are either redefining an @@ -2807,28 +2820,20 @@ void VM_RedefineClasses::AdjustCpoolCacheAndVtable::do_klass(Klass* k) { &trace_name_printed); } } - { - ResourceMark rm(_thread); - // PreviousVersionInfo objects returned via PreviousVersionWalker - // contain a GrowableArray of handles. We have to clean up the - // GrowableArray _after_ the PreviousVersionWalker destructor - // has destroyed the handles. - { - // the previous versions' constant pool caches may need adjustment - PreviousVersionWalker pvw(ik); - for (PreviousVersionInfo * pv_info = pvw.next_previous_version(); - pv_info != NULL; pv_info = pvw.next_previous_version()) { - other_cp = pv_info->prev_constant_pool_handle(); - cp_cache = other_cp->cache(); - if (cp_cache != NULL) { - cp_cache->adjust_method_entries(_matching_old_methods, - _matching_new_methods, - _matching_methods_length, - &trace_name_printed); - } - } - } // pvw is cleaned up - } // rm is cleaned up + + // the previous versions' constant pool caches may need adjustment + PreviousVersionWalker pvw(_thread, ik); + for (PreviousVersionNode * pv_node = pvw.next_previous_version(); + pv_node != NULL; pv_node = pvw.next_previous_version()) { + other_cp = pv_node->prev_constant_pool(); + cp_cache = other_cp->cache(); + if (cp_cache != NULL) { + cp_cache->adjust_method_entries(_matching_old_methods, + _matching_new_methods, + _matching_methods_length, + &trace_name_printed); + } + } } } @@ -2939,13 +2944,13 @@ void VM_RedefineClasses::check_methods_and_mark_as_obsolete( old_method->set_is_obsolete(); obsolete_count++; - // obsolete methods need a unique idnum + // obsolete methods need a unique idnum so they become new entries in + // the jmethodID cache in InstanceKlass u2 num = InstanceKlass::cast(_the_class_oop)->next_method_idnum(); if (num != ConstMethod::UNSET_IDNUM) { -// u2 old_num = old_method->method_idnum(); old_method->set_method_idnum(num); -// TO DO: attach obsolete annotations to obsolete method's new idnum } + // With tracing we try not to "yack" too much. The position of // this trace assumes there are fewer obsolete methods than // EMCP methods. diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp index eb68b4296f5..977614648d3 100644 --- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp +++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp @@ -165,7 +165,7 @@ class JvmtiTagHashmap : public CHeapObj { static unsigned int hash(oop key, int size) { // shift right to get better distribution (as these bits will be zero // with aligned addresses) - unsigned int addr = (unsigned int)((intptr_t)key); + unsigned int addr = (unsigned int)(cast_from_oop(key)); #ifdef _LP64 return (addr >> 3) % size; #else diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp index 88b82b358e6..94b5537a6a5 100644 --- a/hotspot/src/share/vm/prims/methodHandles.cpp +++ b/hotspot/src/share/vm/prims/methodHandles.cpp @@ -187,12 +187,34 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) { receiver_limit = m->method_holder(); assert(receiver_limit->verify_itable_index(vmindex), ""); flags |= IS_METHOD | (JVM_REF_invokeInterface << REFERENCE_KIND_SHIFT); + if (TraceInvokeDynamic) { + ResourceMark rm; + tty->print_cr("memberName: invokeinterface method_holder::method: %s, receiver: %s, itableindex: %d, access_flags:", + Method::name_and_sig_as_C_string(receiver_limit(), m->name(), m->signature()), + receiver_limit()->internal_name(), vmindex); + m->access_flags().print_on(tty); + if (!m->is_abstract()) { + tty->print("default"); + } + tty->cr(); + } break; case CallInfo::vtable_call: vmindex = info.vtable_index(); flags |= IS_METHOD | (JVM_REF_invokeVirtual << REFERENCE_KIND_SHIFT); assert(receiver_limit->is_subtype_of(m->method_holder()), "virtual call must be type-safe"); + if (TraceInvokeDynamic) { + ResourceMark rm; + tty->print_cr("memberName: invokevirtual method_holder::method: %s, receiver: %s, vtableindex: %d, access_flags:", + Method::name_and_sig_as_C_string(receiver_limit(), m->name(), m->signature()), + receiver_limit()->internal_name(), vmindex); + m->access_flags().print_on(tty); + if (m->is_default_method()) { + tty->print("default"); + } + tty->cr(); + } break; case CallInfo::direct_call: @@ -1172,9 +1194,7 @@ JVM_ENTRY(jobject, MHN_getMemberVMInfo(JNIEnv *env, jobject igcls, jobject mname } else if (vmtarget->is_klass()) { x = ((Klass*) vmtarget)->java_mirror(); } else if (vmtarget->is_method()) { - Handle mname2 = MethodHandles::new_MemberName(CHECK_NULL); - CallInfo info((Method*)vmtarget); - x = MethodHandles::init_method_MemberName(mname2, info); + x = mname(); } result->obj_at_put(1, x); return JNIHandles::make_local(env, result()); diff --git a/hotspot/src/share/vm/prims/nativeLookup.cpp b/hotspot/src/share/vm/prims/nativeLookup.cpp index 990600eea27..bb4843ee3b0 100644 --- a/hotspot/src/share/vm/prims/nativeLookup.cpp +++ b/hotspot/src/share/vm/prims/nativeLookup.cpp @@ -129,10 +129,6 @@ extern "C" { #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f) static JNINativeMethod lookup_special_native_methods[] = { - // Next two functions only exist for compatibility with 1.3.1 and earlier. - { CC"Java_java_io_ObjectOutputStream_getPrimitiveFieldValues", NULL, FN_PTR(JVM_GetPrimitiveFieldValues) }, // intercept ObjectOutputStream getPrimitiveFieldValues for faster serialization - { CC"Java_java_io_ObjectInputStream_setPrimitiveFieldValues", NULL, FN_PTR(JVM_SetPrimitiveFieldValues) }, // intercept ObjectInputStream setPrimitiveFieldValues for faster serialization - { CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) }, { CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) }, { CC"Java_sun_misc_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) }, @@ -140,9 +136,8 @@ static JNINativeMethod lookup_special_native_methods[] = { }; static address lookup_special_native(char* jni_name) { - int i = !JDK_Version::is_gte_jdk14x_version() ? 0 : 2; // see comment in lookup_special_native_methods int count = sizeof(lookup_special_native_methods) / sizeof(JNINativeMethod); - for (; i < count; i++) { + for (int i = 0; i < count; i++) { // NB: To ignore the jni prefix and jni postfix strstr is used matching. if (strstr(jni_name, lookup_special_native_methods[i].name) != NULL) { return CAST_FROM_FN_PTR(address, lookup_special_native_methods[i].fnPtr); diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp index e37b0c80d20..2e432264b6e 100644 --- a/hotspot/src/share/vm/prims/unsafe.cpp +++ b/hotspot/src/share/vm/prims/unsafe.cpp @@ -292,9 +292,9 @@ UNSAFE_ENTRY(jobject, Unsafe_GetObjectVolatile(JNIEnv *env, jobject unsafe, jobj volatile oop v; if (UseCompressedOops) { volatile narrowOop n = *(volatile narrowOop*) addr; - v = oopDesc::decode_heap_oop(n); + (void)const_cast(v = oopDesc::decode_heap_oop(n)); } else { - v = *(volatile oop*) addr; + (void)const_cast(v = *(volatile oop*) addr); } OrderAccess::acquire(); return JNIHandles::make_local(env, v); @@ -1222,9 +1222,9 @@ UNSAFE_ENTRY(void, Unsafe_Park(JNIEnv *env, jobject unsafe, jboolean isAbsolute, #endif /* USDT2 */ if (event.should_commit()) { oop obj = thread->current_park_blocker(); - event.set_klass(obj ? obj->klass() : NULL); + event.set_klass((obj != NULL) ? obj->klass() : NULL); event.set_timeout(time); - event.set_address(obj ? (TYPE_ADDRESS) (uintptr_t) obj : 0); + event.set_address((obj != NULL) ? (TYPE_ADDRESS) cast_from_oop(obj) : 0); event.commit(); } UNSAFE_END diff --git a/hotspot/src/share/vm/prims/wbtestmethods/parserTests.cpp b/hotspot/src/share/vm/prims/wbtestmethods/parserTests.cpp index 4a74ddfaa68..da3493cf3c1 100644 --- a/hotspot/src/share/vm/prims/wbtestmethods/parserTests.cpp +++ b/hotspot/src/share/vm/prims/wbtestmethods/parserTests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -117,11 +117,12 @@ WB_ENTRY(jobjectArray, WB_ParseCommandLine(JNIEnv* env, jobject o, jstring j_cmd const char* c_cmdline = java_lang_String::as_utf8_string(JNIHandles::resolve(j_cmdline)); objArrayOop argumentArray = objArrayOop(JNIHandles::resolve_non_null(arguments)); + objArrayHandle argumentArray_ah(THREAD, argumentArray); - int length = argumentArray->length(); + int length = argumentArray_ah->length(); for (int i = 0; i < length; i++) { - oop argument_oop = argumentArray->obj_at(i); + oop argument_oop = argumentArray_ah->obj_at(i); fill_in_parser(&parser, argument_oop); } @@ -130,19 +131,20 @@ WB_ENTRY(jobjectArray, WB_ParseCommandLine(JNIEnv* env, jobject o, jstring j_cmd Klass* k = SystemDictionary::Object_klass(); objArrayOop returnvalue_array = oopFactory::new_objArray(k, parser.num_arguments() * 2, CHECK_NULL); + objArrayHandle returnvalue_array_ah(THREAD, returnvalue_array); GrowableArray*parsedArgNames = parser.argument_name_array(); for (int i = 0; i < parser.num_arguments(); i++) { oop parsedName = java_lang_String::create_oop_from_str(parsedArgNames->at(i), CHECK_NULL); - returnvalue_array->obj_at_put(i*2, parsedName); + returnvalue_array_ah->obj_at_put(i*2, parsedName); GenDCmdArgument* arg = parser.lookup_dcmd_option(parsedArgNames->at(i), strlen(parsedArgNames->at(i))); char buf[VALUE_MAXLEN]; arg->value_as_str(buf, sizeof(buf)); oop parsedValue = java_lang_String::create_oop_from_str(buf, CHECK_NULL); - returnvalue_array->obj_at_put(i*2+1, parsedValue); + returnvalue_array_ah->obj_at_put(i*2+1, parsedValue); } - return (jobjectArray) JNIHandles::make_local(returnvalue_array); + return (jobjectArray) JNIHandles::make_local(returnvalue_array_ah()); WB_END diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 93b31f1859a..8060dae0377 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -625,11 +625,11 @@ void Arguments::describe_range_error(ArgsRange errcode) { } } -static bool set_bool_flag(char* name, bool value, FlagValueOrigin origin) { +static bool set_bool_flag(char* name, bool value, Flag::Flags origin) { return CommandLineFlags::boolAtPut(name, &value, origin); } -static bool set_fp_numeric_flag(char* name, char* value, FlagValueOrigin origin) { +static bool set_fp_numeric_flag(char* name, char* value, Flag::Flags origin) { double v; if (sscanf(value, "%lf", &v) != 1) { return false; @@ -641,7 +641,7 @@ static bool set_fp_numeric_flag(char* name, char* value, FlagValueOrigin origin) return false; } -static bool set_numeric_flag(char* name, char* value, FlagValueOrigin origin) { +static bool set_numeric_flag(char* name, char* value, Flag::Flags origin) { julong v; intx intx_v; bool is_neg = false; @@ -674,14 +674,14 @@ static bool set_numeric_flag(char* name, char* value, FlagValueOrigin origin) { return false; } -static bool set_string_flag(char* name, const char* value, FlagValueOrigin origin) { +static bool set_string_flag(char* name, const char* value, Flag::Flags origin) { if (!CommandLineFlags::ccstrAtPut(name, &value, origin)) return false; // Contract: CommandLineFlags always returns a pointer that needs freeing. FREE_C_HEAP_ARRAY(char, value, mtInternal); return true; } -static bool append_to_string_flag(char* name, const char* new_value, FlagValueOrigin origin) { +static bool append_to_string_flag(char* name, const char* new_value, Flag::Flags origin) { const char* old_value = ""; if (!CommandLineFlags::ccstrAt(name, &old_value)) return false; size_t old_len = old_value != NULL ? strlen(old_value) : 0; @@ -709,7 +709,7 @@ static bool append_to_string_flag(char* name, const char* new_value, FlagValueOr return true; } -bool Arguments::parse_argument(const char* arg, FlagValueOrigin origin) { +bool Arguments::parse_argument(const char* arg, Flag::Flags origin) { // range of acceptable characters spelled out for portability reasons #define NAME_RANGE "[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]" @@ -850,7 +850,7 @@ void Arguments::print_jvm_args_on(outputStream* st) { } bool Arguments::process_argument(const char* arg, - jboolean ignore_unrecognized, FlagValueOrigin origin) { + jboolean ignore_unrecognized, Flag::Flags origin) { JDK_Version since = JDK_Version(); @@ -904,7 +904,7 @@ bool Arguments::process_argument(const char* arg, jio_fprintf(defaultStream::error_stream(), "Did you mean '%s%s%s'?\n", (fuzzy_matched->is_bool()) ? "(+/-)" : "", - fuzzy_matched->name, + fuzzy_matched->_name, (fuzzy_matched->is_bool()) ? "" : "="); } } @@ -952,7 +952,7 @@ bool Arguments::process_settings_file(const char* file_name, bool should_exist, // this allows a way to include spaces in string-valued options token[pos] = '\0'; logOption(token); - result &= process_argument(token, ignore_unrecognized, CONFIG_FILE); + result &= process_argument(token, ignore_unrecognized, Flag::CONFIG_FILE); build_jvm_flags(token); pos = 0; in_white_space = true; @@ -970,7 +970,7 @@ bool Arguments::process_settings_file(const char* file_name, bool should_exist, } if (pos > 0) { token[pos] = '\0'; - result &= process_argument(token, ignore_unrecognized, CONFIG_FILE); + result &= process_argument(token, ignore_unrecognized, Flag::CONFIG_FILE); build_jvm_flags(token); } fclose(stream); @@ -1100,6 +1100,7 @@ void Arguments::set_mode_flags(Mode mode) { } } +#if defined(COMPILER2) || defined(_LP64) || !INCLUDE_CDS // Conflict: required to use shared spaces (-Xshare:on), but // incompatible command line options were chosen. @@ -1112,6 +1113,7 @@ static void no_shared_spaces() { FLAG_SET_DEFAULT(UseSharedSpaces, false); } } +#endif void Arguments::set_tiered_flags() { // With tiered, set default policy to AdvancedThresholdPolicy, which is 3. @@ -1130,6 +1132,9 @@ void Arguments::set_tiered_flags() { Tier3InvokeNotifyFreqLog = 0; Tier4InvocationThreshold = 0; } + if (FLAG_IS_DEFAULT(NmethodSweepFraction)) { + FLAG_SET_DEFAULT(NmethodSweepFraction, 1 + ReservedCodeCacheSize / (16 * M)); + } } #if INCLUDE_ALL_GCS @@ -1520,16 +1525,18 @@ void Arguments::set_ergonomics_flags() { FLAG_SET_ERGO(bool, UseParallelGC, true); } } - // Shared spaces work fine with other GCs but causes bytecode rewriting - // to be disabled, which hurts interpreter performance and decreases - // server performance. On server class machines, keep the default - // off unless it is asked for. Future work: either add bytecode rewriting - // at link time, or rewrite bytecodes in non-shared methods. - if (!DumpSharedSpaces && !RequireSharedSpaces && - (FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) { - no_shared_spaces(); - } } +#ifdef COMPILER2 + // Shared spaces work fine with other GCs but causes bytecode rewriting + // to be disabled, which hurts interpreter performance and decreases + // server performance. When -server is specified, keep the default off + // unless it is asked for. Future work: either add bytecode rewriting + // at link time, or rewrite bytecodes in non-shared methods. + if (!DumpSharedSpaces && !RequireSharedSpaces && + (FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) { + no_shared_spaces(); + } +#endif set_conservative_max_heap_alignment(); @@ -1950,12 +1957,6 @@ bool Arguments::check_gc_consistency() { "please refer to the release notes for the combinations " "allowed\n"); status = false; - } else if (ReservedCodeCacheSize > 2*G) { - // Code cache size larger than MAXINT is not supported. - jio_fprintf(defaultStream::error_stream(), - "Invalid ReservedCodeCacheSize=%dM. Must be at most %uM.\n", ReservedCodeCacheSize/M, - (2*G)/M); - status = false; } return status; } @@ -1987,6 +1988,15 @@ void Arguments::check_deprecated_gc_flags() { warning("DefaultMaxRAMFraction is deprecated and will likely be removed in a future release. " "Use MaxRAMFraction instead."); } + if (FLAG_IS_CMDLINE(UseCMSCompactAtFullCollection)) { + warning("UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release."); + } + if (FLAG_IS_CMDLINE(CMSFullGCsBeforeCompaction)) { + warning("CMSFullGCsBeforeCompaction is deprecated and will likely be removed in a future release."); + } + if (FLAG_IS_CMDLINE(UseCMSCollectionPassing)) { + warning("UseCMSCollectionPassing is deprecated and will likely be removed in a future release."); + } } // Check stack pages settings @@ -2038,6 +2048,9 @@ bool Arguments::check_vm_args_consistency() { status = status && verify_interval(StringTableSize, minimumStringTableSize, (max_uintx / StringTable::bucket_size()), "StringTable size"); + status = status && verify_interval(SymbolTableSize, minimumSymbolTableSize, + (max_uintx / SymbolTable::bucket_size()), "SymbolTable size"); + if (MinHeapFreeRatio > MaxHeapFreeRatio) { jio_fprintf(defaultStream::error_stream(), "MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or " @@ -2333,6 +2346,10 @@ bool Arguments::check_vm_args_consistency() { (2*G)/M); status = false; } + + status &= verify_interval(NmethodSweepFraction, 1, ReservedCodeCacheSize/K, "NmethodSweepFraction"); + status &= verify_interval(NmethodSweepActivity, 0, 2000, "NmethodSweepActivity"); + return status; } @@ -2434,26 +2451,11 @@ jint Arguments::parse_vm_init_args(const JavaVMInitArgs* args) { } // Parse JavaVMInitArgs structure passed in - result = parse_each_vm_init_arg(args, &scp, &scp_assembly_required, COMMAND_LINE); + result = parse_each_vm_init_arg(args, &scp, &scp_assembly_required, Flag::COMMAND_LINE); if (result != JNI_OK) { return result; } - if (AggressiveOpts) { - // Insert alt-rt.jar between user-specified bootclasspath - // prefix and the default bootclasspath. os::set_boot_path() - // uses meta_index_dir as the default bootclasspath directory. - const char* altclasses_jar = "alt-rt.jar"; - size_t altclasses_path_len = strlen(get_meta_index_dir()) + 1 + - strlen(altclasses_jar); - char* altclasses_path = NEW_C_HEAP_ARRAY(char, altclasses_path_len, mtInternal); - strcpy(altclasses_path, get_meta_index_dir()); - strcat(altclasses_path, altclasses_jar); - scp.add_suffix_to_prefix(altclasses_path); - scp_assembly_required = true; - FREE_C_HEAP_ARRAY(char, altclasses_path, mtInternal); - } - // Parse _JAVA_OPTIONS environment variable (if present) (mimics classic VM) result = parse_java_options_environment_variable(&scp, &scp_assembly_required); if (result != JNI_OK) { @@ -2521,7 +2523,7 @@ bool valid_hprof_or_jdwp_agent(char *name, bool is_path) { jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, - FlagValueOrigin origin) { + Flag::Flags origin) { // Remaining part of option string const char* tail; @@ -2658,16 +2660,16 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, FLAG_SET_CMDLINE(bool, BackgroundCompilation, false); // -Xmn for compatibility with other JVM vendors } else if (match_option(option, "-Xmn", &tail)) { - julong long_initial_eden_size = 0; - ArgsRange errcode = parse_memory_size(tail, &long_initial_eden_size, 1); + julong long_initial_young_size = 0; + ArgsRange errcode = parse_memory_size(tail, &long_initial_young_size, 1); if (errcode != arg_in_range) { jio_fprintf(defaultStream::error_stream(), - "Invalid initial eden size: %s\n", option->optionString); + "Invalid initial young generation size: %s\n", option->optionString); describe_range_error(errcode); return JNI_EINVAL; } - FLAG_SET_CMDLINE(uintx, MaxNewSize, (uintx)long_initial_eden_size); - FLAG_SET_CMDLINE(uintx, NewSize, (uintx)long_initial_eden_size); + FLAG_SET_CMDLINE(uintx, MaxNewSize, (uintx)long_initial_young_size); + FLAG_SET_CMDLINE(uintx, NewSize, (uintx)long_initial_young_size); // -Xms } else if (match_option(option, "-Xms", &tail)) { julong long_initial_heap_size = 0; @@ -2695,8 +2697,9 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, FLAG_SET_CMDLINE(uintx, MaxHeapSize, (uintx)long_max_heap_size); // Xmaxf } else if (match_option(option, "-Xmaxf", &tail)) { - int maxf = (int)(atof(tail) * 100); - if (maxf < 0 || maxf > 100) { + char* err; + int maxf = (int)(strtod(tail, &err) * 100); + if (*err != '\0' || maxf < 0 || maxf > 100) { jio_fprintf(defaultStream::error_stream(), "Bad max heap free percentage size: %s\n", option->optionString); @@ -2706,8 +2709,9 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, } // Xminf } else if (match_option(option, "-Xminf", &tail)) { - int minf = (int)(atof(tail) * 100); - if (minf < 0 || minf > 100) { + char* err; + int minf = (int)(strtod(tail, &err) * 100); + if (*err != '\0' || minf < 0 || minf > 100) { jio_fprintf(defaultStream::error_stream(), "Bad min heap free percentage size: %s\n", option->optionString); @@ -3344,7 +3348,7 @@ jint Arguments::parse_options_environment_variable(const char* name, SysClassPat } } - return(parse_each_vm_init_arg(&vm_args, scp_p, scp_assembly_required_p, ENVIRON_VAR)); + return(parse_each_vm_init_arg(&vm_args, scp_p, scp_assembly_required_p, Flag::ENVIRON_VAR)); } return JNI_OK; } @@ -3667,6 +3671,9 @@ jint Arguments::apply_ergo() { assert(verify_serial_gc_flags(), "SerialGC unset"); #endif // INCLUDE_ALL_GCS + // Initialize Metaspace flags and alignments. + Metaspace::ergo_initialize(); + // Set bytecode rewriting flags set_bytecode_flags(); @@ -3717,6 +3724,18 @@ jint Arguments::apply_ergo() { // incremental inlining: bump MaxNodeLimit FLAG_SET_DEFAULT(MaxNodeLimit, (intx)75000); } + if (!UseTypeSpeculation && FLAG_IS_DEFAULT(TypeProfileLevel)) { + // nothing to use the profiling, turn if off + FLAG_SET_DEFAULT(TypeProfileLevel, 0); + } + if (UseTypeSpeculation && FLAG_IS_DEFAULT(ReplaceInParentMaps)) { + // Doing the replace in parent maps helps speculation + FLAG_SET_DEFAULT(ReplaceInParentMaps, true); + } +#ifndef X86 + // Only on x86 for now + FLAG_SET_DEFAULT(TypeProfileLevel, 0); +#endif #endif if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) { diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp index 4b2a821a5a3..d016e22f22e 100644 --- a/hotspot/src/share/vm/runtime/arguments.hpp +++ b/hotspot/src/share/vm/runtime/arguments.hpp @@ -360,15 +360,15 @@ class Arguments : AllStatic { // Argument parsing static void do_pd_flag_adjustments(); - static bool parse_argument(const char* arg, FlagValueOrigin origin); - static bool process_argument(const char* arg, jboolean ignore_unrecognized, FlagValueOrigin origin); + static bool parse_argument(const char* arg, Flag::Flags origin); + static bool process_argument(const char* arg, jboolean ignore_unrecognized, Flag::Flags origin); static void process_java_launcher_argument(const char*, void*); static void process_java_compiler_argument(char* arg); static jint parse_options_environment_variable(const char* name, SysClassPath* scp_p, bool* scp_assembly_required_p); static jint parse_java_tool_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p); static jint parse_java_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p); static jint parse_vm_init_args(const JavaVMInitArgs* args); - static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, FlagValueOrigin origin); + static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, Flag::Flags origin); static jint finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required); static bool is_bad_option(const JavaVMOption* option, jboolean ignore, const char* option_type); diff --git a/hotspot/src/share/vm/runtime/biasedLocking.cpp b/hotspot/src/share/vm/runtime/biasedLocking.cpp index f526fbcbc7f..2ac4da03f5e 100644 --- a/hotspot/src/share/vm/runtime/biasedLocking.cpp +++ b/hotspot/src/share/vm/runtime/biasedLocking.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -161,7 +161,7 @@ static BiasedLocking::Condition revoke_bias(oop obj, bool allow_rebias, bool is_ if (TraceBiasedLocking && (Verbose || !is_bulk)) { ResourceMark rm; tty->print_cr("Revoking bias of object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s , prototype header " INTPTR_FORMAT " , allow rebias %d , requesting thread " INTPTR_FORMAT, - (intptr_t) obj, (intptr_t) mark, obj->klass()->external_name(), (intptr_t) obj->klass()->prototype_header(), (allow_rebias ? 1 : 0), (intptr_t) requesting_thread); + (void *)obj, (intptr_t) mark, obj->klass()->external_name(), (intptr_t) obj->klass()->prototype_header(), (allow_rebias ? 1 : 0), (intptr_t) requesting_thread); } JavaThread* biased_thread = mark->biased_locker(); @@ -214,8 +214,8 @@ static BiasedLocking::Condition revoke_bias(oop obj, bool allow_rebias, bool is_ if (mon_info->owner() == obj) { if (TraceBiasedLocking && Verbose) { tty->print_cr(" mon_info->owner (" PTR_FORMAT ") == obj (" PTR_FORMAT ")", - (intptr_t) mon_info->owner(), - (intptr_t) obj); + (void *) mon_info->owner(), + (void *) obj); } // Assume recursive case and fix up highest lock later markOop mark = markOopDesc::encode((BasicLock*) NULL); @@ -224,8 +224,8 @@ static BiasedLocking::Condition revoke_bias(oop obj, bool allow_rebias, bool is_ } else { if (TraceBiasedLocking && Verbose) { tty->print_cr(" mon_info->owner (" PTR_FORMAT ") != obj (" PTR_FORMAT ")", - (intptr_t) mon_info->owner(), - (intptr_t) obj); + (void *) mon_info->owner(), + (void *) obj); } } } @@ -326,7 +326,7 @@ static BiasedLocking::Condition bulk_revoke_or_rebias_at_safepoint(oop o, tty->print_cr("* Beginning bulk revocation (kind == %s) because of object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", (bulk_rebias ? "rebias" : "revoke"), - (intptr_t) o, (intptr_t) o->mark(), o->klass()->external_name()); + (void *) o, (intptr_t) o->mark(), o->klass()->external_name()); } jlong cur_time = os::javaTimeMillis(); diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp index 007bfe7aa13..0ba02448aac 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -234,7 +234,7 @@ Deoptimization::UnrollBlock* Deoptimization::fetch_unroll_info_helper(JavaThread assert(Universe::heap()->is_in_or_null(result), "must be heap pointer"); if (TraceDeoptimization) { ttyLocker ttyl; - tty->print_cr("SAVED OOP RESULT " INTPTR_FORMAT " in thread " INTPTR_FORMAT, result, thread); + tty->print_cr("SAVED OOP RESULT " INTPTR_FORMAT " in thread " INTPTR_FORMAT, (void *)result, thread); } } bool reallocated = false; @@ -278,7 +278,7 @@ Deoptimization::UnrollBlock* Deoptimization::fetch_unroll_info_helper(JavaThread first = false; tty->print_cr("RELOCK OBJECTS in thread " INTPTR_FORMAT, thread); } - tty->print_cr(" object <" INTPTR_FORMAT "> locked", mi->owner()); + tty->print_cr(" object <" INTPTR_FORMAT "> locked", (void *)mi->owner()); } } } @@ -977,7 +977,7 @@ void Deoptimization::print_objects(GrowableArray* objects) { KlassHandle k(java_lang_Class::as_Klass(sv->klass()->as_ConstantOopReadValue()->value()())); Handle obj = sv->value(); - tty->print(" object <" INTPTR_FORMAT "> of type ", sv->value()()); + tty->print(" object <" INTPTR_FORMAT "> of type ", (void *)sv->value()()); k->print_value(); tty->print(" allocated (%d bytes)", obj->size() * HeapWordSize); tty->cr(); diff --git a/hotspot/src/share/vm/runtime/frame.cpp b/hotspot/src/share/vm/runtime/frame.cpp index 4fae1c8fe11..e2269a34367 100644 --- a/hotspot/src/share/vm/runtime/frame.cpp +++ b/hotspot/src/share/vm/runtime/frame.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1097,7 +1097,7 @@ oop frame::retrieve_receiver(RegisterMap* reg_map) { return NULL; } oop r = *oop_adr; - assert(Universe::heap()->is_in_or_null(r), err_msg("bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", (intptr_t) r, (intptr_t) r)); + assert(Universe::heap()->is_in_or_null(r), err_msg("bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", (void *) r, (void *) r)); return r; } @@ -1228,9 +1228,7 @@ void frame::check_derived_oop(oop* base, oop* derived) { void frame::ZapDeadClosure::do_oop(oop* p) { if (TraceZapDeadLocals) tty->print_cr("zapping @ " INTPTR_FORMAT " containing " INTPTR_FORMAT, p, (address)*p); - // Need cast because on _LP64 the conversion to oop is ambiguous. Constant - // can be either long or int. - *p = (oop)(int)0xbabebabe; + *p = cast_to_oop(0xbabebabe); } frame::ZapDeadClosure frame::_zap_dead; diff --git a/hotspot/src/share/vm/runtime/globals.cpp b/hotspot/src/share/vm/runtime/globals.cpp index 280e15976de..f4b3865e5d3 100644 --- a/hotspot/src/share/vm/runtime/globals.cpp +++ b/hotspot/src/share/vm/runtime/globals.cpp @@ -62,26 +62,174 @@ ARCH_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PRODUCT_FLAG, \ MATERIALIZE_FLAGS_EXT +void Flag::check_writable() { + if (is_constant_in_binary()) { + fatal(err_msg("flag is constant: %s", _name)); + } +} + +bool Flag::is_bool() const { + return strcmp(_type, "bool") == 0; +} + +bool Flag::get_bool() const { + return *((bool*) _addr); +} + +void Flag::set_bool(bool value) { + check_writable(); + *((bool*) _addr) = value; +} + +bool Flag::is_intx() const { + return strcmp(_type, "intx") == 0; +} + +intx Flag::get_intx() const { + return *((intx*) _addr); +} + +void Flag::set_intx(intx value) { + check_writable(); + *((intx*) _addr) = value; +} + +bool Flag::is_uintx() const { + return strcmp(_type, "uintx") == 0; +} + +uintx Flag::get_uintx() const { + return *((uintx*) _addr); +} + +void Flag::set_uintx(uintx value) { + check_writable(); + *((uintx*) _addr) = value; +} + +bool Flag::is_uint64_t() const { + return strcmp(_type, "uint64_t") == 0; +} + +uint64_t Flag::get_uint64_t() const { + return *((uint64_t*) _addr); +} + +void Flag::set_uint64_t(uint64_t value) { + check_writable(); + *((uint64_t*) _addr) = value; +} + +bool Flag::is_double() const { + return strcmp(_type, "double") == 0; +} + +double Flag::get_double() const { + return *((double*) _addr); +} + +void Flag::set_double(double value) { + check_writable(); + *((double*) _addr) = value; +} + +bool Flag::is_ccstr() const { + return strcmp(_type, "ccstr") == 0 || strcmp(_type, "ccstrlist") == 0; +} + +bool Flag::ccstr_accumulates() const { + return strcmp(_type, "ccstrlist") == 0; +} + +ccstr Flag::get_ccstr() const { + return *((ccstr*) _addr); +} + +void Flag::set_ccstr(ccstr value) { + check_writable(); + *((ccstr*) _addr) = value; +} + + +Flag::Flags Flag::get_origin() { + return Flags(_flags & VALUE_ORIGIN_MASK); +} + +void Flag::set_origin(Flags origin) { + assert((origin & VALUE_ORIGIN_MASK) == origin, "sanity"); + _flags = Flags((_flags & ~VALUE_ORIGIN_MASK) | origin); +} + +bool Flag::is_default() { + return (get_origin() == DEFAULT); +} + +bool Flag::is_ergonomic() { + return (get_origin() == ERGONOMIC); +} + +bool Flag::is_command_line() { + return (get_origin() == COMMAND_LINE); +} + +bool Flag::is_product() const { + return (_flags & KIND_PRODUCT) != 0; +} + +bool Flag::is_manageable() const { + return (_flags & KIND_MANAGEABLE) != 0; +} + +bool Flag::is_diagnostic() const { + return (_flags & KIND_DIAGNOSTIC) != 0; +} + +bool Flag::is_experimental() const { + return (_flags & KIND_EXPERIMENTAL) != 0; +} + +bool Flag::is_notproduct() const { + return (_flags & KIND_NOT_PRODUCT) != 0; +} + +bool Flag::is_develop() const { + return (_flags & KIND_DEVELOP) != 0; +} + +bool Flag::is_read_write() const { + return (_flags & KIND_READ_WRITE) != 0; +} + +bool Flag::is_commercial() const { + return (_flags & KIND_COMMERCIAL) != 0; +} + +/** + * Returns if this flag is a constant in the binary. Right now this is + * true for notproduct and develop flags in product builds. + */ +bool Flag::is_constant_in_binary() const { +#ifdef PRODUCT + return is_notproduct() || is_develop(); +#else + return false; +#endif +} + bool Flag::is_unlocker() const { - return strcmp(name, "UnlockDiagnosticVMOptions") == 0 || - strcmp(name, "UnlockExperimentalVMOptions") == 0 || + return strcmp(_name, "UnlockDiagnosticVMOptions") == 0 || + strcmp(_name, "UnlockExperimentalVMOptions") == 0 || is_unlocker_ext(); } bool Flag::is_unlocked() const { - if (strcmp(kind, "{diagnostic}") == 0 || - strcmp(kind, "{C2 diagnostic}") == 0 || - strcmp(kind, "{ARCH diagnostic}") == 0 || - strcmp(kind, "{Shark diagnostic}") == 0) { + if (is_diagnostic()) { return UnlockDiagnosticVMOptions; - } else if (strcmp(kind, "{experimental}") == 0 || - strcmp(kind, "{C2 experimental}") == 0 || - strcmp(kind, "{ARCH experimental}") == 0 || - strcmp(kind, "{Shark experimental}") == 0) { - return UnlockExperimentalVMOptions; - } else { - return is_unlocked_ext(); } + if (is_experimental()) { + return UnlockExperimentalVMOptions; + } + return is_unlocked_ext(); } // Get custom message for this locked flag, or return NULL if @@ -91,16 +239,14 @@ void Flag::get_locked_message(char* buf, int buflen) const { } bool Flag::is_writeable() const { - return strcmp(kind, "{manageable}") == 0 || - strcmp(kind, "{product rw}") == 0 || - is_writeable_ext(); + return is_manageable() || (is_product() && is_read_write()) || is_writeable_ext(); } // All flags except "manageable" are assumed to be internal flags. // Long term, we need to define a mechanism to specify which flags // are external/stable and change this function accordingly. bool Flag::is_external() const { - return strcmp(kind, "{manageable}") == 0 || is_external_ext(); + return is_manageable() || is_external_ext(); } @@ -108,53 +254,113 @@ bool Flag::is_external() const { #define FORMAT_BUFFER_LEN 16 void Flag::print_on(outputStream* st, bool withComments) { - st->print("%9s %-40s %c= ", type, name, (origin != DEFAULT ? ':' : ' ')); - if (is_bool()) st->print("%-16s", get_bool() ? "true" : "false"); - if (is_intx()) st->print("%-16ld", get_intx()); - if (is_uintx()) st->print("%-16lu", get_uintx()); - if (is_uint64_t()) st->print("%-16lu", get_uint64_t()); - if (is_double()) st->print("%-16f", get_double()); - - if (is_ccstr()) { - const char* cp = get_ccstr(); - if (cp != NULL) { - const char* eol; - while ((eol = strchr(cp, '\n')) != NULL) { - char format_buffer[FORMAT_BUFFER_LEN]; - size_t llen = pointer_delta(eol, cp, sizeof(char)); - jio_snprintf(format_buffer, FORMAT_BUFFER_LEN, - "%%." SIZE_FORMAT "s", llen); - st->print(format_buffer, cp); - st->cr(); - cp = eol+1; - st->print("%5s %-35s += ", "", name); - } - st->print("%-16s", cp); - } - else st->print("%-16s", ""); + // Don't print notproduct and develop flags in a product build. + if (is_constant_in_binary()) { + return; } - st->print("%-20s", kind); + + st->print("%9s %-40s %c= ", _type, _name, (!is_default() ? ':' : ' ')); + + if (is_bool()) { + st->print("%-16s", get_bool() ? "true" : "false"); + } + if (is_intx()) { + st->print("%-16ld", get_intx()); + } + if (is_uintx()) { + st->print("%-16lu", get_uintx()); + } + if (is_uint64_t()) { + st->print("%-16lu", get_uint64_t()); + } + if (is_double()) { + st->print("%-16f", get_double()); + } + if (is_ccstr()) { + const char* cp = get_ccstr(); + if (cp != NULL) { + const char* eol; + while ((eol = strchr(cp, '\n')) != NULL) { + char format_buffer[FORMAT_BUFFER_LEN]; + size_t llen = pointer_delta(eol, cp, sizeof(char)); + jio_snprintf(format_buffer, FORMAT_BUFFER_LEN, + "%%." SIZE_FORMAT "s", llen); + st->print(format_buffer, cp); + st->cr(); + cp = eol+1; + st->print("%5s %-35s += ", "", _name); + } + st->print("%-16s", cp); + } + else st->print("%-16s", ""); + } + + st->print("%-20"); + print_kind(st); + if (withComments) { #ifndef PRODUCT - st->print("%s", doc ); + st->print("%s", _doc); #endif } st->cr(); } +void Flag::print_kind(outputStream* st) { + struct Data { + int flag; + const char* name; + }; + + Data data[] = { + { KIND_C1, "C1" }, + { KIND_C2, "C2" }, + { KIND_ARCH, "ARCH" }, + { KIND_SHARK, "SHARK" }, + { KIND_PLATFORM_DEPENDENT, "pd" }, + { KIND_PRODUCT, "product" }, + { KIND_MANAGEABLE, "manageable" }, + { KIND_DIAGNOSTIC, "diagnostic" }, + { KIND_NOT_PRODUCT, "notproduct" }, + { KIND_DEVELOP, "develop" }, + { KIND_LP64_PRODUCT, "lp64_product" }, + { KIND_READ_WRITE, "rw" }, + { -1, "" } + }; + + if ((_flags & KIND_MASK) != 0) { + st->print("{"); + bool is_first = true; + + for (int i = 0; data[i].flag != -1; i++) { + Data d = data[i]; + if ((_flags & d.flag) != 0) { + if (is_first) { + is_first = false; + } else { + st->print(" "); + } + st->print(d.name); + } + } + + st->print("}"); + } +} + void Flag::print_as_flag(outputStream* st) { if (is_bool()) { - st->print("-XX:%s%s", get_bool() ? "+" : "-", name); + st->print("-XX:%s%s", get_bool() ? "+" : "-", _name); } else if (is_intx()) { - st->print("-XX:%s=" INTX_FORMAT, name, get_intx()); + st->print("-XX:%s=" INTX_FORMAT, _name, get_intx()); } else if (is_uintx()) { - st->print("-XX:%s=" UINTX_FORMAT, name, get_uintx()); + st->print("-XX:%s=" UINTX_FORMAT, _name, get_uintx()); } else if (is_uint64_t()) { - st->print("-XX:%s=" UINT64_FORMAT, name, get_uint64_t()); + st->print("-XX:%s=" UINT64_FORMAT, _name, get_uint64_t()); } else if (is_double()) { - st->print("-XX:%s=%f", name, get_double()); + st->print("-XX:%s=%f", _name, get_double()); } else if (is_ccstr()) { - st->print("-XX:%s=", name); + st->print("-XX:%s=", _name); const char* cp = get_ccstr(); if (cp != NULL) { // Need to turn embedded '\n's back into separate arguments @@ -167,7 +373,7 @@ void Flag::print_as_flag(outputStream* st) { st->print("%c", *cp); break; case '\n': - st->print(" -XX:%s=", name); + st->print(" -XX:%s=", _name); break; } } @@ -180,79 +386,51 @@ void Flag::print_as_flag(outputStream* st) { // 4991491 do not "optimize out" the was_set false values: omitting them // tickles a Microsoft compiler bug causing flagTable to be malformed -#define RUNTIME_PRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{product}", DEFAULT }, -#define RUNTIME_PD_PRODUCT_FLAG_STRUCT(type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{pd product}", DEFAULT }, -#define RUNTIME_DIAGNOSTIC_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{diagnostic}", DEFAULT }, -#define RUNTIME_EXPERIMENTAL_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{experimental}", DEFAULT }, -#define RUNTIME_MANAGEABLE_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{manageable}", DEFAULT }, -#define RUNTIME_PRODUCT_RW_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{product rw}", DEFAULT }, +#define NAME(name) NOT_PRODUCT(&name) PRODUCT_ONLY(&CONST_##name) -#ifdef PRODUCT - #define RUNTIME_DEVELOP_FLAG_STRUCT(type, name, value, doc) /* flag is constant */ - #define RUNTIME_PD_DEVELOP_FLAG_STRUCT(type, name, doc) /* flag is constant */ - #define RUNTIME_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc) -#else - #define RUNTIME_DEVELOP_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, doc, "", DEFAULT }, - #define RUNTIME_PD_DEVELOP_FLAG_STRUCT(type, name, doc) { #type, XSTR(name), &name, doc, "{pd}", DEFAULT }, - #define RUNTIME_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, doc, "{notproduct}", DEFAULT }, -#endif +#define RUNTIME_PRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_PRODUCT) }, +#define RUNTIME_PD_PRODUCT_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_PRODUCT | Flag::KIND_PLATFORM_DEPENDENT) }, +#define RUNTIME_DIAGNOSTIC_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_DIAGNOSTIC) }, +#define RUNTIME_EXPERIMENTAL_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_EXPERIMENTAL) }, +#define RUNTIME_MANAGEABLE_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_MANAGEABLE) }, +#define RUNTIME_PRODUCT_RW_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_PRODUCT | Flag::KIND_READ_WRITE) }, +#define RUNTIME_DEVELOP_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), NAME(name), NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_DEVELOP) }, +#define RUNTIME_PD_DEVELOP_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), NAME(name), NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_DEVELOP | Flag::KIND_PLATFORM_DEPENDENT) }, +#define RUNTIME_NOTPRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), NAME(name), NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_NOT_PRODUCT) }, #ifdef _LP64 - #define RUNTIME_LP64_PRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{lp64_product}", DEFAULT }, +#define RUNTIME_LP64_PRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_LP64_PRODUCT) }, #else - #define RUNTIME_LP64_PRODUCT_FLAG_STRUCT(type, name, value, doc) /* flag is constant */ +#define RUNTIME_LP64_PRODUCT_FLAG_STRUCT(type, name, value, doc) /* flag is constant */ #endif // _LP64 -#define C1_PRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{C1 product}", DEFAULT }, -#define C1_PD_PRODUCT_FLAG_STRUCT(type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{C1 pd product}", DEFAULT }, -#define C1_DIAGNOSTIC_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{C1 diagnostic}", DEFAULT }, -#ifdef PRODUCT - #define C1_DEVELOP_FLAG_STRUCT(type, name, value, doc) /* flag is constant */ - #define C1_PD_DEVELOP_FLAG_STRUCT(type, name, doc) /* flag is constant */ - #define C1_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc) -#else - #define C1_DEVELOP_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, doc, "{C1}", DEFAULT }, - #define C1_PD_DEVELOP_FLAG_STRUCT(type, name, doc) { #type, XSTR(name), &name, doc, "{C1 pd}", DEFAULT }, - #define C1_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, doc, "{C1 notproduct}", DEFAULT }, -#endif +#define C1_PRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C1 | Flag::KIND_PRODUCT) }, +#define C1_PD_PRODUCT_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C1 | Flag::KIND_PRODUCT | Flag::KIND_PLATFORM_DEPENDENT) }, +#define C1_DIAGNOSTIC_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C1 | Flag::KIND_DIAGNOSTIC) }, +#define C1_DEVELOP_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), NAME(name), NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C1 | Flag::KIND_DEVELOP) }, +#define C1_PD_DEVELOP_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), NAME(name), NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C1 | Flag::KIND_DEVELOP | Flag::KIND_PLATFORM_DEPENDENT) }, +#define C1_NOTPRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), NAME(name), NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C1 | Flag::KIND_NOT_PRODUCT) }, -#define C2_PRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{C2 product}", DEFAULT }, -#define C2_PD_PRODUCT_FLAG_STRUCT(type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{C2 pd product}", DEFAULT }, -#define C2_DIAGNOSTIC_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{C2 diagnostic}", DEFAULT }, -#define C2_EXPERIMENTAL_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{C2 experimental}", DEFAULT }, -#ifdef PRODUCT - #define C2_DEVELOP_FLAG_STRUCT(type, name, value, doc) /* flag is constant */ - #define C2_PD_DEVELOP_FLAG_STRUCT(type, name, doc) /* flag is constant */ - #define C2_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc) -#else - #define C2_DEVELOP_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, doc, "{C2}", DEFAULT }, - #define C2_PD_DEVELOP_FLAG_STRUCT(type, name, doc) { #type, XSTR(name), &name, doc, "{C2 pd}", DEFAULT }, - #define C2_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, doc, "{C2 notproduct}", DEFAULT }, -#endif +#define C2_PRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C2 | Flag::KIND_PRODUCT) }, +#define C2_PD_PRODUCT_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C2 | Flag::KIND_PRODUCT | Flag::KIND_PLATFORM_DEPENDENT) }, +#define C2_DIAGNOSTIC_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C2 | Flag::KIND_DIAGNOSTIC) }, +#define C2_EXPERIMENTAL_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C2 | Flag::KIND_EXPERIMENTAL) }, +#define C2_DEVELOP_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), NAME(name), NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C2 | Flag::KIND_DEVELOP) }, +#define C2_PD_DEVELOP_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), NAME(name), NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C2 | Flag::KIND_DEVELOP | Flag::KIND_PLATFORM_DEPENDENT) }, +#define C2_NOTPRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), NAME(name), NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C2 | Flag::KIND_NOT_PRODUCT) }, -#define ARCH_PRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{ARCH product}", DEFAULT }, -#define ARCH_DIAGNOSTIC_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{ARCH diagnostic}", DEFAULT }, -#define ARCH_EXPERIMENTAL_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{ARCH experimental}", DEFAULT }, -#ifdef PRODUCT - #define ARCH_DEVELOP_FLAG_STRUCT(type, name, value, doc) /* flag is constant */ - #define ARCH_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc) -#else - #define ARCH_DEVELOP_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, doc, "{ARCH}", DEFAULT }, - #define ARCH_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, doc, "{ARCH notproduct}", DEFAULT }, -#endif +#define ARCH_PRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_ARCH | Flag::KIND_PRODUCT) }, +#define ARCH_DIAGNOSTIC_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_ARCH | Flag::KIND_DIAGNOSTIC) }, +#define ARCH_EXPERIMENTAL_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_ARCH | Flag::KIND_EXPERIMENTAL) }, +#define ARCH_DEVELOP_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), NAME(name), NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_ARCH | Flag::KIND_DEVELOP) }, +#define ARCH_NOTPRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), NAME(name), NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_ARCH | Flag::KIND_NOT_PRODUCT) }, -#define SHARK_PRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{Shark product}", DEFAULT }, -#define SHARK_PD_PRODUCT_FLAG_STRUCT(type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{Shark pd product}", DEFAULT }, -#define SHARK_DIAGNOSTIC_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) "{Shark diagnostic}", DEFAULT }, -#ifdef PRODUCT - #define SHARK_DEVELOP_FLAG_STRUCT(type, name, value, doc) /* flag is constant */ - #define SHARK_PD_DEVELOP_FLAG_STRUCT(type, name, doc) /* flag is constant */ - #define SHARK_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc) -#else - #define SHARK_DEVELOP_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, doc, "{Shark}", DEFAULT }, - #define SHARK_PD_DEVELOP_FLAG_STRUCT(type, name, doc) { #type, XSTR(name), &name, doc, "{Shark pd}", DEFAULT }, - #define SHARK_NOTPRODUCT_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, doc, "{Shark notproduct}", DEFAULT }, -#endif +#define SHARK_PRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_SHARK | Flag::KIND_PRODUCT) }, +#define SHARK_PD_PRODUCT_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_SHARK | Flag::KIND_PRODUCT | Flag::KIND_PLATFORM_DEPENDENT) }, +#define SHARK_DIAGNOSTIC_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_SHARK | Flag::KIND_DIAGNOSTIC) }, +#define SHARK_DEVELOP_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), NAME(name), NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_SHARK | Flag::KIND_DEVELOP) }, +#define SHARK_PD_DEVELOP_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), NAME(name), NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_SHARK | Flag::KIND_DEVELOP | Flag::KIND_PLATFORM_DEPENDENT) }, +#define SHARK_NOTPRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), NAME(name), NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_SHARK | Flag::KIND_NOT_PRODUCT) }, static Flag flagTable[] = { RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_STRUCT, RUNTIME_PD_DEVELOP_FLAG_STRUCT, RUNTIME_PRODUCT_FLAG_STRUCT, RUNTIME_PD_PRODUCT_FLAG_STRUCT, RUNTIME_DIAGNOSTIC_FLAG_STRUCT, RUNTIME_EXPERIMENTAL_FLAG_STRUCT, RUNTIME_NOTPRODUCT_FLAG_STRUCT, RUNTIME_MANAGEABLE_FLAG_STRUCT, RUNTIME_PRODUCT_RW_FLAG_STRUCT, RUNTIME_LP64_PRODUCT_FLAG_STRUCT) @@ -285,9 +463,14 @@ inline bool str_equal(const char* s, const char* q, size_t len) { // Search the flag table for a named flag Flag* Flag::find_flag(const char* name, size_t length, bool allow_locked) { - for (Flag* current = &flagTable[0]; current->name != NULL; current++) { - if (str_equal(current->name, name, length)) { - // Found a matching entry. Report locked flags only if allowed. + for (Flag* current = &flagTable[0]; current->_name != NULL; current++) { + if (str_equal(current->_name, name, length)) { + // Found a matching entry. + // Don't report notproduct and develop flags in product builds. + if (current->is_constant_in_binary()) { + return NULL; + } + // Report locked flags only if allowed. if (!(current->is_unlocked() || current->is_unlocker())) { if (!allow_locked) { // disable use of locked flags, e.g. diagnostic, experimental, @@ -327,8 +510,8 @@ Flag* Flag::fuzzy_match(const char* name, size_t length, bool allow_locked) { float score; float max_score = -1; - for (Flag* current = &flagTable[0]; current->name != NULL; current++) { - score = str_similar(current->name, name, length); + for (Flag* current = &flagTable[0]; current->_name != NULL; current++) { + score = str_similar(current->_name, name, length); if (score > max_score) { max_score = score; match = current; @@ -357,25 +540,25 @@ static Flag* address_of_flag(CommandLineFlagWithType flag) { bool CommandLineFlagsEx::is_default(CommandLineFlag flag) { assert((size_t)flag < Flag::numFlags, "bad command line flag index"); Flag* f = &Flag::flags[flag]; - return (f->origin == DEFAULT); + return f->is_default(); } bool CommandLineFlagsEx::is_ergo(CommandLineFlag flag) { assert((size_t)flag < Flag::numFlags, "bad command line flag index"); Flag* f = &Flag::flags[flag]; - return (f->origin == ERGONOMIC); + return f->is_ergonomic(); } bool CommandLineFlagsEx::is_cmdline(CommandLineFlag flag) { assert((size_t)flag < Flag::numFlags, "bad command line flag index"); Flag* f = &Flag::flags[flag]; - return (f->origin == COMMAND_LINE); + return f->is_command_line(); } bool CommandLineFlags::wasSetOnCmdline(const char* name, bool* value) { Flag* result = Flag::find_flag((char*)name, strlen(name)); if (result == NULL) return false; - *value = (result->origin == COMMAND_LINE); + *value = result->is_command_line(); return true; } @@ -387,22 +570,22 @@ bool CommandLineFlags::boolAt(char* name, size_t len, bool* value) { return true; } -bool CommandLineFlags::boolAtPut(char* name, size_t len, bool* value, FlagValueOrigin origin) { +bool CommandLineFlags::boolAtPut(char* name, size_t len, bool* value, Flag::Flags origin) { Flag* result = Flag::find_flag(name, len); if (result == NULL) return false; if (!result->is_bool()) return false; bool old_value = result->get_bool(); result->set_bool(*value); *value = old_value; - result->origin = origin; + result->set_origin(origin); return true; } -void CommandLineFlagsEx::boolAtPut(CommandLineFlagWithType flag, bool value, FlagValueOrigin origin) { +void CommandLineFlagsEx::boolAtPut(CommandLineFlagWithType flag, bool value, Flag::Flags origin) { Flag* faddr = address_of_flag(flag); guarantee(faddr != NULL && faddr->is_bool(), "wrong flag type"); faddr->set_bool(value); - faddr->origin = origin; + faddr->set_origin(origin); } bool CommandLineFlags::intxAt(char* name, size_t len, intx* value) { @@ -413,22 +596,22 @@ bool CommandLineFlags::intxAt(char* name, size_t len, intx* value) { return true; } -bool CommandLineFlags::intxAtPut(char* name, size_t len, intx* value, FlagValueOrigin origin) { +bool CommandLineFlags::intxAtPut(char* name, size_t len, intx* value, Flag::Flags origin) { Flag* result = Flag::find_flag(name, len); if (result == NULL) return false; if (!result->is_intx()) return false; intx old_value = result->get_intx(); result->set_intx(*value); *value = old_value; - result->origin = origin; + result->set_origin(origin); return true; } -void CommandLineFlagsEx::intxAtPut(CommandLineFlagWithType flag, intx value, FlagValueOrigin origin) { +void CommandLineFlagsEx::intxAtPut(CommandLineFlagWithType flag, intx value, Flag::Flags origin) { Flag* faddr = address_of_flag(flag); guarantee(faddr != NULL && faddr->is_intx(), "wrong flag type"); faddr->set_intx(value); - faddr->origin = origin; + faddr->set_origin(origin); } bool CommandLineFlags::uintxAt(char* name, size_t len, uintx* value) { @@ -439,22 +622,22 @@ bool CommandLineFlags::uintxAt(char* name, size_t len, uintx* value) { return true; } -bool CommandLineFlags::uintxAtPut(char* name, size_t len, uintx* value, FlagValueOrigin origin) { +bool CommandLineFlags::uintxAtPut(char* name, size_t len, uintx* value, Flag::Flags origin) { Flag* result = Flag::find_flag(name, len); if (result == NULL) return false; if (!result->is_uintx()) return false; uintx old_value = result->get_uintx(); result->set_uintx(*value); *value = old_value; - result->origin = origin; + result->set_origin(origin); return true; } -void CommandLineFlagsEx::uintxAtPut(CommandLineFlagWithType flag, uintx value, FlagValueOrigin origin) { +void CommandLineFlagsEx::uintxAtPut(CommandLineFlagWithType flag, uintx value, Flag::Flags origin) { Flag* faddr = address_of_flag(flag); guarantee(faddr != NULL && faddr->is_uintx(), "wrong flag type"); faddr->set_uintx(value); - faddr->origin = origin; + faddr->set_origin(origin); } bool CommandLineFlags::uint64_tAt(char* name, size_t len, uint64_t* value) { @@ -465,22 +648,22 @@ bool CommandLineFlags::uint64_tAt(char* name, size_t len, uint64_t* value) { return true; } -bool CommandLineFlags::uint64_tAtPut(char* name, size_t len, uint64_t* value, FlagValueOrigin origin) { +bool CommandLineFlags::uint64_tAtPut(char* name, size_t len, uint64_t* value, Flag::Flags origin) { Flag* result = Flag::find_flag(name, len); if (result == NULL) return false; if (!result->is_uint64_t()) return false; uint64_t old_value = result->get_uint64_t(); result->set_uint64_t(*value); *value = old_value; - result->origin = origin; + result->set_origin(origin); return true; } -void CommandLineFlagsEx::uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, FlagValueOrigin origin) { +void CommandLineFlagsEx::uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, Flag::Flags origin) { Flag* faddr = address_of_flag(flag); guarantee(faddr != NULL && faddr->is_uint64_t(), "wrong flag type"); faddr->set_uint64_t(value); - faddr->origin = origin; + faddr->set_origin(origin); } bool CommandLineFlags::doubleAt(char* name, size_t len, double* value) { @@ -491,22 +674,22 @@ bool CommandLineFlags::doubleAt(char* name, size_t len, double* value) { return true; } -bool CommandLineFlags::doubleAtPut(char* name, size_t len, double* value, FlagValueOrigin origin) { +bool CommandLineFlags::doubleAtPut(char* name, size_t len, double* value, Flag::Flags origin) { Flag* result = Flag::find_flag(name, len); if (result == NULL) return false; if (!result->is_double()) return false; double old_value = result->get_double(); result->set_double(*value); *value = old_value; - result->origin = origin; + result->set_origin(origin); return true; } -void CommandLineFlagsEx::doubleAtPut(CommandLineFlagWithType flag, double value, FlagValueOrigin origin) { +void CommandLineFlagsEx::doubleAtPut(CommandLineFlagWithType flag, double value, Flag::Flags origin) { Flag* faddr = address_of_flag(flag); guarantee(faddr != NULL && faddr->is_double(), "wrong flag type"); faddr->set_double(value); - faddr->origin = origin; + faddr->set_origin(origin); } bool CommandLineFlags::ccstrAt(char* name, size_t len, ccstr* value) { @@ -519,7 +702,7 @@ bool CommandLineFlags::ccstrAt(char* name, size_t len, ccstr* value) { // Contract: Flag will make private copy of the incoming value. // Outgoing value is always malloc-ed, and caller MUST call free. -bool CommandLineFlags::ccstrAtPut(char* name, size_t len, ccstr* value, FlagValueOrigin origin) { +bool CommandLineFlags::ccstrAtPut(char* name, size_t len, ccstr* value, Flag::Flags origin) { Flag* result = Flag::find_flag(name, len); if (result == NULL) return false; if (!result->is_ccstr()) return false; @@ -530,35 +713,35 @@ bool CommandLineFlags::ccstrAtPut(char* name, size_t len, ccstr* value, FlagValu strcpy(new_value, *value); } result->set_ccstr(new_value); - if (result->origin == DEFAULT && old_value != NULL) { + if (result->is_default() && old_value != NULL) { // Prior value is NOT heap allocated, but was a literal constant. char* old_value_to_free = NEW_C_HEAP_ARRAY(char, strlen(old_value)+1, mtInternal); strcpy(old_value_to_free, old_value); old_value = old_value_to_free; } *value = old_value; - result->origin = origin; + result->set_origin(origin); return true; } // Contract: Flag will make private copy of the incoming value. -void CommandLineFlagsEx::ccstrAtPut(CommandLineFlagWithType flag, ccstr value, FlagValueOrigin origin) { +void CommandLineFlagsEx::ccstrAtPut(CommandLineFlagWithType flag, ccstr value, Flag::Flags origin) { Flag* faddr = address_of_flag(flag); guarantee(faddr != NULL && faddr->is_ccstr(), "wrong flag type"); ccstr old_value = faddr->get_ccstr(); char* new_value = NEW_C_HEAP_ARRAY(char, strlen(value)+1, mtInternal); strcpy(new_value, value); faddr->set_ccstr(new_value); - if (faddr->origin != DEFAULT && old_value != NULL) { + if (!faddr->is_default() && old_value != NULL) { // Prior value is heap allocated so free it. FREE_C_HEAP_ARRAY(char, old_value, mtInternal); } - faddr->origin = origin; + faddr->set_origin(origin); } extern "C" { static int compare_flags(const void* void_a, const void* void_b) { - return strcmp((*((Flag**) void_a))->name, (*((Flag**) void_b))->name); + return strcmp((*((Flag**) void_a))->_name, (*((Flag**) void_b))->_name); } } @@ -567,20 +750,19 @@ void CommandLineFlags::printSetFlags(outputStream* out) { // note: this method is called before the thread structure is in place // which means resource allocation cannot be used. - // Compute size - int length= 0; - while (flagTable[length].name != NULL) length++; + // The last entry is the null entry. + const size_t length = Flag::numFlags - 1; // Sort Flag** array = NEW_C_HEAP_ARRAY(Flag*, length, mtInternal); - for (int index = 0; index < length; index++) { - array[index] = &flagTable[index]; + for (size_t i = 0; i < length; i++) { + array[i] = &flagTable[i]; } qsort(array, length, sizeof(Flag*), compare_flags); // Print - for (int i = 0; i < length; i++) { - if (array[i]->origin /* naked field! */) { + for (size_t i = 0; i < length; i++) { + if (array[i]->get_origin() /* naked field! */) { array[i]->print_as_flag(out); out->print(" "); } @@ -603,20 +785,19 @@ void CommandLineFlags::printFlags(outputStream* out, bool withComments) { // note: this method is called before the thread structure is in place // which means resource allocation cannot be used. - // Compute size - int length= 0; - while (flagTable[length].name != NULL) length++; + // The last entry is the null entry. + const size_t length = Flag::numFlags - 1; // Sort Flag** array = NEW_C_HEAP_ARRAY(Flag*, length, mtInternal); - for (int index = 0; index < length; index++) { - array[index] = &flagTable[index]; + for (size_t i = 0; i < length; i++) { + array[i] = &flagTable[i]; } qsort(array, length, sizeof(Flag*), compare_flags); // Print out->print_cr("[Global flags]"); - for (int i = 0; i < length; i++) { + for (size_t i = 0; i < length; i++) { if (array[i]->is_unlocked()) { array[i]->print_on(out, withComments); } diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index f2cf5efabeb..2fe5420be39 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -194,29 +194,49 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G); typedef const char* ccstr; typedef const char* ccstrlist; // represents string arguments which accumulate -enum FlagValueOrigin { - DEFAULT = 0, - COMMAND_LINE = 1, - ENVIRON_VAR = 2, - CONFIG_FILE = 3, - MANAGEMENT = 4, - ERGONOMIC = 5, - ATTACH_ON_DEMAND = 6, - INTERNAL = 99 -}; - struct Flag { - const char *type; - const char *name; - void* addr; + enum Flags { + // value origin + DEFAULT = 0, + COMMAND_LINE = 1, + ENVIRON_VAR = 2, + CONFIG_FILE = 3, + MANAGEMENT = 4, + ERGONOMIC = 5, + ATTACH_ON_DEMAND = 6, + INTERNAL = 7, - NOT_PRODUCT(const char *doc;) + LAST_VALUE_ORIGIN = INTERNAL, + VALUE_ORIGIN_BITS = 4, + VALUE_ORIGIN_MASK = right_n_bits(VALUE_ORIGIN_BITS), - const char *kind; - FlagValueOrigin origin; + // flag kind + KIND_PRODUCT = 1 << 4, + KIND_MANAGEABLE = 1 << 5, + KIND_DIAGNOSTIC = 1 << 6, + KIND_EXPERIMENTAL = 1 << 7, + KIND_NOT_PRODUCT = 1 << 8, + KIND_DEVELOP = 1 << 9, + KIND_PLATFORM_DEPENDENT = 1 << 10, + KIND_READ_WRITE = 1 << 11, + KIND_C1 = 1 << 12, + KIND_C2 = 1 << 13, + KIND_ARCH = 1 << 14, + KIND_SHARK = 1 << 15, + KIND_LP64_PRODUCT = 1 << 16, + KIND_COMMERCIAL = 1 << 17, + + KIND_MASK = ~VALUE_ORIGIN_MASK + }; + + const char* _type; + const char* _name; + void* _addr; + NOT_PRODUCT(const char* _doc;) + Flags _flags; // points to all Flags static array - static Flag *flags; + static Flag* flags; // number of flags static size_t numFlags; @@ -224,30 +244,50 @@ struct Flag { static Flag* find_flag(const char* name, size_t length, bool allow_locked = false); static Flag* fuzzy_match(const char* name, size_t length, bool allow_locked = false); - bool is_bool() const { return strcmp(type, "bool") == 0; } - bool get_bool() const { return *((bool*) addr); } - void set_bool(bool value) { *((bool*) addr) = value; } + void check_writable(); - bool is_intx() const { return strcmp(type, "intx") == 0; } - intx get_intx() const { return *((intx*) addr); } - void set_intx(intx value) { *((intx*) addr) = value; } + bool is_bool() const; + bool get_bool() const; + void set_bool(bool value); - bool is_uintx() const { return strcmp(type, "uintx") == 0; } - uintx get_uintx() const { return *((uintx*) addr); } - void set_uintx(uintx value) { *((uintx*) addr) = value; } + bool is_intx() const; + intx get_intx() const; + void set_intx(intx value); - bool is_uint64_t() const { return strcmp(type, "uint64_t") == 0; } - uint64_t get_uint64_t() const { return *((uint64_t*) addr); } - void set_uint64_t(uint64_t value) { *((uint64_t*) addr) = value; } + bool is_uintx() const; + uintx get_uintx() const; + void set_uintx(uintx value); - bool is_double() const { return strcmp(type, "double") == 0; } - double get_double() const { return *((double*) addr); } - void set_double(double value) { *((double*) addr) = value; } + bool is_uint64_t() const; + uint64_t get_uint64_t() const; + void set_uint64_t(uint64_t value); - bool is_ccstr() const { return strcmp(type, "ccstr") == 0 || strcmp(type, "ccstrlist") == 0; } - bool ccstr_accumulates() const { return strcmp(type, "ccstrlist") == 0; } - ccstr get_ccstr() const { return *((ccstr*) addr); } - void set_ccstr(ccstr value) { *((ccstr*) addr) = value; } + bool is_double() const; + double get_double() const; + void set_double(double value); + + bool is_ccstr() const; + bool ccstr_accumulates() const; + ccstr get_ccstr() const; + void set_ccstr(ccstr value); + + Flags get_origin(); + void set_origin(Flags origin); + + bool is_default(); + bool is_ergonomic(); + bool is_command_line(); + + bool is_product() const; + bool is_manageable() const; + bool is_diagnostic() const; + bool is_experimental() const; + bool is_notproduct() const; + bool is_develop() const; + bool is_read_write() const; + bool is_commercial() const; + + bool is_constant_in_binary() const; bool is_unlocker() const; bool is_unlocked() const; @@ -263,6 +303,7 @@ struct Flag { void get_locked_message_ext(char*, int) const; void print_on(outputStream* st, bool withComments = false ); + void print_kind(outputStream* st); void print_as_flag(outputStream* st); }; @@ -310,33 +351,33 @@ class CommandLineFlags { public: static bool boolAt(char* name, size_t len, bool* value); static bool boolAt(char* name, bool* value) { return boolAt(name, strlen(name), value); } - static bool boolAtPut(char* name, size_t len, bool* value, FlagValueOrigin origin); - static bool boolAtPut(char* name, bool* value, FlagValueOrigin origin) { return boolAtPut(name, strlen(name), value, origin); } + static bool boolAtPut(char* name, size_t len, bool* value, Flag::Flags origin); + static bool boolAtPut(char* name, bool* value, Flag::Flags origin) { return boolAtPut(name, strlen(name), value, origin); } static bool intxAt(char* name, size_t len, intx* value); static bool intxAt(char* name, intx* value) { return intxAt(name, strlen(name), value); } - static bool intxAtPut(char* name, size_t len, intx* value, FlagValueOrigin origin); - static bool intxAtPut(char* name, intx* value, FlagValueOrigin origin) { return intxAtPut(name, strlen(name), value, origin); } + static bool intxAtPut(char* name, size_t len, intx* value, Flag::Flags origin); + static bool intxAtPut(char* name, intx* value, Flag::Flags origin) { return intxAtPut(name, strlen(name), value, origin); } static bool uintxAt(char* name, size_t len, uintx* value); static bool uintxAt(char* name, uintx* value) { return uintxAt(name, strlen(name), value); } - static bool uintxAtPut(char* name, size_t len, uintx* value, FlagValueOrigin origin); - static bool uintxAtPut(char* name, uintx* value, FlagValueOrigin origin) { return uintxAtPut(name, strlen(name), value, origin); } + static bool uintxAtPut(char* name, size_t len, uintx* value, Flag::Flags origin); + static bool uintxAtPut(char* name, uintx* value, Flag::Flags origin) { return uintxAtPut(name, strlen(name), value, origin); } static bool uint64_tAt(char* name, size_t len, uint64_t* value); static bool uint64_tAt(char* name, uint64_t* value) { return uint64_tAt(name, strlen(name), value); } - static bool uint64_tAtPut(char* name, size_t len, uint64_t* value, FlagValueOrigin origin); - static bool uint64_tAtPut(char* name, uint64_t* value, FlagValueOrigin origin) { return uint64_tAtPut(name, strlen(name), value, origin); } + static bool uint64_tAtPut(char* name, size_t len, uint64_t* value, Flag::Flags origin); + static bool uint64_tAtPut(char* name, uint64_t* value, Flag::Flags origin) { return uint64_tAtPut(name, strlen(name), value, origin); } static bool doubleAt(char* name, size_t len, double* value); static bool doubleAt(char* name, double* value) { return doubleAt(name, strlen(name), value); } - static bool doubleAtPut(char* name, size_t len, double* value, FlagValueOrigin origin); - static bool doubleAtPut(char* name, double* value, FlagValueOrigin origin) { return doubleAtPut(name, strlen(name), value, origin); } + static bool doubleAtPut(char* name, size_t len, double* value, Flag::Flags origin); + static bool doubleAtPut(char* name, double* value, Flag::Flags origin) { return doubleAtPut(name, strlen(name), value, origin); } static bool ccstrAt(char* name, size_t len, ccstr* value); static bool ccstrAt(char* name, ccstr* value) { return ccstrAt(name, strlen(name), value); } - static bool ccstrAtPut(char* name, size_t len, ccstr* value, FlagValueOrigin origin); - static bool ccstrAtPut(char* name, ccstr* value, FlagValueOrigin origin) { return ccstrAtPut(name, strlen(name), value, origin); } + static bool ccstrAtPut(char* name, size_t len, ccstr* value, Flag::Flags origin); + static bool ccstrAtPut(char* name, ccstr* value, Flag::Flags origin) { return ccstrAtPut(name, strlen(name), value, origin); } // Returns false if name is not a command line flag. static bool wasSetOnCmdline(const char* name, bool* value); @@ -440,21 +481,21 @@ class CommandLineFlags { #define RUNTIME_FLAGS(develop, develop_pd, product, product_pd, diagnostic, experimental, notproduct, manageable, product_rw, lp64_product) \ \ lp64_product(bool, UseCompressedOops, false, \ - "Use 32-bit object references in 64-bit VM " \ - "lp64_product means flag is always constant in 32 bit VM") \ + "Use 32-bit object references in 64-bit VM. " \ + "lp64_product means flag is always constant in 32 bit VM") \ \ lp64_product(bool, UseCompressedClassPointers, false, \ - "Use 32-bit class pointers in 64-bit VM " \ - "lp64_product means flag is always constant in 32 bit VM") \ + "Use 32-bit class pointers in 64-bit VM. " \ + "lp64_product means flag is always constant in 32 bit VM") \ \ notproduct(bool, CheckCompressedOops, true, \ - "generate checks in encoding/decoding code in debug VM") \ + "Generate checks in encoding/decoding code in debug VM") \ \ product_pd(uintx, HeapBaseMinAddress, \ - "OS specific low limit for heap base address") \ + "OS specific low limit for heap base address") \ \ diagnostic(bool, PrintCompressedOopsMode, false, \ - "Print compressed oops base address and encoding mode") \ + "Print compressed oops base address and encoding mode") \ \ lp64_product(intx, ObjectAlignmentInBytes, 8, \ "Default object alignment in bytes, 8 is minimum") \ @@ -476,7 +517,7 @@ class CommandLineFlags { "Use lwsync instruction if true, else use slower sync") \ \ develop(bool, CleanChunkPoolAsync, falseInEmbedded, \ - "Whether to clean the chunk pool asynchronously") \ + "Clean the chunk pool asynchronously") \ \ /* Temporary: See 6948537 */ \ experimental(bool, UseMemSetInBOT, true, \ @@ -486,10 +527,12 @@ class CommandLineFlags { "Enable normal processing of flags relating to field diagnostics")\ \ experimental(bool, UnlockExperimentalVMOptions, false, \ - "Enable normal processing of flags relating to experimental features")\ + "Enable normal processing of flags relating to experimental " \ + "features") \ \ product(bool, JavaMonitorsInStackTrace, true, \ - "Print info. about Java monitor locks when the stacks are dumped")\ + "Print information about Java monitor locks when the stacks are" \ + "dumped") \ \ product_pd(bool, UseLargePages, \ "Use large page memory") \ @@ -500,8 +543,12 @@ class CommandLineFlags { develop(bool, LargePagesIndividualAllocationInjectError, false, \ "Fail large pages individual allocation") \ \ + product(bool, UseLargePagesInMetaspace, false, \ + "Use large page memory in metaspace. " \ + "Only used if UseLargePages is enabled.") \ + \ develop(bool, TracePageSizes, false, \ - "Trace page size selection and usage.") \ + "Trace page size selection and usage") \ \ product(bool, UseNUMA, false, \ "Use NUMA if available") \ @@ -516,12 +563,12 @@ class CommandLineFlags { "Force NUMA optimizations on single-node/UMA systems") \ \ product(uintx, NUMAChunkResizeWeight, 20, \ - "Percentage (0-100) used to weigh the current sample when " \ + "Percentage (0-100) used to weigh the current sample when " \ "computing exponentially decaying average for " \ "AdaptiveNUMAChunkSizing") \ \ product(uintx, NUMASpaceResizeRate, 1*G, \ - "Do not reallocate more that this amount per collection") \ + "Do not reallocate more than this amount per collection") \ \ product(bool, UseAdaptiveNUMAChunkSizing, true, \ "Enable adaptive chunk sizing for NUMA") \ @@ -538,17 +585,17 @@ class CommandLineFlags { product(intx, UseSSE, 99, \ "Highest supported SSE instructions set on x86/x64") \ \ - product(bool, UseAES, false, \ + product(bool, UseAES, false, \ "Control whether AES instructions can be used on x86/x64") \ \ product(uintx, LargePageSizeInBytes, 0, \ - "Large page size (0 to let VM choose the page size") \ + "Large page size (0 to let VM choose the page size)") \ \ product(uintx, LargePageHeapSizeThreshold, 128*M, \ - "Use large pages if max heap is at least this big") \ + "Use large pages if maximum heap is at least this big") \ \ product(bool, ForceTimeHighResolution, false, \ - "Using high time resolution(For Win32 only)") \ + "Using high time resolution (for Win32 only)") \ \ develop(bool, TraceItables, false, \ "Trace initialization and use of itables") \ @@ -564,10 +611,10 @@ class CommandLineFlags { \ develop(bool, TraceLongCompiles, false, \ "Print out every time compilation is longer than " \ - "a given threashold") \ + "a given threshold") \ \ develop(bool, SafepointALot, false, \ - "Generates a lot of safepoints. Works with " \ + "Generate a lot of safepoints. This works with " \ "GuaranteedSafepointInterval") \ \ product_pd(bool, BackgroundCompilation, \ @@ -575,13 +622,13 @@ class CommandLineFlags { "compilation") \ \ product(bool, PrintVMQWaitTime, false, \ - "Prints out the waiting time in VM operation queue") \ + "Print out the waiting time in VM operation queue") \ \ develop(bool, NoYieldsInMicrolock, false, \ "Disable yields in microlock") \ \ develop(bool, TraceOopMapGeneration, false, \ - "Shows oopmap generation") \ + "Show OopMapGeneration") \ \ product(bool, MethodFlushing, true, \ "Reclamation of zombie and not-entrant methods") \ @@ -590,10 +637,11 @@ class CommandLineFlags { "Verify stack of each thread when it is entering a runtime call") \ \ diagnostic(bool, ForceUnreachable, false, \ - "Make all non code cache addresses to be unreachable with forcing use of 64bit literal fixups") \ + "Make all non code cache addresses to be unreachable by " \ + "forcing use of 64bit literal fixups") \ \ notproduct(bool, StressDerivedPointers, false, \ - "Force scavenge when a derived pointers is detected on stack " \ + "Force scavenge when a derived pointer is detected on stack " \ "after rtm call") \ \ develop(bool, TraceDerivedPointers, false, \ @@ -612,86 +660,86 @@ class CommandLineFlags { "Use Inline Caches for virtual calls ") \ \ develop(bool, InlineArrayCopy, true, \ - "inline arraycopy native that is known to be part of " \ + "Inline arraycopy native that is known to be part of " \ "base library DLL") \ \ develop(bool, InlineObjectHash, true, \ - "inline Object::hashCode() native that is known to be part " \ + "Inline Object::hashCode() native that is known to be part " \ "of base library DLL") \ \ develop(bool, InlineNatives, true, \ - "inline natives that are known to be part of base library DLL") \ + "Inline natives that are known to be part of base library DLL") \ \ develop(bool, InlineMathNatives, true, \ - "inline SinD, CosD, etc.") \ + "Inline SinD, CosD, etc.") \ \ develop(bool, InlineClassNatives, true, \ - "inline Class.isInstance, etc") \ + "Inline Class.isInstance, etc") \ \ develop(bool, InlineThreadNatives, true, \ - "inline Thread.currentThread, etc") \ + "Inline Thread.currentThread, etc") \ \ develop(bool, InlineUnsafeOps, true, \ - "inline memory ops (native methods) from sun.misc.Unsafe") \ + "Inline memory ops (native methods) from sun.misc.Unsafe") \ \ product(bool, CriticalJNINatives, true, \ - "check for critical JNI entry points") \ + "Check for critical JNI entry points") \ \ notproduct(bool, StressCriticalJNINatives, false, \ - "Exercise register saving code in critical natives") \ + "Exercise register saving code in critical natives") \ \ product(bool, UseSSE42Intrinsics, false, \ "SSE4.2 versions of intrinsics") \ \ product(bool, UseAESIntrinsics, false, \ - "use intrinsics for AES versions of crypto") \ + "Use intrinsics for AES versions of crypto") \ \ product(bool, UseCRC32Intrinsics, false, \ "use intrinsics for java.util.zip.CRC32") \ \ develop(bool, TraceCallFixup, false, \ - "traces all call fixups") \ + "Trace all call fixups") \ \ develop(bool, DeoptimizeALot, false, \ - "deoptimize at every exit from the runtime system") \ + "Deoptimize at every exit from the runtime system") \ \ notproduct(ccstrlist, DeoptimizeOnlyAt, "", \ - "a comma separated list of bcis to deoptimize at") \ + "A comma separated list of bcis to deoptimize at") \ \ product(bool, DeoptimizeRandom, false, \ - "deoptimize random frames on random exit from the runtime system")\ + "Deoptimize random frames on random exit from the runtime system")\ \ notproduct(bool, ZombieALot, false, \ - "creates zombies (non-entrant) at exit from the runt. system") \ + "Create zombies (non-entrant) at exit from the runtime system") \ \ product(bool, UnlinkSymbolsALot, false, \ - "unlink unreferenced symbols from the symbol table at safepoints")\ + "Unlink unreferenced symbols from the symbol table at safepoints")\ \ notproduct(bool, WalkStackALot, false, \ - "trace stack (no print) at every exit from the runtime system") \ + "Trace stack (no print) at every exit from the runtime system") \ \ product(bool, Debugging, false, \ - "set when executing debug methods in debug.ccp " \ + "Set when executing debug methods in debug.cpp " \ "(to prevent triggering assertions)") \ \ notproduct(bool, StrictSafepointChecks, trueInDebug, \ "Enable strict checks that safepoints cannot happen for threads " \ - "that used No_Safepoint_Verifier") \ + "that use No_Safepoint_Verifier") \ \ notproduct(bool, VerifyLastFrame, false, \ "Verify oops on last frame on entry to VM") \ \ develop(bool, TraceHandleAllocation, false, \ - "Prints out warnings when suspicious many handles are allocated") \ + "Print out warnings when suspiciously many handles are allocated")\ \ product(bool, UseCompilerSafepoints, true, \ "Stop at safepoints in compiled code") \ \ product(bool, FailOverToOldVerifier, true, \ - "fail over to old verifier when split verifier fails") \ + "Fail over to old verifier when split verifier fails") \ \ develop(bool, ShowSafepointMsgs, false, \ - "Show msg. about safepoint synch.") \ + "Show message about safepoint synchronization") \ \ product(bool, SafepointTimeout, false, \ "Time out and warn or fail after SafepointTimeoutDelay " \ @@ -715,19 +763,19 @@ class CommandLineFlags { "Trace external suspend wait failures") \ \ product(bool, MaxFDLimit, true, \ - "Bump the number of file descriptors to max in solaris.") \ + "Bump the number of file descriptors to maximum in Solaris") \ \ diagnostic(bool, LogEvents, true, \ - "Enable the various ring buffer event logs") \ + "Enable the various ring buffer event logs") \ \ diagnostic(uintx, LogEventsBufferEntries, 10, \ - "Enable the various ring buffer event logs") \ + "Number of ring buffer event logs") \ \ product(bool, BytecodeVerificationRemote, true, \ - "Enables the Java bytecode verifier for remote classes") \ + "Enable the Java bytecode verifier for remote classes") \ \ product(bool, BytecodeVerificationLocal, false, \ - "Enables the Java bytecode verifier for local classes") \ + "Enable the Java bytecode verifier for local classes") \ \ develop(bool, ForceFloatExceptions, trueInDebug, \ "Force exceptions on FP stack under/overflow") \ @@ -739,7 +787,7 @@ class CommandLineFlags { "Trace java language assertions") \ \ notproduct(bool, CheckAssertionStatusDirectives, false, \ - "temporary - see javaClasses.cpp") \ + "Temporary - see javaClasses.cpp") \ \ notproduct(bool, PrintMallocFree, false, \ "Trace calls to C heap malloc/free allocation") \ @@ -758,16 +806,16 @@ class CommandLineFlags { "entering the VM") \ \ notproduct(bool, CheckOopishValues, false, \ - "Warn if value contains oop ( requires ZapDeadLocals)") \ + "Warn if value contains oop (requires ZapDeadLocals)") \ \ develop(bool, UseMallocOnly, false, \ - "use only malloc/free for allocation (no resource area/arena)") \ + "Use only malloc/free for allocation (no resource area/arena)") \ \ develop(bool, PrintMalloc, false, \ - "print all malloc/free calls") \ + "Print all malloc/free calls") \ \ develop(bool, PrintMallocStatistics, false, \ - "print malloc/free statistics") \ + "Print malloc/free statistics") \ \ develop(bool, ZapResourceArea, trueInDebug, \ "Zap freed resource/arena space with 0xABABABAB") \ @@ -779,7 +827,7 @@ class CommandLineFlags { "Zap freed JNI handle space with 0xFEFEFEFE") \ \ notproduct(bool, ZapStackSegments, trueInDebug, \ - "Zap allocated/freed Stack segments with 0xFADFADED") \ + "Zap allocated/freed stack segments with 0xFADFADED") \ \ develop(bool, ZapUnusedHeapArea, trueInDebug, \ "Zap unused heap space with 0xBAADBABE") \ @@ -794,7 +842,7 @@ class CommandLineFlags { "Zap filler objects with 0xDEAFBABE") \ \ develop(bool, PrintVMMessages, true, \ - "Print vm messages on console") \ + "Print VM messages on console") \ \ product(bool, PrintGCApplicationConcurrentTime, false, \ "Print the time the application has been running") \ @@ -803,21 +851,21 @@ class CommandLineFlags { "Print the time the application has been stopped") \ \ diagnostic(bool, VerboseVerification, false, \ - "Display detailed verification details") \ + "Display detailed verification details") \ \ notproduct(uintx, ErrorHandlerTest, 0, \ - "If > 0, provokes an error after VM initialization; the value" \ - "determines which error to provoke. See test_error_handler()" \ + "If > 0, provokes an error after VM initialization; the value " \ + "determines which error to provoke. See test_error_handler() " \ "in debug.cpp.") \ \ develop(bool, Verbose, false, \ - "Prints additional debugging information from other modes") \ + "Print additional debugging information from other modes") \ \ develop(bool, PrintMiscellaneous, false, \ - "Prints uncategorized debugging information (requires +Verbose)") \ + "Print uncategorized debugging information (requires +Verbose)") \ \ develop(bool, WizardMode, false, \ - "Prints much more debugging information") \ + "Print much more debugging information") \ \ product(bool, ShowMessageBoxOnError, false, \ "Keep process alive on VM fatal error") \ @@ -829,7 +877,7 @@ class CommandLineFlags { "Let VM fatal error propagate to the OS (ie. WER on Windows)") \ \ product(bool, SuppressFatalErrorMessage, false, \ - "Do NO Fatal Error report [Avoid deadlock]") \ + "Report NO fatal error message (avoid deadlock)") \ \ product(ccstrlist, OnError, "", \ "Run user-defined commands on fatal error; see VMError.cpp " \ @@ -839,17 +887,17 @@ class CommandLineFlags { "Run user-defined commands on first java.lang.OutOfMemoryError") \ \ manageable(bool, HeapDumpBeforeFullGC, false, \ - "Dump heap to file before any major stop-world GC") \ + "Dump heap to file before any major stop-the-world GC") \ \ manageable(bool, HeapDumpAfterFullGC, false, \ - "Dump heap to file after any major stop-world GC") \ + "Dump heap to file after any major stop-the-world GC") \ \ manageable(bool, HeapDumpOnOutOfMemoryError, false, \ "Dump heap to file when java.lang.OutOfMemoryError is thrown") \ \ manageable(ccstr, HeapDumpPath, NULL, \ - "When HeapDumpOnOutOfMemoryError is on, the path (filename or" \ - "directory) of the dump file (defaults to java_pid.hprof" \ + "When HeapDumpOnOutOfMemoryError is on, the path (filename or " \ + "directory) of the dump file (defaults to java_pid.hprof " \ "in the working directory)") \ \ develop(uintx, SegmentedHeapDumpThreshold, 2*G, \ @@ -863,10 +911,10 @@ class CommandLineFlags { "Execute breakpoint upon encountering VM warning") \ \ develop(bool, TraceVMOperation, false, \ - "Trace vm operations") \ + "Trace VM operations") \ \ develop(bool, UseFakeTimers, false, \ - "Tells whether the VM should use system time or a fake timer") \ + "Tell whether the VM should use system time or a fake timer") \ \ product(ccstr, NativeMemoryTracking, "off", \ "Native memory tracking options") \ @@ -876,7 +924,7 @@ class CommandLineFlags { \ diagnostic(bool, AutoShutdownNMT, true, \ "Automatically shutdown native memory tracking under stress " \ - "situation. When set to false, native memory tracking tries to " \ + "situations. When set to false, native memory tracking tries to " \ "stay alive at the expense of JVM performance") \ \ diagnostic(bool, LogCompilation, false, \ @@ -886,12 +934,12 @@ class CommandLineFlags { "Print compilations") \ \ diagnostic(bool, TraceNMethodInstalls, false, \ - "Trace nmethod intallation") \ + "Trace nmethod installation") \ \ diagnostic(intx, ScavengeRootsInCode, 2, \ - "0: do not allow scavengable oops in the code cache; " \ - "1: allow scavenging from the code cache; " \ - "2: emit as many constants as the compiler can see") \ + "0: do not allow scavengable oops in the code cache; " \ + "1: allow scavenging from the code cache; " \ + "2: emit as many constants as the compiler can see") \ \ product(bool, AlwaysRestoreFPU, false, \ "Restore the FPU control word after every JNI call (expensive)") \ @@ -912,7 +960,7 @@ class CommandLineFlags { "Print assembly code (using external disassembler.so)") \ \ diagnostic(ccstr, PrintAssemblyOptions, NULL, \ - "Options string passed to disassembler.so") \ + "Print options string passed to disassembler.so") \ \ diagnostic(bool, PrintNMethods, false, \ "Print assembly code for nmethods when generated") \ @@ -933,20 +981,21 @@ class CommandLineFlags { "Print exception handler tables for all nmethods when generated") \ \ develop(bool, StressCompiledExceptionHandlers, false, \ - "Exercise compiled exception handlers") \ + "Exercise compiled exception handlers") \ \ develop(bool, InterceptOSException, false, \ - "Starts debugger when an implicit OS (e.g., NULL) " \ + "Start debugger when an implicit OS (e.g. NULL) " \ "exception happens") \ \ product(bool, PrintCodeCache, false, \ "Print the code cache memory usage when exiting") \ \ develop(bool, PrintCodeCache2, false, \ - "Print detailed usage info on the code cache when exiting") \ + "Print detailed usage information on the code cache when exiting")\ \ product(bool, PrintCodeCacheOnCompilation, false, \ - "Print the code cache memory usage each time a method is compiled") \ + "Print the code cache memory usage each time a method is " \ + "compiled") \ \ diagnostic(bool, PrintStubCode, false, \ "Print generated stub code") \ @@ -958,40 +1007,40 @@ class CommandLineFlags { "Omit backtraces for some 'hot' exceptions in optimized code") \ \ product(bool, ProfilerPrintByteCodeStatistics, false, \ - "Prints byte code statictics when dumping profiler output") \ + "Print bytecode statistics when dumping profiler output") \ \ product(bool, ProfilerRecordPC, false, \ - "Collects tick for each 16 byte interval of compiled code") \ + "Collect ticks for each 16 byte interval of compiled code") \ \ product(bool, ProfileVM, false, \ - "Profiles ticks that fall within VM (either in the VM Thread " \ + "Profile ticks that fall within VM (either in the VM Thread " \ "or VM code called through stubs)") \ \ product(bool, ProfileIntervals, false, \ - "Prints profiles for each interval (see ProfileIntervalsTicks)") \ + "Print profiles for each interval (see ProfileIntervalsTicks)") \ \ notproduct(bool, ProfilerCheckIntervals, false, \ - "Collect and print info on spacing of profiler ticks") \ + "Collect and print information on spacing of profiler ticks") \ \ develop(bool, PrintJVMWarnings, false, \ - "Prints warnings for unimplemented JVM functions") \ + "Print warnings for unimplemented JVM functions") \ \ product(bool, PrintWarnings, true, \ - "Prints JVM warnings to output stream") \ + "Print JVM warnings to output stream") \ \ notproduct(uintx, WarnOnStalledSpinLock, 0, \ - "Prints warnings for stalled SpinLocks") \ + "Print warnings for stalled SpinLocks") \ \ product(bool, RegisterFinalizersAtInit, true, \ "Register finalizable objects at end of Object. or " \ "after allocation") \ \ develop(bool, RegisterReferences, true, \ - "Tells whether the VM should register soft/weak/final/phantom " \ + "Tell whether the VM should register soft/weak/final/phantom " \ "references") \ \ develop(bool, IgnoreRewrites, false, \ - "Supress rewrites of bytecodes in the oopmap generator. " \ + "Suppress rewrites of bytecodes in the oopmap generator. " \ "This is unsafe!") \ \ develop(bool, PrintCodeCacheExtension, false, \ @@ -1001,8 +1050,7 @@ class CommandLineFlags { "Enable the security JVM functions") \ \ develop(bool, ProtectionDomainVerification, true, \ - "Verifies protection domain before resolution in system " \ - "dictionary") \ + "Verify protection domain before resolution in system dictionary")\ \ product(bool, ClassUnloading, true, \ "Do unloading of classes") \ @@ -1015,14 +1063,14 @@ class CommandLineFlags { "Write memory usage profiling to log file") \ \ notproduct(bool, PrintSystemDictionaryAtExit, false, \ - "Prints the system dictionary at exit") \ + "Print the system dictionary at exit") \ \ experimental(intx, PredictedLoadedClassCount, 0, \ - "Experimental: Tune loaded class cache starting size.") \ + "Experimental: Tune loaded class cache starting size") \ \ diagnostic(bool, UnsyncloadClass, false, \ "Unstable: VM calls loadClass unsynchronized. Custom " \ - "class loader must call VM synchronized for findClass " \ + "class loader must call VM synchronized for findClass " \ "and defineClass.") \ \ product(bool, AlwaysLockClassLoader, false, \ @@ -1038,22 +1086,22 @@ class CommandLineFlags { "Call loadClassInternal() rather than loadClass()") \ \ product_pd(bool, DontYieldALot, \ - "Throw away obvious excess yield calls (for SOLARIS only)") \ + "Throw away obvious excess yield calls (for Solaris only)") \ \ product_pd(bool, ConvertSleepToYield, \ - "Converts sleep(0) to thread yield " \ - "(may be off for SOLARIS to improve GUI)") \ + "Convert sleep(0) to thread yield " \ + "(may be off for Solaris to improve GUI)") \ \ product(bool, ConvertYieldToSleep, false, \ - "Converts yield to a sleep of MinSleepInterval to simulate Win32 "\ - "behavior (SOLARIS only)") \ + "Convert yield to a sleep of MinSleepInterval to simulate Win32 " \ + "behavior (Solaris only)") \ \ product(bool, UseBoundThreads, true, \ - "Bind user level threads to kernel threads (for SOLARIS only)") \ + "Bind user level threads to kernel threads (for Solaris only)") \ \ develop(bool, UseDetachedThreads, true, \ "Use detached threads that are recycled upon termination " \ - "(for SOLARIS only)") \ + "(for Solaris only)") \ \ product(bool, UseLWPSynchronization, true, \ "Use LWP-based instead of libthread-based synchronization " \ @@ -1063,41 +1111,43 @@ class CommandLineFlags { "(Unstable) Various monitor synchronization tunables") \ \ product(intx, EmitSync, 0, \ - "(Unsafe,Unstable) " \ - " Controls emission of inline sync fast-path code") \ + "(Unsafe, Unstable) " \ + "Control emission of inline sync fast-path code") \ \ product(intx, MonitorBound, 0, "Bound Monitor population") \ \ product(bool, MonitorInUseLists, false, "Track Monitors for Deflation") \ \ - product(intx, SyncFlags, 0, "(Unsafe,Unstable) Experimental Sync flags" ) \ + product(intx, SyncFlags, 0, "(Unsafe, Unstable) Experimental Sync flags") \ \ - product(intx, SyncVerbose, 0, "(Unstable)" ) \ + product(intx, SyncVerbose, 0, "(Unstable)") \ \ - product(intx, ClearFPUAtPark, 0, "(Unsafe,Unstable)" ) \ + product(intx, ClearFPUAtPark, 0, "(Unsafe, Unstable)") \ \ product(intx, hashCode, 5, \ - "(Unstable) select hashCode generation algorithm" ) \ + "(Unstable) select hashCode generation algorithm") \ \ product(intx, WorkAroundNPTLTimedWaitHang, 1, \ - "(Unstable, Linux-specific)" \ - " avoid NPTL-FUTEX hang pthread_cond_timedwait" ) \ + "(Unstable, Linux-specific) " \ + "avoid NPTL-FUTEX hang pthread_cond_timedwait") \ \ product(bool, FilterSpuriousWakeups, true, \ "Prevent spurious or premature wakeups from object.wait " \ "(Solaris only)") \ \ - product(intx, NativeMonitorTimeout, -1, "(Unstable)" ) \ - product(intx, NativeMonitorFlags, 0, "(Unstable)" ) \ - product(intx, NativeMonitorSpinLimit, 20, "(Unstable)" ) \ + product(intx, NativeMonitorTimeout, -1, "(Unstable)") \ + \ + product(intx, NativeMonitorFlags, 0, "(Unstable)") \ + \ + product(intx, NativeMonitorSpinLimit, 20, "(Unstable)") \ \ develop(bool, UsePthreads, false, \ "Use pthread-based instead of libthread-based synchronization " \ "(SPARC only)") \ \ product(bool, AdjustConcurrency, false, \ - "call thr_setconcurrency at thread create time to avoid " \ - "LWP starvation on MP systems (For Solaris Only)") \ + "Call thr_setconcurrency at thread creation time to avoid " \ + "LWP starvation on MP systems (for Solaris Only)") \ \ product(bool, ReduceSignalUsage, false, \ "Reduce the use of OS signals in Java and/or the VM") \ @@ -1106,13 +1156,14 @@ class CommandLineFlags { "Share vtable stubs (smaller code but worse branch prediction") \ \ develop(bool, LoadLineNumberTables, true, \ - "Tells whether the class file parser loads line number tables") \ + "Tell whether the class file parser loads line number tables") \ \ develop(bool, LoadLocalVariableTables, true, \ - "Tells whether the class file parser loads local variable tables")\ + "Tell whether the class file parser loads local variable tables") \ \ develop(bool, LoadLocalVariableTypeTables, true, \ - "Tells whether the class file parser loads local variable type tables")\ + "Tell whether the class file parser loads local variable type" \ + "tables") \ \ product(bool, AllowUserSignalHandlers, false, \ "Do not complain if the application installs signal handlers " \ @@ -1143,10 +1194,12 @@ class CommandLineFlags { \ product(bool, EagerXrunInit, false, \ "Eagerly initialize -Xrun libraries; allows startup profiling, " \ - " but not all -Xrun libraries may support the state of the VM at this time") \ + "but not all -Xrun libraries may support the state of the VM " \ + "at this time") \ \ product(bool, PreserveAllAnnotations, false, \ - "Preserve RuntimeInvisibleAnnotations as well as RuntimeVisibleAnnotations") \ + "Preserve RuntimeInvisibleAnnotations as well " \ + "as RuntimeVisibleAnnotations") \ \ develop(uintx, PreallocatedOutOfMemoryErrorCount, 4, \ "Number of OutOfMemoryErrors preallocated with backtrace") \ @@ -1221,7 +1274,7 @@ class CommandLineFlags { "Trace level for JVMTI RedefineClasses") \ \ develop(bool, StressMethodComparator, false, \ - "run the MethodComparator on all loaded methods") \ + "Run the MethodComparator on all loaded methods") \ \ /* change to false by default sometime after Mustang */ \ product(bool, VerifyMergedCPBytecodes, true, \ @@ -1255,7 +1308,7 @@ class CommandLineFlags { "Trace dependencies") \ \ develop(bool, VerifyDependencies, trueInDebug, \ - "Exercise and verify the compilation dependency mechanism") \ + "Exercise and verify the compilation dependency mechanism") \ \ develop(bool, TraceNewOopMapGeneration, false, \ "Trace OopMapGeneration") \ @@ -1273,7 +1326,7 @@ class CommandLineFlags { "Trace monitor matching failures during OopMapGeneration") \ \ develop(bool, TraceOopMapRewrites, false, \ - "Trace rewritting of method oops during oop map generation") \ + "Trace rewriting of method oops during oop map generation") \ \ develop(bool, TraceSafepoint, false, \ "Trace safepoint operations") \ @@ -1291,10 +1344,10 @@ class CommandLineFlags { "Trace setup time") \ \ develop(bool, TraceProtectionDomainVerification, false, \ - "Trace protection domain verifcation") \ + "Trace protection domain verification") \ \ develop(bool, TraceClearedExceptions, false, \ - "Prints when an exception is forcibly cleared") \ + "Print when an exception is forcibly cleared") \ \ product(bool, TraceClassResolution, false, \ "Trace all constant pool resolutions (for debugging)") \ @@ -1308,7 +1361,7 @@ class CommandLineFlags { /* gc */ \ \ product(bool, UseSerialGC, false, \ - "Use the serial garbage collector") \ + "Use the Serial garbage collector") \ \ product(bool, UseG1GC, false, \ "Use the Garbage-First garbage collector") \ @@ -1327,16 +1380,16 @@ class CommandLineFlags { "The collection count for the first maximum compaction") \ \ product(bool, UseMaximumCompactionOnSystemGC, true, \ - "In the Parallel Old garbage collector maximum compaction for " \ - "a system GC") \ + "Use maximum compaction in the Parallel Old garbage collector " \ + "for a system GC") \ \ product(uintx, ParallelOldDeadWoodLimiterMean, 50, \ - "The mean used by the par compact dead wood" \ - "limiter (a number between 0-100).") \ + "The mean used by the parallel compact dead wood " \ + "limiter (a number between 0-100)") \ \ product(uintx, ParallelOldDeadWoodLimiterStdDev, 80, \ - "The standard deviation used by the par compact dead wood" \ - "limiter (a number between 0-100).") \ + "The standard deviation used by the parallel compact dead wood " \ + "limiter (a number between 0-100)") \ \ product(uintx, ParallelGCThreads, 0, \ "Number of parallel threads parallel gc will use") \ @@ -1346,7 +1399,7 @@ class CommandLineFlags { "parallel gc will use") \ \ diagnostic(bool, ForceDynamicNumberOfGCThreads, false, \ - "Force dynamic selection of the number of" \ + "Force dynamic selection of the number of " \ "parallel threads parallel gc will use to aid debugging") \ \ product(uintx, HeapSizePerGCThread, ScaleForWordSize(64*M), \ @@ -1357,7 +1410,7 @@ class CommandLineFlags { "Trace the dynamic GC thread usage") \ \ develop(bool, ParallelOldGCSplitALot, false, \ - "Provoke splitting (copying data from a young gen space to" \ + "Provoke splitting (copying data from a young gen space to " \ "multiple destination spaces)") \ \ develop(uintx, ParallelOldGCSplitInterval, 3, \ @@ -1367,19 +1420,19 @@ class CommandLineFlags { "Number of threads concurrent gc will use") \ \ product(uintx, YoungPLABSize, 4096, \ - "Size of young gen promotion labs (in HeapWords)") \ + "Size of young gen promotion LAB's (in HeapWords)") \ \ product(uintx, OldPLABSize, 1024, \ - "Size of old gen promotion labs (in HeapWords)") \ + "Size of old gen promotion LAB's (in HeapWords)") \ \ product(uintx, GCTaskTimeStampEntries, 200, \ "Number of time stamp entries per gc worker thread") \ \ product(bool, AlwaysTenure, false, \ - "Always tenure objects in eden. (ParallelGC only)") \ + "Always tenure objects in eden (ParallelGC only)") \ \ product(bool, NeverTenure, false, \ - "Never tenure objects in eden, May tenure on overflow " \ + "Never tenure objects in eden, may tenure on overflow " \ "(ParallelGC only)") \ \ product(bool, ScavengeBeforeFullGC, true, \ @@ -1387,14 +1440,14 @@ class CommandLineFlags { "used with UseParallelGC") \ \ develop(bool, ScavengeWithObjectsInToSpace, false, \ - "Allow scavenges to occur when to_space contains objects.") \ + "Allow scavenges to occur when to-space contains objects") \ \ product(bool, UseConcMarkSweepGC, false, \ "Use Concurrent Mark-Sweep GC in the old generation") \ \ product(bool, ExplicitGCInvokesConcurrent, false, \ - "A System.gc() request invokes a concurrent collection;" \ - " (effective only when UseConcMarkSweepGC)") \ + "A System.gc() request invokes a concurrent collection; " \ + "(effective only when UseConcMarkSweepGC)") \ \ product(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false, \ "A System.gc() request invokes a concurrent collection and " \ @@ -1402,19 +1455,19 @@ class CommandLineFlags { "(effective only when UseConcMarkSweepGC)") \ \ product(bool, GCLockerInvokesConcurrent, false, \ - "The exit of a JNI CS necessitating a scavenge also" \ - " kicks off a bkgrd concurrent collection") \ + "The exit of a JNI critical section necessitating a scavenge, " \ + "also kicks off a background concurrent collection") \ \ product(uintx, GCLockerEdenExpansionPercent, 5, \ - "How much the GC can expand the eden by while the GC locker " \ + "How much the GC can expand the eden by while the GC locker " \ "is active (as a percentage)") \ \ diagnostic(intx, GCLockerRetryAllocationCount, 2, \ - "Number of times to retry allocations when" \ - " blocked by the GC locker") \ + "Number of times to retry allocations when " \ + "blocked by the GC locker") \ \ develop(bool, UseCMSAdaptiveFreeLists, true, \ - "Use Adaptive Free Lists in the CMS generation") \ + "Use adaptive free lists in the CMS generation") \ \ develop(bool, UseAsyncConcMarkSweepGC, true, \ "Use Asynchronous Concurrent Mark-Sweep GC in the old generation")\ @@ -1429,44 +1482,46 @@ class CommandLineFlags { "Use passing of collection from background to foreground") \ \ product(bool, UseParNewGC, false, \ - "Use parallel threads in the new generation.") \ + "Use parallel threads in the new generation") \ \ product(bool, ParallelGCVerbose, false, \ - "Verbose output for parallel GC.") \ + "Verbose output for parallel gc") \ \ product(uintx, ParallelGCBufferWastePct, 10, \ - "Wasted fraction of parallel allocation buffer.") \ + "Wasted fraction of parallel allocation buffer") \ \ diagnostic(bool, ParallelGCRetainPLAB, false, \ - "Retain parallel allocation buffers across scavenges; " \ - " -- disabled because this currently conflicts with " \ - " parallel card scanning under certain conditions ") \ + "Retain parallel allocation buffers across scavenges; " \ + "it is disabled because this currently conflicts with " \ + "parallel card scanning under certain conditions.") \ \ product(uintx, TargetPLABWastePct, 10, \ "Target wasted space in last buffer as percent of overall " \ "allocation") \ \ product(uintx, PLABWeight, 75, \ - "Percentage (0-100) used to weight the current sample when" \ - "computing exponentially decaying average for ResizePLAB.") \ + "Percentage (0-100) used to weigh the current sample when " \ + "computing exponentially decaying average for ResizePLAB") \ \ product(bool, ResizePLAB, true, \ - "Dynamically resize (survivor space) promotion labs") \ + "Dynamically resize (survivor space) promotion LAB's") \ \ product(bool, PrintPLAB, false, \ - "Print (survivor space) promotion labs sizing decisions") \ + "Print (survivor space) promotion LAB's sizing decisions") \ \ product(intx, ParGCArrayScanChunk, 50, \ - "Scan a subset and push remainder, if array is bigger than this") \ + "Scan a subset of object array and push remainder, if array is " \ + "bigger than this") \ \ product(bool, ParGCUseLocalOverflow, false, \ "Instead of a global overflow list, use local overflow stacks") \ \ product(bool, ParGCTrimOverflow, true, \ - "Eagerly trim the local overflow lists (when ParGCUseLocalOverflow") \ + "Eagerly trim the local overflow lists " \ + "(when ParGCUseLocalOverflow)") \ \ notproduct(bool, ParGCWorkQueueOverflowALot, false, \ - "Whether we should simulate work queue overflow in ParNew") \ + "Simulate work queue overflow in ParNew") \ \ notproduct(uintx, ParGCWorkQueueOverflowInterval, 1000, \ "An `interval' counter that determines how frequently " \ @@ -1484,43 +1539,46 @@ class CommandLineFlags { "during card table scanning") \ \ product(uintx, CMSParPromoteBlocksToClaim, 16, \ - "Number of blocks to attempt to claim when refilling CMS LAB for "\ - "parallel GC.") \ + "Number of blocks to attempt to claim when refilling CMS LAB's " \ + "for parallel GC") \ \ product(uintx, OldPLABWeight, 50, \ - "Percentage (0-100) used to weight the current sample when" \ - "computing exponentially decaying average for resizing CMSParPromoteBlocksToClaim.") \ + "Percentage (0-100) used to weight the current sample when " \ + "computing exponentially decaying average for resizing " \ + "CMSParPromoteBlocksToClaim") \ \ product(bool, ResizeOldPLAB, true, \ - "Dynamically resize (old gen) promotion labs") \ + "Dynamically resize (old gen) promotion LAB's") \ \ product(bool, PrintOldPLAB, false, \ - "Print (old gen) promotion labs sizing decisions") \ + "Print (old gen) promotion LAB's sizing decisions") \ \ product(uintx, CMSOldPLABMin, 16, \ - "Min size of CMS gen promotion lab caches per worker per blksize")\ + "Minimum size of CMS gen promotion LAB caches per worker " \ + "per block size") \ \ product(uintx, CMSOldPLABMax, 1024, \ - "Max size of CMS gen promotion lab caches per worker per blksize")\ + "Maximum size of CMS gen promotion LAB caches per worker " \ + "per block size") \ \ product(uintx, CMSOldPLABNumRefills, 4, \ - "Nominal number of refills of CMS gen promotion lab cache" \ - " per worker per block size") \ + "Nominal number of refills of CMS gen promotion LAB cache " \ + "per worker per block size") \ \ product(bool, CMSOldPLABResizeQuicker, false, \ - "Whether to react on-the-fly during a scavenge to a sudden" \ - " change in block demand rate") \ + "React on-the-fly during a scavenge to a sudden " \ + "change in block demand rate") \ \ product(uintx, CMSOldPLABToleranceFactor, 4, \ - "The tolerance of the phase-change detector for on-the-fly" \ - " PLAB resizing during a scavenge") \ + "The tolerance of the phase-change detector for on-the-fly " \ + "PLAB resizing during a scavenge") \ \ product(uintx, CMSOldPLABReactivityFactor, 2, \ - "The gain in the feedback loop for on-the-fly PLAB resizing" \ - " during a scavenge") \ + "The gain in the feedback loop for on-the-fly PLAB resizing " \ + "during a scavenge") \ \ product(bool, AlwaysPreTouch, false, \ - "It forces all freshly committed pages to be pre-touched.") \ + "Force all freshly committed pages to be pre-touched") \ \ product_pd(uintx, CMSYoungGenPerWorker, \ "The maximum size of young gen chosen by default per GC worker " \ @@ -1530,64 +1588,67 @@ class CommandLineFlags { "Whether CMS GC should operate in \"incremental\" mode") \ \ product(uintx, CMSIncrementalDutyCycle, 10, \ - "CMS incremental mode duty cycle (a percentage, 0-100). If" \ - "CMSIncrementalPacing is enabled, then this is just the initial" \ - "value") \ + "Percentage (0-100) of CMS incremental mode duty cycle. If " \ + "CMSIncrementalPacing is enabled, then this is just the initial " \ + "value.") \ \ product(bool, CMSIncrementalPacing, true, \ "Whether the CMS incremental mode duty cycle should be " \ "automatically adjusted") \ \ product(uintx, CMSIncrementalDutyCycleMin, 0, \ - "Lower bound on the duty cycle when CMSIncrementalPacing is " \ - "enabled (a percentage, 0-100)") \ + "Minimum percentage (0-100) of the CMS incremental duty cycle " \ + "used when CMSIncrementalPacing is enabled") \ \ product(uintx, CMSIncrementalSafetyFactor, 10, \ "Percentage (0-100) used to add conservatism when computing the " \ "duty cycle") \ \ product(uintx, CMSIncrementalOffset, 0, \ - "Percentage (0-100) by which the CMS incremental mode duty cycle" \ - " is shifted to the right within the period between young GCs") \ + "Percentage (0-100) by which the CMS incremental mode duty cycle "\ + "is shifted to the right within the period between young GCs") \ \ product(uintx, CMSExpAvgFactor, 50, \ - "Percentage (0-100) used to weight the current sample when" \ - "computing exponential averages for CMS statistics.") \ + "Percentage (0-100) used to weigh the current sample when " \ + "computing exponential averages for CMS statistics") \ \ product(uintx, CMS_FLSWeight, 75, \ - "Percentage (0-100) used to weight the current sample when" \ - "computing exponentially decating averages for CMS FLS statistics.") \ + "Percentage (0-100) used to weigh the current sample when " \ + "computing exponentially decaying averages for CMS FLS " \ + "statistics") \ \ product(uintx, CMS_FLSPadding, 1, \ - "The multiple of deviation from mean to use for buffering" \ - "against volatility in free list demand.") \ + "The multiple of deviation from mean to use for buffering " \ + "against volatility in free list demand") \ \ product(uintx, FLSCoalescePolicy, 2, \ - "CMS: Aggression level for coalescing, increasing from 0 to 4") \ + "CMS: aggressiveness level for coalescing, increasing " \ + "from 0 to 4") \ \ product(bool, FLSAlwaysCoalesceLarge, false, \ - "CMS: Larger free blocks are always available for coalescing") \ + "CMS: larger free blocks are always available for coalescing") \ \ product(double, FLSLargestBlockCoalesceProximity, 0.99, \ - "CMS: the smaller the percentage the greater the coalition force")\ + "CMS: the smaller the percentage the greater the coalescing " \ + "force") \ \ product(double, CMSSmallCoalSurplusPercent, 1.05, \ - "CMS: the factor by which to inflate estimated demand of small" \ - " block sizes to prevent coalescing with an adjoining block") \ + "CMS: the factor by which to inflate estimated demand of small " \ + "block sizes to prevent coalescing with an adjoining block") \ \ product(double, CMSLargeCoalSurplusPercent, 0.95, \ - "CMS: the factor by which to inflate estimated demand of large" \ - " block sizes to prevent coalescing with an adjoining block") \ + "CMS: the factor by which to inflate estimated demand of large " \ + "block sizes to prevent coalescing with an adjoining block") \ \ product(double, CMSSmallSplitSurplusPercent, 1.10, \ - "CMS: the factor by which to inflate estimated demand of small" \ - " block sizes to prevent splitting to supply demand for smaller" \ - " blocks") \ + "CMS: the factor by which to inflate estimated demand of small " \ + "block sizes to prevent splitting to supply demand for smaller " \ + "blocks") \ \ product(double, CMSLargeSplitSurplusPercent, 1.00, \ - "CMS: the factor by which to inflate estimated demand of large" \ - " block sizes to prevent splitting to supply demand for smaller" \ - " blocks") \ + "CMS: the factor by which to inflate estimated demand of large " \ + "block sizes to prevent splitting to supply demand for smaller " \ + "blocks") \ \ product(bool, CMSExtrapolateSweep, false, \ "CMS: cushion for block demand during sweep") \ @@ -1599,11 +1660,11 @@ class CommandLineFlags { \ product(uintx, CMS_SweepPadding, 1, \ "The multiple of deviation from mean to use for buffering " \ - "against volatility in inter-sweep duration.") \ + "against volatility in inter-sweep duration") \ \ product(uintx, CMS_SweepTimerThresholdMillis, 10, \ "Skip block flux-rate sampling for an epoch unless inter-sweep " \ - "duration exceeds this threhold in milliseconds") \ + "duration exceeds this threshold in milliseconds") \ \ develop(bool, CMSTraceIncrementalMode, false, \ "Trace CMS incremental mode") \ @@ -1618,14 +1679,15 @@ class CommandLineFlags { "Whether class unloading enabled when using CMS GC") \ \ product(uintx, CMSClassUnloadingMaxInterval, 0, \ - "When CMS class unloading is enabled, the maximum CMS cycle count"\ - " for which classes may not be unloaded") \ + "When CMS class unloading is enabled, the maximum CMS cycle " \ + "count for which classes may not be unloaded") \ \ product(bool, CMSCompactWhenClearAllSoftRefs, true, \ - "Compact when asked to collect CMS gen with clear_all_soft_refs") \ + "Compact when asked to collect CMS gen with " \ + "clear_all_soft_refs()") \ \ product(bool, UseCMSCompactAtFullCollection, true, \ - "Use mark sweep compact at full collections") \ + "Use Mark-Sweep-Compact algorithm at full collections") \ \ product(uintx, CMSFullGCsBeforeCompaction, 0, \ "Number of CMS full collection done before compaction if > 0") \ @@ -1647,38 +1709,37 @@ class CommandLineFlags { "Warn in case of excessive CMS looping") \ \ develop(bool, CMSOverflowEarlyRestoration, false, \ - "Whether preserved marks should be restored early") \ + "Restore preserved marks early") \ \ product(uintx, MarkStackSize, NOT_LP64(32*K) LP64_ONLY(4*M), \ "Size of marking stack") \ \ product(uintx, MarkStackSizeMax, NOT_LP64(4*M) LP64_ONLY(512*M), \ - "Max size of marking stack") \ + "Maximum size of marking stack") \ \ notproduct(bool, CMSMarkStackOverflowALot, false, \ - "Whether we should simulate frequent marking stack / work queue" \ - " overflow") \ + "Simulate frequent marking stack / work queue overflow") \ \ notproduct(uintx, CMSMarkStackOverflowInterval, 1000, \ - "An `interval' counter that determines how frequently" \ - " we simulate overflow; a smaller number increases frequency") \ + "An \"interval\" counter that determines how frequently " \ + "to simulate overflow; a smaller number increases frequency") \ \ product(uintx, CMSMaxAbortablePrecleanLoops, 0, \ - "(Temporary, subject to experimentation)" \ + "(Temporary, subject to experimentation) " \ "Maximum number of abortable preclean iterations, if > 0") \ \ product(intx, CMSMaxAbortablePrecleanTime, 5000, \ - "(Temporary, subject to experimentation)" \ - "Maximum time in abortable preclean in ms") \ + "(Temporary, subject to experimentation) " \ + "Maximum time in abortable preclean (in milliseconds)") \ \ product(uintx, CMSAbortablePrecleanMinWorkPerIteration, 100, \ - "(Temporary, subject to experimentation)" \ + "(Temporary, subject to experimentation) " \ "Nominal minimum work per abortable preclean iteration") \ \ manageable(intx, CMSAbortablePrecleanWaitMillis, 100, \ - "(Temporary, subject to experimentation)" \ - " Time that we sleep between iterations when not given" \ - " enough work per iteration") \ + "(Temporary, subject to experimentation) " \ + "Time that we sleep between iterations when not given " \ + "enough work per iteration") \ \ product(uintx, CMSRescanMultiple, 32, \ "Size (in cards) of CMS parallel rescan task") \ @@ -1696,23 +1757,24 @@ class CommandLineFlags { "Whether parallel remark enabled (only if ParNewGC)") \ \ product(bool, CMSParallelSurvivorRemarkEnabled, true, \ - "Whether parallel remark of survivor space" \ - " enabled (effective only if CMSParallelRemarkEnabled)") \ + "Whether parallel remark of survivor space " \ + "enabled (effective only if CMSParallelRemarkEnabled)") \ \ product(bool, CMSPLABRecordAlways, true, \ - "Whether to always record survivor space PLAB bdries" \ - " (effective only if CMSParallelSurvivorRemarkEnabled)") \ + "Always record survivor space PLAB boundaries (effective only " \ + "if CMSParallelSurvivorRemarkEnabled)") \ \ product(bool, CMSEdenChunksRecordAlways, true, \ - "Whether to always record eden chunks used for " \ - "the parallel initial mark or remark of eden" ) \ + "Always record eden chunks used for the parallel initial mark " \ + "or remark of eden") \ \ product(bool, CMSPrintEdenSurvivorChunks, false, \ "Print the eden and the survivor chunks used for the parallel " \ "initial mark or remark of the eden/survivor spaces") \ \ product(bool, CMSConcurrentMTEnabled, true, \ - "Whether multi-threaded concurrent work enabled (if ParNewGC)") \ + "Whether multi-threaded concurrent work enabled " \ + "(effective only if ParNewGC)") \ \ product(bool, CMSPrecleaningEnabled, true, \ "Whether concurrent precleaning enabled") \ @@ -1721,12 +1783,12 @@ class CommandLineFlags { "Maximum number of precleaning iteration passes") \ \ product(uintx, CMSPrecleanNumerator, 2, \ - "CMSPrecleanNumerator:CMSPrecleanDenominator yields convergence" \ - " ratio") \ + "CMSPrecleanNumerator:CMSPrecleanDenominator yields convergence " \ + "ratio") \ \ product(uintx, CMSPrecleanDenominator, 3, \ - "CMSPrecleanNumerator:CMSPrecleanDenominator yields convergence" \ - " ratio") \ + "CMSPrecleanNumerator:CMSPrecleanDenominator yields convergence " \ + "ratio") \ \ product(bool, CMSPrecleanRefLists1, true, \ "Preclean ref lists during (initial) preclean phase") \ @@ -1741,7 +1803,7 @@ class CommandLineFlags { "Preclean survivors during abortable preclean phase") \ \ product(uintx, CMSPrecleanThreshold, 1000, \ - "Don't re-iterate if #dirty cards less than this") \ + "Do not iterate again if number of dirty cards is less than this")\ \ product(bool, CMSCleanOnEnter, true, \ "Clean-on-enter optimization for reducing number of dirty cards") \ @@ -1750,14 +1812,16 @@ class CommandLineFlags { "Choose variant (1,2) of verification following remark") \ \ product(uintx, CMSScheduleRemarkEdenSizeThreshold, 2*M, \ - "If Eden used is below this value, don't try to schedule remark") \ + "If Eden size is below this, do not try to schedule remark") \ \ product(uintx, CMSScheduleRemarkEdenPenetration, 50, \ - "The Eden occupancy % at which to try and schedule remark pause") \ + "The Eden occupancy percentage (0-100) at which " \ + "to try and schedule remark pause") \ \ product(uintx, CMSScheduleRemarkSamplingRatio, 5, \ - "Start sampling Eden top at least before yg occupancy reaches" \ - " 1/ of the size at which we plan to schedule remark") \ + "Start sampling eden top at least before young gen " \ + "occupancy reaches 1/ of the size at which " \ + "we plan to schedule remark") \ \ product(uintx, CMSSamplingGrain, 16*K, \ "The minimum distance between eden samples for CMS (see above)") \ @@ -1779,27 +1843,27 @@ class CommandLineFlags { "should start a collection cycle") \ \ product(bool, CMSYield, true, \ - "Yield between steps of concurrent mark & sweep") \ + "Yield between steps of CMS") \ \ product(uintx, CMSBitMapYieldQuantum, 10*M, \ - "Bitmap operations should process at most this many bits" \ + "Bitmap operations should process at most this many bits " \ "between yields") \ \ product(bool, CMSDumpAtPromotionFailure, false, \ "Dump useful information about the state of the CMS old " \ - " generation upon a promotion failure.") \ + "generation upon a promotion failure") \ \ product(bool, CMSPrintChunksInDump, false, \ "In a dump enabled by CMSDumpAtPromotionFailure, include " \ - " more detailed information about the free chunks.") \ + "more detailed information about the free chunks") \ \ product(bool, CMSPrintObjectsInDump, false, \ "In a dump enabled by CMSDumpAtPromotionFailure, include " \ - " more detailed information about the allocated objects.") \ + "more detailed information about the allocated objects") \ \ diagnostic(bool, FLSVerifyAllHeapReferences, false, \ - "Verify that all refs across the FLS boundary " \ - " are to valid objects") \ + "Verify that all references across the FLS boundary " \ + "are to valid objects") \ \ diagnostic(bool, FLSVerifyLists, false, \ "Do lots of (expensive) FreeListSpace verification") \ @@ -1811,17 +1875,18 @@ class CommandLineFlags { "Do lots of (expensive) FLS dictionary verification") \ \ develop(bool, VerifyBlockOffsetArray, false, \ - "Do (expensive!) block offset array verification") \ + "Do (expensive) block offset array verification") \ \ diagnostic(bool, BlockOffsetArrayUseUnallocatedBlock, false, \ - "Maintain _unallocated_block in BlockOffsetArray" \ - " (currently applicable only to CMS collector)") \ + "Maintain _unallocated_block in BlockOffsetArray " \ + "(currently applicable only to CMS collector)") \ \ develop(bool, TraceCMSState, false, \ "Trace the state of the CMS collection") \ \ product(intx, RefDiscoveryPolicy, 0, \ - "Whether reference-based(0) or referent-based(1)") \ + "Select type of reference discovery policy: " \ + "reference-based(0) or referent-based(1)") \ \ product(bool, ParallelRefProcEnabled, false, \ "Enable parallel reference processing whenever possible") \ @@ -1849,7 +1914,7 @@ class CommandLineFlags { "denotes 'do constant GC cycles'.") \ \ product(bool, UseCMSInitiatingOccupancyOnly, false, \ - "Only use occupancy as a crierion for starting a CMS collection") \ + "Only use occupancy as a criterion for starting a CMS collection")\ \ product(uintx, CMSIsTooFullPercentage, 98, \ "An absolute ceiling above which CMS will always consider the " \ @@ -1861,7 +1926,7 @@ class CommandLineFlags { \ notproduct(bool, CMSVerifyReturnedBytes, false, \ "Check that all the garbage collected was returned to the " \ - "free lists.") \ + "free lists") \ \ notproduct(bool, ScavengeALot, false, \ "Force scavenge at every Nth exit from the runtime system " \ @@ -1876,16 +1941,16 @@ class CommandLineFlags { \ product(bool, PrintPromotionFailure, false, \ "Print additional diagnostic information following " \ - " promotion failure") \ + "promotion failure") \ \ notproduct(bool, PromotionFailureALot, false, \ "Use promotion failure handling on every youngest generation " \ "collection") \ \ develop(uintx, PromotionFailureALotCount, 1000, \ - "Number of promotion failures occurring at ParGCAllocBuffer" \ + "Number of promotion failures occurring at ParGCAllocBuffer " \ "refill attempts (ParNew) or promotion attempts " \ - "(other young collectors) ") \ + "(other young collectors)") \ \ develop(uintx, PromotionFailureALotInterval, 5, \ "Total collections between promotion failures alot") \ @@ -1904,7 +1969,7 @@ class CommandLineFlags { "Ratio of hard spins to calls to yield") \ \ develop(uintx, ObjArrayMarkingStride, 512, \ - "Number of ObjArray elements to push onto the marking stack" \ + "Number of object array elements to push onto the marking stack " \ "before pushing a continuation entry") \ \ develop(bool, MetadataAllocationFailALot, false, \ @@ -1912,14 +1977,7 @@ class CommandLineFlags { "MetadataAllocationFailALotInterval") \ \ develop(uintx, MetadataAllocationFailALotInterval, 1000, \ - "metadata allocation failure alot interval") \ - \ - develop(bool, MetaDataDeallocateALot, false, \ - "Deallocation bunches of metadata at intervals controlled by " \ - "MetaDataAllocateALotInterval") \ - \ - develop(uintx, MetaDataDeallocateALotInterval, 100, \ - "Metadata deallocation alot interval") \ + "Metadata allocation failure a lot interval") \ \ develop(bool, TraceMetadataChunkAllocation, false, \ "Trace chunk metadata allocations") \ @@ -1931,7 +1989,7 @@ class CommandLineFlags { "Trace virtual space metadata allocations") \ \ notproduct(bool, ExecuteInternalVMTests, false, \ - "Enable execution of internal VM tests.") \ + "Enable execution of internal VM tests") \ \ notproduct(bool, VerboseInternalVMTests, false, \ "Turn on logging for internal VM tests.") \ @@ -1939,7 +1997,7 @@ class CommandLineFlags { product_pd(bool, UseTLAB, "Use thread-local object allocation") \ \ product_pd(bool, ResizeTLAB, \ - "Dynamically resize tlab size for threads") \ + "Dynamically resize TLAB size for threads") \ \ product(bool, ZeroTLAB, false, \ "Zero out the newly created TLAB") \ @@ -1951,7 +2009,8 @@ class CommandLineFlags { "Print various TLAB related information") \ \ product(bool, TLABStats, true, \ - "Print various TLAB related information") \ + "Provide more detailed and expensive TLAB statistics " \ + "(with PrintTLAB)") \ \ EMBEDDED_ONLY(product(bool, LowMemoryProtection, true, \ "Enable LowMemoryProtection")) \ @@ -1985,14 +2044,14 @@ class CommandLineFlags { "Fraction (1/n) of real memory used for initial heap size") \ \ develop(uintx, MaxVirtMemFraction, 2, \ - "Maximum fraction (1/n) of virtual memory used for ergonomically" \ + "Maximum fraction (1/n) of virtual memory used for ergonomically "\ "determining maximum heap size") \ \ product(bool, UseAutoGCSelectPolicy, false, \ "Use automatic collection selection policy") \ \ product(uintx, AutoGCSelectPauseMillis, 5000, \ - "Automatic GC selection pause threshhold in ms") \ + "Automatic GC selection pause threshold in milliseconds") \ \ product(bool, UseAdaptiveSizePolicy, true, \ "Use adaptive generation sizing policies") \ @@ -2007,7 +2066,7 @@ class CommandLineFlags { "Use adaptive young-old sizing policies at major collections") \ \ product(bool, UseAdaptiveSizePolicyWithSystemGC, false, \ - "Use statistics from System.GC for adaptive size policy") \ + "Include statistics from System.gc() for adaptive size policy") \ \ product(bool, UseAdaptiveGCBoundary, false, \ "Allow young-old boundary to move") \ @@ -2019,16 +2078,16 @@ class CommandLineFlags { "Resize the virtual spaces of the young or old generations") \ \ product(uintx, AdaptiveSizeThroughPutPolicy, 0, \ - "Policy for changeing generation size for throughput goals") \ + "Policy for changing generation size for throughput goals") \ \ product(uintx, AdaptiveSizePausePolicy, 0, \ "Policy for changing generation size for pause goals") \ \ develop(bool, PSAdjustTenuredGenForMinorPause, false, \ - "Adjust tenured generation to achive a minor pause goal") \ + "Adjust tenured generation to achieve a minor pause goal") \ \ develop(bool, PSAdjustYoungGenForMajorPause, false, \ - "Adjust young generation to achive a major pause goal") \ + "Adjust young generation to achieve a major pause goal") \ \ product(uintx, AdaptiveSizePolicyInitializingSteps, 20, \ "Number of steps where heuristics is used before data is used") \ @@ -2083,14 +2142,15 @@ class CommandLineFlags { "Decay factor to TenuredGenerationSizeIncrement") \ \ product(uintx, MaxGCPauseMillis, max_uintx, \ - "Adaptive size policy maximum GC pause time goal in msec, " \ - "or (G1 Only) the max. GC time per MMU time slice") \ + "Adaptive size policy maximum GC pause time goal in millisecond, "\ + "or (G1 Only) the maximum GC time per MMU time slice") \ \ product(uintx, GCPauseIntervalMillis, 0, \ "Time slice for MMU specification") \ \ product(uintx, MaxGCMinorPauseMillis, max_uintx, \ - "Adaptive size policy maximum GC minor pause time goal in msec") \ + "Adaptive size policy maximum GC minor pause time goal " \ + "in millisecond") \ \ product(uintx, GCTimeRatio, 99, \ "Adaptive size policy application time to GC time ratio") \ @@ -2108,7 +2168,7 @@ class CommandLineFlags { "Minimum ratio of young generation/survivor space size") \ \ product(uintx, InitialSurvivorRatio, 8, \ - "Initial ratio of eden/survivor space size") \ + "Initial ratio of young generation/survivor space size") \ \ product(uintx, BaseFootPrintEstimate, 256*M, \ "Estimate of footprint other than Java Heap") \ @@ -2118,8 +2178,8 @@ class CommandLineFlags { "before an OutOfMemory error is thrown") \ \ product(uintx, GCTimeLimit, 98, \ - "Limit of proportion of time spent in GC before an OutOfMemory" \ - "error is thrown (used with GCHeapFreeLimit)") \ + "Limit of the proportion of time spent in GC before " \ + "an OutOfMemoryError is thrown (used with GCHeapFreeLimit)") \ \ product(uintx, GCHeapFreeLimit, 2, \ "Minimum percentage of free space after a full GC before an " \ @@ -2141,7 +2201,7 @@ class CommandLineFlags { "How many fields ahead to prefetch in oop scan (<= 0 means off)") \ \ diagnostic(bool, VerifySilently, false, \ - "Don't print print the verification progress") \ + "Do not print the verification progress") \ \ diagnostic(bool, VerifyDuringStartup, false, \ "Verify memory system before executing any Java code " \ @@ -2164,7 +2224,7 @@ class CommandLineFlags { \ diagnostic(bool, DeferInitialCardMark, false, \ "When +ReduceInitialCardMarks, explicitly defer any that " \ - "may arise from new_pre_store_barrier") \ + "may arise from new_pre_store_barrier") \ \ diagnostic(bool, VerifyRememberedSets, false, \ "Verify GC remembered sets") \ @@ -2173,10 +2233,10 @@ class CommandLineFlags { "Verify GC object start array if verify before/after") \ \ product(bool, DisableExplicitGC, false, \ - "Tells whether calling System.gc() does a full GC") \ + "Ignore calls to System.gc()") \ \ notproduct(bool, CheckMemoryInitialization, false, \ - "Checks memory initialization") \ + "Check memory initialization") \ \ product(bool, CollectGen0First, false, \ "Collect youngest generation before each full GC") \ @@ -2197,44 +2257,45 @@ class CommandLineFlags { "Stride through processors when distributing processes") \ \ product(uintx, CMSCoordinatorYieldSleepCount, 10, \ - "number of times the coordinator GC thread will sleep while " \ + "Number of times the coordinator GC thread will sleep while " \ "yielding before giving up and resuming GC") \ \ product(uintx, CMSYieldSleepCount, 0, \ - "number of times a GC thread (minus the coordinator) " \ + "Number of times a GC thread (minus the coordinator) " \ "will sleep while yielding before giving up and resuming GC") \ \ /* gc tracing */ \ manageable(bool, PrintGC, false, \ - "Print message at garbage collect") \ + "Print message at garbage collection") \ \ manageable(bool, PrintGCDetails, false, \ - "Print more details at garbage collect") \ + "Print more details at garbage collection") \ \ manageable(bool, PrintGCDateStamps, false, \ - "Print date stamps at garbage collect") \ + "Print date stamps at garbage collection") \ \ manageable(bool, PrintGCTimeStamps, false, \ - "Print timestamps at garbage collect") \ + "Print timestamps at garbage collection") \ \ product(bool, PrintGCTaskTimeStamps, false, \ "Print timestamps for individual gc worker thread tasks") \ \ develop(intx, ConcGCYieldTimeout, 0, \ - "If non-zero, assert that GC threads yield within this # of ms.") \ + "If non-zero, assert that GC threads yield within this " \ + "number of milliseconds") \ \ notproduct(bool, TraceMarkSweep, false, \ "Trace mark sweep") \ \ product(bool, PrintReferenceGC, false, \ "Print times spent handling reference objects during GC " \ - " (enabled only when PrintGCDetails)") \ + "(enabled only when PrintGCDetails)") \ \ develop(bool, TraceReferenceGC, false, \ "Trace handling of soft/weak/final/phantom references") \ \ develop(bool, TraceFinalizerRegistration, false, \ - "Trace registration of final references") \ + "Trace registration of final references") \ \ notproduct(bool, TraceScavenge, false, \ "Trace scavenge") \ @@ -2271,7 +2332,7 @@ class CommandLineFlags { "Print heap layout before and after each GC") \ \ product_rw(bool, PrintHeapAtGCExtended, false, \ - "Prints extended information about the layout of the heap " \ + "Print extended information about the layout of the heap " \ "when -XX:+PrintHeapAtGC is set") \ \ product(bool, PrintHeapAtSIGBREAK, true, \ @@ -2308,45 +2369,45 @@ class CommandLineFlags { "Trace actions of the GC task threads") \ \ product(bool, PrintParallelOldGCPhaseTimes, false, \ - "Print the time taken by each parallel old gc phase." \ - "PrintGCDetails must also be enabled.") \ + "Print the time taken by each phase in ParallelOldGC " \ + "(PrintGCDetails must also be enabled)") \ \ develop(bool, TraceParallelOldGCMarkingPhase, false, \ - "Trace parallel old gc marking phase") \ + "Trace marking phase in ParallelOldGC") \ \ develop(bool, TraceParallelOldGCSummaryPhase, false, \ - "Trace parallel old gc summary phase") \ + "Trace summary phase in ParallelOldGC") \ \ develop(bool, TraceParallelOldGCCompactionPhase, false, \ - "Trace parallel old gc compaction phase") \ + "Trace compaction phase in ParallelOldGC") \ \ develop(bool, TraceParallelOldGCDensePrefix, false, \ - "Trace parallel old gc dense prefix computation") \ + "Trace dense prefix computation for ParallelOldGC") \ \ develop(bool, IgnoreLibthreadGPFault, false, \ "Suppress workaround for libthread GP fault") \ \ product(bool, PrintJNIGCStalls, false, \ - "Print diagnostic message when GC is stalled" \ + "Print diagnostic message when GC is stalled " \ "by JNI critical section") \ \ experimental(double, ObjectCountCutOffPercent, 0.5, \ "The percentage of the used heap that the instances of a class " \ - "must occupy for the class to generate a trace event.") \ + "must occupy for the class to generate a trace event") \ \ /* GC log rotation setting */ \ \ product(bool, UseGCLogFileRotation, false, \ - "Prevent large gclog file for long running app. " \ - "Requires -Xloggc:") \ + "Rotate gclog files (for long running applications). It requires "\ + "-Xloggc:") \ \ product(uintx, NumberOfGCLogFiles, 0, \ - "Number of gclog files in rotation, " \ - "Default: 0, no rotation") \ + "Number of gclog files in rotation " \ + "(default: 0, no rotation)") \ \ product(uintx, GCLogFileSize, 0, \ - "GC log file size, Default: 0 bytes, no rotation " \ - "Only valid with UseGCLogFileRotation") \ + "GC log file size (default: 0 bytes, no rotation). " \ + "It requires UseGCLogFileRotation") \ \ /* JVMTI heap profiling */ \ \ @@ -2423,40 +2484,40 @@ class CommandLineFlags { "Generate range checks for array accesses") \ \ develop_pd(bool, ImplicitNullChecks, \ - "generate code for implicit null checks") \ + "Generate code for implicit null checks") \ \ product(bool, PrintSafepointStatistics, false, \ - "print statistics about safepoint synchronization") \ + "Print statistics about safepoint synchronization") \ \ product(intx, PrintSafepointStatisticsCount, 300, \ - "total number of safepoint statistics collected " \ + "Total number of safepoint statistics collected " \ "before printing them out") \ \ product(intx, PrintSafepointStatisticsTimeout, -1, \ - "print safepoint statistics only when safepoint takes" \ - " more than PrintSafepointSatisticsTimeout in millis") \ + "Print safepoint statistics only when safepoint takes " \ + "more than PrintSafepointSatisticsTimeout in millis") \ \ product(bool, TraceSafepointCleanupTime, false, \ - "print the break down of clean up tasks performed during" \ - " safepoint") \ + "Print the break down of clean up tasks performed during " \ + "safepoint") \ \ product(bool, Inline, true, \ - "enable inlining") \ + "Enable inlining") \ \ product(bool, ClipInlining, true, \ - "clip inlining if aggregate method exceeds DesiredMethodLimit") \ + "Clip inlining if aggregate method exceeds DesiredMethodLimit") \ \ develop(bool, UseCHA, true, \ - "enable CHA") \ + "Enable CHA") \ \ product(bool, UseTypeProfile, true, \ "Check interpreter profile for historically monomorphic calls") \ \ notproduct(bool, TimeCompiler, false, \ - "time the compiler") \ + "Time the compiler") \ \ diagnostic(bool, PrintInlining, false, \ - "prints inlining optimizations") \ + "Print inlining optimizations") \ \ product(bool, UsePopCountInstruction, false, \ "Use population count instruction") \ @@ -2468,57 +2529,59 @@ class CommandLineFlags { "Print when methods are replaced do to recompilation") \ \ develop(bool, PrintMethodFlushing, false, \ - "print the nmethods being flushed") \ + "Print the nmethods being flushed") \ \ develop(bool, UseRelocIndex, false, \ - "use an index to speed random access to relocations") \ + "Use an index to speed random access to relocations") \ \ develop(bool, StressCodeBuffers, false, \ - "Exercise code buffer expansion and other rare state changes") \ + "Exercise code buffer expansion and other rare state changes") \ \ diagnostic(bool, DebugNonSafepoints, trueInDebug, \ - "Generate extra debugging info for non-safepoints in nmethods") \ + "Generate extra debugging information for non-safepoints in " \ + "nmethods") \ \ product(bool, PrintVMOptions, false, \ - "Print flags that appeared on the command line") \ + "Print flags that appeared on the command line") \ \ product(bool, IgnoreUnrecognizedVMOptions, false, \ - "Ignore unrecognized VM options") \ + "Ignore unrecognized VM options") \ \ product(bool, PrintCommandLineFlags, false, \ - "Print flags specified on command line or set by ergonomics") \ + "Print flags specified on command line or set by ergonomics") \ \ product(bool, PrintFlagsInitial, false, \ - "Print all VM flags before argument processing and exit VM") \ + "Print all VM flags before argument processing and exit VM") \ \ product(bool, PrintFlagsFinal, false, \ - "Print all VM flags after argument and ergonomic processing") \ + "Print all VM flags after argument and ergonomic processing") \ \ notproduct(bool, PrintFlagsWithComments, false, \ - "Print all VM flags with default values and descriptions and exit")\ + "Print all VM flags with default values and descriptions and " \ + "exit") \ \ diagnostic(bool, SerializeVMOutput, true, \ - "Use a mutex to serialize output to tty and LogFile") \ + "Use a mutex to serialize output to tty and LogFile") \ \ diagnostic(bool, DisplayVMOutput, true, \ - "Display all VM output on the tty, independently of LogVMOutput") \ + "Display all VM output on the tty, independently of LogVMOutput") \ \ diagnostic(bool, LogVMOutput, false, \ - "Save VM output to LogFile") \ + "Save VM output to LogFile") \ \ diagnostic(ccstr, LogFile, NULL, \ - "If LogVMOutput or LogCompilation is on, save VM output to " \ - "this file [default: ./hotspot_pid%p.log] (%p replaced with pid)") \ + "If LogVMOutput or LogCompilation is on, save VM output to " \ + "this file [default: ./hotspot_pid%p.log] (%p replaced with pid)")\ \ product(ccstr, ErrorFile, NULL, \ - "If an error occurs, save the error data to this file " \ - "[default: ./hs_err_pid%p.log] (%p replaced with pid)") \ + "If an error occurs, save the error data to this file " \ + "[default: ./hs_err_pid%p.log] (%p replaced with pid)") \ \ product(bool, DisplayVMOutputToStderr, false, \ - "If DisplayVMOutput is true, display all VM output to stderr") \ + "If DisplayVMOutput is true, display all VM output to stderr") \ \ product(bool, DisplayVMOutputToStdout, false, \ - "If DisplayVMOutput is true, display all VM output to stdout") \ + "If DisplayVMOutput is true, display all VM output to stdout") \ \ product(bool, UseHeavyMonitors, false, \ "use heavyweight instead of lightweight Java monitors") \ @@ -2526,6 +2589,9 @@ class CommandLineFlags { product(bool, PrintStringTableStatistics, false, \ "print statistics about the StringTable and SymbolTable") \ \ + diagnostic(bool, VerifyStringTableAtExit, false, \ + "verify StringTable contents at exit") \ + \ notproduct(bool, PrintSymbolTableSizeHistogram, false, \ "print histogram of the symbol table") \ \ @@ -2539,7 +2605,7 @@ class CommandLineFlags { \ notproduct(ccstr, AbortVMOnExceptionMessage, NULL, \ "Call fatal if the exception pointed by AbortVMOnException " \ - "has this message.") \ + "has this message") \ \ develop(bool, DebugVtables, false, \ "add debugging code to vtable dispatch") \ @@ -2604,31 +2670,44 @@ class CommandLineFlags { product(bool, AggressiveOpts, false, \ "Enable aggressive optimizations - see arguments.cpp") \ \ + product_pd(uintx, TypeProfileLevel, \ + "=XYZ, with Z: Type profiling of arguments at call; " \ + "Y: Type profiling of return value at call; " \ + "X: Type profiling of parameters to methods; " \ + "X, Y and Z in 0=off ; 1=jsr292 only; 2=all methods") \ + \ + product(intx, TypeProfileArgsLimit, 2, \ + "max number of call arguments to consider for type profiling") \ + \ + product(intx, TypeProfileParmsLimit, 2, \ + "max number of incoming parameters to consider for type profiling"\ + ", -1 for all") \ + \ /* statistics */ \ develop(bool, CountCompiledCalls, false, \ - "counts method invocations") \ + "Count method invocations") \ \ notproduct(bool, CountRuntimeCalls, false, \ - "counts VM runtime calls") \ + "Count VM runtime calls") \ \ develop(bool, CountJNICalls, false, \ - "counts jni method invocations") \ + "Count jni method invocations") \ \ notproduct(bool, CountJVMCalls, false, \ - "counts jvm method invocations") \ + "Count jvm method invocations") \ \ notproduct(bool, CountRemovableExceptions, false, \ - "count exceptions that could be replaced by branches due to " \ + "Count exceptions that could be replaced by branches due to " \ "inlining") \ \ notproduct(bool, ICMissHistogram, false, \ - "produce histogram of IC misses") \ + "Produce histogram of IC misses") \ \ notproduct(bool, PrintClassStatistics, false, \ - "prints class statistics at end of run") \ + "Print class statistics at end of run") \ \ notproduct(bool, PrintMethodStatistics, false, \ - "prints method statistics at end of run") \ + "Print method statistics at end of run") \ \ /* interpreter */ \ develop(bool, ClearInterpreterLocals, false, \ @@ -2642,7 +2721,7 @@ class CommandLineFlags { "Rewrite frequently used bytecode pairs into a single bytecode") \ \ diagnostic(bool, PrintInterpreter, false, \ - "Prints the generated interpreter code") \ + "Print the generated interpreter code") \ \ product(bool, UseInterpreter, true, \ "Use interpreter for non-compiled methods") \ @@ -2660,8 +2739,8 @@ class CommandLineFlags { "Use fast method entry code for accessor methods") \ \ product_pd(bool, UseOnStackReplacement, \ - "Use on stack replacement, calls runtime if invoc. counter " \ - "overflows in loop") \ + "Use on stack replacement, calls runtime if invoc. counter " \ + "overflows in loop") \ \ notproduct(bool, TraceOnStackReplacement, false, \ "Trace on stack replacement") \ @@ -2709,10 +2788,10 @@ class CommandLineFlags { "Trace frequency based inlining") \ \ develop_pd(bool, InlineIntrinsics, \ - "Inline intrinsics that can be statically resolved") \ + "Inline intrinsics that can be statically resolved") \ \ product_pd(bool, ProfileInterpreter, \ - "Profile at the bytecode level during interpretation") \ + "Profile at the bytecode level during interpretation") \ \ develop_pd(bool, ProfileTraps, \ "Profile deoptimization traps at the bytecode level") \ @@ -2722,7 +2801,7 @@ class CommandLineFlags { "CompileThreshold) before using the method's profile") \ \ develop(bool, PrintMethodData, false, \ - "Print the results of +ProfileInterpreter at end of run") \ + "Print the results of +ProfileInterpreter at end of run") \ \ develop(bool, VerifyDataPointer, trueInDebug, \ "Verify the method data pointer during interpreter profiling") \ @@ -2737,7 +2816,7 @@ class CommandLineFlags { \ /* compilation */ \ product(bool, UseCompiler, true, \ - "use compilation") \ + "Use Just-In-Time compilation") \ \ develop(bool, TraceCompilationPolicy, false, \ "Trace compilation policy") \ @@ -2746,20 +2825,21 @@ class CommandLineFlags { "Time the compilation policy") \ \ product(bool, UseCounterDecay, true, \ - "adjust recompilation counters") \ + "Adjust recompilation counters") \ \ develop(intx, CounterHalfLifeTime, 30, \ - "half-life time of invocation counters (in secs)") \ + "Half-life time of invocation counters (in seconds)") \ \ develop(intx, CounterDecayMinIntervalLength, 500, \ - "Min. ms. between invocation of CounterDecay") \ + "The minimum interval (in milliseconds) between invocation of " \ + "CounterDecay") \ \ product(bool, AlwaysCompileLoopMethods, false, \ - "when using recompilation, never interpret methods " \ + "When using recompilation, never interpret methods " \ "containing loops") \ \ product(bool, DontCompileHugeMethods, true, \ - "don't compile methods > HugeMethodLimit") \ + "Do not compile methods > HugeMethodLimit") \ \ /* Bytecode escape analysis estimation. */ \ product(bool, EstimateArgEscape, true, \ @@ -2769,10 +2849,10 @@ class CommandLineFlags { "How much tracing to do of bytecode escape analysis estimates") \ \ product(intx, MaxBCEAEstimateLevel, 5, \ - "Maximum number of nested calls that are analyzed by BC EA.") \ + "Maximum number of nested calls that are analyzed by BC EA") \ \ product(intx, MaxBCEAEstimateSize, 150, \ - "Maximum bytecode size of a method to be analyzed by BC EA.") \ + "Maximum bytecode size of a method to be analyzed by BC EA") \ \ product(intx, AllocatePrefetchStyle, 1, \ "0 = no prefetch, " \ @@ -2787,7 +2867,8 @@ class CommandLineFlags { "Number of lines to prefetch ahead of array allocation pointer") \ \ product(intx, AllocateInstancePrefetchLines, 1, \ - "Number of lines to prefetch ahead of instance allocation pointer") \ + "Number of lines to prefetch ahead of instance allocation " \ + "pointer") \ \ product(intx, AllocatePrefetchStepSize, 16, \ "Step size in bytes of sequential prefetch instructions") \ @@ -2807,8 +2888,8 @@ class CommandLineFlags { "(0 means off)") \ \ product(intx, MaxJavaStackTraceDepth, 1024, \ - "Max. no. of lines in the stack trace for Java exceptions " \ - "(0 means all)") \ + "The maximum number of lines in the stack trace for Java " \ + "exceptions (0 means all)") \ \ NOT_EMBEDDED(diagnostic(intx, GuaranteedSafepointInterval, 1000, \ "Guarantee a safepoint (at least) every so many milliseconds " \ @@ -2827,11 +2908,15 @@ class CommandLineFlags { product(intx, NmethodSweepCheckInterval, 5, \ "Compilers wake up every n seconds to possibly sweep nmethods") \ \ + product(intx, NmethodSweepActivity, 10, \ + "Removes cold nmethods from code cache if > 0. Higher values " \ + "result in more aggressive sweeping") \ + \ notproduct(bool, LogSweeper, false, \ - "Keep a ring buffer of sweeper activity") \ + "Keep a ring buffer of sweeper activity") \ \ notproduct(intx, SweeperLogEntries, 1024, \ - "Number of records in the ring buffer of sweeper activity") \ + "Number of records in the ring buffer of sweeper activity") \ \ notproduct(intx, MemProfilingInterval, 500, \ "Time between each invocation of the MemProfiler") \ @@ -2874,34 +2959,35 @@ class CommandLineFlags { "less than this") \ \ product(intx, MaxInlineSize, 35, \ - "maximum bytecode size of a method to be inlined") \ + "The maximum bytecode size of a method to be inlined") \ \ product_pd(intx, FreqInlineSize, \ - "maximum bytecode size of a frequent method to be inlined") \ + "The maximum bytecode size of a frequent method to be inlined") \ \ product(intx, MaxTrivialSize, 6, \ - "maximum bytecode size of a trivial method to be inlined") \ + "The maximum bytecode size of a trivial method to be inlined") \ \ product(intx, MinInliningThreshold, 250, \ - "min. invocation count a method needs to have to be inlined") \ + "The minimum invocation count a method needs to have to be " \ + "inlined") \ \ develop(intx, MethodHistogramCutoff, 100, \ - "cutoff value for method invoc. histogram (+CountCalls)") \ + "The cutoff value for method invocation histogram (+CountCalls)") \ \ develop(intx, ProfilerNumberOfInterpretedMethods, 25, \ - "# of interpreted methods to show in profile") \ + "Number of interpreted methods to show in profile") \ \ develop(intx, ProfilerNumberOfCompiledMethods, 25, \ - "# of compiled methods to show in profile") \ + "Number of compiled methods to show in profile") \ \ develop(intx, ProfilerNumberOfStubMethods, 25, \ - "# of stub methods to show in profile") \ + "Number of stub methods to show in profile") \ \ develop(intx, ProfilerNumberOfRuntimeStubNodes, 25, \ - "# of runtime stub nodes to show in profile") \ + "Number of runtime stub nodes to show in profile") \ \ product(intx, ProfileIntervalsTicks, 100, \ - "# of ticks between printing of interval profile " \ + "Number of ticks between printing of interval profile " \ "(+ProfileIntervals)") \ \ notproduct(intx, ScavengeALotInterval, 1, \ @@ -2922,7 +3008,7 @@ class CommandLineFlags { \ develop(intx, MinSleepInterval, 1, \ "Minimum sleep() interval (milliseconds) when " \ - "ConvertSleepToYield is off (used for SOLARIS)") \ + "ConvertSleepToYield is off (used for Solaris)") \ \ develop(intx, ProfilerPCTickThreshold, 15, \ "Number of ticks in a PC buckets to be a hotspot") \ @@ -2937,22 +3023,22 @@ class CommandLineFlags { "Mark nmethods non-entrant at registration") \ \ diagnostic(intx, MallocVerifyInterval, 0, \ - "if non-zero, verify C heap after every N calls to " \ + "If non-zero, verify C heap after every N calls to " \ "malloc/realloc/free") \ \ diagnostic(intx, MallocVerifyStart, 0, \ - "if non-zero, start verifying C heap after Nth call to " \ + "If non-zero, start verifying C heap after Nth call to " \ "malloc/realloc/free") \ \ diagnostic(uintx, MallocMaxTestWords, 0, \ - "if non-zero, max # of Words that malloc/realloc can allocate " \ - "(for testing only)") \ + "If non-zero, maximum number of words that malloc/realloc can " \ + "allocate (for testing only)") \ \ product(intx, TypeProfileWidth, 2, \ - "number of receiver types to record in call/cast profile") \ + "Number of receiver types to record in call/cast profile") \ \ develop(intx, BciProfileWidth, 2, \ - "number of return bci's to record in ret profile") \ + "Number of return bci's to record in ret profile") \ \ product(intx, PerMethodRecompilationCutoff, 400, \ "After recompiling N times, stay in the interpreter (-1=>'Inf')") \ @@ -3019,7 +3105,7 @@ class CommandLineFlags { "Percentage of Eden that can be wasted") \ \ product(uintx, TLABRefillWasteFraction, 64, \ - "Max TLAB waste at a refill (internal fragmentation)") \ + "Maximum TLAB waste at a refill (internal fragmentation)") \ \ product(uintx, TLABWasteIncrement, 4, \ "Increment allowed waste at slow allocation") \ @@ -3028,7 +3114,7 @@ class CommandLineFlags { "Ratio of eden/survivor space size") \ \ product(uintx, NewRatio, 2, \ - "Ratio of new/old generation sizes") \ + "Ratio of old/new generation sizes") \ \ product_pd(uintx, NewSizeThreadIncrease, \ "Additional size added to desired new generation size per " \ @@ -3045,28 +3131,34 @@ class CommandLineFlags { "class pointers are used") \ \ product(uintx, MinHeapFreeRatio, 40, \ - "Min percentage of heap free after GC to avoid expansion") \ + "The minimum percentage of heap free after GC to avoid expansion."\ + " For most GCs this applies to the old generation. In G1 it" \ + " applies to the whole heap. Not supported by ParallelGC.") \ \ product(uintx, MaxHeapFreeRatio, 70, \ - "Max percentage of heap free after GC to avoid shrinking") \ + "The maximum percentage of heap free after GC to avoid shrinking."\ + " For most GCs this applies to the old generation. In G1 it" \ + " applies to the whole heap. Not supported by ParallelGC.") \ \ product(intx, SoftRefLRUPolicyMSPerMB, 1000, \ "Number of milliseconds per MB of free space in the heap") \ \ product(uintx, MinHeapDeltaBytes, ScaleForWordSize(128*K), \ - "Min change in heap space due to GC (in bytes)") \ + "The minimum change in heap space due to GC (in bytes)") \ \ product(uintx, MinMetaspaceExpansion, ScaleForWordSize(256*K), \ - "Min expansion of Metaspace (in bytes)") \ + "The minimum expansion of Metaspace (in bytes)") \ \ product(uintx, MinMetaspaceFreeRatio, 40, \ - "Min percentage of Metaspace free after GC to avoid expansion") \ + "The minimum percentage of Metaspace free after GC to avoid " \ + "expansion") \ \ product(uintx, MaxMetaspaceFreeRatio, 70, \ - "Max percentage of Metaspace free after GC to avoid shrinking") \ + "The maximum percentage of Metaspace free after GC to avoid " \ + "shrinking") \ \ product(uintx, MaxMetaspaceExpansion, ScaleForWordSize(4*M), \ - "Max expansion of Metaspace without full GC (in bytes)") \ + "The maximum expansion of Metaspace without full GC (in bytes)") \ \ product(uintx, QueuedAllocationWarningCount, 0, \ "Number of times an allocation that queues behind a GC " \ @@ -3088,13 +3180,14 @@ class CommandLineFlags { "Desired percentage of survivor space used after scavenge") \ \ product(uintx, MarkSweepDeadRatio, 5, \ - "Percentage (0-100) of the old gen allowed as dead wood." \ - "Serial mark sweep treats this as both the min and max value." \ - "CMS uses this value only if it falls back to mark sweep." \ - "Par compact uses a variable scale based on the density of the" \ - "generation and treats this as the max value when the heap is" \ - "either completely full or completely empty. Par compact also" \ - "has a smaller default value; see arguments.cpp.") \ + "Percentage (0-100) of the old gen allowed as dead wood. " \ + "Serial mark sweep treats this as both the minimum and maximum " \ + "value. " \ + "CMS uses this value only if it falls back to mark sweep. " \ + "Par compact uses a variable scale based on the density of the " \ + "generation and treats this as the maximum value when the heap " \ + "is either completely full or completely empty. Par compact " \ + "also has a smaller default value; see arguments.cpp.") \ \ product(uintx, MarkSweepAlwaysCompactCount, 4, \ "How often should we fully compact the heap (ignoring the dead " \ @@ -3113,27 +3206,27 @@ class CommandLineFlags { "Census for CMS' FreeListSpace") \ \ develop(uintx, GCExpandToAllocateDelayMillis, 0, \ - "Delay in ms between expansion and allocation") \ + "Delay between expansion and allocation (in milliseconds)") \ \ develop(uintx, GCWorkerDelayMillis, 0, \ - "Delay in ms in scheduling GC workers") \ + "Delay in scheduling GC workers (in milliseconds)") \ \ product(intx, DeferThrSuspendLoopCount, 4000, \ "(Unstable) Number of times to iterate in safepoint loop " \ - " before blocking VM threads ") \ + "before blocking VM threads ") \ \ product(intx, DeferPollingPageLoopCount, -1, \ "(Unsafe,Unstable) Number of iterations in safepoint loop " \ "before changing safepoint polling page to RO ") \ \ - product(intx, SafepointSpinBeforeYield, 2000, "(Unstable)") \ + product(intx, SafepointSpinBeforeYield, 2000, "(Unstable)") \ \ product(bool, PSChunkLargeArrays, true, \ - "true: process large arrays in chunks") \ + "Process large arrays in chunks") \ \ product(uintx, GCDrainStackTargetSize, 64, \ - "how many entries we'll try to leave on the stack during " \ - "parallel GC") \ + "Number of entries we will try to leave on the stack " \ + "during parallel gc") \ \ /* stack parameters */ \ product_pd(intx, StackYellowPages, \ @@ -3143,8 +3236,8 @@ class CommandLineFlags { "Number of red zone (unrecoverable overflows) pages") \ \ product_pd(intx, StackShadowPages, \ - "Number of shadow zone (for overflow checking) pages" \ - " this should exceed the depth of the VM and native call stack") \ + "Number of shadow zone (for overflow checking) pages " \ + "this should exceed the depth of the VM and native call stack") \ \ product_pd(intx, ThreadStackSize, \ "Thread Stack Size (in Kbytes)") \ @@ -3184,60 +3277,51 @@ class CommandLineFlags { "Reserved code cache size (in bytes) - maximum code cache size") \ \ product(uintx, CodeCacheMinimumFreeSpace, 500*K, \ - "When less than X space left, we stop compiling.") \ + "When less than X space left, we stop compiling") \ \ product_pd(uintx, CodeCacheExpansionSize, \ "Code cache expansion size (in bytes)") \ \ develop_pd(uintx, CodeCacheMinBlockLength, \ - "Minimum number of segments in a code cache block.") \ + "Minimum number of segments in a code cache block") \ \ notproduct(bool, ExitOnFullCodeCache, false, \ - "Exit the VM if we fill the code cache.") \ + "Exit the VM if we fill the code cache") \ \ product(bool, UseCodeCacheFlushing, true, \ "Attempt to clean the code cache before shutting off compiler") \ \ - product(intx, MinCodeCacheFlushingInterval, 30, \ - "Min number of seconds between code cache cleaning sessions") \ - \ - product(uintx, CodeCacheFlushingMinimumFreeSpace, 1500*K, \ - "When less than X space left, start code cache cleaning") \ - \ - product(uintx, CodeCacheFlushingFraction, 2, \ - "Fraction of the code cache that is flushed when full") \ - \ /* interpreter debugging */ \ develop(intx, BinarySwitchThreshold, 5, \ "Minimal number of lookupswitch entries for rewriting to binary " \ "switch") \ \ develop(intx, StopInterpreterAt, 0, \ - "Stops interpreter execution at specified bytecode number") \ + "Stop interpreter execution at specified bytecode number") \ \ develop(intx, TraceBytecodesAt, 0, \ - "Traces bytecodes starting with specified bytecode number") \ + "Trace bytecodes starting with specified bytecode number") \ \ /* compiler interface */ \ develop(intx, CIStart, 0, \ - "the id of the first compilation to permit") \ + "The id of the first compilation to permit") \ \ develop(intx, CIStop, -1, \ - "the id of the last compilation to permit") \ + "The id of the last compilation to permit") \ \ develop(intx, CIStartOSR, 0, \ - "the id of the first osr compilation to permit " \ + "The id of the first osr compilation to permit " \ "(CICountOSR must be on)") \ \ develop(intx, CIStopOSR, -1, \ - "the id of the last osr compilation to permit " \ + "The id of the last osr compilation to permit " \ "(CICountOSR must be on)") \ \ develop(intx, CIBreakAtOSR, -1, \ - "id of osr compilation to break at") \ + "The id of osr compilation to break at") \ \ develop(intx, CIBreakAt, -1, \ - "id of compilation to break at") \ + "The id of compilation to break at") \ \ product(ccstrlist, CompileOnly, "", \ "List of methods (pkg/class.name) to restrict compilation to") \ @@ -3256,11 +3340,11 @@ class CommandLineFlags { "[default: ./replay_pid%p.log] (%p replaced with pid)") \ \ develop(intx, ReplaySuppressInitializers, 2, \ - "Controls handling of class initialization during replay" \ - "0 - don't do anything special" \ - "1 - treat all class initializers as empty" \ - "2 - treat class initializers for application classes as empty" \ - "3 - allow all class initializers to run during bootstrap but" \ + "Control handling of class initialization during replay: " \ + "0 - don't do anything special; " \ + "1 - treat all class initializers as empty; " \ + "2 - treat class initializers for application classes as empty; " \ + "3 - allow all class initializers to run during bootstrap but " \ " pretend they are empty after starting replay") \ \ develop(bool, ReplayIgnoreInitErrors, false, \ @@ -3289,14 +3373,15 @@ class CommandLineFlags { "0 : Normal. "\ " VM chooses priorities that are appropriate for normal "\ " applications. On Solaris NORM_PRIORITY and above are mapped "\ - " to normal native priority. Java priorities below NORM_PRIORITY"\ - " map to lower native priority values. On Windows applications"\ - " are allowed to use higher native priorities. However, with "\ - " ThreadPriorityPolicy=0, VM will not use the highest possible"\ - " native priority, THREAD_PRIORITY_TIME_CRITICAL, as it may "\ - " interfere with system threads. On Linux thread priorities "\ - " are ignored because the OS does not support static priority "\ - " in SCHED_OTHER scheduling class which is the only choice for"\ + " to normal native priority. Java priorities below " \ + " NORM_PRIORITY map to lower native priority values. On "\ + " Windows applications are allowed to use higher native "\ + " priorities. However, with ThreadPriorityPolicy=0, VM will "\ + " not use the highest possible native priority, "\ + " THREAD_PRIORITY_TIME_CRITICAL, as it may interfere with "\ + " system threads. On Linux thread priorities are ignored "\ + " because the OS does not support static priority in "\ + " SCHED_OTHER scheduling class which is the only choice for "\ " non-root, non-realtime applications. "\ "1 : Aggressive. "\ " Java thread priorities map over to the entire range of "\ @@ -3327,16 +3412,35 @@ class CommandLineFlags { product(bool, VMThreadHintNoPreempt, false, \ "(Solaris only) Give VM thread an extra quanta") \ \ - product(intx, JavaPriority1_To_OSPriority, -1, "Map Java priorities to OS priorities") \ - product(intx, JavaPriority2_To_OSPriority, -1, "Map Java priorities to OS priorities") \ - product(intx, JavaPriority3_To_OSPriority, -1, "Map Java priorities to OS priorities") \ - product(intx, JavaPriority4_To_OSPriority, -1, "Map Java priorities to OS priorities") \ - product(intx, JavaPriority5_To_OSPriority, -1, "Map Java priorities to OS priorities") \ - product(intx, JavaPriority6_To_OSPriority, -1, "Map Java priorities to OS priorities") \ - product(intx, JavaPriority7_To_OSPriority, -1, "Map Java priorities to OS priorities") \ - product(intx, JavaPriority8_To_OSPriority, -1, "Map Java priorities to OS priorities") \ - product(intx, JavaPriority9_To_OSPriority, -1, "Map Java priorities to OS priorities") \ - product(intx, JavaPriority10_To_OSPriority,-1, "Map Java priorities to OS priorities") \ + product(intx, JavaPriority1_To_OSPriority, -1, \ + "Map Java priorities to OS priorities") \ + \ + product(intx, JavaPriority2_To_OSPriority, -1, \ + "Map Java priorities to OS priorities") \ + \ + product(intx, JavaPriority3_To_OSPriority, -1, \ + "Map Java priorities to OS priorities") \ + \ + product(intx, JavaPriority4_To_OSPriority, -1, \ + "Map Java priorities to OS priorities") \ + \ + product(intx, JavaPriority5_To_OSPriority, -1, \ + "Map Java priorities to OS priorities") \ + \ + product(intx, JavaPriority6_To_OSPriority, -1, \ + "Map Java priorities to OS priorities") \ + \ + product(intx, JavaPriority7_To_OSPriority, -1, \ + "Map Java priorities to OS priorities") \ + \ + product(intx, JavaPriority8_To_OSPriority, -1, \ + "Map Java priorities to OS priorities") \ + \ + product(intx, JavaPriority9_To_OSPriority, -1, \ + "Map Java priorities to OS priorities") \ + \ + product(intx, JavaPriority10_To_OSPriority,-1, \ + "Map Java priorities to OS priorities") \ \ experimental(bool, UseCriticalJavaThreadPriority, false, \ "Java thread priority 10 maps to critical scheduling priority") \ @@ -3367,37 +3471,38 @@ class CommandLineFlags { "Used with +TraceLongCompiles") \ \ product(intx, StarvationMonitorInterval, 200, \ - "Pause between each check in ms") \ + "Pause between each check (in milliseconds)") \ \ /* recompilation */ \ product_pd(intx, CompileThreshold, \ "number of interpreted method invocations before (re-)compiling") \ \ product_pd(intx, BackEdgeThreshold, \ - "Interpreter Back edge threshold at which an OSR compilation is invoked")\ + "Interpreter Back edge threshold at which an OSR compilation is " \ + "invoked") \ \ product(intx, Tier0InvokeNotifyFreqLog, 7, \ - "Interpreter (tier 0) invocation notification frequency.") \ + "Interpreter (tier 0) invocation notification frequency") \ \ product(intx, Tier2InvokeNotifyFreqLog, 11, \ - "C1 without MDO (tier 2) invocation notification frequency.") \ + "C1 without MDO (tier 2) invocation notification frequency") \ \ product(intx, Tier3InvokeNotifyFreqLog, 10, \ "C1 with MDO profiling (tier 3) invocation notification " \ - "frequency.") \ + "frequency") \ \ product(intx, Tier23InlineeNotifyFreqLog, 20, \ "Inlinee invocation (tiers 2 and 3) notification frequency") \ \ product(intx, Tier0BackedgeNotifyFreqLog, 10, \ - "Interpreter (tier 0) invocation notification frequency.") \ + "Interpreter (tier 0) invocation notification frequency") \ \ product(intx, Tier2BackedgeNotifyFreqLog, 14, \ - "C1 without MDO (tier 2) invocation notification frequency.") \ + "C1 without MDO (tier 2) invocation notification frequency") \ \ product(intx, Tier3BackedgeNotifyFreqLog, 13, \ "C1 with MDO profiling (tier 3) invocation notification " \ - "frequency.") \ + "frequency") \ \ product(intx, Tier2CompileThreshold, 0, \ "threshold at which tier 2 compilation is invoked") \ @@ -3414,7 +3519,7 @@ class CommandLineFlags { \ product(intx, Tier3CompileThreshold, 2000, \ "Threshold at which tier 3 compilation is invoked (invocation " \ - "minimum must be satisfied.") \ + "minimum must be satisfied") \ \ product(intx, Tier3BackEdgeThreshold, 60000, \ "Back edge threshold at which tier 3 OSR compilation is invoked") \ @@ -3428,7 +3533,7 @@ class CommandLineFlags { \ product(intx, Tier4CompileThreshold, 15000, \ "Threshold at which tier 4 compilation is invoked (invocation " \ - "minimum must be satisfied.") \ + "minimum must be satisfied") \ \ product(intx, Tier4BackEdgeThreshold, 40000, \ "Back edge threshold at which tier 4 OSR compilation is invoked") \ @@ -3457,12 +3562,12 @@ class CommandLineFlags { "Stop at given compilation level") \ \ product(intx, Tier0ProfilingStartPercentage, 200, \ - "Start profiling in interpreter if the counters exceed tier 3" \ + "Start profiling in interpreter if the counters exceed tier 3 " \ "thresholds by the specified percentage") \ \ product(uintx, IncreaseFirstTierCompileThresholdAt, 50, \ - "Increase the compile threshold for C1 compilation if the code" \ - "cache is filled by the specified percentage.") \ + "Increase the compile threshold for C1 compilation if the code " \ + "cache is filled by the specified percentage") \ \ product(intx, TieredRateUpdateMinTime, 1, \ "Minimum rate sampling interval (in milliseconds)") \ @@ -3477,24 +3582,26 @@ class CommandLineFlags { "Print tiered events notifications") \ \ product_pd(intx, OnStackReplacePercentage, \ - "NON_TIERED number of method invocations/branches (expressed as %"\ - "of CompileThreshold) before (re-)compiling OSR code") \ + "NON_TIERED number of method invocations/branches (expressed as " \ + "% of CompileThreshold) before (re-)compiling OSR code") \ \ product(intx, InterpreterProfilePercentage, 33, \ - "NON_TIERED number of method invocations/branches (expressed as %"\ - "of CompileThreshold) before profiling in the interpreter") \ + "NON_TIERED number of method invocations/branches (expressed as " \ + "% of CompileThreshold) before profiling in the interpreter") \ \ develop(intx, MaxRecompilationSearchLength, 10, \ - "max. # frames to inspect searching for recompilee") \ + "The maximum number of frames to inspect when searching for " \ + "recompilee") \ \ develop(intx, MaxInterpretedSearchLength, 3, \ - "max. # interp. frames to skip when searching for recompilee") \ + "The maximum number of interpreted frames to skip when searching "\ + "for recompilee") \ \ develop(intx, DesiredMethodLimit, 8000, \ - "desired max. method size (in bytecodes) after inlining") \ + "The desired maximum method size (in bytecodes) after inlining") \ \ develop(intx, HugeMethodLimit, 8000, \ - "don't compile methods larger than this if " \ + "Don't compile methods larger than this if " \ "+DontCompileHugeMethods") \ \ /* New JDK 1.4 reflection implementation */ \ @@ -3516,7 +3623,7 @@ class CommandLineFlags { "in InvocationTargetException. See 6531596") \ \ develop(bool, VerifyLambdaBytecodes, false, \ - "Force verification of jdk 8 lambda metafactory bytecodes.") \ + "Force verification of jdk 8 lambda metafactory bytecodes") \ \ develop(intx, FastSuperclassLimit, 8, \ "Depth of hardwired instanceof accelerator array") \ @@ -3540,18 +3647,19 @@ class CommandLineFlags { /* flags for performance data collection */ \ \ product(bool, UsePerfData, falseInEmbedded, \ - "Flag to disable jvmstat instrumentation for performance testing" \ - "and problem isolation purposes.") \ + "Flag to disable jvmstat instrumentation for performance testing "\ + "and problem isolation purposes") \ \ product(bool, PerfDataSaveToFile, false, \ "Save PerfData memory to hsperfdata_ file on exit") \ \ product(ccstr, PerfDataSaveFile, NULL, \ - "Save PerfData memory to the specified absolute pathname," \ - "%p in the file name if present will be replaced by pid") \ + "Save PerfData memory to the specified absolute pathname. " \ + "The string %p in the file name (if present) " \ + "will be replaced by pid") \ \ - product(intx, PerfDataSamplingInterval, 50 /*ms*/, \ - "Data sampling interval in milliseconds") \ + product(intx, PerfDataSamplingInterval, 50, \ + "Data sampling interval (in milliseconds)") \ \ develop(bool, PerfTraceDataCreation, false, \ "Trace creation of Performance Data Entries") \ @@ -3576,7 +3684,7 @@ class CommandLineFlags { "Bypass Win32 file system criteria checks (Windows Only)") \ \ product(intx, UnguardOnExecutionViolation, 0, \ - "Unguard page and retry on no-execute fault (Win32 only)" \ + "Unguard page and retry on no-execute fault (Win32 only) " \ "0=off, 1=conservative, 2=aggressive") \ \ /* Serviceability Support */ \ @@ -3585,7 +3693,7 @@ class CommandLineFlags { "Create JMX Management Server") \ \ product(bool, DisableAttachMechanism, false, \ - "Disable mechanism that allows tools to attach to this VM") \ + "Disable mechanism that allows tools to attach to this VM") \ \ product(bool, StartAttachListener, false, \ "Always start Attach Listener at VM startup") \ @@ -3608,9 +3716,9 @@ class CommandLineFlags { "Require shared spaces for metadata") \ \ product(bool, DumpSharedSpaces, false, \ - "Special mode: JVM reads a class list, loads classes, builds " \ - "shared spaces, and dumps the shared spaces to a file to be " \ - "used in future JVM runs.") \ + "Special mode: JVM reads a class list, loads classes, builds " \ + "shared spaces, and dumps the shared spaces to a file to be " \ + "used in future JVM runs") \ \ product(bool, PrintSharedSpaces, false, \ "Print usage of shared spaces") \ @@ -3683,11 +3791,14 @@ class CommandLineFlags { "Relax the access control checks in the verifier") \ \ diagnostic(bool, PrintDTraceDOF, false, \ - "Print the DTrace DOF passed to the system for JSDT probes") \ + "Print the DTrace DOF passed to the system for JSDT probes") \ \ product(uintx, StringTableSize, defaultStringTableSize, \ "Number of buckets in the interned String table") \ \ + experimental(uintx, SymbolTableSize, defaultSymbolTableSize, \ + "Number of buckets in the JVM internal Symbol table") \ + \ develop(bool, TraceDefaultMethods, false, \ "Trace the default method processing steps") \ \ @@ -3696,8 +3807,8 @@ class CommandLineFlags { \ product(bool, UseVMInterruptibleIO, false, \ "(Unstable, Solaris-specific) Thread interrupt before or with " \ - "EINTR for I/O operations results in OS_INTRPT. The default value"\ - " of this flag is true for JDK 6 and earlier") \ + "EINTR for I/O operations results in OS_INTRPT. The default " \ + "value of this flag is true for JDK 6 and earlier") \ \ diagnostic(bool, WhiteBoxAPI, false, \ "Enable internal testing APIs") \ @@ -3718,29 +3829,29 @@ class CommandLineFlags { \ product(bool, EnableTracing, false, \ "Enable event-based tracing") \ + \ product(bool, UseLockedTracing, false, \ "Use locked-tracing when doing event-based tracing") - /* * Macros for factoring of globals */ // Interface macros -#define DECLARE_PRODUCT_FLAG(type, name, value, doc) extern "C" type name; -#define DECLARE_PD_PRODUCT_FLAG(type, name, doc) extern "C" type name; -#define DECLARE_DIAGNOSTIC_FLAG(type, name, value, doc) extern "C" type name; +#define DECLARE_PRODUCT_FLAG(type, name, value, doc) extern "C" type name; +#define DECLARE_PD_PRODUCT_FLAG(type, name, doc) extern "C" type name; +#define DECLARE_DIAGNOSTIC_FLAG(type, name, value, doc) extern "C" type name; #define DECLARE_EXPERIMENTAL_FLAG(type, name, value, doc) extern "C" type name; -#define DECLARE_MANAGEABLE_FLAG(type, name, value, doc) extern "C" type name; -#define DECLARE_PRODUCT_RW_FLAG(type, name, value, doc) extern "C" type name; +#define DECLARE_MANAGEABLE_FLAG(type, name, value, doc) extern "C" type name; +#define DECLARE_PRODUCT_RW_FLAG(type, name, value, doc) extern "C" type name; #ifdef PRODUCT -#define DECLARE_DEVELOPER_FLAG(type, name, value, doc) const type name = value; -#define DECLARE_PD_DEVELOPER_FLAG(type, name, doc) const type name = pd_##name; -#define DECLARE_NOTPRODUCT_FLAG(type, name, value, doc) +#define DECLARE_DEVELOPER_FLAG(type, name, value, doc) extern "C" type CONST_##name; const type name = value; +#define DECLARE_PD_DEVELOPER_FLAG(type, name, doc) extern "C" type CONST_##name; const type name = pd_##name; +#define DECLARE_NOTPRODUCT_FLAG(type, name, value, doc) extern "C" type CONST_##name; #else -#define DECLARE_DEVELOPER_FLAG(type, name, value, doc) extern "C" type name; -#define DECLARE_PD_DEVELOPER_FLAG(type, name, doc) extern "C" type name; -#define DECLARE_NOTPRODUCT_FLAG(type, name, value, doc) extern "C" type name; +#define DECLARE_DEVELOPER_FLAG(type, name, value, doc) extern "C" type name; +#define DECLARE_PD_DEVELOPER_FLAG(type, name, doc) extern "C" type name; +#define DECLARE_NOTPRODUCT_FLAG(type, name, value, doc) extern "C" type name; #endif // Special LP64 flags, product only needed for now. #ifdef _LP64 @@ -3750,23 +3861,23 @@ class CommandLineFlags { #endif // _LP64 // Implementation macros -#define MATERIALIZE_PRODUCT_FLAG(type, name, value, doc) type name = value; -#define MATERIALIZE_PD_PRODUCT_FLAG(type, name, doc) type name = pd_##name; -#define MATERIALIZE_DIAGNOSTIC_FLAG(type, name, value, doc) type name = value; +#define MATERIALIZE_PRODUCT_FLAG(type, name, value, doc) type name = value; +#define MATERIALIZE_PD_PRODUCT_FLAG(type, name, doc) type name = pd_##name; +#define MATERIALIZE_DIAGNOSTIC_FLAG(type, name, value, doc) type name = value; #define MATERIALIZE_EXPERIMENTAL_FLAG(type, name, value, doc) type name = value; -#define MATERIALIZE_MANAGEABLE_FLAG(type, name, value, doc) type name = value; -#define MATERIALIZE_PRODUCT_RW_FLAG(type, name, value, doc) type name = value; +#define MATERIALIZE_MANAGEABLE_FLAG(type, name, value, doc) type name = value; +#define MATERIALIZE_PRODUCT_RW_FLAG(type, name, value, doc) type name = value; #ifdef PRODUCT -#define MATERIALIZE_DEVELOPER_FLAG(type, name, value, doc) /* flag name is constant */ -#define MATERIALIZE_PD_DEVELOPER_FLAG(type, name, doc) /* flag name is constant */ -#define MATERIALIZE_NOTPRODUCT_FLAG(type, name, value, doc) +#define MATERIALIZE_DEVELOPER_FLAG(type, name, value, doc) type CONST_##name = value; +#define MATERIALIZE_PD_DEVELOPER_FLAG(type, name, doc) type CONST_##name = pd_##name; +#define MATERIALIZE_NOTPRODUCT_FLAG(type, name, value, doc) type CONST_##name = value; #else -#define MATERIALIZE_DEVELOPER_FLAG(type, name, value, doc) type name = value; -#define MATERIALIZE_PD_DEVELOPER_FLAG(type, name, doc) type name = pd_##name; -#define MATERIALIZE_NOTPRODUCT_FLAG(type, name, value, doc) type name = value; +#define MATERIALIZE_DEVELOPER_FLAG(type, name, value, doc) type name = value; +#define MATERIALIZE_PD_DEVELOPER_FLAG(type, name, doc) type name = pd_##name; +#define MATERIALIZE_NOTPRODUCT_FLAG(type, name, value, doc) type name = value; #endif #ifdef _LP64 -#define MATERIALIZE_LP64_PRODUCT_FLAG(type, name, value, doc) type name = value; +#define MATERIALIZE_LP64_PRODUCT_FLAG(type, name, value, doc) type name = value; #else #define MATERIALIZE_LP64_PRODUCT_FLAG(type, name, value, doc) /* flag is constant */ #endif // _LP64 diff --git a/hotspot/src/share/vm/runtime/globals_extension.hpp b/hotspot/src/share/vm/runtime/globals_extension.hpp index bc4fd4a74bc..ea3fc60739c 100644 --- a/hotspot/src/share/vm/runtime/globals_extension.hpp +++ b/hotspot/src/share/vm/runtime/globals_extension.hpp @@ -34,64 +34,42 @@ // Parens left off in the following for the enum decl below. #define FLAG_MEMBER(flag) Flag_##flag -#define RUNTIME_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), -#define RUNTIME_PD_PRODUCT_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name), -#define RUNTIME_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), +#define RUNTIME_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), +#define RUNTIME_PD_PRODUCT_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name), +#define RUNTIME_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), #define RUNTIME_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), -#define RUNTIME_MANAGEABLE_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), -#define RUNTIME_PRODUCT_RW_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), -#ifdef PRODUCT - #define RUNTIME_DEVELOP_FLAG_MEMBER(type, name, value, doc) /* flag is constant */ - #define RUNTIME_PD_DEVELOP_FLAG_MEMBER(type, name, doc) /* flag is constant */ - #define RUNTIME_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) -#else - #define RUNTIME_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), - #define RUNTIME_PD_DEVELOP_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name), - #define RUNTIME_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), -#endif +#define RUNTIME_MANAGEABLE_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), +#define RUNTIME_PRODUCT_RW_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), +#define RUNTIME_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), +#define RUNTIME_PD_DEVELOP_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name), +#define RUNTIME_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), + #ifdef _LP64 -#define RUNTIME_LP64_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), +#define RUNTIME_LP64_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), #else -#define RUNTIME_LP64_PRODUCT_FLAG_MEMBER(type, name, value, doc) /* flag is constant */ +#define RUNTIME_LP64_PRODUCT_FLAG_MEMBER(type, name, value, doc) /* flag is constant */ #endif // _LP64 -#define C1_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), -#define C1_PD_PRODUCT_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name), -#define C1_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), -#ifdef PRODUCT - #define C1_DEVELOP_FLAG_MEMBER(type, name, value, doc) /* flag is constant */ - #define C1_PD_DEVELOP_FLAG_MEMBER(type, name, doc) /* flag is constant */ - #define C1_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) -#else - #define C1_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), - #define C1_PD_DEVELOP_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name), - #define C1_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), -#endif +#define C1_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), +#define C1_PD_PRODUCT_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name), +#define C1_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), +#define C1_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), +#define C1_PD_DEVELOP_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name), +#define C1_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), -#define C2_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), -#define C2_PD_PRODUCT_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name), -#define C2_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), -#define C2_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), -#ifdef PRODUCT - #define C2_DEVELOP_FLAG_MEMBER(type, name, value, doc) /* flag is constant */ - #define C2_PD_DEVELOP_FLAG_MEMBER(type, name, doc) /* flag is constant */ - #define C2_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) -#else - #define C2_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), - #define C2_PD_DEVELOP_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name), - #define C2_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), -#endif +#define C2_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), +#define C2_PD_PRODUCT_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name), +#define C2_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), +#define C2_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), +#define C2_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), +#define C2_PD_DEVELOP_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name), +#define C2_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), #define ARCH_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), #define ARCH_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), #define ARCH_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), -#ifdef PRODUCT - #define ARCH_DEVELOP_FLAG_MEMBER(type, name, value, doc) /* flag is constant */ - #define ARCH_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) -#else - #define ARCH_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), - #define ARCH_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), -#endif +#define ARCH_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), +#define ARCH_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name), typedef enum { RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_EXPERIMENTAL_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER, RUNTIME_MANAGEABLE_FLAG_MEMBER, RUNTIME_PRODUCT_RW_FLAG_MEMBER, RUNTIME_LP64_PRODUCT_FLAG_MEMBER) @@ -114,64 +92,42 @@ typedef enum { #define FLAG_MEMBER_WITH_TYPE(flag,type) Flag_##flag##_##type -#define RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#define RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#define RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), #define RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#define RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#define RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#ifdef PRODUCT - #define RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) /* flag is constant */ - #define RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) /* flag is constant */ - #define RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) -#else - #define RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), - #define RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type), - #define RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#endif +#define RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), + +#define C1_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define C1_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define C1_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define C1_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#define C1_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#define C1_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#define C1_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#ifdef PRODUCT - #define C1_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) /* flag is constant */ - #define C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) /* flag is constant */ - #define C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) -#else - #define C1_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), - #define C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type), - #define C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#endif #ifdef _LP64 -#define RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), #else -#define RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) /* flag is constant */ +#define RUNTIME_LP64_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) /* flag is constant */ #endif // _LP64 -#define C2_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#define C2_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#define C2_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define C2_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define C2_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define C2_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), #define C2_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#ifdef PRODUCT - #define C2_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) /* flag is constant */ - #define C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) /* flag is constant */ - #define C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) -#else - #define C2_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), - #define C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type), - #define C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#endif +#define C2_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), #define ARCH_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), #define ARCH_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#define ARCH_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#ifdef PRODUCT - #define ARCH_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) /* flag is constant */ - #define ARCH_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) -#else - #define ARCH_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), - #define ARCH_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), -#endif +#define ARCH_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define ARCH_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), +#define ARCH_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type), typedef enum { RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE, @@ -233,19 +189,19 @@ typedef enum { #define FLAG_SET_DEFAULT(name, value) ((name) = (value)) -#define FLAG_SET_CMDLINE(type, name, value) (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), COMMAND_LINE)) -#define FLAG_SET_ERGO(type, name, value) (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), ERGONOMIC)) +#define FLAG_SET_CMDLINE(type, name, value) (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), Flag::COMMAND_LINE)) +#define FLAG_SET_ERGO(type, name, value) (CommandLineFlagsEx::type##AtPut(FLAG_MEMBER_WITH_TYPE(name,type), (type)(value), Flag::ERGONOMIC)) // Can't put the following in CommandLineFlags because // of a circular dependency on the enum definition. class CommandLineFlagsEx : CommandLineFlags { public: - static void boolAtPut(CommandLineFlagWithType flag, bool value, FlagValueOrigin origin); - static void intxAtPut(CommandLineFlagWithType flag, intx value, FlagValueOrigin origin); - static void uintxAtPut(CommandLineFlagWithType flag, uintx value, FlagValueOrigin origin); - static void uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, FlagValueOrigin origin); - static void doubleAtPut(CommandLineFlagWithType flag, double value, FlagValueOrigin origin); - static void ccstrAtPut(CommandLineFlagWithType flag, ccstr value, FlagValueOrigin origin); + static void boolAtPut(CommandLineFlagWithType flag, bool value, Flag::Flags origin); + static void intxAtPut(CommandLineFlagWithType flag, intx value, Flag::Flags origin); + static void uintxAtPut(CommandLineFlagWithType flag, uintx value, Flag::Flags origin); + static void uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, Flag::Flags origin); + static void doubleAtPut(CommandLineFlagWithType flag, double value, Flag::Flags origin); + static void ccstrAtPut(CommandLineFlagWithType flag, ccstr value, Flag::Flags origin); static bool is_default(CommandLineFlag flag); static bool is_ergo(CommandLineFlag flag); diff --git a/hotspot/src/share/vm/runtime/handles.cpp b/hotspot/src/share/vm/runtime/handles.cpp index 1b4e9faecf9..ca73f86ba7f 100644 --- a/hotspot/src/share/vm/runtime/handles.cpp +++ b/hotspot/src/share/vm/runtime/handles.cpp @@ -45,7 +45,7 @@ oop* HandleArea::allocate_handle(oop obj) { assert(_handle_mark_nesting > 1, "memory leak: allocating handle outside HandleMark"); assert(_no_handle_mark_nesting == 0, "allocating handle inside NoHandleMark"); - assert(obj->is_oop(), "sanity check"); + assert(obj->is_oop(), err_msg("not an oop: " INTPTR_FORMAT, (intptr_t*) obj)); return real_allocate_handle(obj); } diff --git a/hotspot/src/share/vm/runtime/handles.hpp b/hotspot/src/share/vm/runtime/handles.hpp index dc254227971..c2ce4b38c5a 100644 --- a/hotspot/src/share/vm/runtime/handles.hpp +++ b/hotspot/src/share/vm/runtime/handles.hpp @@ -136,7 +136,7 @@ DEF_HANDLE(typeArray , is_typeArray ) // Specific Handles for different oop types #define DEF_METADATA_HANDLE(name, type) \ class name##Handle; \ - class name##Handle { \ + class name##Handle : public StackObj { \ type* _value; \ Thread* _thread; \ protected: \ @@ -175,7 +175,7 @@ DEF_METADATA_HANDLE(constantPool, ConstantPool) // Writing this class explicitly, since DEF_METADATA_HANDLE(klass) doesn't // provide the necessary Klass* <-> Klass* conversions. This Klass // could be removed when we don't have the Klass* typedef anymore. -class KlassHandle { +class KlassHandle : public StackObj { Klass* _value; protected: Klass* obj() const { return _value; } diff --git a/hotspot/src/share/vm/runtime/handles.inline.hpp b/hotspot/src/share/vm/runtime/handles.inline.hpp index 9530b127aea..5a0f3f773c2 100644 --- a/hotspot/src/share/vm/runtime/handles.inline.hpp +++ b/hotspot/src/share/vm/runtime/handles.inline.hpp @@ -79,6 +79,7 @@ inline name##Handle::name##Handle(const name##Handle &h) { \ } else { \ _thread = Thread::current(); \ } \ + assert (_thread->is_in_stack((address)this), "not on stack?"); \ _thread->metadata_handles()->push((Metadata*)_value); \ } else { \ _thread = NULL; \ @@ -95,6 +96,7 @@ inline name##Handle& name##Handle::operator=(const name##Handle &s) { \ } else { \ _thread = Thread::current(); \ } \ + assert (_thread->is_in_stack((address)this), "not on stack?"); \ _thread->metadata_handles()->push((Metadata*)_value); \ } else { \ _thread = NULL; \ diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index ebc4e087578..a356157e4f9 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -183,6 +183,7 @@ void print_method_profiling_data() { collected_profiled_methods->sort(&compare_methods); int count = collected_profiled_methods->length(); + int total_size = 0; if (count > 0) { for (int index = 0; index < count; index++) { Method* m = collected_profiled_methods->at(index); @@ -190,10 +191,18 @@ void print_method_profiling_data() { tty->print_cr("------------------------------------------------------------------------"); //m->print_name(tty); m->print_invocation_count(); + tty->print_cr(" mdo size: %d bytes", m->method_data()->size_in_bytes()); tty->cr(); + // Dump data on parameters if any + if (m->method_data() != NULL && m->method_data()->parameters_type_data() != NULL) { + tty->fill_to(2); + m->method_data()->parameters_type_data()->print_data_on(tty); + } m->print_codes(); + total_size += m->method_data()->size_in_bytes(); } tty->print_cr("------------------------------------------------------------------------"); + tty->print_cr("Total MDO size: %d bytes", total_size); } } @@ -544,6 +553,19 @@ void before_exit(JavaThread * thread) { // it will run into trouble when system destroys static variables. MemTracker::shutdown(MemTracker::NMT_normal); + if (VerifyStringTableAtExit) { + int fail_cnt = 0; + { + MutexLocker ml(StringTable_lock); + fail_cnt = StringTable::verify_and_compare_entries(); + } + + if (fail_cnt != 0) { + tty->print_cr("ERROR: fail_cnt=%d", fail_cnt); + guarantee(fail_cnt == 0, "unexpected StringTable verification failures"); + } + } + #undef BEFORE_EXIT_NOT_RUN #undef BEFORE_EXIT_RUNNING #undef BEFORE_EXIT_DONE diff --git a/hotspot/src/share/vm/runtime/javaCalls.cpp b/hotspot/src/share/vm/runtime/javaCalls.cpp index 1dc58e40c7b..2de958d6f0e 100644 --- a/hotspot/src/share/vm/runtime/javaCalls.cpp +++ b/hotspot/src/share/vm/runtime/javaCalls.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -430,7 +430,7 @@ intptr_t* JavaCallArguments::parameters() { for(int i = 0; i < _size; i++) { if (_is_oop[i]) { // Handle conversion - _value[i] = (intptr_t)Handle::raw_resolve((oop *)_value[i]); + _value[i] = cast_from_oop(Handle::raw_resolve((oop *)_value[i])); } } // Return argument vector diff --git a/hotspot/src/share/vm/runtime/reflectionUtils.cpp b/hotspot/src/share/vm/runtime/reflectionUtils.cpp index 9fcf966b95c..2ec82abc91a 100644 --- a/hotspot/src/share/vm/runtime/reflectionUtils.cpp +++ b/hotspot/src/share/vm/runtime/reflectionUtils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,11 @@ #include "memory/universe.inline.hpp" #include "runtime/reflectionUtils.hpp" -KlassStream::KlassStream(instanceKlassHandle klass, bool local_only, bool classes_only) { - _klass = klass; +KlassStream::KlassStream(instanceKlassHandle klass, bool local_only, + bool classes_only, bool walk_defaults) { + _klass = _base_klass = klass; + _base_class_search_defaults = false; + _defaults_checked = false; if (classes_only) { _interfaces = Universe::the_empty_klass_array(); } else { @@ -37,6 +40,7 @@ KlassStream::KlassStream(instanceKlassHandle klass, bool local_only, bool classe _interface_index = _interfaces->length(); _local_only = local_only; _classes_only = classes_only; + _walk_defaults = walk_defaults; } bool KlassStream::eos() { @@ -45,7 +49,13 @@ bool KlassStream::eos() { if (!_klass->is_interface() && _klass->super() != NULL) { // go up superclass chain (not for interfaces) _klass = _klass->super(); + // Next for method walks, walk default methods + } else if (_walk_defaults && (_defaults_checked == false) && (_base_klass->default_methods() != NULL)) { + _base_class_search_defaults = true; + _klass = _base_klass; + _defaults_checked = true; } else { + // Next walk transitive interfaces if (_interface_index > 0) { _klass = _interfaces->at(--_interface_index); } else { diff --git a/hotspot/src/share/vm/runtime/reflectionUtils.hpp b/hotspot/src/share/vm/runtime/reflectionUtils.hpp index 71a500976a7..1f5b87f8d39 100644 --- a/hotspot/src/share/vm/runtime/reflectionUtils.hpp +++ b/hotspot/src/share/vm/runtime/reflectionUtils.hpp @@ -38,7 +38,7 @@ // and (super)interfaces. Streaming is done in reverse order (subclasses first, // interfaces last). // -// for (KlassStream st(k, false, false); !st.eos(); st.next()) { +// for (KlassStream st(k, false, false, false); !st.eos(); st.next()) { // Klass* k = st.klass(); // ... // } @@ -46,17 +46,21 @@ class KlassStream VALUE_OBJ_CLASS_SPEC { protected: instanceKlassHandle _klass; // current klass/interface iterated over - Array* _interfaces; // transitive interfaces for initial class + instanceKlassHandle _base_klass; // initial klass/interface to iterate over + Array* _interfaces; // transitive interfaces for initial class int _interface_index; // current interface being processed bool _local_only; // process initial class/interface only bool _classes_only; // process classes only (no interfaces) + bool _walk_defaults; // process default methods + bool _base_class_search_defaults; // time to process default methods + bool _defaults_checked; // already checked for default methods int _index; - virtual int length() const = 0; + virtual int length() = 0; public: // constructor - KlassStream(instanceKlassHandle klass, bool local_only, bool classes_only); + KlassStream(instanceKlassHandle klass, bool local_only, bool classes_only, bool walk_defaults); // testing bool eos(); @@ -67,6 +71,8 @@ class KlassStream VALUE_OBJ_CLASS_SPEC { // accessors instanceKlassHandle klass() const { return _klass; } int index() const { return _index; } + bool base_class_search_defaults() const { return _base_class_search_defaults; } + void base_class_search_defaults(bool b) { _base_class_search_defaults = b; } }; @@ -81,17 +87,24 @@ class KlassStream VALUE_OBJ_CLASS_SPEC { class MethodStream : public KlassStream { private: - int length() const { return methods()->length(); } - Array* methods() const { return _klass->methods(); } + int length() { return methods()->length(); } + Array* methods() { + if (base_class_search_defaults()) { + base_class_search_defaults(false); + return _klass->default_methods(); + } else { + return _klass->methods(); + } + } public: MethodStream(instanceKlassHandle klass, bool local_only, bool classes_only) - : KlassStream(klass, local_only, classes_only) { + : KlassStream(klass, local_only, classes_only, true) { _index = length(); next(); } void next() { _index--; } - Method* method() const { return methods()->at(index()); } + Method* method() { return methods()->at(index()); } }; @@ -107,13 +120,13 @@ class MethodStream : public KlassStream { class FieldStream : public KlassStream { private: - int length() const { return _klass->java_fields_count(); } + int length() { return _klass->java_fields_count(); } fieldDescriptor _fd_buf; public: FieldStream(instanceKlassHandle klass, bool local_only, bool classes_only) - : KlassStream(klass, local_only, classes_only) { + : KlassStream(klass, local_only, classes_only, false) { _index = length(); next(); } diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp index f3191e524de..48e523f5aa0 100644 --- a/hotspot/src/share/vm/runtime/safepoint.cpp +++ b/hotspot/src/share/vm/runtime/safepoint.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -519,8 +519,8 @@ void SafepointSynchronize::do_cleanup_tasks() { } { - TraceTime t4("sweeping nmethods", TraceSafepointCleanupTime); - NMethodSweeper::scan_stacks(); + TraceTime t4("mark nmethods", TraceSafepointCleanupTime); + NMethodSweeper::mark_active_nmethods(); } if (SymbolTable::needs_rehashing()) { @@ -745,14 +745,14 @@ void SafepointSynchronize::block(JavaThread *thread) { #endif static void print_ptrs(intptr_t oldptr, intptr_t newptr, bool wasoop) { - bool is_oop = newptr ? ((oop)newptr)->is_oop() : false; + bool is_oop = newptr ? (cast_to_oop(newptr))->is_oop() : false; tty->print_cr(PTR_FORMAT PTR_PAD " %s %c " PTR_FORMAT PTR_PAD " %s %s", oldptr, wasoop?"oop":" ", oldptr == newptr ? ' ' : '!', newptr, is_oop?"oop":" ", (wasoop && !is_oop) ? "STALE" : ((wasoop==false&&is_oop==false&&oldptr !=newptr)?"STOMP":" ")); } static void print_longs(jlong oldptr, jlong newptr, bool wasoop) { - bool is_oop = newptr ? ((oop)(intptr_t)newptr)->is_oop() : false; + bool is_oop = newptr ? (cast_to_oop(newptr))->is_oop() : false; tty->print_cr(PTR64_FORMAT " %s %c " PTR64_FORMAT " %s %s", oldptr, wasoop?"oop":" ", oldptr == newptr ? ' ' : '!', newptr, is_oop?"oop":" ", (wasoop && !is_oop) ? "STALE" : ((wasoop==false&&is_oop==false&&oldptr !=newptr)?"STOMP":" ")); diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index d014eda2f80..f0a332a0055 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -577,7 +577,7 @@ oop SharedRuntime::retrieve_receiver( Symbol* sig, frame caller ) { assert(caller.is_interpreted_frame(), ""); int args_size = ArgumentSizeComputer(sig).size() + 1; assert(args_size <= caller.interpreter_frame_expression_stack_size(), "receiver must be on interpreter stack"); - oop result = (oop) *caller.interpreter_frame_tos_at(args_size - 1); + oop result = cast_to_oop(*caller.interpreter_frame_tos_at(args_size - 1)); assert(Universe::heap()->is_in(result) && result->is_oop(), "receiver must be an oop"); return result; } @@ -1506,8 +1506,11 @@ methodHandle SharedRuntime::handle_ic_miss_helper(JavaThread *thread, TRAPS) { info, CHECK_(methodHandle())); inline_cache->set_to_monomorphic(info); } else if (!inline_cache->is_megamorphic() && !inline_cache->is_clean()) { - // Change to megamorphic - inline_cache->set_to_megamorphic(&call_info, bc, CHECK_(methodHandle())); + // Potential change to megamorphic + bool successful = inline_cache->set_to_megamorphic(&call_info, bc, CHECK_(methodHandle())); + if (!successful) { + inline_cache->set_to_clean(); + } } else { // Either clean or megamorphic } @@ -2872,7 +2875,7 @@ JRT_LEAF(intptr_t*, SharedRuntime::OSR_migration_begin( JavaThread *thread) ) ObjectSynchronizer::inflate_helper(kptr2->obj()); // Now the displaced header is free to move buf[i++] = (intptr_t)lock->displaced_header(); - buf[i++] = (intptr_t)kptr2->obj(); + buf[i++] = cast_from_oop(kptr2->obj()); } } assert( i - max_locals == active_monitor_count*2, "found the expected number of monitors" ); diff --git a/hotspot/src/share/vm/runtime/signature.cpp b/hotspot/src/share/vm/runtime/signature.cpp index ce1b069ee6b..388058aa538 100644 --- a/hotspot/src/share/vm/runtime/signature.cpp +++ b/hotspot/src/share/vm/runtime/signature.cpp @@ -378,6 +378,16 @@ Symbol* SignatureStream::as_symbol_or_null() { return result; } +int SignatureStream::reference_parameter_count() { + int args_count = 0; + for ( ; !at_return_type(); next()) { + if (is_object()) { + args_count++; + } + } + return args_count; +} + bool SignatureVerifier::is_valid_signature(Symbol* sig) { const char* signature = (const char*)sig->bytes(); ssize_t len = sig->utf8_length(); diff --git a/hotspot/src/share/vm/runtime/signature.hpp b/hotspot/src/share/vm/runtime/signature.hpp index 33c8c8232ca..4bd4d4bab1f 100644 --- a/hotspot/src/share/vm/runtime/signature.hpp +++ b/hotspot/src/share/vm/runtime/signature.hpp @@ -401,6 +401,9 @@ class SignatureStream : public StackObj { // return same as_symbol except allocation of new symbols is avoided. Symbol* as_symbol_or_null(); + + // count the number of references in the signature + int reference_parameter_count(); }; class SignatureVerifier : public StackObj { diff --git a/hotspot/src/share/vm/runtime/sweeper.cpp b/hotspot/src/share/vm/runtime/sweeper.cpp index 37315aec328..eab7636fac1 100644 --- a/hotspot/src/share/vm/runtime/sweeper.cpp +++ b/hotspot/src/share/vm/runtime/sweeper.cpp @@ -127,64 +127,79 @@ void NMethodSweeper::record_sweep(nmethod* nm, int line) { #define SWEEP(nm) #endif +nmethod* NMethodSweeper::_current = NULL; // Current nmethod +long NMethodSweeper::_traversals = 0; // Nof. stack traversals performed +int NMethodSweeper::_seen = 0; // Nof. nmethods we have currently processed in current pass of CodeCache +int NMethodSweeper::_flushed_count = 0; // Nof. nmethods flushed in current sweep +int NMethodSweeper::_zombified_count = 0; // Nof. nmethods made zombie in current sweep +int NMethodSweeper::_marked_count = 0; // Nof. nmethods marked for reclaim in current sweep -long NMethodSweeper::_traversals = 0; // No. of stack traversals performed -nmethod* NMethodSweeper::_current = NULL; // Current nmethod -int NMethodSweeper::_seen = 0 ; // No. of nmethods we have currently processed in current pass of CodeCache -int NMethodSweeper::_flushed_count = 0; // Nof. nmethods flushed in current sweep -int NMethodSweeper::_zombified_count = 0; // Nof. nmethods made zombie in current sweep -int NMethodSweeper::_marked_count = 0; // Nof. nmethods marked for reclaim in current sweep - -volatile int NMethodSweeper::_invocations = 0; // No. of invocations left until we are completed with this pass +volatile int NMethodSweeper::_invocations = 0; // Nof. invocations left until we are completed with this pass volatile int NMethodSweeper::_sweep_started = 0; // Whether a sweep is in progress. -jint NMethodSweeper::_locked_seen = 0; +jint NMethodSweeper::_locked_seen = 0; jint NMethodSweeper::_not_entrant_seen_on_stack = 0; -bool NMethodSweeper::_resweep = false; -jint NMethodSweeper::_flush_token = 0; -jlong NMethodSweeper::_last_full_flush_time = 0; -int NMethodSweeper::_highest_marked = 0; -int NMethodSweeper::_dead_compile_ids = 0; -long NMethodSweeper::_last_flush_traversal_id = 0; +bool NMethodSweeper::_request_mark_phase = false; -int NMethodSweeper::_number_of_flushes = 0; // Total of full traversals caused by full cache int NMethodSweeper::_total_nof_methods_reclaimed = 0; -jlong NMethodSweeper::_total_time_sweeping = 0; -jlong NMethodSweeper::_total_time_this_sweep = 0; -jlong NMethodSweeper::_peak_sweep_time = 0; -jlong NMethodSweeper::_peak_sweep_fraction_time = 0; -jlong NMethodSweeper::_total_disconnect_time = 0; -jlong NMethodSweeper::_peak_disconnect_time = 0; +jlong NMethodSweeper::_total_time_sweeping = 0; +jlong NMethodSweeper::_total_time_this_sweep = 0; +jlong NMethodSweeper::_peak_sweep_time = 0; +jlong NMethodSweeper::_peak_sweep_fraction_time = 0; +int NMethodSweeper::_hotness_counter_reset_val = 0; + class MarkActivationClosure: public CodeBlobClosure { public: virtual void do_code_blob(CodeBlob* cb) { - // If we see an activation belonging to a non_entrant nmethod, we mark it. - if (cb->is_nmethod() && ((nmethod*)cb)->is_not_entrant()) { - ((nmethod*)cb)->mark_as_seen_on_stack(); + if (cb->is_nmethod()) { + nmethod* nm = (nmethod*)cb; + nm->set_hotness_counter(NMethodSweeper::hotness_counter_reset_val()); + // If we see an activation belonging to a non_entrant nmethod, we mark it. + if (nm->is_not_entrant()) { + nm->mark_as_seen_on_stack(); + } } } }; static MarkActivationClosure mark_activation_closure; +class SetHotnessClosure: public CodeBlobClosure { +public: + virtual void do_code_blob(CodeBlob* cb) { + if (cb->is_nmethod()) { + nmethod* nm = (nmethod*)cb; + nm->set_hotness_counter(NMethodSweeper::hotness_counter_reset_val()); + } + } +}; +static SetHotnessClosure set_hotness_closure; + + +int NMethodSweeper::hotness_counter_reset_val() { + if (_hotness_counter_reset_val == 0) { + _hotness_counter_reset_val = (ReservedCodeCacheSize < M) ? 1 : (ReservedCodeCacheSize / M) * 2; + } + return _hotness_counter_reset_val; +} bool NMethodSweeper::sweep_in_progress() { return (_current != NULL); } -void NMethodSweeper::scan_stacks() { +// Scans the stacks of all Java threads and marks activations of not-entrant methods. +// No need to synchronize access, since 'mark_active_nmethods' is always executed at a +// safepoint. +void NMethodSweeper::mark_active_nmethods() { assert(SafepointSynchronize::is_at_safepoint(), "must be executed at a safepoint"); - if (!MethodFlushing) return; - - // No need to synchronize access, since this is always executed at a - // safepoint. - - // Make sure CompiledIC_lock in unlocked, since we might update some - // inline caches. If it is, we just bail-out and try later. - if (CompiledIC_lock->is_locked() || Patching_lock->is_locked()) return; + // If we do not want to reclaim not-entrant or zombie methods there is no need + // to scan stacks + if (!MethodFlushing) { + return; + } // Check for restart assert(CodeCache::find_blob_unsafe(_current) == _current, "Sweeper nmethod cached state invalid"); - if (!sweep_in_progress() && _resweep) { + if (!sweep_in_progress() && need_marking_phase()) { _seen = 0; _invocations = NmethodSweepFraction; _current = CodeCache::first_nmethod(); @@ -197,30 +212,22 @@ void NMethodSweeper::scan_stacks() { Threads::nmethods_do(&mark_activation_closure); // reset the flags since we started a scan from the beginning. - _resweep = false; + reset_nmethod_marking(); _locked_seen = 0; _not_entrant_seen_on_stack = 0; + } else { + // Only set hotness counter + Threads::nmethods_do(&set_hotness_closure); } - if (UseCodeCacheFlushing) { - // only allow new flushes after the interval is complete. - jlong now = os::javaTimeMillis(); - jlong max_interval = (jlong)MinCodeCacheFlushingInterval * (jlong)1000; - jlong curr_interval = now - _last_full_flush_time; - if (curr_interval > max_interval) { - _flush_token = 0; - } - - if (!CodeCache::needs_flushing() && !CompileBroker::should_compile_new_jobs()) { - CompileBroker::set_should_compile_new_jobs(CompileBroker::run_compilation); - log_sweep("restart_compiler"); - } - } + OrderAccess::storestore(); } void NMethodSweeper::possibly_sweep() { assert(JavaThread::current()->thread_state() == _thread_in_vm, "must run in vm mode"); - if (!MethodFlushing || !sweep_in_progress()) return; + if (!MethodFlushing || !sweep_in_progress()) { + return; + } if (_invocations > 0) { // Only one thread at a time will sweep @@ -258,8 +265,7 @@ void NMethodSweeper::sweep_code_cache() { if (!CompileBroker::should_compile_new_jobs()) { // If we have turned off compilations we might as well do full sweeps // in order to reach the clean state faster. Otherwise the sleeping compiler - // threads will slow down sweeping. After a few iterations the cache - // will be clean and sweeping stops (_resweep will not be set) + // threads will slow down sweeping. _invocations = 1; } @@ -271,9 +277,11 @@ void NMethodSweeper::sweep_code_cache() { int todo = (CodeCache::nof_nmethods() - _seen) / _invocations; int swept_count = 0; + assert(!SafepointSynchronize::is_at_safepoint(), "should not be in safepoint when we get here"); assert(!CodeCache_lock->owned_by_self(), "just checking"); + int freed_memory = 0; { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); @@ -299,7 +307,7 @@ void NMethodSweeper::sweep_code_cache() { // Now ready to process nmethod and give up CodeCache_lock { MutexUnlockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - process_nmethod(_current); + freed_memory += process_nmethod(_current); } _seen++; _current = next; @@ -308,11 +316,11 @@ void NMethodSweeper::sweep_code_cache() { assert(_invocations > 1 || _current == NULL, "must have scanned the whole cache"); - if (!sweep_in_progress() && !_resweep && (_locked_seen || _not_entrant_seen_on_stack)) { + if (!sweep_in_progress() && !need_marking_phase() && (_locked_seen || _not_entrant_seen_on_stack)) { // we've completed a scan without making progress but there were // nmethods we were unable to process either because they were - // locked or were still on stack. We don't have to aggresively - // clean them up so just stop scanning. We could scan once more + // locked or were still on stack. We don't have to aggressively + // clean them up so just stop scanning. We could scan once more // but that complicates the control logic and it's unlikely to // matter much. if (PrintMethodFlushing) { @@ -351,9 +359,16 @@ void NMethodSweeper::sweep_code_cache() { log_sweep("finished"); } - // Sweeper is the only case where memory is released, - // check here if it is time to restart the compiler. - if (UseCodeCacheFlushing && !CompileBroker::should_compile_new_jobs() && !CodeCache::needs_flushing()) { + // Sweeper is the only case where memory is released, check here if it + // is time to restart the compiler. Only checking if there is a certain + // amount of free memory in the code cache might lead to re-enabling + // compilation although no memory has been released. For example, there are + // cases when compilation was disabled although there is 4MB (or more) free + // memory in the code cache. The reason is code cache fragmentation. Therefore, + // it only makes sense to re-enable compilation if we have actually freed memory. + // Note that typically several kB are released for sweeping 16MB of the code + // cache. As a result, 'freed_memory' > 0 to restart the compiler. + if (UseCodeCacheFlushing && (!CompileBroker::should_compile_new_jobs() && (freed_memory > 0))) { CompileBroker::set_should_compile_new_jobs(CompileBroker::run_compilation); log_sweep("restart_compiler"); } @@ -367,8 +382,8 @@ class NMethodMarker: public StackObj { _thread = CompilerThread::current(); if (!nm->is_zombie() && !nm->is_unloaded()) { // Only expose live nmethods for scanning - _thread->set_scanned_nmethod(nm); - } + _thread->set_scanned_nmethod(nm); + } } ~NMethodMarker() { _thread->set_scanned_nmethod(NULL); @@ -392,20 +407,20 @@ void NMethodSweeper::release_nmethod(nmethod *nm) { nm->flush(); } -void NMethodSweeper::process_nmethod(nmethod *nm) { +int NMethodSweeper::process_nmethod(nmethod *nm) { assert(!CodeCache_lock->owned_by_self(), "just checking"); + int freed_memory = 0; // Make sure this nmethod doesn't get unloaded during the scan, - // since the locks acquired below might safepoint. + // since safepoints may happen during acquired below locks. NMethodMarker nmm(nm); - SWEEP(nm); // Skip methods that are currently referenced by the VM if (nm->is_locked_by_vm()) { // But still remember to clean-up inline caches for alive nmethods if (nm->is_alive()) { - // Clean-up all inline caches that points to zombie/non-reentrant methods + // Clean inline caches that point to zombie/non-entrant methods MutexLocker cl(CompiledIC_lock); nm->cleanup_inline_caches(); SWEEP(nm); @@ -413,18 +428,19 @@ void NMethodSweeper::process_nmethod(nmethod *nm) { _locked_seen++; SWEEP(nm); } - return; + return freed_memory; } if (nm->is_zombie()) { - // If it is first time, we see nmethod then we mark it. Otherwise, - // we reclame it. When we have seen a zombie method twice, we know that + // If it is the first time we see nmethod then we mark it. Otherwise, + // we reclaim it. When we have seen a zombie method twice, we know that // there are no inline caches that refer to it. if (nm->is_marked_for_reclamation()) { assert(!nm->is_locked_by_vm(), "must not flush locked nmethods"); if (PrintMethodFlushing && Verbose) { tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (marked for reclamation) being flushed", nm->compile_id(), nm); } + freed_memory = nm->total_size(); release_nmethod(nm); _flushed_count++; } else { @@ -432,19 +448,19 @@ void NMethodSweeper::process_nmethod(nmethod *nm) { tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (zombie) being marked for reclamation", nm->compile_id(), nm); } nm->mark_for_reclamation(); - _resweep = true; + request_nmethod_marking(); _marked_count++; SWEEP(nm); } } else if (nm->is_not_entrant()) { - // If there is no current activations of this method on the + // If there are no current activations of this method on the // stack we can safely convert it to a zombie method if (nm->can_not_entrant_be_converted()) { if (PrintMethodFlushing && Verbose) { tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (not entrant) being made zombie", nm->compile_id(), nm); } nm->make_zombie(); - _resweep = true; + request_nmethod_marking(); _zombified_count++; SWEEP(nm); } else { @@ -459,159 +475,57 @@ void NMethodSweeper::process_nmethod(nmethod *nm) { } } else if (nm->is_unloaded()) { // Unloaded code, just make it a zombie - if (PrintMethodFlushing && Verbose) + if (PrintMethodFlushing && Verbose) { tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (unloaded) being made zombie", nm->compile_id(), nm); - + } if (nm->is_osr_method()) { SWEEP(nm); // No inline caches will ever point to osr methods, so we can just remove it + freed_memory = nm->total_size(); release_nmethod(nm); _flushed_count++; } else { nm->make_zombie(); - _resweep = true; + request_nmethod_marking(); _zombified_count++; SWEEP(nm); } } else { - assert(nm->is_alive(), "should be alive"); - if (UseCodeCacheFlushing) { - if (nm->is_speculatively_disconnected() && !nm->is_locked_by_vm() && !nm->is_osr_method() && - (_traversals > _last_flush_traversal_id + 2) && (nm->compile_id() < _highest_marked)) { - // This method has not been called since the forced cleanup happened - nm->make_not_entrant(); + if (!nm->is_locked_by_vm() && !nm->is_osr_method() && !nm->is_native_method()) { + // Do not make native methods and OSR-methods not-entrant + nm->dec_hotness_counter(); + // Get the initial value of the hotness counter. This value depends on the + // ReservedCodeCacheSize + int reset_val = hotness_counter_reset_val(); + int time_since_reset = reset_val - nm->hotness_counter(); + double threshold = -reset_val + (CodeCache::reverse_free_ratio() * NmethodSweepActivity); + // The less free space in the code cache we have - the bigger reverse_free_ratio() is. + // I.e., 'threshold' increases with lower available space in the code cache and a higher + // NmethodSweepActivity. If the current hotness counter - which decreases from its initial + // value until it is reset by stack walking - is smaller than the computed threshold, the + // corresponding nmethod is considered for removal. + if ((NmethodSweepActivity > 0) && (nm->hotness_counter() < threshold) && (time_since_reset > 10)) { + // A method is marked as not-entrant if the method is + // 1) 'old enough': nm->hotness_counter() < threshold + // 2) The method was in_use for a minimum amount of time: (time_since_reset > 10) + // The second condition is necessary if we are dealing with very small code cache + // sizes (e.g., <10m) and the code cache size is too small to hold all hot methods. + // The second condition ensures that methods are not immediately made not-entrant + // after compilation. + nm->make_not_entrant(); + request_nmethod_marking(); + } } } - - // Clean-up all inline caches that points to zombie/non-reentrant methods + // Clean-up all inline caches that point to zombie/non-reentrant methods MutexLocker cl(CompiledIC_lock); nm->cleanup_inline_caches(); SWEEP(nm); } + return freed_memory; } -// Code cache unloading: when compilers notice the code cache is getting full, -// they will call a vm op that comes here. This code attempts to speculatively -// unload the oldest half of the nmethods (based on the compile job id) by -// saving the old code in a list in the CodeCache. Then -// execution resumes. If a method so marked is not called by the second sweeper -// stack traversal after the current one, the nmethod will be marked non-entrant and -// got rid of by normal sweeping. If the method is called, the Method*'s -// _code field is restored and the Method*/nmethod -// go back to their normal state. -void NMethodSweeper::handle_full_code_cache(bool is_full) { - - if (is_full) { - // Since code cache is full, immediately stop new compiles - if (CompileBroker::set_should_compile_new_jobs(CompileBroker::stop_compilation)) { - log_sweep("disable_compiler"); - } - } - - // Make sure only one thread can flush - // The token is reset after CodeCacheMinimumFlushInterval in scan stacks, - // no need to check the timeout here. - jint old = Atomic::cmpxchg( 1, &_flush_token, 0 ); - if (old != 0) { - return; - } - - VM_HandleFullCodeCache op(is_full); - VMThread::execute(&op); - - // resweep again as soon as possible - _resweep = true; -} - -void NMethodSweeper::speculative_disconnect_nmethods(bool is_full) { - // If there was a race in detecting full code cache, only run - // one vm op for it or keep the compiler shut off - - jlong disconnect_start_counter = os::elapsed_counter(); - - // Traverse the code cache trying to dump the oldest nmethods - int curr_max_comp_id = CompileBroker::get_compilation_id(); - int flush_target = ((curr_max_comp_id - _dead_compile_ids) / CodeCacheFlushingFraction) + _dead_compile_ids; - - log_sweep("start_cleaning"); - - nmethod* nm = CodeCache::alive_nmethod(CodeCache::first()); - jint disconnected = 0; - jint made_not_entrant = 0; - jint nmethod_count = 0; - - while ((nm != NULL)){ - int curr_comp_id = nm->compile_id(); - - // OSR methods cannot be flushed like this. Also, don't flush native methods - // since they are part of the JDK in most cases - if (!nm->is_osr_method() && !nm->is_locked_by_vm() && !nm->is_native_method()) { - - // only count methods that can be speculatively disconnected - nmethod_count++; - - if (nm->is_in_use() && (curr_comp_id < flush_target)) { - if ((nm->method()->code() == nm)) { - // This method has not been previously considered for - // unloading or it was restored already - CodeCache::speculatively_disconnect(nm); - disconnected++; - } else if (nm->is_speculatively_disconnected()) { - // This method was previously considered for preemptive unloading and was not called since then - CompilationPolicy::policy()->delay_compilation(nm->method()); - nm->make_not_entrant(); - made_not_entrant++; - } - - if (curr_comp_id > _highest_marked) { - _highest_marked = curr_comp_id; - } - } - } - nm = CodeCache::alive_nmethod(CodeCache::next(nm)); - } - - // remember how many compile_ids wheren't seen last flush. - _dead_compile_ids = curr_max_comp_id - nmethod_count; - - log_sweep("stop_cleaning", - "disconnected='" UINT32_FORMAT "' made_not_entrant='" UINT32_FORMAT "'", - disconnected, made_not_entrant); - - // Shut off compiler. Sweeper will start over with a new stack scan and - // traversal cycle and turn it back on if it clears enough space. - if (is_full) { - _last_full_flush_time = os::javaTimeMillis(); - } - - jlong disconnect_end_counter = os::elapsed_counter(); - jlong disconnect_time = disconnect_end_counter - disconnect_start_counter; - _total_disconnect_time += disconnect_time; - _peak_disconnect_time = MAX2(disconnect_time, _peak_disconnect_time); - - EventCleanCodeCache event(UNTIMED); - if (event.should_commit()) { - event.set_starttime(disconnect_start_counter); - event.set_endtime(disconnect_end_counter); - event.set_disconnectedCount(disconnected); - event.set_madeNonEntrantCount(made_not_entrant); - event.commit(); - } - _number_of_flushes++; - - // After two more traversals the sweeper will get rid of unrestored nmethods - _last_flush_traversal_id = _traversals; - _resweep = true; -#ifdef ASSERT - - if(PrintMethodFlushing && Verbose) { - tty->print_cr("### sweeper: unload time: " INT64_FORMAT, (jlong)disconnect_time); - } -#endif -} - - // Print out some state information about the current sweep and the // state of the code cache if it's requested. void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) { diff --git a/hotspot/src/share/vm/runtime/sweeper.hpp b/hotspot/src/share/vm/runtime/sweeper.hpp index da4a13adc77..bd351760769 100644 --- a/hotspot/src/share/vm/runtime/sweeper.hpp +++ b/hotspot/src/share/vm/runtime/sweeper.hpp @@ -27,8 +27,30 @@ // An NmethodSweeper is an incremental cleaner for: // - cleanup inline caches -// - reclamation of unreferences zombie nmethods -// +// - reclamation of nmethods +// Removing nmethods from the code cache includes two operations +// 1) mark active nmethods +// Is done in 'mark_active_nmethods()'. This function is called at a +// safepoint and marks all nmethods that are active on a thread's stack. +// 2) sweep nmethods +// Is done in sweep_code_cache(). This function is the only place in the +// sweeper where memory is reclaimed. Note that sweep_code_cache() is not +// called at a safepoint. However, sweep_code_cache() stops executing if +// another thread requests a safepoint. Consequently, 'mark_active_nmethods()' +// and sweep_code_cache() cannot execute at the same time. +// To reclaim memory, nmethods are first marked as 'not-entrant'. Methods can +// be made not-entrant by (i) the sweeper, (ii) deoptimization, (iii) dependency +// invalidation, and (iv) being replaced be a different method version (tiered +// compilation). Not-entrant nmethod cannot be called by Java threads, but they +// can still be active on the stack. To ensure that active nmethod are not reclaimed, +// we have to wait until the next marking phase has completed. If a not-entrant +// nmethod was NOT marked as active, it can be converted to 'zombie' state. To safely +// remove the nmethod, all inline caches (IC) that point to the the nmethod must be +// cleared. After that, the nmethod can be evicted from the code cache. Each nmethod's +// state change happens during separate sweeps. It may take at least 3 sweeps before an +// nmethod's space is freed. Sweeping is currently done by compiler threads between +// compilations or at least each 5 sec (NmethodSweepCheckInterval) when the code cache +// is full. class NMethodSweeper : public AllStatic { static long _traversals; // Stack scan count, also sweep ID. @@ -41,46 +63,38 @@ class NMethodSweeper : public AllStatic { static volatile int _invocations; // No. of invocations left until we are completed with this pass static volatile int _sweep_started; // Flag to control conc sweeper - //The following are reset in scan_stacks and synchronized by the safepoint - static bool _resweep; // Indicates that a change has happend and we want another sweep, - // always checked and reset at a safepoint so memory will be in sync. - static int _locked_seen; // Number of locked nmethods encountered during the scan + //The following are reset in mark_active_nmethods and synchronized by the safepoint + static bool _request_mark_phase; // Indicates that a change has happend and we need another mark pahse, + // always checked and reset at a safepoint so memory will be in sync. + static int _locked_seen; // Number of locked nmethods encountered during the scan static int _not_entrant_seen_on_stack; // Number of not entrant nmethod were are still on stack - static jint _flush_token; // token that guards method flushing, making sure it is executed only once. - - // These are set during a flush, a VM-operation - static long _last_flush_traversal_id; // trav number at last flush unloading - static jlong _last_full_flush_time; // timestamp of last emergency unloading - - // These are synchronized by the _sweep_started token - static int _highest_marked; // highest compile id dumped at last emergency unloading - static int _dead_compile_ids; // number of compile ids that where not in the cache last flush // Stat counters - static int _number_of_flushes; // Total of full traversals caused by full cache static int _total_nof_methods_reclaimed; // Accumulated nof methods flushed static jlong _total_time_sweeping; // Accumulated time sweeping static jlong _total_time_this_sweep; // Total time this sweep static jlong _peak_sweep_time; // Peak time for a full sweep static jlong _peak_sweep_fraction_time; // Peak time sweeping one fraction - static jlong _total_disconnect_time; // Total time cleaning code mem - static jlong _peak_disconnect_time; // Peak time cleaning code mem - static void process_nmethod(nmethod *nm); + static int process_nmethod(nmethod *nm); static void release_nmethod(nmethod* nm); - static void log_sweep(const char* msg, const char* format = NULL, ...); static bool sweep_in_progress(); + static void sweep_code_cache(); + static void request_nmethod_marking() { _request_mark_phase = true; } + static void reset_nmethod_marking() { _request_mark_phase = false; } + static bool need_marking_phase() { return _request_mark_phase; } + + static int _hotness_counter_reset_val; public: static long traversal_count() { return _traversals; } - static int number_of_flushes() { return _number_of_flushes; } static int total_nof_methods_reclaimed() { return _total_nof_methods_reclaimed; } static jlong total_time_sweeping() { return _total_time_sweeping; } static jlong peak_sweep_time() { return _peak_sweep_time; } static jlong peak_sweep_fraction_time() { return _peak_sweep_fraction_time; } - static jlong total_disconnect_time() { return _total_disconnect_time; } - static jlong peak_disconnect_time() { return _peak_disconnect_time; } + static void log_sweep(const char* msg, const char* format = NULL, ...); + #ifdef ASSERT static bool is_sweeping(nmethod* which) { return _current == which; } @@ -90,19 +104,18 @@ class NMethodSweeper : public AllStatic { static void report_events(); #endif - static void scan_stacks(); // Invoked at the end of each safepoint - static void sweep_code_cache(); // Concurrent part of sweep job - static void possibly_sweep(); // Compiler threads call this to sweep + static void mark_active_nmethods(); // Invoked at the end of each safepoint + static void possibly_sweep(); // Compiler threads call this to sweep - static void notify(nmethod* nm) { + static int sort_nmethods_by_hotness(nmethod** nm1, nmethod** nm2); + static int hotness_counter_reset_val(); + + static void notify() { // Request a new sweep of the code cache from the beginning. No // need to synchronize the setting of this flag since it only // changes to false at safepoint so we can never overwrite it with false. - _resweep = true; + request_nmethod_marking(); } - - static void handle_full_code_cache(bool is_full); // Called by compilers who fail to allocate - static void speculative_disconnect_nmethods(bool was_full); // Called by vm op to deal with alloc failure }; #endif // SHARE_VM_RUNTIME_SWEEPER_HPP diff --git a/hotspot/src/share/vm/runtime/synchronizer.cpp b/hotspot/src/share/vm/runtime/synchronizer.cpp index 015dd757b23..99f0d07771d 100644 --- a/hotspot/src/share/vm/runtime/synchronizer.cpp +++ b/hotspot/src/share/vm/runtime/synchronizer.cpp @@ -154,7 +154,7 @@ int ObjectSynchronizer::gOmInUseCount = 0; static volatile intptr_t ListLock = 0 ; // protects global monitor free-list cache static volatile int MonitorFreeCount = 0 ; // # on gFreeList static volatile int MonitorPopulation = 0 ; // # Extant -- in circulation -#define CHAINMARKER ((oop)-1) +#define CHAINMARKER (cast_to_oop(-1)) // ----------------------------------------------------------------------------- // Fast Monitor Enter/Exit @@ -510,7 +510,7 @@ static markOop ReadStableMark (oop obj) { // then for each thread on the list, set the flag and unpark() the thread. // This is conceptually similar to muxAcquire-muxRelease, except that muxRelease // wakes at most one thread whereas we need to wake the entire list. - int ix = (intptr_t(obj) >> 5) & (NINFLATIONLOCKS-1) ; + int ix = (cast_from_oop(obj) >> 5) & (NINFLATIONLOCKS-1) ; int YieldThenBlock = 0 ; assert (ix >= 0 && ix < NINFLATIONLOCKS, "invariant") ; assert ((NINFLATIONLOCKS & (NINFLATIONLOCKS-1)) == 0, "invariant") ; @@ -565,7 +565,7 @@ static inline intptr_t get_next_hash(Thread * Self, oop obj) { // This variation has the property of being stable (idempotent) // between STW operations. This can be useful in some of the 1-0 // synchronization schemes. - intptr_t addrBits = intptr_t(obj) >> 3 ; + intptr_t addrBits = cast_from_oop(obj) >> 3 ; value = addrBits ^ (addrBits >> 5) ^ GVars.stwRandom ; } else if (hashCode == 2) { @@ -575,7 +575,7 @@ static inline intptr_t get_next_hash(Thread * Self, oop obj) { value = ++GVars.hcSequence ; } else if (hashCode == 4) { - value = intptr_t(obj) ; + value = cast_from_oop(obj) ; } else { // Marsaglia's xor-shift scheme with thread-specific state // This is probably the best overall implementation -- we'll @@ -1321,7 +1321,7 @@ ObjectMonitor * ATTR ObjectSynchronizer::inflate (Thread * Self, oop object) { if (object->is_instance()) { ResourceMark rm; tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", - (intptr_t) object, (intptr_t) object->mark(), + (void *) object, (intptr_t) object->mark(), object->klass()->external_name()); } } @@ -1371,7 +1371,7 @@ ObjectMonitor * ATTR ObjectSynchronizer::inflate (Thread * Self, oop object) { if (object->is_instance()) { ResourceMark rm; tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", - (intptr_t) object, (intptr_t) object->mark(), + (void *) object, (intptr_t) object->mark(), object->klass()->external_name()); } } @@ -1439,7 +1439,7 @@ bool ObjectSynchronizer::deflate_monitor(ObjectMonitor* mid, oop obj, if (obj->is_instance()) { ResourceMark rm; tty->print_cr("Deflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", - (intptr_t) obj, (intptr_t) obj->mark(), obj->klass()->external_name()); + (void *) obj, (intptr_t) obj->mark(), obj->klass()->external_name()); } } diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index a0f0bdba713..9f31c25b7c6 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -1097,7 +1097,7 @@ static const char* get_java_runtime_version(TRAPS) { // General purpose hook into Java code, run once when the VM is initialized. // The Java library method itself may be changed independently from the VM. static void call_postVMInitHook(TRAPS) { - Klass* k = SystemDictionary::PostVMInitHook_klass(); + Klass* k = SystemDictionary::resolve_or_null(vmSymbols::sun_misc_PostVMInitHook(), THREAD); instanceKlassHandle klass (THREAD, k); if (klass.not_null()) { JavaValue result(T_VOID); @@ -1444,7 +1444,7 @@ void JavaThread::initialize() { _in_deopt_handler = 0; _doing_unsafe_access = false; _stack_guard_state = stack_guard_unused; - _exception_oop = NULL; + (void)const_cast(_exception_oop = NULL); _exception_pc = 0; _exception_handler_pc = 0; _is_method_handle_return = 0; @@ -1454,7 +1454,6 @@ void JavaThread::initialize() { _interp_only_mode = 0; _special_runtime_exit_condition = _no_async_condition; _pending_async_exception = NULL; - _is_compiling = false; _thread_stat = NULL; _thread_stat = new ThreadStatistics(); _blocked_on_compilation = false; @@ -1815,7 +1814,8 @@ void JavaThread::exit(bool destroy_vm, ExitType exit_type) { // Call Thread.exit(). We try 3 times in case we got another Thread.stop during // the execution of the method. If that is not enough, then we don't really care. Thread.stop // is deprecated anyhow. - { int count = 3; + if (!is_Compiler_thread()) { + int count = 3; while (java_lang_Thread::threadGroup(threadObj()) != NULL && (count-- > 0)) { EXCEPTION_MARK; JavaValue result(T_VOID); @@ -1828,7 +1828,6 @@ void JavaThread::exit(bool destroy_vm, ExitType exit_type) { CLEAR_PENDING_EXCEPTION; } } - // notify JVMTI if (JvmtiExport::should_post_thread_life()) { JvmtiExport::post_thread_end(this); @@ -3239,6 +3238,7 @@ CompilerThread::CompilerThread(CompileQueue* queue, CompilerCounters* counters) _counters = counters; _buffer_blob = NULL; _scanned_nmethod = NULL; + _compiler = NULL; #ifndef PRODUCT _ideal_graph_printer = NULL; @@ -3255,6 +3255,7 @@ void CompilerThread::oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClos } } + // ======= Threads ======== // The Threads class links together all active threads, and provides @@ -3275,8 +3276,6 @@ bool Threads::_vm_complete = false; // All JavaThreads #define ALL_JAVA_THREADS(X) for (JavaThread* X = _thread_list; X; X = X->next()) -void os_stream(); - // All JavaThreads + all non-JavaThreads (i.e., every thread in the system) void Threads::threads_do(ThreadClosure* tc) { assert_locked_or_safepoint(Threads_lock); diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp index 2afaf2a8f62..d655df4f1da 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -923,9 +923,6 @@ class JavaThread: public Thread { volatile address _exception_handler_pc; // PC for handler of exception volatile int _is_method_handle_return; // true (== 1) if the current exception PC is a MethodHandle call site. - // support for compilation - bool _is_compiling; // is true if a compilation is active inthis thread (one compilation per thread possible) - // support for JNI critical regions jint _jni_active_critical; // count of entries into JNI critical region @@ -1005,10 +1002,6 @@ class JavaThread: public Thread { // Testers virtual bool is_Java_thread() const { return true; } - // compilation - void set_is_compiling(bool f) { _is_compiling = f; } - bool is_compiling() const { return _is_compiling; } - // Thread chain operations JavaThread* next() const { return _next; } void set_next(JavaThread* p) { _next = p; } @@ -1278,11 +1271,16 @@ class JavaThread: public Thread { address exception_handler_pc() const { return _exception_handler_pc; } bool is_method_handle_return() const { return _is_method_handle_return == 1; } - void set_exception_oop(oop o) { _exception_oop = o; } + void set_exception_oop(oop o) { (void)const_cast(_exception_oop = o); } void set_exception_pc(address a) { _exception_pc = a; } void set_exception_handler_pc(address a) { _exception_handler_pc = a; } void set_is_method_handle_return(bool value) { _is_method_handle_return = value ? 1 : 0; } + void clear_exception_oop_and_pc() { + set_exception_oop(NULL); + set_exception_pc(NULL); + } + // Stack overflow support inline size_t stack_available(address cur_sp); address stack_yellow_zone_base() @@ -1811,13 +1809,14 @@ class CompilerThread : public JavaThread { private: CompilerCounters* _counters; - ciEnv* _env; - CompileLog* _log; - CompileTask* _task; - CompileQueue* _queue; - BufferBlob* _buffer_blob; + ciEnv* _env; + CompileLog* _log; + CompileTask* _task; + CompileQueue* _queue; + BufferBlob* _buffer_blob; - nmethod* _scanned_nmethod; // nmethod being scanned by the sweeper + nmethod* _scanned_nmethod; // nmethod being scanned by the sweeper + AbstractCompiler* _compiler; public: @@ -1829,14 +1828,17 @@ class CompilerThread : public JavaThread { // Hide this compiler thread from external view. bool is_hidden_from_external_view() const { return true; } - CompileQueue* queue() { return _queue; } - CompilerCounters* counters() { return _counters; } + void set_compiler(AbstractCompiler* c) { _compiler = c; } + AbstractCompiler* compiler() const { return _compiler; } + + CompileQueue* queue() const { return _queue; } + CompilerCounters* counters() const { return _counters; } // Get/set the thread's compilation environment. ciEnv* env() { return _env; } void set_env(ciEnv* env) { _env = env; } - BufferBlob* get_buffer_blob() { return _buffer_blob; } + BufferBlob* get_buffer_blob() const { return _buffer_blob; } void set_buffer_blob(BufferBlob* b) { _buffer_blob = b; }; // Get/set the thread's logging information diff --git a/hotspot/src/share/vm/runtime/vframeArray.cpp b/hotspot/src/share/vm/runtime/vframeArray.cpp index 3fda9e6dc1d..b13d560375e 100644 --- a/hotspot/src/share/vm/runtime/vframeArray.cpp +++ b/hotspot/src/share/vm/runtime/vframeArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,7 +111,7 @@ void vframeArrayElement::fill_in(compiledVFrame* vf) { case T_OBJECT: assert(!value->obj_is_scalar_replaced(), "object should be reallocated already"); // preserve object type - _locals->add( new StackValue((intptr_t) (value->get_obj()()), T_OBJECT )); + _locals->add( new StackValue(cast_from_oop((value->get_obj()())), T_OBJECT )); break; case T_CONFLICT: // A dead local. Will be initialized to null/zero. @@ -136,7 +136,7 @@ void vframeArrayElement::fill_in(compiledVFrame* vf) { case T_OBJECT: assert(!value->obj_is_scalar_replaced(), "object should be reallocated already"); // preserve object type - _expressions->add( new StackValue((intptr_t) (value->get_obj()()), T_OBJECT )); + _expressions->add( new StackValue(cast_from_oop((value->get_obj()())), T_OBJECT )); break; case T_CONFLICT: // A dead stack element. Will be initialized to null/zero. diff --git a/hotspot/src/share/vm/runtime/virtualspace.cpp b/hotspot/src/share/vm/runtime/virtualspace.cpp index 98ee7635002..24650f39f04 100644 --- a/hotspot/src/share/vm/runtime/virtualspace.cpp +++ b/hotspot/src/share/vm/runtime/virtualspace.cpp @@ -368,8 +368,15 @@ VirtualSpace::VirtualSpace() { bool VirtualSpace::initialize(ReservedSpace rs, size_t committed_size) { + const size_t max_commit_granularity = os::page_size_for_region(rs.size(), rs.size(), 1); + return initialize_with_granularity(rs, committed_size, max_commit_granularity); +} + +bool VirtualSpace::initialize_with_granularity(ReservedSpace rs, size_t committed_size, size_t max_commit_granularity) { if(!rs.is_reserved()) return false; // allocation failed. assert(_low_boundary == NULL, "VirtualSpace already initialized"); + assert(max_commit_granularity > 0, "Granularity must be non-zero."); + _low_boundary = rs.base(); _high_boundary = low_boundary() + rs.size(); @@ -390,7 +397,7 @@ bool VirtualSpace::initialize(ReservedSpace rs, size_t committed_size) { // No attempt is made to force large page alignment at the very top and // bottom of the space if they are not aligned so already. _lower_alignment = os::vm_page_size(); - _middle_alignment = os::page_size_for_region(rs.size(), rs.size(), 1); + _middle_alignment = max_commit_granularity; _upper_alignment = os::vm_page_size(); // End of each region @@ -966,17 +973,52 @@ void TestReservedSpace_test() { class TestVirtualSpace : AllStatic { + enum TestLargePages { + Default, + Disable, + Reserve, + Commit + }; + + static ReservedSpace reserve_memory(size_t reserve_size_aligned, TestLargePages mode) { + switch(mode) { + default: + case Default: + case Reserve: + return ReservedSpace(reserve_size_aligned); + case Disable: + case Commit: + return ReservedSpace(reserve_size_aligned, + os::vm_allocation_granularity(), + /* large */ false, /* exec */ false); + } + } + + static bool initialize_virtual_space(VirtualSpace& vs, ReservedSpace rs, TestLargePages mode) { + switch(mode) { + default: + case Default: + case Reserve: + return vs.initialize(rs, 0); + case Disable: + return vs.initialize_with_granularity(rs, 0, os::vm_page_size()); + case Commit: + return vs.initialize_with_granularity(rs, 0, os::page_size_for_region(rs.size(), rs.size(), 1)); + } + } + public: - static void test_virtual_space_actual_committed_space(size_t reserve_size, size_t commit_size) { + static void test_virtual_space_actual_committed_space(size_t reserve_size, size_t commit_size, + TestLargePages mode = Default) { size_t granularity = os::vm_allocation_granularity(); size_t reserve_size_aligned = align_size_up(reserve_size, granularity); - ReservedSpace reserved(reserve_size_aligned); + ReservedSpace reserved = reserve_memory(reserve_size_aligned, mode); assert(reserved.is_reserved(), "Must be"); VirtualSpace vs; - bool initialized = vs.initialize(reserved, 0); + bool initialized = initialize_virtual_space(vs, reserved, mode); assert(initialized, "Failed to initialize VirtualSpace"); vs.expand_by(commit_size, false); @@ -986,7 +1028,10 @@ class TestVirtualSpace : AllStatic { } else { assert_ge(vs.actual_committed_size(), commit_size); // Approximate the commit granularity. - size_t commit_granularity = UseLargePages ? os::large_page_size() : os::vm_page_size(); + // Make sure that we don't commit using large pages + // if large pages has been disabled for this VirtualSpace. + size_t commit_granularity = (mode == Disable || !UseLargePages) ? + os::vm_page_size() : os::large_page_size(); assert_lt(vs.actual_committed_size(), commit_size + commit_granularity); } @@ -1042,9 +1087,40 @@ class TestVirtualSpace : AllStatic { test_virtual_space_actual_committed_space(10 * M, 10 * M); } + static void test_virtual_space_disable_large_pages() { + if (!UseLargePages) { + return; + } + // These test cases verify that if we force VirtualSpace to disable large pages + test_virtual_space_actual_committed_space(10 * M, 0, Disable); + test_virtual_space_actual_committed_space(10 * M, 4 * K, Disable); + test_virtual_space_actual_committed_space(10 * M, 8 * K, Disable); + test_virtual_space_actual_committed_space(10 * M, 1 * M, Disable); + test_virtual_space_actual_committed_space(10 * M, 2 * M, Disable); + test_virtual_space_actual_committed_space(10 * M, 5 * M, Disable); + test_virtual_space_actual_committed_space(10 * M, 10 * M, Disable); + + test_virtual_space_actual_committed_space(10 * M, 0, Reserve); + test_virtual_space_actual_committed_space(10 * M, 4 * K, Reserve); + test_virtual_space_actual_committed_space(10 * M, 8 * K, Reserve); + test_virtual_space_actual_committed_space(10 * M, 1 * M, Reserve); + test_virtual_space_actual_committed_space(10 * M, 2 * M, Reserve); + test_virtual_space_actual_committed_space(10 * M, 5 * M, Reserve); + test_virtual_space_actual_committed_space(10 * M, 10 * M, Reserve); + + test_virtual_space_actual_committed_space(10 * M, 0, Commit); + test_virtual_space_actual_committed_space(10 * M, 4 * K, Commit); + test_virtual_space_actual_committed_space(10 * M, 8 * K, Commit); + test_virtual_space_actual_committed_space(10 * M, 1 * M, Commit); + test_virtual_space_actual_committed_space(10 * M, 2 * M, Commit); + test_virtual_space_actual_committed_space(10 * M, 5 * M, Commit); + test_virtual_space_actual_committed_space(10 * M, 10 * M, Commit); + } + static void test_virtual_space() { test_virtual_space_actual_committed_space(); test_virtual_space_actual_committed_space_one_large_page(); + test_virtual_space_disable_large_pages(); } }; diff --git a/hotspot/src/share/vm/runtime/virtualspace.hpp b/hotspot/src/share/vm/runtime/virtualspace.hpp index 02b14734a00..a00527052f6 100644 --- a/hotspot/src/share/vm/runtime/virtualspace.hpp +++ b/hotspot/src/share/vm/runtime/virtualspace.hpp @@ -178,6 +178,7 @@ class VirtualSpace VALUE_OBJ_CLASS_SPEC { public: // Initialization VirtualSpace(); + bool initialize_with_granularity(ReservedSpace rs, size_t committed_byte_size, size_t max_commit_ganularity); bool initialize(ReservedSpace rs, size_t committed_byte_size); // Destruction diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index 55405b27fd4..0897c25183b 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -27,7 +27,6 @@ #include "classfile/javaClasses.hpp" #include "classfile/loaderConstraints.hpp" #include "classfile/placeholders.hpp" -#include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "ci/ciField.hpp" #include "ci/ciInstance.hpp" @@ -59,7 +58,7 @@ #include "memory/generation.hpp" #include "memory/generationSpec.hpp" #include "memory/heap.hpp" -#include "memory/metablock.hpp" +#include "memory/metachunk.hpp" #include "memory/referenceType.hpp" #include "memory/space.hpp" #include "memory/tenuredGeneration.hpp" @@ -176,6 +175,7 @@ #include "opto/loopnode.hpp" #include "opto/machnode.hpp" #include "opto/matcher.hpp" +#include "opto/mathexactnode.hpp" #include "opto/mulnode.hpp" #include "opto/phaseX.hpp" #include "opto/parse.hpp" @@ -288,6 +288,7 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; nonstatic_field(ConstantPoolCache, _constant_pool, ConstantPool*) \ nonstatic_field(InstanceKlass, _array_klasses, Klass*) \ nonstatic_field(InstanceKlass, _methods, Array*) \ + nonstatic_field(InstanceKlass, _default_methods, Array*) \ nonstatic_field(InstanceKlass, _local_interfaces, Array*) \ nonstatic_field(InstanceKlass, _transitive_interfaces, Array*) \ nonstatic_field(InstanceKlass, _fields, Array*) \ @@ -322,6 +323,7 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; nonstatic_field(nmethodBucket, _count, int) \ nonstatic_field(nmethodBucket, _next, nmethodBucket*) \ nonstatic_field(InstanceKlass, _method_ordering, Array*) \ + nonstatic_field(InstanceKlass, _default_vtable_indices, Array*) \ nonstatic_field(Klass, _super_check_offset, juint) \ nonstatic_field(Klass, _secondary_super_cache, Klass*) \ nonstatic_field(Klass, _secondary_supers, Array*) \ @@ -714,11 +716,17 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; nonstatic_field(PlaceholderEntry, _loader_data, ClassLoaderData*) \ \ /**************************/ \ - /* ProctectionDomainEntry */ \ + /* ProtectionDomainEntry */ \ /**************************/ \ \ nonstatic_field(ProtectionDomainEntry, _next, ProtectionDomainEntry*) \ - nonstatic_field(ProtectionDomainEntry, _protection_domain, oop) \ + nonstatic_field(ProtectionDomainEntry, _pd_cache, ProtectionDomainCacheEntry*) \ + \ + /*******************************/ \ + /* ProtectionDomainCacheEntry */ \ + /*******************************/ \ + \ + nonstatic_field(ProtectionDomainCacheEntry, _literal, oop) \ \ /*************************/ \ /* LoaderConstraintEntry */ \ @@ -841,7 +849,7 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; nonstatic_field(nmethod, _osr_link, nmethod*) \ nonstatic_field(nmethod, _scavenge_root_link, nmethod*) \ nonstatic_field(nmethod, _scavenge_root_state, jbyte) \ - nonstatic_field(nmethod, _state, unsigned char) \ + nonstatic_field(nmethod, _state, volatile unsigned char) \ nonstatic_field(nmethod, _exception_offset, int) \ nonstatic_field(nmethod, _deoptimize_offset, int) \ nonstatic_field(nmethod, _deoptimize_mh_offset, int) \ @@ -909,7 +917,6 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; volatile_nonstatic_field(JavaThread, _exception_oop, oop) \ volatile_nonstatic_field(JavaThread, _exception_pc, address) \ volatile_nonstatic_field(JavaThread, _is_method_handle_return, int) \ - nonstatic_field(JavaThread, _is_compiling, bool) \ nonstatic_field(JavaThread, _special_runtime_exit_condition, JavaThread::AsyncRequests) \ nonstatic_field(JavaThread, _saved_exception_pc, address) \ volatile_nonstatic_field(JavaThread, _thread_state, JavaThreadState) \ @@ -1185,11 +1192,10 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; /* -XX flags */ \ /*********************/ \ \ - nonstatic_field(Flag, type, const char*) \ - nonstatic_field(Flag, name, const char*) \ - unchecked_nonstatic_field(Flag, addr, sizeof(void*)) /* NOTE: no type */ \ - nonstatic_field(Flag, kind, const char*) \ - nonstatic_field(Flag, origin, FlagValueOrigin) \ + nonstatic_field(Flag, _type, const char*) \ + nonstatic_field(Flag, _name, const char*) \ + unchecked_nonstatic_field(Flag, _addr, sizeof(void*)) /* NOTE: no type */ \ + nonstatic_field(Flag, _flags, Flag::Flags) \ static_field(Flag, flags, Flag*) \ static_field(Flag, numFlags, size_t) \ \ @@ -1360,6 +1366,7 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; declare_integer_type(long) \ declare_integer_type(char) \ declare_unsigned_integer_type(unsigned char) \ + declare_unsigned_integer_type(volatile unsigned char) \ declare_unsigned_integer_type(u_char) \ declare_unsigned_integer_type(unsigned int) \ declare_unsigned_integer_type(uint) \ @@ -1382,6 +1389,7 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; declare_toplevel_type(char**) \ declare_toplevel_type(u_char*) \ declare_toplevel_type(unsigned char*) \ + declare_toplevel_type(volatile unsigned char*) \ \ /*******************************************************************/ \ /* Types which it will be handy to have available over in the SA */ \ @@ -1456,6 +1464,7 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; declare_toplevel_type(CheckedExceptionElement) \ declare_toplevel_type(LocalVariableTableElement) \ declare_toplevel_type(ExceptionTableElement) \ + declare_toplevel_type(MethodParametersElement) \ \ declare_toplevel_type(ClassLoaderData) \ declare_toplevel_type(ClassLoaderDataGraph) \ @@ -1560,6 +1569,7 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; declare_toplevel_type(SystemDictionary) \ declare_toplevel_type(vmSymbols) \ declare_toplevel_type(ProtectionDomainEntry) \ + declare_toplevel_type(ProtectionDomainCacheEntry) \ \ declare_toplevel_type(GenericGrowableArray) \ declare_toplevel_type(GrowableArray) \ @@ -1928,6 +1938,15 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; declare_c2_type(CmpF3Node, CmpFNode) \ declare_c2_type(CmpDNode, CmpNode) \ declare_c2_type(CmpD3Node, CmpDNode) \ + declare_c2_type(MathExactNode, MultiNode) \ + declare_c2_type(MathExactINode, MathExactNode) \ + declare_c2_type(AddExactINode, MathExactINode) \ + declare_c2_type(AddExactLNode, MathExactLNode) \ + declare_c2_type(SubExactINode, MathExactINode) \ + declare_c2_type(SubExactLNode, MathExactLNode) \ + declare_c2_type(NegExactINode, MathExactINode) \ + declare_c2_type(MulExactINode, MathExactINode) \ + declare_c2_type(FlagsProjNode, ProjNode) \ declare_c2_type(BoolNode, Node) \ declare_c2_type(AbsNode, Node) \ declare_c2_type(AbsINode, AbsNode) \ @@ -2074,7 +2093,7 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; declare_integer_type(JavaThreadState) \ declare_integer_type(Location::Type) \ declare_integer_type(Location::Where) \ - declare_integer_type(FlagValueOrigin) \ + declare_integer_type(Flag::Flags) \ COMPILER2_PRESENT(declare_integer_type(OptoReg::Name)) \ \ declare_toplevel_type(CHeapObj) \ @@ -2082,7 +2101,7 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; declare_type(Array, MetaspaceObj) \ declare_type(Array, MetaspaceObj) \ declare_type(Array, MetaspaceObj) \ - declare_type(Array, MetaspaceObj) \ + declare_type(Array, MetaspaceObj) \ \ declare_integer_type(AccessFlags) /* FIXME: wrong type (not integer) */\ declare_toplevel_type(address) /* FIXME: should this be an integer type? */\ @@ -2242,12 +2261,6 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; declare_preprocessor_constant("PERFDATA_BIG_ENDIAN", PERFDATA_BIG_ENDIAN) \ declare_preprocessor_constant("PERFDATA_LITTLE_ENDIAN", PERFDATA_LITTLE_ENDIAN) \ \ - /***************/ \ - /* SymbolTable */ \ - /***************/ \ - \ - declare_constant(SymbolTable::symbol_table_size) \ - \ /***********************************/ \ /* LoaderConstraintTable constants */ \ /***********************************/ \ @@ -2330,6 +2343,7 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; declare_constant(ConstMethod::_has_localvariable_table) \ declare_constant(ConstMethod::_has_exception_table) \ declare_constant(ConstMethod::_has_generic_signature) \ + declare_constant(ConstMethod::_has_method_parameters) \ declare_constant(ConstMethod::_has_method_annotations) \ declare_constant(ConstMethod::_has_parameter_annotations) \ declare_constant(ConstMethod::_has_default_annotations) \ diff --git a/hotspot/src/share/vm/runtime/vm_operations.cpp b/hotspot/src/share/vm/runtime/vm_operations.cpp index 5166cfdaae1..e26c3938b20 100644 --- a/hotspot/src/share/vm/runtime/vm_operations.cpp +++ b/hotspot/src/share/vm/runtime/vm_operations.cpp @@ -173,10 +173,6 @@ void VM_UnlinkSymbols::doit() { SymbolTable::unlink(); } -void VM_HandleFullCodeCache::doit() { - NMethodSweeper::speculative_disconnect_nmethods(_is_full); -} - void VM_Verify::doit() { Universe::heap()->prepare_for_verify(); Universe::verify(_silent); diff --git a/hotspot/src/share/vm/runtime/vm_operations.hpp b/hotspot/src/share/vm/runtime/vm_operations.hpp index b6555b45704..ca616a52cf4 100644 --- a/hotspot/src/share/vm/runtime/vm_operations.hpp +++ b/hotspot/src/share/vm/runtime/vm_operations.hpp @@ -51,7 +51,6 @@ template(DeoptimizeAll) \ template(ZombieAll) \ template(UnlinkSymbols) \ - template(HandleFullCodeCache) \ template(Verify) \ template(PrintJNI) \ template(HeapDumper) \ @@ -261,16 +260,6 @@ class VM_DeoptimizeFrame: public VM_Operation { bool allow_nested_vm_operations() const { return true; } }; -class VM_HandleFullCodeCache: public VM_Operation { - private: - bool _is_full; - public: - VM_HandleFullCodeCache(bool is_full) { _is_full = is_full; } - VMOp_Type type() const { return VMOp_HandleFullCodeCache; } - void doit(); - bool allow_nested_vm_operations() const { return true; } -}; - #ifndef PRODUCT class VM_DeoptimizeAll: public VM_Operation { private: diff --git a/hotspot/src/share/vm/runtime/vm_version.hpp b/hotspot/src/share/vm/runtime/vm_version.hpp index c901b260de5..f03b77ca326 100644 --- a/hotspot/src/share/vm/runtime/vm_version.hpp +++ b/hotspot/src/share/vm/runtime/vm_version.hpp @@ -78,7 +78,13 @@ class Abstract_VM_Version: AllStatic { static const char* jre_release_version(); // does HW support an 8-byte compare-exchange operation? - static bool supports_cx8() {return _supports_cx8;} + static bool supports_cx8() { +#ifdef SUPPORTS_NATIVE_CX8 + return true; +#else + return _supports_cx8; +#endif + } // does HW support atomic get-and-set or atomic get-and-add? Used // to guide intrinsification decisions for Unsafe atomic ops static bool supports_atomic_getset4() {return _supports_atomic_getset4;} diff --git a/hotspot/src/share/vm/services/attachListener.cpp b/hotspot/src/share/vm/services/attachListener.cpp index bf002e7fa88..51fdb6fa9ae 100644 --- a/hotspot/src/share/vm/services/attachListener.cpp +++ b/hotspot/src/share/vm/services/attachListener.cpp @@ -245,7 +245,7 @@ static jint set_bool_flag(const char* name, AttachOperation* op, outputStream* o } value = (tmp != 0); } - bool res = CommandLineFlags::boolAtPut((char*)name, &value, ATTACH_ON_DEMAND); + bool res = CommandLineFlags::boolAtPut((char*)name, &value, Flag::ATTACH_ON_DEMAND); if (! res) { out->print_cr("setting flag %s failed", name); } @@ -263,7 +263,7 @@ static jint set_intx_flag(const char* name, AttachOperation* op, outputStream* o return JNI_ERR; } } - bool res = CommandLineFlags::intxAtPut((char*)name, &value, ATTACH_ON_DEMAND); + bool res = CommandLineFlags::intxAtPut((char*)name, &value, Flag::ATTACH_ON_DEMAND); if (! res) { out->print_cr("setting flag %s failed", name); } @@ -282,7 +282,7 @@ static jint set_uintx_flag(const char* name, AttachOperation* op, outputStream* return JNI_ERR; } } - bool res = CommandLineFlags::uintxAtPut((char*)name, &value, ATTACH_ON_DEMAND); + bool res = CommandLineFlags::uintxAtPut((char*)name, &value, Flag::ATTACH_ON_DEMAND); if (! res) { out->print_cr("setting flag %s failed", name); } @@ -301,7 +301,7 @@ static jint set_uint64_t_flag(const char* name, AttachOperation* op, outputStrea return JNI_ERR; } } - bool res = CommandLineFlags::uint64_tAtPut((char*)name, &value, ATTACH_ON_DEMAND); + bool res = CommandLineFlags::uint64_tAtPut((char*)name, &value, Flag::ATTACH_ON_DEMAND); if (! res) { out->print_cr("setting flag %s failed", name); } @@ -316,7 +316,7 @@ static jint set_ccstr_flag(const char* name, AttachOperation* op, outputStream* out->print_cr("flag value must be a string"); return JNI_ERR; } - bool res = CommandLineFlags::ccstrAtPut((char*)name, &value, ATTACH_ON_DEMAND); + bool res = CommandLineFlags::ccstrAtPut((char*)name, &value, Flag::ATTACH_ON_DEMAND); if (res) { FREE_C_HEAP_ARRAY(char, value, mtInternal); } else { @@ -470,7 +470,17 @@ void AttachListener::init() { vmSymbols::threadgroup_string_void_signature(), thread_group, string, - CHECK); + THREAD); + + if (HAS_PENDING_EXCEPTION) { + tty->print_cr("Exception in VM (AttachListener::init) : "); + java_lang_Throwable::print(PENDING_EXCEPTION, tty); + tty->cr(); + + CLEAR_PENDING_EXCEPTION; + + return; + } KlassHandle group(THREAD, SystemDictionary::ThreadGroup_klass()); JavaCalls::call_special(&result, @@ -479,7 +489,17 @@ void AttachListener::init() { vmSymbols::add_method_name(), vmSymbols::thread_void_signature(), thread_oop, // ARG 1 - CHECK); + THREAD); + + if (HAS_PENDING_EXCEPTION) { + tty->print_cr("Exception in VM (AttachListener::init) : "); + java_lang_Throwable::print(PENDING_EXCEPTION, tty); + tty->cr(); + + CLEAR_PENDING_EXCEPTION; + + return; + } { MutexLocker mu(Threads_lock); JavaThread* listener_thread = new JavaThread(&attach_listener_thread_entry); diff --git a/hotspot/src/share/vm/services/classLoadingService.cpp b/hotspot/src/share/vm/services/classLoadingService.cpp index b06890808ab..aa2299fca6d 100644 --- a/hotspot/src/share/vm/services/classLoadingService.cpp +++ b/hotspot/src/share/vm/services/classLoadingService.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ HS_DTRACE_PROBE_DECL4(hotspot, class__unloaded, char*, int, oop, bool); len = name->utf8_length(); \ } \ HS_DTRACE_PROBE4(hotspot, class__##type, \ - data, len, (clss)->class_loader(), (shared)); \ + data, len, SOLARIS_ONLY((void *))(clss)->class_loader(), (shared)); \ } #else /* USDT2 */ @@ -202,7 +202,7 @@ bool ClassLoadingService::set_verbose(bool verbose) { MutexLocker m(Management_lock); // verbose will be set to the previous value - bool succeed = CommandLineFlags::boolAtPut((char*)"TraceClassLoading", &verbose, MANAGEMENT); + bool succeed = CommandLineFlags::boolAtPut((char*)"TraceClassLoading", &verbose, Flag::MANAGEMENT); assert(succeed, "Setting TraceClassLoading flag fails"); reset_trace_class_unloading(); @@ -213,7 +213,7 @@ bool ClassLoadingService::set_verbose(bool verbose) { void ClassLoadingService::reset_trace_class_unloading() { assert(Management_lock->owned_by_self(), "Must own the Management_lock"); bool value = MemoryService::get_verbose() || ClassLoadingService::get_verbose(); - bool succeed = CommandLineFlags::boolAtPut((char*)"TraceClassUnloading", &value, MANAGEMENT); + bool succeed = CommandLineFlags::boolAtPut((char*)"TraceClassUnloading", &value, Flag::MANAGEMENT); assert(succeed, "Setting TraceClassUnLoading flag fails"); } diff --git a/hotspot/src/share/vm/services/diagnosticArgument.cpp b/hotspot/src/share/vm/services/diagnosticArgument.cpp index 0a1c20d8a2c..51126f063b4 100644 --- a/hotspot/src/share/vm/services/diagnosticArgument.cpp +++ b/hotspot/src/share/vm/services/diagnosticArgument.cpp @@ -61,7 +61,7 @@ void GenDCmdArgument::to_string(MemorySizeArgument m, char* buf, size_t len) { } void GenDCmdArgument::to_string(char* c, char* buf, size_t len) { - jio_snprintf(buf, len, "%s", c); + jio_snprintf(buf, len, "%s", (c != NULL) ? c : ""); } void GenDCmdArgument::to_string(StringArrayArgument* f, char* buf, size_t len) { diff --git a/hotspot/src/share/vm/services/diagnosticCommand.cpp b/hotspot/src/share/vm/services/diagnosticCommand.cpp index 79c922a8586..71b552801aa 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.cpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp @@ -48,7 +48,7 @@ void DCmdRegistrant::register_dcmds(){ DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); #if INCLUDE_SERVICES // Heap dumping/inspection supported - DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); + DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); #endif // INCLUDE_SERVICES @@ -505,7 +505,11 @@ JMXStartRemoteDCmd::JMXStartRemoteDCmd(outputStream *output, bool heap_allocated _jdp_pause ("jdp.pause", - "set com.sun.management.jdp.pause", "INT", false) + "set com.sun.management.jdp.pause", "INT", false), + + _jdp_name + ("jdp.name", + "set com.sun.management.jdp.name", "STRING", false) { _dcmdparser.add_dcmd_option(&_config_file); @@ -527,6 +531,7 @@ JMXStartRemoteDCmd::JMXStartRemoteDCmd(outputStream *output, bool heap_allocated _dcmdparser.add_dcmd_option(&_jdp_source_addr); _dcmdparser.add_dcmd_option(&_jdp_ttl); _dcmdparser.add_dcmd_option(&_jdp_pause); + _dcmdparser.add_dcmd_option(&_jdp_name); } @@ -596,6 +601,7 @@ void JMXStartRemoteDCmd::execute(DCmdSource source, TRAPS) { PUT_OPTION(_jdp_source_addr); PUT_OPTION(_jdp_ttl); PUT_OPTION(_jdp_pause); + PUT_OPTION(_jdp_name); #undef PUT_OPTION diff --git a/hotspot/src/share/vm/services/diagnosticCommand.hpp b/hotspot/src/share/vm/services/diagnosticCommand.hpp index 9c7216177bf..5485b119dec 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.hpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp @@ -302,6 +302,7 @@ class JMXStartRemoteDCmd : public DCmdWithParser { DCmdArgument _jdp_source_addr; DCmdArgument _jdp_ttl; DCmdArgument _jdp_pause; + DCmdArgument _jdp_name; public: JMXStartRemoteDCmd(outputStream *output, bool heap_allocated); diff --git a/hotspot/src/share/vm/services/dtraceAttacher.cpp b/hotspot/src/share/vm/services/dtraceAttacher.cpp index 9722e4eb278..e0799eac055 100644 --- a/hotspot/src/share/vm/services/dtraceAttacher.cpp +++ b/hotspot/src/share/vm/services/dtraceAttacher.cpp @@ -51,7 +51,7 @@ class VM_DeoptimizeTheWorld : public VM_Operation { static void set_bool_flag(const char* flag, bool value) { CommandLineFlags::boolAtPut((char*)flag, strlen(flag), &value, - ATTACH_ON_DEMAND); + Flag::ATTACH_ON_DEMAND); } // Enable only the "fine grained" flags. Do *not* touch diff --git a/hotspot/src/share/vm/services/heapDumper.cpp b/hotspot/src/share/vm/services/heapDumper.cpp index fa1bf273e07..c0d01048924 100644 --- a/hotspot/src/share/vm/services/heapDumper.cpp +++ b/hotspot/src/share/vm/services/heapDumper.cpp @@ -563,7 +563,7 @@ void DumpWriter::write_u8(u8 x) { } void DumpWriter::write_objectID(oop o) { - address a = (address)((uintptr_t)o); + address a = (address)o; #ifdef _LP64 write_u8((u8)a); #else @@ -1545,7 +1545,9 @@ void VM_HeapDumper::do_load_class(Klass* k) { // writes a HPROF_GC_CLASS_DUMP record for the given class void VM_HeapDumper::do_class_dump(Klass* k) { - DumperSupport::dump_class_and_array_classes(writer(), k); + if (k->oop_is_instance()) { + DumperSupport::dump_class_and_array_classes(writer(), k); + } } // writes a HPROF_GC_CLASS_DUMP records for a given basic type @@ -1722,7 +1724,7 @@ void VM_HeapDumper::doit() { SymbolTable::symbols_do(&sym_dumper); // write HPROF_LOAD_CLASS records - SystemDictionary::classes_do(&do_load_class); + ClassLoaderDataGraph::classes_do(&do_load_class); Universe::basic_type_classes_do(&do_load_class); // write HPROF_FRAME and HPROF_TRACE records @@ -1733,7 +1735,7 @@ void VM_HeapDumper::doit() { write_dump_header(); // Writes HPROF_GC_CLASS_DUMP records - SystemDictionary::classes_do(&do_class_dump); + ClassLoaderDataGraph::classes_do(&do_class_dump); Universe::basic_type_classes_do(&do_basic_type_array_class_dump); check_segment_length(); diff --git a/hotspot/src/share/vm/services/jmm.h b/hotspot/src/share/vm/services/jmm.h index 9f46499b4e8..e0a748a41d5 100644 --- a/hotspot/src/share/vm/services/jmm.h +++ b/hotspot/src/share/vm/services/jmm.h @@ -78,6 +78,7 @@ typedef enum { JMM_COMPILE_TOTAL_TIME_MS = 8, /* Total accumulated time spent in compilation */ JMM_GC_TIME_MS = 9, /* Total accumulated time spent in collection */ JMM_GC_COUNT = 10, /* Total number of collections */ + JMM_JVM_UPTIME_MS = 11, /* The JVM uptime in milliseconds */ JMM_INTERNAL_ATTRIBUTE_INDEX = 100, JMM_CLASS_LOADED_BYTES = 101, /* Number of bytes loaded instance classes */ diff --git a/hotspot/src/share/vm/services/management.cpp b/hotspot/src/share/vm/services/management.cpp index 5cc0cc4ffcc..9585960daa2 100644 --- a/hotspot/src/share/vm/services/management.cpp +++ b/hotspot/src/share/vm/services/management.cpp @@ -1032,6 +1032,9 @@ static jlong get_long_attribute(jmmLongAttribute att) { case JMM_JVM_INIT_DONE_TIME_MS: return Management::vm_init_done_time(); + case JMM_JVM_UPTIME_MS: + return Management::ticks_to_ms(os::elapsed_counter()); + case JMM_COMPILE_TOTAL_TIME_MS: return Management::ticks_to_ms(CompileBroker::total_compilation_ticks()); @@ -1643,9 +1646,13 @@ JVM_ENTRY(jobjectArray, jmm_GetVMGlobalNames(JNIEnv *env)) int num_entries = 0; for (int i = 0; i < nFlags; i++) { Flag* flag = &Flag::flags[i]; + // Exclude notproduct and develop flags in product builds. + if (flag->is_constant_in_binary()) { + continue; + } // Exclude the locked (experimental, diagnostic) flags if (flag->is_unlocked() || flag->is_unlocker()) { - Handle s = java_lang_String::create_from_str(flag->name, CHECK_0); + Handle s = java_lang_String::create_from_str(flag->_name, CHECK_0); flags_ah->obj_at_put(num_entries, s()); num_entries++; } @@ -1669,7 +1676,7 @@ JVM_END bool add_global_entry(JNIEnv* env, Handle name, jmmVMGlobal *global, Flag *flag, TRAPS) { Handle flag_name; if (name() == NULL) { - flag_name = java_lang_String::create_from_str(flag->name, CHECK_false); + flag_name = java_lang_String::create_from_str(flag->_name, CHECK_false); } else { flag_name = name; } @@ -1698,23 +1705,23 @@ bool add_global_entry(JNIEnv* env, Handle name, jmmVMGlobal *global, Flag *flag, global->writeable = flag->is_writeable(); global->external = flag->is_external(); - switch (flag->origin) { - case DEFAULT: + switch (flag->get_origin()) { + case Flag::DEFAULT: global->origin = JMM_VMGLOBAL_ORIGIN_DEFAULT; break; - case COMMAND_LINE: + case Flag::COMMAND_LINE: global->origin = JMM_VMGLOBAL_ORIGIN_COMMAND_LINE; break; - case ENVIRON_VAR: + case Flag::ENVIRON_VAR: global->origin = JMM_VMGLOBAL_ORIGIN_ENVIRON_VAR; break; - case CONFIG_FILE: + case Flag::CONFIG_FILE: global->origin = JMM_VMGLOBAL_ORIGIN_CONFIG_FILE; break; - case MANAGEMENT: + case Flag::MANAGEMENT: global->origin = JMM_VMGLOBAL_ORIGIN_MANAGEMENT; break; - case ERGONOMIC: + case Flag::ERGONOMIC: global->origin = JMM_VMGLOBAL_ORIGIN_ERGONOMIC; break; default: @@ -1781,6 +1788,10 @@ JVM_ENTRY(jint, jmm_GetVMGlobals(JNIEnv *env, int num_entries = 0; for (int i = 0; i < nFlags && num_entries < count; i++) { Flag* flag = &Flag::flags[i]; + // Exclude notproduct and develop flags in product builds. + if (flag->is_constant_in_binary()) { + continue; + } // Exclude the locked (diagnostic, experimental) flags if ((flag->is_unlocked() || flag->is_unlocker()) && add_global_entry(env, null_h, &globals[num_entries], flag, THREAD)) { @@ -1813,23 +1824,23 @@ JVM_ENTRY(void, jmm_SetVMGlobal(JNIEnv *env, jstring flag_name, jvalue new_value bool succeed; if (flag->is_bool()) { bool bvalue = (new_value.z == JNI_TRUE ? true : false); - succeed = CommandLineFlags::boolAtPut(name, &bvalue, MANAGEMENT); + succeed = CommandLineFlags::boolAtPut(name, &bvalue, Flag::MANAGEMENT); } else if (flag->is_intx()) { intx ivalue = (intx)new_value.j; - succeed = CommandLineFlags::intxAtPut(name, &ivalue, MANAGEMENT); + succeed = CommandLineFlags::intxAtPut(name, &ivalue, Flag::MANAGEMENT); } else if (flag->is_uintx()) { uintx uvalue = (uintx)new_value.j; - succeed = CommandLineFlags::uintxAtPut(name, &uvalue, MANAGEMENT); + succeed = CommandLineFlags::uintxAtPut(name, &uvalue, Flag::MANAGEMENT); } else if (flag->is_uint64_t()) { uint64_t uvalue = (uint64_t)new_value.j; - succeed = CommandLineFlags::uint64_tAtPut(name, &uvalue, MANAGEMENT); + succeed = CommandLineFlags::uint64_tAtPut(name, &uvalue, Flag::MANAGEMENT); } else if (flag->is_ccstr()) { oop str = JNIHandles::resolve_external_guard(new_value.l); if (str == NULL) { THROW(vmSymbols::java_lang_NullPointerException()); } ccstr svalue = java_lang_String::as_utf8_string(str); - succeed = CommandLineFlags::ccstrAtPut(name, &svalue, MANAGEMENT); + succeed = CommandLineFlags::ccstrAtPut(name, &svalue, Flag::MANAGEMENT); } assert(succeed, "Setting flag should succeed"); JVM_END diff --git a/hotspot/src/share/vm/services/memoryManager.cpp b/hotspot/src/share/vm/services/memoryManager.cpp index d5e54f5ff15..0cfd05b78f5 100644 --- a/hotspot/src/share/vm/services/memoryManager.cpp +++ b/hotspot/src/share/vm/services/memoryManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ HS_DTRACE_PROBE_DECL8(hotspot, mem__pool__gc__end, char*, int, char*, int, MemoryManager::MemoryManager() { _num_pools = 0; - _memory_mgr_obj = NULL; + (void)const_cast(_memory_mgr_obj = NULL); } void MemoryManager::add_pool(MemoryPool* pool) { diff --git a/hotspot/src/share/vm/services/memoryPool.cpp b/hotspot/src/share/vm/services/memoryPool.cpp index cfae726cf7b..655ee68e9e3 100644 --- a/hotspot/src/share/vm/services/memoryPool.cpp +++ b/hotspot/src/share/vm/services/memoryPool.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ MemoryPool::MemoryPool(const char* name, _name = name; _initial_size = init_size; _max_size = max_size; - _memory_pool_obj = NULL; + (void)const_cast(_memory_pool_obj = NULL); _available_for_allocation = true; _num_managers = 0; _type = type; diff --git a/hotspot/src/share/vm/services/memoryService.cpp b/hotspot/src/share/vm/services/memoryService.cpp index 6508cd2086a..46553ba0acd 100644 --- a/hotspot/src/share/vm/services/memoryService.cpp +++ b/hotspot/src/share/vm/services/memoryService.cpp @@ -515,7 +515,7 @@ void MemoryService::oops_do(OopClosure* f) { bool MemoryService::set_verbose(bool verbose) { MutexLocker m(Management_lock); // verbose will be set to the previous value - bool succeed = CommandLineFlags::boolAtPut((char*)"PrintGC", &verbose, MANAGEMENT); + bool succeed = CommandLineFlags::boolAtPut((char*)"PrintGC", &verbose, Flag::MANAGEMENT); assert(succeed, "Setting PrintGC flag fails"); ClassLoadingService::reset_trace_class_unloading(); @@ -618,4 +618,3 @@ TraceMemoryManagerStats::~TraceMemoryManagerStats() { MemoryService::gc_end(_fullGC, _recordPostGCUsage, _recordAccumulatedGCTime, _recordGCEndTime, _countCollection, _cause); } - diff --git a/hotspot/src/share/vm/services/memoryService.hpp b/hotspot/src/share/vm/services/memoryService.hpp index 8ae6994bf44..7ef9094f574 100644 --- a/hotspot/src/share/vm/services/memoryService.hpp +++ b/hotspot/src/share/vm/services/memoryService.hpp @@ -148,6 +148,12 @@ public: static void track_code_cache_memory_usage() { track_memory_pool_usage(_code_heap_pool); } + static void track_metaspace_memory_usage() { + track_memory_pool_usage(_metaspace_pool); + } + static void track_compressed_class_memory_usage() { + track_memory_pool_usage(_compressed_class_pool); + } static void track_memory_pool_usage(MemoryPool* pool); static void gc_begin(bool fullGC, bool recordGCBeginTime, diff --git a/hotspot/src/share/vm/services/runtimeService.cpp b/hotspot/src/share/vm/services/runtimeService.cpp index fc2fdf1f6c0..379b8f3ff9e 100644 --- a/hotspot/src/share/vm/services/runtimeService.cpp +++ b/hotspot/src/share/vm/services/runtimeService.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -119,7 +119,7 @@ void RuntimeService::record_safepoint_begin() { #endif /* USDT2 */ // Print the time interval in which the app was executing - if (PrintGCApplicationConcurrentTime) { + if (PrintGCApplicationConcurrentTime && _app_timer.is_updated()) { gclog_or_tty->date_stamp(PrintGCDateStamps); gclog_or_tty->stamp(PrintGCTimeStamps); gclog_or_tty->print_cr("Application time: %3.7f seconds", diff --git a/hotspot/src/share/vm/shark/sharkCompiler.cpp b/hotspot/src/share/vm/shark/sharkCompiler.cpp index cde6bc23e76..211129bc387 100644 --- a/hotspot/src/share/vm/shark/sharkCompiler.cpp +++ b/hotspot/src/share/vm/shark/sharkCompiler.cpp @@ -133,11 +133,10 @@ SharkCompiler::SharkCompiler() exit(1); } - execution_engine()->addModule( - _native_context->module()); + execution_engine()->addModule(_native_context->module()); // All done - mark_initialized(); + set_state(initialized); } void SharkCompiler::initialize() { diff --git a/hotspot/src/share/vm/shark/sharkCompiler.hpp b/hotspot/src/share/vm/shark/sharkCompiler.hpp index 7e530c142aa..12c3cd84c5b 100644 --- a/hotspot/src/share/vm/shark/sharkCompiler.hpp +++ b/hotspot/src/share/vm/shark/sharkCompiler.hpp @@ -50,10 +50,6 @@ class SharkCompiler : public AbstractCompiler { return ! (method->is_method_handle_intrinsic() || method->is_compiled_lambda_form()); } - // Customization - bool needs_adapters() { return false; } - bool needs_stubs() { return false; } - // Initialization void initialize(); diff --git a/hotspot/src/share/vm/trace/trace.xml b/hotspot/src/share/vm/trace/trace.xml index 6b1d9a8850f..a4286116a67 100644 --- a/hotspot/src/share/vm/trace/trace.xml +++ b/hotspot/src/share/vm/trace/trace.xml @@ -313,13 +313,6 @@ Declares a structure type that can be used in other events. - - - - - - + diff --git a/hotspot/src/share/vm/trace/traceEventIds.xsl b/hotspot/src/share/vm/trace/traceEventIds.xsl index 737377cadd7..6a7e95474c0 100644 --- a/hotspot/src/share/vm/trace/traceEventIds.xsl +++ b/hotspot/src/share/vm/trace/traceEventIds.xsl @@ -23,8 +23,8 @@ --> - + diff --git a/hotspot/src/share/vm/trace/traceTypes.xsl b/hotspot/src/share/vm/trace/traceTypes.xsl index b06b604cedd..278720d1c1a 100644 --- a/hotspot/src/share/vm/trace/traceTypes.xsl +++ b/hotspot/src/share/vm/trace/traceTypes.xsl @@ -23,8 +23,8 @@ --> - + diff --git a/hotspot/src/share/vm/utilities/array.hpp b/hotspot/src/share/vm/utilities/array.hpp index fb32f5ca8fd..9f8e45f3243 100644 --- a/hotspot/src/share/vm/utilities/array.hpp +++ b/hotspot/src/share/vm/utilities/array.hpp @@ -353,9 +353,9 @@ protected: // sort the array. bool contains(const T& x) const { return index_of(x) >= 0; } - T at(int i) const { assert(i >= 0 && i< _length, err_msg_res("oob: 0 <= %d < %d", i, _length)); return _data[i]; } - void at_put(const int i, const T& x) { assert(i >= 0 && i< _length, err_msg_res("oob: 0 <= %d < %d", i, _length)); _data[i] = x; } - T* adr_at(const int i) { assert(i >= 0 && i< _length, err_msg_res("oob: 0 <= %d < %d", i, _length)); return &_data[i]; } + T at(int i) const { assert(i >= 0 && i< _length, err_msg("oob: 0 <= %d < %d", i, _length)); return _data[i]; } + void at_put(const int i, const T& x) { assert(i >= 0 && i< _length, err_msg("oob: 0 <= %d < %d", i, _length)); _data[i] = x; } + T* adr_at(const int i) { assert(i >= 0 && i< _length, err_msg("oob: 0 <= %d < %d", i, _length)); return &_data[i]; } int find(const T& x) { return index_of(x); } T at_acquire(const int which) { return OrderAccess::load_acquire(adr_at(which)); } diff --git a/hotspot/src/share/vm/utilities/constantTag.cpp b/hotspot/src/share/vm/utilities/constantTag.cpp index 25bff0fed6d..7bc55690ac2 100644 --- a/hotspot/src/share/vm/utilities/constantTag.cpp +++ b/hotspot/src/share/vm/utilities/constantTag.cpp @@ -51,7 +51,9 @@ BasicType constantTag::basic_type() const { case JVM_CONSTANT_ClassIndex : case JVM_CONSTANT_StringIndex : case JVM_CONSTANT_MethodHandle : + case JVM_CONSTANT_MethodHandleInError : case JVM_CONSTANT_MethodType : + case JVM_CONSTANT_MethodTypeInError : return T_OBJECT; default: ShouldNotReachHere(); @@ -60,6 +62,19 @@ BasicType constantTag::basic_type() const { } +jbyte constantTag::non_error_value() const { + switch (_tag) { + case JVM_CONSTANT_UnresolvedClassInError: + return JVM_CONSTANT_UnresolvedClass; + case JVM_CONSTANT_MethodHandleInError: + return JVM_CONSTANT_MethodHandle; + case JVM_CONSTANT_MethodTypeInError: + return JVM_CONSTANT_MethodType; + default: + return _tag; + } +} + const char* constantTag::internal_name() const { switch (_tag) { diff --git a/hotspot/src/share/vm/utilities/constantTag.hpp b/hotspot/src/share/vm/utilities/constantTag.hpp index 4865ce21f29..cedddf6a41f 100644 --- a/hotspot/src/share/vm/utilities/constantTag.hpp +++ b/hotspot/src/share/vm/utilities/constantTag.hpp @@ -108,7 +108,8 @@ class constantTag VALUE_OBJ_CLASS_SPEC { _tag = tag; } - jbyte value() { return _tag; } + jbyte value() const { return _tag; } + jbyte non_error_value() const; BasicType basic_type() const; // if used with ldc, what kind of value gets pushed? diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index bbee85c8b23..7806cdc0811 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -326,12 +326,18 @@ typedef jlong s8; const int max_method_code_size = 64*K - 1; // JVM spec, 2nd ed. section 4.8.1 (p.134) +// Default ProtectionDomainCacheSize values + +const int defaultProtectionDomainCacheSize = NOT_LP64(137) LP64_ONLY(2017); //---------------------------------------------------------------------------------------------------- // Default and minimum StringTableSize values const int defaultStringTableSize = NOT_LP64(1009) LP64_ONLY(60013); -const int minimumStringTableSize=1009; +const int minimumStringTableSize = 1009; + +const int defaultSymbolTableSize = 20011; +const int minimumSymbolTableSize = 1009; //---------------------------------------------------------------------------------------------------- @@ -362,8 +368,6 @@ const int KlassAlignment = KlassAlignmentInBytes / HeapWordSize; // Klass encoding metaspace max size const uint64_t KlassEncodingMetaspaceMax = (uint64_t(max_juint) + 1) << LogKlassAlignmentInBytes; -const jlong CompressedKlassPointersBase = NOT_LP64(0) LP64_ONLY(CONST64(0x800000000)); // 32*G - // Machine dependent stuff #ifdef TARGET_ARCH_x86 @@ -967,9 +971,9 @@ const int badCodeHeapFreeVal = 0xDD; // value used to zap // (These must be implemented as #defines because C++ compilers are // not obligated to inline non-integral constants!) #define badAddress ((address)::badAddressVal) -#define badOop ((oop)::badOopVal) +#define badOop (cast_to_oop(::badOopVal)) #define badHeapWord (::badHeapWordVal) -#define badJNIHandle ((oop)::badJNIHandleVal) +#define badJNIHandle (cast_to_oop(::badJNIHandleVal)) // Default TaskQueue size is 16K (32-bit) or 128K (64-bit) #define TASKQUEUE_SIZE (NOT_LP64(1<<14) LP64_ONLY(1<<17)) diff --git a/hotspot/src/share/vm/utilities/globalDefinitions_visCPP.hpp b/hotspot/src/share/vm/utilities/globalDefinitions_visCPP.hpp index d6056fcb1f0..6bccc18e9fe 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions_visCPP.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions_visCPP.hpp @@ -189,6 +189,10 @@ const jlong max_jlong = CONST64(0x7fffffffffffffff); #pragma warning( disable : 4201 ) // nonstandard extension used : nameless struct/union (needed in windows.h) #pragma warning( disable : 4511 ) // copy constructor could not be generated #pragma warning( disable : 4291 ) // no matching operator delete found; memory will not be freed if initialization thows an exception +#ifdef CHECK_UNHANDLED_OOPS +#pragma warning( disable : 4521 ) // class has multiple copy ctors of a single type +#pragma warning( disable : 4522 ) // class has multiple assignment operators of a single type +#endif // CHECK_UNHANDLED_OOPS #if _MSC_VER >= 1400 #pragma warning( disable : 4996 ) // unsafe string functions. Same as define _CRT_SECURE_NO_WARNINGS/_CRT_SECURE_NO_DEPRICATE #endif diff --git a/hotspot/src/share/vm/utilities/hashtable.cpp b/hotspot/src/share/vm/utilities/hashtable.cpp index ecb43da83b0..3e1413f618f 100644 --- a/hotspot/src/share/vm/utilities/hashtable.cpp +++ b/hotspot/src/share/vm/utilities/hashtable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -356,9 +356,9 @@ template class Hashtable; template class Hashtable; template class Hashtable; template class Hashtable; -#ifdef SOLARIS +#if defined(SOLARIS) || defined(CHECK_UNHANDLED_OOPS) template class Hashtable; -#endif +#endif // SOLARIS || CHECK_UNHANDLED_OOPS template class Hashtable; template class Hashtable; template class HashtableEntry; diff --git a/hotspot/src/share/vm/utilities/ostream.cpp b/hotspot/src/share/vm/utilities/ostream.cpp index e4215504a4d..39f87a47758 100644 --- a/hotspot/src/share/vm/utilities/ostream.cpp +++ b/hotspot/src/share/vm/utilities/ostream.cpp @@ -465,7 +465,7 @@ static const char* make_log_name_internal(const char* log_name, const char* forc } // log_name comes from -XX:LogFile=log_name or -Xloggc:log_name -// in log_name, %p => pipd1234 and +// in log_name, %p => pid1234 and // %t => YYYY-MM-DD_HH-MM-SS static const char* make_log_name(const char* log_name, const char* force_directory) { char timestr[32]; @@ -792,7 +792,7 @@ bool defaultStream::has_log_file() { void defaultStream::init_log() { // %%% Need a MutexLocker? - const char* log_name = LogFile != NULL ? LogFile : "hotspot_pid%p.log"; + const char* log_name = LogFile != NULL ? LogFile : "hotspot_%p.log"; const char* try_name = make_log_name(log_name, NULL); fileStream* file = new(ResourceObj::C_HEAP, mtInternal) fileStream(try_name); if (!file->is_open()) { diff --git a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp index cdc119dd691..1d4e0635311 100644 --- a/hotspot/src/share/vm/utilities/taskqueue.hpp +++ b/hotspot/src/share/vm/utilities/taskqueue.hpp @@ -322,11 +322,11 @@ public: // Attempts to claim a task from the "local" end of the queue (the most // recently pushed). If successful, returns true and sets t to the task; // otherwise, returns false (the queue is empty). - inline bool pop_local(E& t); + inline bool pop_local(volatile E& t); // Like pop_local(), but uses the "global" end of the queue (the least // recently pushed). - bool pop_global(E& t); + bool pop_global(volatile E& t); // Delete any resource associated with the queue. ~GenericTaskQueue(); @@ -424,7 +424,7 @@ bool GenericTaskQueue::pop_local_slow(uint localBot, Age oldAge) { } template -bool GenericTaskQueue::pop_global(E& t) { +bool GenericTaskQueue::pop_global(volatile E& t) { Age oldAge = _age.get(); // Architectures with weak memory model require a barrier here // to guarantee that bottom is not older than age, @@ -701,7 +701,7 @@ GenericTaskQueue::push(E t) { } template inline bool -GenericTaskQueue::pop_local(E& t) { +GenericTaskQueue::pop_local(volatile E& t) { uint localBot = _bottom; // This value cannot be N-1. That can only occur as a result of // the assignment to bottom in this method. If it does, this method @@ -799,7 +799,7 @@ public: } volatile ObjArrayTask& operator =(const volatile ObjArrayTask& t) volatile { - _obj = t._obj; + (void)const_cast(_obj = t._obj); _index = t._index; return *this; } diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index 79769aeb3bc..bbf983953b7 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -1050,7 +1050,7 @@ void VMError::report_and_die() { FILE* replay_data_file = os::open(fd, "w"); if (replay_data_file != NULL) { fileStream replay_data_stream(replay_data_file, /*need_close=*/true); - env->dump_replay_data(&replay_data_stream); + env->dump_replay_data_unsafe(&replay_data_stream); out.print_raw("#\n# Compiler replay data is saved as:\n# "); out.print_raw_cr(buffer); } else { diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index bae5a9b3469..18fb1d9a157 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -27,7 +27,7 @@ # - compact1, compact2, compact3, full JRE, JDK # # In addition they support testing of the minimal VM on compact1 and compact2. -# Essentially this defines groups based around the specified API's and VM +# Essentially this defines groups based around the specified API's and VM # services available in the runtime. # # The groups are defined hierarchically in two forms: @@ -44,9 +44,9 @@ # by listing the top-level test directories. # # To use a group simply list it on the jtreg command line eg: -# jtreg :jdk +# jtreg :jdk # runs all tests. While -# jtreg :compact2 +# jtreg :compact2 # runs those tests that only require compact1 and compact2 API's. # @@ -64,12 +64,13 @@ needs_jdk = \ gc/TestG1ZeroPGCTJcmdThreadPrint.java \ gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java \ gc/metaspace/TestMetaspacePerfCounters.java \ + gc/metaspace/TestPerfCountersAndMemoryPools.java \ runtime/6819213/TestBootNativeLibraryPath.java \ - runtime/6878713/Test6878713.sh \ runtime/6925573/SortMethodsTest.java \ runtime/7107135/Test7107135.sh \ runtime/7158988/FieldMonitor.java \ runtime/7194254/Test7194254.java \ + runtime/8026365/InvokeSpecialAnonTest.java \ runtime/jsig/Test8017498.sh \ runtime/Metaspace/FragmentMetaspace.java \ runtime/NMT/BaselineWithParameter.java \ @@ -85,7 +86,9 @@ needs_jdk = \ runtime/NMT/VirtualAllocTestType.java \ runtime/RedefineObject/TestRedefineObject.java \ runtime/XCheckJniJsig/XCheckJSig.java \ - serviceability/attach/AttachWithStalePidFile.java + serviceability/attach/AttachWithStalePidFile.java \ + serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java + # JRE adds further tests to compact3 # @@ -99,7 +102,9 @@ jre = \ needs_jre = \ compiler/6852078/Test6852078.java \ compiler/7047069/Test7047069.java \ - runtime/6294277/SourceDebugExtension.java + runtime/6294277/SourceDebugExtension.java \ + runtime/ClassFile/JsrRewriting.java \ + runtime/ClassFile/OomWhileParsingRepeatedJsr.java # Compact 3 adds further tests to compact2 # @@ -123,7 +128,7 @@ needs_compact3 = \ compiler/whitebox/IsMethodCompilableTest.java \ gc/6581734/Test6581734.java \ gc/7072527/TestFullGCCount.java \ - gc/7168848/HumongousAlloc.java \ + gc/g1/TestHumongousAllocInitialMark.java \ gc/arguments/TestG1HeapRegionSize.java \ gc/metaspace/TestMetaspaceMemoryPool.java \ runtime/InternalApi/ThreadCpuTimesDeadlock.java \ @@ -139,7 +144,7 @@ compact2 = \ -:needs_jdk # Tests that require compact2 API's and a full VM -# +# needs_full_vm_compact2 = # Compact 1 adds full VM tests @@ -193,6 +198,7 @@ compact1_minimal = \ serviceability/ \ compiler/ \ testlibrary/ \ + testlibrary_tests/ \ sanity/ \ runtime/ \ gc/ \ diff --git a/hotspot/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java b/hotspot/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java new file mode 100644 index 00000000000..eea5c90e9f7 --- /dev/null +++ b/hotspot/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8013496 + * @summary Test checks that the order in which ReversedCodeCacheSize and + * InitialCodeCacheSize are passed to the VM is irrelevant. + * @library /testlibrary + * + */ +import com.oracle.java.testlibrary.*; + +public class CheckReservedInitialCodeCacheSizeArgOrder { + public static void main(String[] args) throws Exception { + ProcessBuilder pb1, pb2; + OutputAnalyzer out1, out2; + + pb1 = ProcessTools.createJavaProcessBuilder("-XX:InitialCodeCacheSize=4m", "-XX:ReservedCodeCacheSize=8m", "-version"); + pb2 = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=8m", "-XX:InitialCodeCacheSize=4m", "-version"); + + out1 = new OutputAnalyzer(pb1.start()); + out2 = new OutputAnalyzer(pb2.start()); + + // Check that the outputs are equal + if (out1.getStdout().compareTo(out2.getStdout()) != 0) { + throw new RuntimeException("Test failed"); + } + + out1.shouldHaveExitValue(0); + out2.shouldHaveExitValue(0); + } +} diff --git a/hotspot/test/compiler/inlining/InlineDefaultMethod.java b/hotspot/test/compiler/inlining/InlineDefaultMethod.java new file mode 100644 index 00000000000..609eaf217d5 --- /dev/null +++ b/hotspot/test/compiler/inlining/InlineDefaultMethod.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026735 + * @summary CHA in C1 should make correct decisions about default methods + * @run main/othervm -Xcomp -XX:CompileOnly=InlineDefaultMethod::test -XX:TieredStopAtLevel=1 InlineDefaultMethod + */ + + +interface InterfaceWithDefaultMethod0 { + default public int defaultMethod() { + return 1; + } +} + +interface InterfaceWithDefaultMethod1 extends InterfaceWithDefaultMethod0 { } + +abstract class Subtype implements InterfaceWithDefaultMethod1 { } + +class Decoy extends Subtype { + public int defaultMethod() { + return 2; + } +} + +class Instance extends Subtype { } + +public class InlineDefaultMethod { + public static int test(InterfaceWithDefaultMethod1 x) { + return x.defaultMethod(); + } + public static void main(String[] args) { + InterfaceWithDefaultMethod1 a = new Decoy(); + InterfaceWithDefaultMethod1 b = new Instance(); + if (test(a) != 2 || + test(b) != 1) { + System.err.println("FAILED"); + System.exit(97); + } + System.err.println("PASSED"); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactICondTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactICondTest.java new file mode 100644 index 00000000000..8862160d8b4 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactICondTest.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8024924 + * @summary Test non constant addExact + * @compile AddExactICondTest.java + * @run main AddExactICondTest + * + */ + +public class AddExactICondTest { + public static int result = 0; + + public static void main(String[] args) { + for (int i = 0; i < 50000; ++i) { + runTest(); + } + } + + public static void runTest() { + int i = 7; + while (java.lang.Math.addExact(i, result) < 89361) { + if ((java.lang.Math.addExact(i, i) & 1) == 1) { + i += 3; + } else if ((i & 5) == 4) { + i += 7; + } else if ((i & 0xf) == 6) { + i += 2; + } else { + i += 1; + } + result += 2; + } + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java new file mode 100644 index 00000000000..77000a1d958 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactIConstantTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8024924 + * @summary Test constant addExact + * @compile AddExactIConstantTest.java Verify.java + * @run main AddExactIConstantTest + * + */ + +public class AddExactIConstantTest { + public static void main(String[] args) { + Verify.ConstantTest.verify(new Verify.AddExactI()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoadTest.java new file mode 100644 index 00000000000..2d96bb8b8a6 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoadTest.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8024924 + * @summary Test non constant addExact + * @compile AddExactILoadTest.java Verify.java + * @run main AddExactILoadTest + * + */ + +public class AddExactILoadTest { + public static void main(String[] args) { + Verify.LoadTest.init(); + Verify.LoadTest.verify(new Verify.AddExactI()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java new file mode 100644 index 00000000000..99aae0d7b21 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactILoopDependentTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8024924 + * @summary Test non constant addExact + * @compile AddExactILoopDependentTest.java Verify.java + * @run main AddExactILoopDependentTest + * + */ + +public class AddExactILoopDependentTest { + public static void main(String[] args) { + Verify.LoopDependentTest.verify(new Verify.AddExactI()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java new file mode 100644 index 00000000000..b3a24758569 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactINonConstantTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8024924 + * @summary Test non constant addExact + * @compile AddExactINonConstantTest.java Verify.java + * @run main AddExactINonConstantTest + * + */ + +public class AddExactINonConstantTest { + public static void main(String[] args) { + Verify.NonConstantTest.verify(new Verify.AddExactI()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java new file mode 100644 index 00000000000..d111b66ce82 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8025657 + * @summary Test repeating addExact + * @compile AddExactIRepeatTest.java Verify.java + * @run main AddExactIRepeatTest + * + */ + +public class AddExactIRepeatTest { + public static void main(String[] args) { + runTest(new Verify.AddExactI()); + } + + public static int nonExact(int x, int y, Verify.BinaryMethod method) { + int result = method.unchecked(x, y); + result += method.unchecked(x, y); + result += method.unchecked(x, y); + result += method.unchecked(x, y); + return result; + } + + public static void runTest(Verify.BinaryMethod method) { + java.util.Random rnd = new java.util.Random(); + for (int i = 0; i < 50000; ++i) { + int x = Integer.MAX_VALUE - 10; + int y = Integer.MAX_VALUE - 10 + rnd.nextInt(5); + + int c = rnd.nextInt() / 2; + int d = rnd.nextInt() / 2; + + int a = catchingExact(x, y, method); + + if (a != 36) { + throw new RuntimeException("a != 36 : " + a); + } + + int b = nonExact(c, d, method); + int n = exact(c, d, method); + + + if (n != b) { + throw new RuntimeException("n != b : " + n + " != " + b); + } + } + } + + public static int exact(int x, int y, Verify.BinaryMethod method) { + int result = 0; + result += method.checkMethod(x, y); + result += method.checkMethod(x, y); + result += method.checkMethod(x, y); + result += method.checkMethod(x, y); + return result; + } + + public static int catchingExact(int x, int y, Verify.BinaryMethod method) { + int result = 0; + try { + result += 5; + result = method.checkMethod(x, y); + } catch (ArithmeticException e) { + result += 1; + } + try { + result += 6; + + result += method.checkMethod(x, y); + } catch (ArithmeticException e) { + result += 2; + } + try { + result += 7; + result += method.checkMethod(x, y); + } catch (ArithmeticException e) { + result += 3; + } + try { + result += 8; + result += method.checkMethod(x, y); + } catch (ArithmeticException e) { + result += 4; + } + return result; + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java new file mode 100644 index 00000000000..dc751406192 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactLConstantTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test constant addExact + * @compile AddExactLConstantTest.java Verify.java + * @run main AddExactLConstantTest + * + */ + +public class AddExactLConstantTest { + public static void main(String[] args) { + Verify.ConstantLongTest.verify(new Verify.AddExactL()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java new file mode 100644 index 00000000000..efd5fd7c92b --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactLNonConstantTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test non constant addExact + * @compile AddExactLNonConstantTest.java Verify.java + * @run main AddExactLNonConstantTest + * + */ + +public class AddExactLNonConstantTest { + public static void main(String[] args) { + Verify.NonConstantLongTest.verify(new Verify.AddExactL()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/CompareTest.java b/hotspot/test/compiler/intrinsics/mathexact/CompareTest.java new file mode 100644 index 00000000000..f6785c07c69 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/CompareTest.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026722 + * @summary Verify that the compare after addExact is a signed compare + * @compile CompareTest.java + * @run main CompareTest + * + */ + +public class CompareTest { + public static long store = 0; + public static long addValue = 1231; + + public static void main(String[] args) { + for (int i = 0; i < 20000; ++i) { + runTest(i, i); + runTest(i-1, i); + } + } + + public static long create(long value, int v) { + if ((value | v) == 0) { + return 0; + } + + // C2 turned this test into unsigned test when a control edge was set on the Cmp + if (value < -31557014167219200L || value > 31556889864403199L) { + throw new RuntimeException("error"); + } + + return value; + } + + public static void runTest(long value, int value2) { + long res = Math.addExact(value, addValue); + store = create(res, Math.floorMod(value2, 100000)); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/DecExactITest.java b/hotspot/test/compiler/intrinsics/mathexact/DecExactITest.java new file mode 100644 index 00000000000..7e6e1ca3bde --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/DecExactITest.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test decrementExact + * @compile DecExactITest.java Verify.java + * @run main DecExactITest + * + */ + +public class DecExactITest { + public static int[] values = {1, 1, 1, 1}; + public static int[] minvalues = {Integer.MIN_VALUE, Integer.MIN_VALUE}; + + public static void main(String[] args) { + runTest(new Verify.DecExactI()); + } + + public static void runTest(Verify.UnaryMethod method) { + for (int i = 0; i < 20000; ++i) { + Verify.verifyUnary(Integer.MIN_VALUE, method); + Verify.verifyUnary(minvalues[0], method); + Verify.verifyUnary(Integer.MIN_VALUE - values[2], method); + Verify.verifyUnary(0, method); + Verify.verifyUnary(values[2], method); + Verify.verifyUnary(Integer.MAX_VALUE, method); + Verify.verifyUnary(Integer.MIN_VALUE - values[0] + values[3], method); + Verify.verifyUnary(Integer.MIN_VALUE + 1 - values[0], method); + } + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/DecExactLTest.java b/hotspot/test/compiler/intrinsics/mathexact/DecExactLTest.java new file mode 100644 index 00000000000..7dca00b963e --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/DecExactLTest.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test decrementExact + * @compile DecExactITest.java Verify.java + * @run main DecExactITest + * + */ + +public class DecExactLTest { + public static long[] values = {1, 1, 1, 1}; + public static long[] minvalues = {Long.MIN_VALUE, Long.MIN_VALUE}; + + public static void main(String[] args) { + runTest(new Verify.DecExactL()); + } + + public static void runTest(Verify.UnaryLongMethod method) { + for (int i = 0; i < 20000; ++i) { + Verify.verifyUnary(Long.MIN_VALUE, method); + Verify.verifyUnary(minvalues[0], method); + Verify.verifyUnary(Long.MIN_VALUE - values[2], method); + Verify.verifyUnary(0, method); + Verify.verifyUnary(values[2], method); + Verify.verifyUnary(Long.MAX_VALUE, method); + Verify.verifyUnary(Long.MIN_VALUE - values[0] + values[3], method); + Verify.verifyUnary(Long.MIN_VALUE + 1 - values[0], method); + } + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/IncExactITest.java b/hotspot/test/compiler/intrinsics/mathexact/IncExactITest.java new file mode 100644 index 00000000000..9f7ddbd3211 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/IncExactITest.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test incrementExact + * @compile IncExactITest.java Verify.java + * @run main IncExactITest + * + */ + + +public class IncExactITest { + public static int[] values = {1, 1, 1, 1}; + public static void main(String[] args) { + runTest(new Verify.IncExactI()); + } + + public static void runTest(Verify.UnaryMethod method) { + for (int i = 0; i < 20000; ++i) { + Verify.verifyUnary(Integer.MIN_VALUE, method); + Verify.verifyUnary(Integer.MAX_VALUE - 1, method); + Verify.verifyUnary(0, method); + Verify.verifyUnary(values[1], method); + Verify.verifyUnary(Integer.MAX_VALUE, method); + Verify.verifyUnary(Integer.MAX_VALUE - values[0] + values[3], method); + Verify.verifyUnary(Integer.MAX_VALUE - 1 + values[0], method); + } + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/IncExactLTest.java b/hotspot/test/compiler/intrinsics/mathexact/IncExactLTest.java new file mode 100644 index 00000000000..755d81908ce --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/IncExactLTest.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test incrementExact + * @compile IncExactLTest.java Verify.java + * @run main IncExactLTest + * + */ + +public class IncExactLTest { + public static long[] values = {1, 1, 1, 1}; + public static void main(String[] args) { + runTest(new Verify.IncExactL()); + } + + public static void runTest(Verify.UnaryLongMethod method) { + for (int i = 0; i < 20000; ++i) { + Verify.verifyUnary(Long.MIN_VALUE, method); + Verify.verifyUnary(Long.MAX_VALUE - 1, method); + Verify.verifyUnary(0, method); + Verify.verifyUnary(values[1], method); + Verify.verifyUnary(Long.MAX_VALUE, method); + Verify.verifyUnary(Long.MAX_VALUE - values[0] + values[3], method); + Verify.verifyUnary(Long.MAX_VALUE - 1 + values[0], method); + } + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactICondTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactICondTest.java new file mode 100644 index 00000000000..5f3e1e64568 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactICondTest.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test multiplyExact as condition + * @compile MulExactICondTest.java + * @run main MulExactICondTest + * + */ + +public class MulExactICondTest { + public static int result = 0; + + public static void main(String[] args) { + for (int i = 0; i < 50000; ++i) { + runTest(); + } + } + + public static void runTest() { + int i = 7; + while (java.lang.Math.multiplyExact(i, result) < 89361) { + if ((java.lang.Math.multiplyExact(i, i) & 1) == 1) { + i += 3; + } else if ((i & 5) == 4) { + i += 7; + } else if ((i & 0xf) == 6) { + i += 2; + } else { + i += 1; + } + result += 2; + } + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java new file mode 100644 index 00000000000..120bef5e9b9 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactIConstantTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test constant multiplyExact + * @compile MulExactIConstantTest.java Verify.java + * @run main MulExactIConstantTest + * + */ + +public class MulExactIConstantTest { + public static void main(String[] args) { + Verify.ConstantTest.verify(new Verify.MulExactI()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoadTest.java new file mode 100644 index 00000000000..36aa3d46230 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoadTest.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test multiplyExact + * @compile MulExactILoadTest.java Verify.java + * @run main MulExactILoadTest + * + */ + +public class MulExactILoadTest { + public static void main(String[] args) { + Verify.LoadTest.init(); + Verify.LoadTest.verify(new Verify.MulExactI()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java new file mode 100644 index 00000000000..5ba4ad3cfc3 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactILoopDependentTest.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test loop dependent multiplyExact + * @compile MulExactILoopDependentTest.java Verify.java + * @run main MulExactILoopDependentTest + * + */ +public class MulExactILoopDependentTest { + public static void main(String[] args) { + Verify.LoopDependentTest.verify(new Verify.MulExactI()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java new file mode 100644 index 00000000000..e108059885b --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactINonConstantTest.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test non constant multiplyExact + * @compile MulExactINonConstantTest.java Verify.java + * @run main MulExactINonConstantTest + * + */ + +public class MulExactINonConstantTest { + public static void main(String[] args) { + Verify.NonConstantTest.verify(new Verify.MulExactI()); + Verify.LoadTest.verify(new Verify.MulExactI()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java new file mode 100644 index 00000000000..dd14ce21ed6 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test repeating multiplyExact + * @compile MulExactIRepeatTest.java Verify.java + * @run main MulExactIRepeatTest + * + */ + +public class MulExactIRepeatTest { + public static void main(String[] args) { + runTest(new Verify.MulExactI()); + } + + public static int nonExact(int x, int y, Verify.BinaryMethod method) { + int result = method.unchecked(x, y); + result += method.unchecked(x, y); + result += method.unchecked(x, y); + result += method.unchecked(x, y); + return result; + } + + public static void runTest(Verify.BinaryMethod method) { + java.util.Random rnd = new java.util.Random(); + for (int i = 0; i < 50000; ++i) { + int x = Integer.MAX_VALUE - 10; + int y = Integer.MAX_VALUE - 10 + rnd.nextInt(5); + + int c = rnd.nextInt() / 10; + int d = rnd.nextInt(9); + + int a = catchingExact(x, y, method); + + if (a != 36) { + throw new RuntimeException("a != 36 : " + a); + } + + int b = nonExact(c, d, method); + int n = exact(c, d, method); + + + if (n != b) { + throw new RuntimeException("n != b : " + n + " != " + b); + } + } + } + + public static int exact(int x, int y, Verify.BinaryMethod method) { + int result = 0; + result += method.checkMethod(x, y); + result += method.checkMethod(x, y); + result += method.checkMethod(x, y); + result += method.checkMethod(x, y); + return result; + } + + public static int catchingExact(int x, int y, Verify.BinaryMethod method) { + int result = 0; + try { + result += 5; + result = method.checkMethod(x, y); + } catch (ArithmeticException e) { + result += 1; + } + try { + result += 6; + + result += method.checkMethod(x, y); + } catch (ArithmeticException e) { + result += 2; + } + try { + result += 7; + result += method.checkMethod(x, y); + } catch (ArithmeticException e) { + result += 3; + } + try { + result += 8; + result += method.checkMethod(x, y); + } catch (ArithmeticException e) { + result += 4; + } + return result; + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java new file mode 100644 index 00000000000..c687cc276f2 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactLConstantTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test constant mulExact + * @compile MulExactLConstantTest.java Verify.java + * @run main MulExactLConstantTest + * + */ + +public class MulExactLConstantTest { + public static void main(String[] args) { + Verify.ConstantLongTest.verify(new Verify.MulExactL()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java new file mode 100644 index 00000000000..f9d82ed0876 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactLNonConstantTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test non constant mulExact + * @compile MulExactLNonConstantTest.java Verify.java + * @run main MulExactLNonConstantTest + * + */ + +public class MulExactLNonConstantTest { + public static void main(String[] args) { + Verify.NonConstantLongTest.verify(new Verify.MulExactL()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java new file mode 100644 index 00000000000..ba49d778762 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactIConstantTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test constant negExact + * @compile NegExactIConstantTest.java Verify.java + * @run main NegExactIConstantTest + * + */ + +public class NegExactIConstantTest { + public static void main(String[] args) { + Verify.ConstantTest.verify(new Verify.UnaryToBinary(new Verify.NegExactI())); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoadTest.java new file mode 100644 index 00000000000..371f3aedb6c --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoadTest.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test negExact + * @compile NegExactILoadTest.java Verify.java + * @run main NegExactILoadTest + * + */ + +public class NegExactILoadTest { + public static void main(String[] args) { + Verify.LoadTest.init(); + Verify.LoadTest.verify(new Verify.UnaryToBinary(new Verify.NegExactI())); + } + +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java new file mode 100644 index 00000000000..882f80b91a1 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactILoopDependentTest.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test negExact loop dependent + * @compile NegExactILoopDependentTest.java Verify.java + * @run main NegExactILoopDependentTest + * + */ +public class NegExactILoopDependentTest { + public static void main(String[] args) { + Verify.LoopDependentTest.verify(new Verify.UnaryToBinary(new Verify.NegExactI())); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java new file mode 100644 index 00000000000..6f044f0d969 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactINonConstantTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test non constant negExact + * @compile NegExactINonConstantTest.java Verify.java + * @run main NegExactINonConstantTest + * + */ + +public class NegExactINonConstantTest { + public static void main(String[] args) { + Verify.NonConstantTest.verify(new Verify.UnaryToBinary(new Verify.NegExactI())); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java new file mode 100644 index 00000000000..382cd5c5f9e --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactLConstantTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test constant negExact + * @compile NegExactLConstantTest.java Verify.java + * @run main NegExactLConstantTest + * + */ + +public class NegExactLConstantTest { + public static void main(String[] args) { + Verify.ConstantLongTest.verify(new Verify.UnaryToBinaryLong(new Verify.NegExactL())); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java new file mode 100644 index 00000000000..0bcad8b2b78 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/NegExactLNonConstantTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test constant negExact + * @compile NegExactLNonConstantTest.java Verify.java + * @run main NegExactLNonConstantTest + * + */ + +public class NegExactLNonConstantTest { + public static void main(String[] args) { + Verify.NonConstantLongTest.verify(new Verify.UnaryToBinaryLong(new Verify.NegExactL())); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java b/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java new file mode 100644 index 00000000000..211dc8baff1 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8027444 + * @summary Test nested loops + * @compile NestedMathExactTest.java + * @run main NestedMathExactTest + * + */ + +public class NestedMathExactTest { + public static final int LIMIT = 100; + public static int[] result = new int[LIMIT]; + public static int value = 17; + + public static void main(String[] args) { + for (int i = 0; i < 100; ++i) { + result[i] = runTest(); + } + } + + public static int runTest() { + int sum = 0; + for (int j = 0; j < 100000; j = Math.addExact(j, 1)) { + sum = 1; + for (int i = 0; i < 5; ++i) { + sum *= value; + } + } + return sum; + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactICondTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactICondTest.java new file mode 100644 index 00000000000..f539bdc7cbe --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactICondTest.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test subtractExact as condition + * @compile SubExactICondTest.java Verify.java + * @run main SubExactICondTest + * + */ + +public class SubExactICondTest { + public static int result = 0; + + public static void main(String[] args) { + for (int i = 0; i < 50000; ++i) { + runTest(); + } + } + + public static void runTest() { + int i = 7; + while (java.lang.Math.subtractExact(i, result) > -31361) { + if ((java.lang.Math.subtractExact(i, i) & 1) == 1) { + i -= 3; + } else if ((i & 5) == 4) { + i -= 7; + } else if ((i & 0xf) == 6) { + i -= 2; + } else { + i -= 1; + } + result += 2; + } + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java new file mode 100644 index 00000000000..b450bd90b11 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactIConstantTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test constant subtractExact + * @compile SubExactIConstantTest.java Verify.java + * @run main SubExactIConstantTest + * + */ + +public class SubExactIConstantTest { + public static void main(String[] args) { + Verify.ConstantTest.verify(new Verify.SubExactI()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactILoadTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoadTest.java new file mode 100644 index 00000000000..af2ed018258 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoadTest.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test non constant subtractExact + * @compile SubExactILoadTest.java Verify.java + * @run main SubExactILoadTest + * + */ + +public class SubExactILoadTest { + public static void main(String[] args) { + Verify.LoadTest.init(); + Verify.LoadTest.verify(new Verify.SubExactI()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java new file mode 100644 index 00000000000..67ebcbca321 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactILoopDependentTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test non constant subtractExact + * @compile SubExactILoopDependentTest.java Verify.java + * @run main SubExactILoopDependentTest + * + */ + +public class SubExactILoopDependentTest { + public static void main(String[] args) { + Verify.LoopDependentTest.verify(new Verify.SubExactI()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java new file mode 100644 index 00000000000..b8153810892 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactINonConstantTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test non constant subtractExact + * @compile SubExactINonConstantTest.java Verify.java + * @run main SubExactINonConstantTest + * + */ + +public class SubExactINonConstantTest { + public static void main(String[] args) { + Verify.NonConstantTest.verify(new Verify.SubExactI()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java new file mode 100644 index 00000000000..3c57f6f3f76 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @summary Test repeating subtractExact + * @compile SubExactIRepeatTest.java Verify.java + * @run main SubExactIRepeatTest + * + */ + +import java.lang.ArithmeticException; + +public class SubExactIRepeatTest { + public static void main(String[] args) { + runTest(new Verify.SubExactI()); + } + + public static int nonExact(int x, int y, Verify.BinaryMethod method) { + int result = method.unchecked(x, y); + result += method.unchecked(x, y); + result += method.unchecked(x, y); + result += method.unchecked(x, y); + return result; + } + + public static void runTest(Verify.BinaryMethod method) { + java.util.Random rnd = new java.util.Random(); + for (int i = 0; i < 50000; ++i) { + int x = Integer.MIN_VALUE + 10; + int y = Integer.MAX_VALUE - 10 + rnd.nextInt(5); + + int c = rnd.nextInt() / 2; + int d = rnd.nextInt() / 2; + + int a = catchingExact(x, y, method); + + if (a != 36) { + throw new RuntimeException("a != 36 : " + a); + } + + int b = nonExact(c, d, method); + int n = exact(c, d, method); + + + if (n != b) { + throw new RuntimeException("n != b : " + n + " != " + b); + } + } + } + + public static int exact(int x, int y, Verify.BinaryMethod method) { + int result = 0; + result += method.checkMethod(x, y); + result += method.checkMethod(x, y); + result += method.checkMethod(x, y); + result += method.checkMethod(x, y); + return result; + } + + public static int catchingExact(int x, int y, Verify.BinaryMethod method) { + int result = 0; + try { + result += 5; + result = method.checkMethod(x, y); + } catch (ArithmeticException e) { + result += 1; + } + try { + result += 6; + + result += method.checkMethod(x, y); + } catch (ArithmeticException e) { + result += 2; + } + try { + result += 7; + result += method.checkMethod(x, y); + } catch (ArithmeticException e) { + result += 3; + } + try { + result += 8; + result += method.checkMethod(x, y); + } catch (ArithmeticException e) { + result += 4; + } + return result; + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java new file mode 100644 index 00000000000..ec554d7662b --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @bug 8027353 + * @summary Test constant subtractExact + * @compile SubExactLConstantTest.java Verify.java + * @run main SubExactLConstantTest + * + */ + +public class SubExactLConstantTest { + public static void main(String[] args) { + Verify.ConstantLongTest.verify(new Verify.SubExactL()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java new file mode 100644 index 00000000000..86ecf20f366 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026844 + * @bug 8027353 + * @summary Test non constant subtractExact + * @compile SubExactLNonConstantTest.java Verify.java + * @run main SubExactLNonConstantTest + * + */ + +public class SubExactLNonConstantTest { + public static void main(String[] args) { + Verify.NonConstantLongTest.verify(new Verify.SubExactL()); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/Verify.java b/hotspot/test/compiler/intrinsics/mathexact/Verify.java new file mode 100644 index 00000000000..a4d728bfd6b --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/Verify.java @@ -0,0 +1,662 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Verify { + public static String throwWord(boolean threw) { + return (threw ? "threw" : "didn't throw"); + } + + public static void verifyResult(UnaryMethod method, int result1, int result2, boolean exception1, boolean exception2, int value) { + if (exception1 != exception2) { + throw new RuntimeException("Intrinsic version [" + method.name() + "]" + throwWord(exception1) + " exception, NonIntrinsic version" + throwWord(exception2) + " for: " + value); + } + if (result1 != result2) { + throw new RuntimeException("Intrinsic version [" + method.name() + "] returned: " + result1 + " while NonIntrinsic version returned: " + result2); + } + } + + public static void verifyResult(UnaryLongMethod method, long result1, long result2, boolean exception1, boolean exception2, long value) { + if (exception1 != exception2) { + throw new RuntimeException("Intrinsic version [" + method.name() + "]" + throwWord(exception1) + " exception, NonIntrinsic version" + throwWord(exception2) + " for: " + value); + } + if (result1 != result2) { + throw new RuntimeException("Intrinsic version [" + method.name() + "] returned: " + result1 + " while NonIntrinsic version returned: " + result2); + } + } + + private static void verifyResult(BinaryMethod method, int result1, int result2, boolean exception1, boolean exception2, int a, int b) { + if (exception1 != exception2) { + throw new RuntimeException("Intrinsic version [" + method.name() + "]" + throwWord(exception1) + " exception, NonIntrinsic version " + throwWord(exception2) + " for: " + a + " + " + b); + } + if (result1 != result2) { + throw new RuntimeException("Intrinsic version [" + method.name() + "] returned: " + result1 + " while NonIntrinsic version returned: " + result2); + } + } + + private static void verifyResult(BinaryLongMethod method, long result1, long result2, boolean exception1, boolean exception2, long a, long b) { + if (exception1 != exception2) { + throw new RuntimeException("Intrinsic version [" + method.name() + "]" + throwWord(exception1) + " exception, NonIntrinsic version " + throwWord(exception2) + " for: " + a + " + " + b); + } + if (result1 != result2) { + throw new RuntimeException("Intrinsic version [" + method.name() + "] returned: " + result1 + " while NonIntrinsic version returned: " + result2); + } + } + + + public static void verifyUnary(int a, UnaryMethod method) { + boolean exception1 = false, exception2 = false; + int result1 = 0, result2 = 0; + try { + result1 = method.checkMethod(a); + } catch (ArithmeticException e) { + exception1 = true; + } + try { + result2 = method.safeMethod(a); + } catch (ArithmeticException e) { + exception2 = true; + } + + verifyResult(method, result1, result2, exception1, exception2, a); + } + + public static void verifyUnary(long a, UnaryLongMethod method) { + boolean exception1 = false, exception2 = false; + long result1 = 0, result2 = 0; + try { + result1 = method.checkMethod(a); + } catch (ArithmeticException e) { + exception1 = true; + } + try { + result2 = method.safeMethod(a); + } catch (ArithmeticException e) { + exception2 = true; + } + + verifyResult(method, result1, result2, exception1, exception2, a); + } + + + public static void verifyBinary(int a, int b, BinaryMethod method) { + boolean exception1 = false, exception2 = false; + int result1 = 0, result2 = 0; + try { + result1 = method.checkMethod(a, b); + } catch (ArithmeticException e) { + exception1 = true; + } + try { + result2 = method.safeMethod(a, b); + } catch (ArithmeticException e) { + exception2 = true; + } + + verifyResult(method, result1, result2, exception1, exception2, a, b); + } + + public static void verifyBinary(long a, long b, BinaryLongMethod method) { + boolean exception1 = false, exception2 = false; + long result1 = 0, result2 = 0; + try { + result1 = method.checkMethod(a, b); + } catch (ArithmeticException e) { + exception1 = true; + } + try { + result2 = method.safeMethod(a, b); + } catch (ArithmeticException e) { + exception2 = true; + } + + verifyResult(method, result1, result2, exception1, exception2, a, b); + } + + + public static class LoadTest { + public static java.util.Random rnd = new java.util.Random(); + public static int[] values = new int[256]; + + public static void init() { + for (int i = 0; i < values.length; ++i) { + values[i] = rnd.nextInt(); + } + } + + public static void verify(BinaryMethod method) { + for (int i = 0; i < 50000; ++i) { + Verify.verifyBinary(values[i & 255], values[i & 255] - i, method); + Verify.verifyBinary(values[i & 255] + i, values[i & 255] - i, method); + Verify.verifyBinary(values[i & 255], values[i & 255], method); + if ((i & 1) == 1 && i > 5) { + Verify.verifyBinary(values[i & 255] + i, values[i & 255] - i, method); + } else { + Verify.verifyBinary(values[i & 255] - i, values[i & 255] + i, method); + } + Verify.verifyBinary(values[i & 255], values[(i + 1) & 255], method); + } + } + } + + public static class NonConstantTest { + public static java.util.Random rnd = new java.util.Random(); + + public static void verify(BinaryMethod method) { + for (int i = 0; i < 50000; ++i) { + int rnd1 = rnd.nextInt(), rnd2 = rnd.nextInt(); + Verify.verifyBinary(rnd1, rnd2, method); + Verify.verifyBinary(rnd1, rnd2 + 1, method); + Verify.verifyBinary(rnd1 + 1, rnd2, method); + Verify.verifyBinary(rnd1 - 1, rnd2, method); + Verify.verifyBinary(rnd1, rnd2 - 1, method); + } + } + } + + public static class NonConstantLongTest { + public static long[] values = { Long.MIN_VALUE, Long.MAX_VALUE, 0, Long.MAX_VALUE - 1831 }; + public static java.util.Random rnd = new java.util.Random(); + + public static void verify(BinaryLongMethod method) { + for (int i = 0; i < 50000; ++i) { + long rnd1 = rnd.nextLong(), rnd2 = rnd.nextLong(); + Verify.verifyBinary(rnd1, rnd2, method); + Verify.verifyBinary(rnd1, rnd2 + 1, method); + Verify.verifyBinary(rnd1 + 1, rnd2, method); + Verify.verifyBinary(rnd1 - 1, rnd2, method); + Verify.verifyBinary(rnd1, rnd2 - 1, method); + Verify.verifyBinary(rnd1 + Long.MAX_VALUE - rnd2, rnd2 + 1, method); + Verify.verifyBinary(values[0], values[2], method); + Verify.verifyBinary(values[1], values[2], method); + Verify.verifyBinary(values[3], 74L, method); + } + } + } + + public static class LoopDependentTest { + public static java.util.Random rnd = new java.util.Random(); + + public static void verify(BinaryMethod method) { + int rnd1 = rnd.nextInt(), rnd2 = rnd.nextInt(); + runTest(rnd1, rnd2, method); + } + + private static void runTest(int rnd1, int rnd2, BinaryMethod method) { + for (int i = 0; i < 50000; ++i) { + Verify.verifyBinary(rnd1 + i, rnd2 + i, method); + Verify.verifyBinary(rnd1 + i, rnd2 + (i & 0xff), method); + Verify.verifyBinary(rnd1 - i, rnd2 - (i & 0xff), method); + Verify.verifyBinary(rnd1 + i + 1, rnd2 + i + 2, method); + Verify.verifyBinary(rnd1 + i * 2, rnd2 + i, method); + } + } + } + + public static class ConstantTest { + public static void verify(BinaryMethod method) { + for (int i = 0; i < 50000; ++i) { + Verify.verifyBinary(5, 7, method); + Verify.verifyBinary(Integer.MAX_VALUE, 1, method); + Verify.verifyBinary(Integer.MIN_VALUE, -1, method); + Verify.verifyBinary(Integer.MAX_VALUE, -1, method); + Verify.verifyBinary(Integer.MIN_VALUE, 1, method); + Verify.verifyBinary(Integer.MAX_VALUE / 2, Integer.MAX_VALUE / 2, method); + Verify.verifyBinary(Integer.MAX_VALUE / 2, (Integer.MAX_VALUE / 2) + 3, method); + Verify.verifyBinary(Integer.MAX_VALUE, Integer.MIN_VALUE, method); + } + } + } + + public static class ConstantLongTest { + public static void verify(BinaryLongMethod method) { + for (int i = 0; i < 50000; ++i) { + Verify.verifyBinary(5, 7, method); + Verify.verifyBinary(Long.MAX_VALUE, 1, method); + Verify.verifyBinary(Long.MIN_VALUE, -1, method); + Verify.verifyBinary(Long.MAX_VALUE, -1, method); + Verify.verifyBinary(Long.MIN_VALUE, 1, method); + Verify.verifyBinary(Long.MAX_VALUE / 2, Long.MAX_VALUE / 2, method); + Verify.verifyBinary(Long.MAX_VALUE / 2, (Long.MAX_VALUE / 2) + 3, method); + Verify.verifyBinary(Long.MAX_VALUE, Long.MIN_VALUE, method); + } + } + } + + public static interface BinaryMethod { + int safeMethod(int a, int b); + int checkMethod(int a, int b); + int unchecked(int a, int b); + String name(); + } + + public static interface UnaryMethod { + int safeMethod(int value); + int checkMethod(int value); + int unchecked(int value); + String name(); + } + + public static interface BinaryLongMethod { + long safeMethod(long a, long b); + long checkMethod(long a, long b); + long unchecked(long a, long b); + String name(); + } + + public static interface UnaryLongMethod { + long safeMethod(long value); + long checkMethod(long value); + long unchecked(long value); + String name(); + } + + public static class UnaryToBinary implements BinaryMethod { + private final UnaryMethod method; + public UnaryToBinary(UnaryMethod method) { + this.method = method; + } + + @Override + public int safeMethod(int a, int b) { + return method.safeMethod(a); + } + + @Override + public int checkMethod(int a, int b) { + return method.checkMethod(a); + } + + @Override + public int unchecked(int a, int b) { + return method.unchecked(a); + + } + + @Override + public String name() { + return method.name(); + } + } + + public static class UnaryToBinaryLong implements BinaryLongMethod { + private final UnaryLongMethod method; + public UnaryToBinaryLong(UnaryLongMethod method) { + this.method = method; + } + + @Override + public long safeMethod(long a, long b) { + return method.safeMethod(a); + } + + @Override + public long checkMethod(long a, long b) { + return method.checkMethod(a); + } + + @Override + public long unchecked(long a, long b) { + return method.unchecked(a); + + } + + @Override + public String name() { + return method.name(); + } + } + + + public static class AddExactI implements BinaryMethod { + @Override + public int safeMethod(int x, int y) { + int r = x + y; + // HD 2-12 Overflow iff both arguments have the opposite sign of the result + if (((x ^ r) & (y ^ r)) < 0) { + throw new ArithmeticException("integer overflow"); + } + return r; + + } + + @Override + public int checkMethod(int a, int b) { + return Math.addExact(a, b); + } + + @Override + public String name() { + return "addExact"; + } + + @Override + public int unchecked(int a, int b) { + return a + b; + } + } + + public static class AddExactL implements BinaryLongMethod { + @Override + public long safeMethod(long x, long y) { + long r = x + y; + // HD 2-12 Overflow iff both arguments have the opposite sign of the result + if (((x ^ r) & (y ^ r)) < 0) { + throw new ArithmeticException("integer overflow"); + } + return r; + + } + + @Override + public long checkMethod(long a, long b) { + return Math.addExact(a, b); + } + + @Override + public String name() { + return "addExactLong"; + } + + @Override + public long unchecked(long a, long b) { + return a + b; + } + } + + public static class MulExactI implements BinaryMethod { + @Override + public int safeMethod(int x, int y) { + long r = (long)x * (long)y; + if ((int)r != r) { + throw new ArithmeticException("integer overflow"); + } + return (int)r; + + } + + @Override + public int checkMethod(int a, int b) { + return Math.multiplyExact(a, b); + } + + @Override + public int unchecked(int a, int b) { + return a * b; + } + + @Override + public String name() { + return "multiplyExact"; + } + } + + public static class MulExactL implements BinaryLongMethod { + @Override + public long safeMethod(long x, long y) { + long r = x * y; + long ax = Math.abs(x); + long ay = Math.abs(y); + if (((ax | ay) >>> 31 != 0)) { + // Some bits greater than 2^31 that might cause overflow + // Check the result using the divide operator + // and check for the special case of Long.MIN_VALUE * -1 + if (((y != 0) && (r / y != x)) || + (x == Long.MIN_VALUE && y == -1)) { + throw new ArithmeticException("long overflow"); + } + } + return r; + } + + @Override + public long checkMethod(long a, long b) { + return Math.multiplyExact(a, b); + } + + @Override + public long unchecked(long a, long b) { + return a * b; + } + + @Override + public String name() { + return "multiplyExact"; + } + } + + public static class NegExactL implements UnaryLongMethod { + @Override + public long safeMethod(long a) { + if (a == Long.MIN_VALUE) { + throw new ArithmeticException("long overflow"); + } + + return -a; + + } + + @Override + public long checkMethod(long value) { + return Math.negateExact(value); + } + + @Override + public long unchecked(long value) { + return -value; + } + + @Override + public String name() { + return "negateExactLong"; + } + } + + public static class NegExactI implements UnaryMethod { + @Override + public int safeMethod(int a) { + if (a == Integer.MIN_VALUE) { + throw new ArithmeticException("integer overflow"); + } + + return -a; + + } + + @Override + public int checkMethod(int value) { + return Math.negateExact(value); + } + + @Override + public int unchecked(int value) { + return -value; + } + + @Override + public String name() { + return "negateExact"; + } + } + + public static class SubExactI implements BinaryMethod { + @Override + public int safeMethod(int x, int y) { + int r = x - y; + // HD 2-12 Overflow iff the arguments have different signs and + // the sign of the result is different than the sign of x + if (((x ^ y) & (x ^ r)) < 0) { + throw new ArithmeticException("integer overflow"); + } + return r; + } + + @Override + public int checkMethod(int a, int b) { + return Math.subtractExact(a, b); + } + + @Override + public int unchecked(int a, int b) { + return a - b; + } + + @Override + public String name() { + return "subtractExact"; + } + } + + public static class SubExactL implements BinaryLongMethod { + @Override + public long safeMethod(long x, long y) { + long r = x - y; + // HD 2-12 Overflow iff the arguments have different signs and + // the sign of the result is different than the sign of x + if (((x ^ y) & (x ^ r)) < 0) { + throw new ArithmeticException("integer overflow"); + } + return r; + } + + @Override + public long checkMethod(long a, long b) { + return Math.subtractExact(a, b); + } + + @Override + public long unchecked(long a, long b) { + return a - b; + } + + @Override + public String name() { + return "subtractExactLong"; + } + } + + static class IncExactL implements UnaryLongMethod { + @Override + public long safeMethod(long a) { + if (a == Long.MAX_VALUE) { + throw new ArithmeticException("long overflow"); + } + + return a + 1L; + + } + + @Override + public long checkMethod(long value) { + return Math.incrementExact(value); + } + + @Override + public long unchecked(long value) { + return value + 1; + } + + @Override + public String name() { + return "incrementExactLong"; + } + } + + static class IncExactI implements UnaryMethod { + @Override + public int safeMethod(int a) { + if (a == Integer.MAX_VALUE) { + throw new ArithmeticException("integer overflow"); + } + + return a + 1; + } + + @Override + public int checkMethod(int value) { + return Math.incrementExact(value); + } + + @Override + public int unchecked(int value) { + return value + 1; + } + + @Override + public String name() { + return "incrementExact"; + } + } + + static class DecExactL implements UnaryLongMethod { + @Override + public long safeMethod(long a) { + if (a == Long.MIN_VALUE) { + throw new ArithmeticException("long overflow"); + } + + return a - 1L; + } + + @Override + public long checkMethod(long value) { + return Math.decrementExact(value); + } + + @Override + public long unchecked(long value) { + return value - 1; + } + + @Override + public String name() { + return "decExactLong"; + } + } + + static class DecExactI implements UnaryMethod { + @Override + public int safeMethod(int a) { + if (a == Integer.MIN_VALUE) { + throw new ArithmeticException("integer overflow"); + } + + return a - 1; + } + + @Override + public int checkMethod(int value) { + return Math.decrementExact(value); + } + + @Override + public int unchecked(int value) { + return value - 1; + } + + @Override + public String name() { + return "decrementExact"; + } + } + +} diff --git a/hotspot/test/compiler/intrinsics/stringequals/TestStringEqualsBadLength.java b/hotspot/test/compiler/intrinsics/stringequals/TestStringEqualsBadLength.java new file mode 100644 index 00000000000..0de5175d286 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/stringequals/TestStringEqualsBadLength.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8027445 + * @summary String.equals() may be called with a length whose upper bits are not cleared + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation TestStringEqualsBadLength + * + */ + +import java.util.Arrays; + +public class TestStringEqualsBadLength { + + int v1; + int v2; + + boolean m(String s1) { + int l = v2 - v1; // 0 - (-1) = 1. On 64 bit: 0xffffffff00000001 + char[] arr = new char[l]; + arr[0] = 'a'; + String s2 = new String(arr); + // The string length is not reloaded but the value computed is + // reused so pointer computation must not use + // 0xffffffff00000001 + return s2.equals(s1); + } + + // Same thing with String.compareTo() + int m2(String s1) { + int l = v2 - v1; + char[] arr = new char[l+1]; + arr[0] = 'a'; + arr[1] = 'b'; + String s2 = new String(arr); + return s2.compareTo(s1); + } + + // Same thing with equals() for arrays + boolean m3(char[] arr1) { + int l = v2 - v1; // 0 - (-1) = 1. On 64 bit: 0xffffffff00000001 + char[] arr2 = new char[l]; + arr2[0] = 'a'; + return Arrays.equals(arr2, arr1); + } + + static public void main(String[] args) { + TestStringEqualsBadLength tse = new TestStringEqualsBadLength(); + tse.v1 = -1; + tse.v2 = 0; + char[] arr = new char[1]; + arr[0] = 'a'; + for (int i = 0; i < 20000; i++) { + tse.m("a"); + tse.m2("ab"); + tse.m3(arr); + } + + System.out.println("TEST PASSED"); + } +} diff --git a/hotspot/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java b/hotspot/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java new file mode 100644 index 00000000000..0230702d7ed --- /dev/null +++ b/hotspot/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/** + * @test + * @bug 8026124 + * @summary Javascript file provoked assertion failure in linkResolver.cpp + * + * @run main/othervm CreatesInterfaceDotEqualsCallInfo + */ + +public class CreatesInterfaceDotEqualsCallInfo { + public static void main(String[] args) throws java.io.IOException { + String[] jsargs = { System.getProperty("test.src", ".") + + "/createsInterfaceDotEqualsCallInfo.js" }; + jdk.nashorn.tools.Shell.main(System.in, System.out, System.err, jsargs); + System.out.println("PASS, did not crash running Javascript"); + } +} diff --git a/hotspot/test/compiler/jsr292/createsInterfaceDotEqualsCallInfo.js b/hotspot/test/compiler/jsr292/createsInterfaceDotEqualsCallInfo.js new file mode 100644 index 00000000000..9c5b8e617a8 --- /dev/null +++ b/hotspot/test/compiler/jsr292/createsInterfaceDotEqualsCallInfo.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +var path = new java.io.File("/Users/someone").toPath(); +path.toString(); diff --git a/hotspot/test/compiler/jsr292/methodHandleExceptions/ByteClassLoader.java b/hotspot/test/compiler/jsr292/methodHandleExceptions/ByteClassLoader.java new file mode 100644 index 00000000000..de257ad71ff --- /dev/null +++ b/hotspot/test/compiler/jsr292/methodHandleExceptions/ByteClassLoader.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/** + * A minimal classloader for loading bytecodes that could not result from + * properly compiled Java. + * + * @author dr2chase + */ +public class ByteClassLoader extends ClassLoader { + /** + * (pre)load class name using classData for the definition. + * + * @param name + * @param classData + * @return + */ + public Class loadBytes(String name, byte[] classData) { + Class clazz = defineClass(name, classData, 0, classData.length); + resolveClass(clazz); + return clazz; + } +} diff --git a/hotspot/test/compiler/jsr292/methodHandleExceptions/C.java b/hotspot/test/compiler/jsr292/methodHandleExceptions/C.java new file mode 100644 index 00000000000..86678967faf --- /dev/null +++ b/hotspot/test/compiler/jsr292/methodHandleExceptions/C.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/** + * Test class -- implements I, which provides default for m, but this class + * declares it abstract which (should) hide the interface default, and throw + * an abstract method error if it is called (calling it requires bytecode hacking + * or inconsistent compilation). + */ +public abstract class C implements I { + public abstract int m(); +} diff --git a/hotspot/test/compiler/jsr292/methodHandleExceptions/I.java b/hotspot/test/compiler/jsr292/methodHandleExceptions/I.java new file mode 100644 index 00000000000..f4cc27e3994 --- /dev/null +++ b/hotspot/test/compiler/jsr292/methodHandleExceptions/I.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +public interface I { + default public int m() { return 1; } +} diff --git a/hotspot/test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java b/hotspot/test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java new file mode 100644 index 00000000000..2b41c15f87b --- /dev/null +++ b/hotspot/test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +import java.lang.reflect.InvocationTargetException; +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.Handle; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import jdk.internal.org.objectweb.asm.Opcodes; + +/** + * @test + * @bug 8025260 + * @summary Ensure that AbstractMethodError is thrown, not NullPointerException, through MethodHandles::jump_from_method_handle code path + * + * @compile -XDignore.symbol.file ByteClassLoader.java I.java C.java TestAMEnotNPE.java + * @run main/othervm TestAMEnotNPE + */ + +public class TestAMEnotNPE implements Opcodes { + + /** + * The bytes for D, a NOT abstract class extending abstract class C + * without supplying an implementation for abstract method m. + * There is a default method in the interface I, but it should lose to + * the abstract class. + + class D extends C { + D() { super(); } + // does not define m + } + + * @return + * @throws Exception + */ + public static byte[] bytesForD() throws Exception { + + ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES|ClassWriter.COMPUTE_MAXS); + MethodVisitor mv; + + cw.visit(V1_8, ACC_PUBLIC + ACC_SUPER, "D", null, "C", null); + + { + mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "C", "", "()V"); + mv.visitInsn(RETURN); + mv.visitMaxs(0, 0); + mv.visitEnd(); + } + cw.visitEnd(); + + return cw.toByteArray(); + } + + + /** + * The bytecodes for an invokeExact of a particular methodHandle, I.m, invoked on a D + + class T { + T() { super(); } // boring constructor + int test() { + MethodHandle mh = `I.m():int`; + D d = new D(); + return mh.invokeExact(d); // Should explode here, AbstractMethodError + } + } + + * @return + * @throws Exception + */ + public static byte[] bytesForT() throws Exception { + + ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES|ClassWriter.COMPUTE_MAXS); + MethodVisitor mv; + + cw.visit(V1_8, ACC_PUBLIC + ACC_SUPER, "T", null, "java/lang/Object", null); + { + mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V"); + mv.visitInsn(RETURN); + mv.visitMaxs(0,0); + mv.visitEnd(); + } + { + mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "test", "()I", null, null); + mv.visitCode(); + mv.visitLdcInsn(new Handle(Opcodes.H_INVOKEINTERFACE, "I", "m", "()I")); + mv.visitTypeInsn(NEW, "D"); + mv.visitInsn(DUP); + mv.visitMethodInsn(INVOKESPECIAL, "D", "", "()V"); + mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandle", "invokeExact", "(LI;)I"); + mv.visitInsn(IRETURN); + mv.visitMaxs(0,0); + mv.visitEnd(); + } + cw.visitEnd(); + return cw.toByteArray(); + } + + public static void main(String args[] ) throws Throwable { + ByteClassLoader bcl = new ByteClassLoader(); + Class d = bcl.loadBytes("D", bytesForD()); + Class t = bcl.loadBytes("T", bytesForT()); + try { + Object result = t.getMethod("test").invoke(null); + System.out.println("Expected AbstractMethodError wrapped in InvocationTargetException, saw no exception"); + throw new Error("Missing expected exception"); + } catch (InvocationTargetException e) { + Throwable th = e.getCause(); + if (th instanceof AbstractMethodError) { + th.printStackTrace(System.out); + System.out.println("PASS, saw expected exception (AbstractMethodError, wrapped in InvocationTargetException)."); + } else { + System.out.println("Expected AbstractMethodError wrapped in InvocationTargetException, saw " + th); + throw th; + } + } + } +} diff --git a/hotspot/test/compiler/print/PrintInlining.java b/hotspot/test/compiler/print/PrintInlining.java new file mode 100644 index 00000000000..6aa90333561 --- /dev/null +++ b/hotspot/test/compiler/print/PrintInlining.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8022585 + * @summary VM crashes when ran with -XX:+PrintInlining + * @run main/othervm -Xcomp -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining PrintInlining + * + */ + +public class PrintInlining { + public static void main(String[] args) { + System.out.println("Passed"); + } +} diff --git a/hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java b/hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java new file mode 100644 index 00000000000..d6976bd3bdf --- /dev/null +++ b/hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8027751 + * @summary C1 crashes generating G1 post-barrier in Unsafe.getAndSetObject() intrinsic because of the new value spill + * @run main/othervm -XX:+UseG1GC C1ObjectSpillInLogicOp + * + * G1 barriers use logical operators (xor) on T_OBJECT mixed with T_LONG or T_INT. + * The current implementation of logical operations on x86 in C1 doesn't allow for long operands to be on stack. + * There is a special code in the register allocator that forces long arguments in registers on x86. However T_OBJECT + * can be spilled just fine, and in that case the xor emission will fail. + */ + +import java.util.concurrent.atomic.*; +class C1ObjectSpillInLogicOp { + static public void main(String[] args) { + AtomicReferenceArray x = new AtomicReferenceArray(128); + Integer y = new Integer(0); + for (int i = 0; i < 50000; i++) { + x.getAndSet(i % x.length(), y); + } + } +} diff --git a/hotspot/test/compiler/startup/SmallCodeCacheStartup.java b/hotspot/test/compiler/startup/SmallCodeCacheStartup.java new file mode 100644 index 00000000000..74b2b762caa --- /dev/null +++ b/hotspot/test/compiler/startup/SmallCodeCacheStartup.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8023014 + * @summary Test ensures that there is no crash when compiler initialization fails + * @library /testlibrary + * + */ +import com.oracle.java.testlibrary.*; + +public class SmallCodeCacheStartup { + public static void main(String[] args) throws Exception { + ProcessBuilder pb; + OutputAnalyzer out; + + pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=3m", "-XX:CICompilerCount=64", "-version"); + out = new OutputAnalyzer(pb.start()); + out.shouldContain("no space to run compiler"); + out.shouldHaveExitValue(0); + } +} diff --git a/hotspot/test/compiler/startup/StartupOutput.java b/hotspot/test/compiler/startup/StartupOutput.java new file mode 100644 index 00000000000..f677853d51c --- /dev/null +++ b/hotspot/test/compiler/startup/StartupOutput.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026949 + * @summary Test ensures correct VM output during startup + * @library ../../testlibrary + * + */ +import com.oracle.java.testlibrary.*; + +public class StartupOutput { + public static void main(String[] args) throws Exception { + ProcessBuilder pb; + OutputAnalyzer out; + + pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version"); + out = new OutputAnalyzer(pb.start()); + out.shouldNotContain("no space to run compilers"); + + out.shouldHaveExitValue(0); + } +} diff --git a/hotspot/test/compiler/tiered/CompLevelsTest.java b/hotspot/test/compiler/tiered/CompLevelsTest.java new file mode 100644 index 00000000000..5c61ba173d7 --- /dev/null +++ b/hotspot/test/compiler/tiered/CompLevelsTest.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Abstract class for testing of used compilation levels correctness. + * + * @author igor.ignatyev@oracle.com + */ +public abstract class CompLevelsTest extends CompilerWhiteBoxTest { + protected CompLevelsTest(TestCase testCase) { + super(testCase); + // to prevent inlining of #method + WHITE_BOX.testSetDontInlineMethod(method, true); + } + + /** + * Checks that level is available. + * @param compLevel level to check + */ + protected void testAvailableLevel(int compLevel, int bci) { + if (IS_VERBOSE) { + System.out.printf("testAvailableLevel(level = %d, bci = %d)%n", + compLevel, bci); + } + WHITE_BOX.enqueueMethodForCompilation(method, compLevel, bci); + checkCompiled(); + checkLevel(compLevel, getCompLevel()); + deoptimize(); + } + + /** + * Checks that level is unavailable. + * @param compLevel level to check + */ + protected void testUnavailableLevel(int compLevel, int bci) { + if (IS_VERBOSE) { + System.out.printf("testUnavailableLevel(level = %d, bci = %d)%n", + compLevel, bci); + } + WHITE_BOX.enqueueMethodForCompilation(method, compLevel, bci); + checkNotCompiled(); + } + + /** + * Checks validity of compilation level. + * @param expected expected level + * @param actual actually level + */ + protected void checkLevel(int expected, int actual) { + if (expected != actual) { + throw new RuntimeException("expected[" + expected + "] != actual[" + + actual + "]"); + } + } +} diff --git a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java new file mode 100644 index 00000000000..28fd24d30bd --- /dev/null +++ b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.function.IntPredicate; + +/** + * @test NonTieredLevelsTest + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @build NonTieredLevelsTest + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:-TieredCompilation + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:CompileCommand=compileonly,TestCase$Helper::* + * NonTieredLevelsTest + * @summary Verify that only one level can be used + * @author igor.ignatyev@oracle.com + */ +public class NonTieredLevelsTest extends CompLevelsTest { + private static final int AVAILABLE_COMP_LEVEL; + private static final IntPredicate IS_AVAILABLE_COMPLEVEL; + static { + String vmName = System.getProperty("java.vm.name"); + if (vmName.endsWith(" Server VM")) { + AVAILABLE_COMP_LEVEL = COMP_LEVEL_FULL_OPTIMIZATION; + IS_AVAILABLE_COMPLEVEL = x -> x == COMP_LEVEL_FULL_OPTIMIZATION; + } else if (vmName.endsWith(" Client VM") + || vmName.endsWith(" Minimal VM")) { + AVAILABLE_COMP_LEVEL = COMP_LEVEL_SIMPLE; + IS_AVAILABLE_COMPLEVEL = x -> x >= COMP_LEVEL_SIMPLE + && x <= COMP_LEVEL_FULL_PROFILE; + } else { + throw new RuntimeException("Unknown VM: " + vmName); + } + + } + public static void main(String[] args) throws Exception { + if (TIERED_COMPILATION) { + System.err.println("Test isn't applicable w/ enabled " + + "TieredCompilation. Skip test."); + return; + } + for (TestCase test : TestCase.values()) { + new NonTieredLevelsTest(test).runTest(); + } + } + + private NonTieredLevelsTest(TestCase testCase) { + super(testCase); + // to prevent inlining of #method + WHITE_BOX.testSetDontInlineMethod(method, true); + } + + @Override + protected void test() throws Exception { + checkNotCompiled(); + compile(); + checkCompiled(); + + int compLevel = getCompLevel(); + checkLevel(AVAILABLE_COMP_LEVEL, compLevel); + int bci = WHITE_BOX.getMethodEntryBci(method); + deoptimize(); + if (!testCase.isOsr) { + for (int level = 1; level <= COMP_LEVEL_MAX; ++level) { + if (IS_AVAILABLE_COMPLEVEL.test(level)) { + testAvailableLevel(level, bci); + } else { + testUnavailableLevel(level, bci); + } + } + } else { + System.out.println("skip other levels testing in OSR"); + testAvailableLevel(AVAILABLE_COMP_LEVEL, bci); + } + } +} diff --git a/hotspot/test/compiler/tiered/TieredLevelsTest.java b/hotspot/test/compiler/tiered/TieredLevelsTest.java new file mode 100644 index 00000000000..9d3112aa274 --- /dev/null +++ b/hotspot/test/compiler/tiered/TieredLevelsTest.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test TieredLevelsTest + * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @build TieredLevelsTest + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+TieredCompilation + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:CompileCommand=compileonly,TestCase$Helper::* + * TieredLevelsTest + * @summary Verify that all levels < 'TieredStopAtLevel' can be used + * @author igor.ignatyev@oracle.com + */ +public class TieredLevelsTest extends CompLevelsTest { + public static void main(String[] args) throws Exception { + if (!TIERED_COMPILATION) { + System.err.println("Test isn't applicable w/ disabled " + + "TieredCompilation. Skip test."); + return; + } + for (TestCase test : TestCase.values()) { + new TieredLevelsTest(test).runTest(); + } + } + + private TieredLevelsTest(TestCase testCase) { + super(testCase); + // to prevent inlining of #method + WHITE_BOX.testSetDontInlineMethod(method, true); + } + + @Override + protected void test() throws Exception { + checkNotCompiled(); + compile(); + checkCompiled(); + + int compLevel = getCompLevel(); + if (compLevel > TIERED_STOP_AT_LEVEL) { + throw new RuntimeException("method.compLevel[" + compLevel + + "] > TieredStopAtLevel [" + TIERED_STOP_AT_LEVEL + "]"); + } + int bci = WHITE_BOX.getMethodEntryBci(method); + deoptimize(); + + for (int testedTier = 1; testedTier <= TIERED_STOP_AT_LEVEL; + ++testedTier) { + testAvailableLevel(testedTier, bci); + } + for (int testedTier = TIERED_STOP_AT_LEVEL + 1; + testedTier <= COMP_LEVEL_MAX; ++testedTier) { + testUnavailableLevel(testedTier, bci); + } + } + + + @Override + protected void checkLevel(int expected, int actual) { + if (expected == COMP_LEVEL_FULL_PROFILE + && actual == COMP_LEVEL_LIMITED_PROFILE) { + // for simple method full_profile may be replaced by limited_profile + return; + } + super.checkLevel(expected, actual); + } +} diff --git a/hotspot/test/compiler/types/TypeSpeculation.java b/hotspot/test/compiler/types/TypeSpeculation.java new file mode 100644 index 00000000000..e47de9203d9 --- /dev/null +++ b/hotspot/test/compiler/types/TypeSpeculation.java @@ -0,0 +1,428 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8024070 + * @summary Test that type speculation doesn't cause incorrect execution + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:TypeProfileLevel=222 TypeSpeculation + * + */ + +public class TypeSpeculation { + + interface I { + } + + static class A { + int m() { + return 1; + } + } + + static class B extends A implements I { + int m() { + return 2; + } + } + + static class C extends B { + int m() { + return 3; + } + } + + static int test1_invokevirtual(A a) { + return a.m(); + } + + static int test1_1(A a) { + return test1_invokevirtual(a); + } + + static boolean test1() { + A a = new A(); + B b = new B(); + C c = new C(); + + // pollute profile at test1_invokevirtual to make sure the + // compiler cannot rely on it + for (int i = 0; i < 5000; i++) { + test1_invokevirtual(a); + test1_invokevirtual(b); + test1_invokevirtual(c); + } + + // profiling + speculation should make test1_invokevirtual + // inline A.m() with a guard + for (int i = 0; i < 20000; i++) { + int res = test1_1(b); + if (res != b.m()) { + System.out.println("test1 failed with class B"); + return false; + } + } + // check that the guard works as expected by passing a + // different type + int res = test1_1(a); + if (res != a.m()) { + System.out.println("test1 failed with class A"); + return false; + } + return true; + } + + static int test2_invokevirtual(A a) { + return a.m(); + } + + static int test2_1(A a, boolean t) { + A aa; + if (t) { + aa = (B)a; + } else { + aa = a; + } + // if a of type B is passed to test2_1, the static type of aa + // here is no better than A but the profiled type is B so this + // should inline + return test2_invokevirtual(aa); + } + + static boolean test2() { + A a = new A(); + B b = new B(); + C c = new C(); + + // pollute profile at test2_invokevirtual to make sure the + // compiler cannot rely on it + for (int i = 0; i < 5000; i++) { + test2_invokevirtual(a); + test2_invokevirtual(b); + test2_invokevirtual(c); + } + + // profiling + speculation should make test2_invokevirtual + // inline A.m() with a guard + for (int i = 0; i < 20000; i++) { + int res = test2_1(b, (i % 2) == 0); + if (res != b.m()) { + System.out.println("test2 failed with class B"); + return false; + } + } + // check that the guard works as expected by passing a + // different type + int res = test2_1(a, false); + if (res != a.m()) { + System.out.println("test2 failed with class A"); + return false; + } + return true; + } + + static int test3_invokevirtual(A a) { + return a.m(); + } + + static void test3_2(A a) { + } + + static int test3_1(A a, int i) { + if (i == 0) { + return 0; + } + // If we come here and a is of type B but parameter profiling + // is polluted, both branches of the if below should have + // profiling that tell us and inlining of the virtual call + // should happen + if (i == 1) { + test3_2(a); + } else { + test3_2(a); + } + return test3_invokevirtual(a); + } + + static boolean test3() { + A a = new A(); + B b = new B(); + C c = new C(); + + // pollute profile at test3_invokevirtual and test3_1 to make + // sure the compiler cannot rely on it + for (int i = 0; i < 3000; i++) { + test3_invokevirtual(a); + test3_invokevirtual(b); + test3_invokevirtual(c); + test3_1(a, 0); + test3_1(b, 0); + } + + // profiling + speculation should make test3_invokevirtual + // inline A.m() with a guard + for (int i = 0; i < 20000; i++) { + int res = test3_1(b, (i % 2) + 1); + if (res != b.m()) { + System.out.println("test3 failed with class B"); + return false; + } + } + // check that the guard works as expected by passing a + // different type + int res = test3_1(a, 1); + if (res != a.m()) { + System.out.println("test3 failed with class A"); + return false; + } + return true; + } + + // Mix 2 incompatible profiled types + static int test4_invokevirtual(A a) { + return a.m(); + } + + static void test4_2(A a) { + } + + static int test4_1(A a, boolean b) { + if (b) { + test4_2(a); + } else { + test4_2(a); + } + // shouldn't inline + return test4_invokevirtual(a); + } + + static boolean test4() { + A a = new A(); + B b = new B(); + C c = new C(); + + // pollute profile at test3_invokevirtual and test3_1 to make + // sure the compiler cannot rely on it + for (int i = 0; i < 3000; i++) { + test4_invokevirtual(a); + test4_invokevirtual(b); + test4_invokevirtual(c); + } + + for (int i = 0; i < 20000; i++) { + if ((i % 2) == 0) { + int res = test4_1(a, true); + if (res != a.m()) { + System.out.println("test4 failed with class A"); + return false; + } + } else { + int res = test4_1(b, false); + if (res != b.m()) { + System.out.println("test4 failed with class B"); + return false; + } + } + } + return true; + } + + // Mix one profiled type with an incompatible type + static int test5_invokevirtual(A a) { + return a.m(); + } + + static void test5_2(A a) { + } + + static int test5_1(A a, boolean b) { + if (b) { + test5_2(a); + } else { + A aa = (B)a; + } + // shouldn't inline + return test5_invokevirtual(a); + } + + static boolean test5() { + A a = new A(); + B b = new B(); + C c = new C(); + + // pollute profile at test3_invokevirtual and test3_1 to make + // sure the compiler cannot rely on it + for (int i = 0; i < 3000; i++) { + test5_invokevirtual(a); + test5_invokevirtual(b); + test5_invokevirtual(c); + } + + for (int i = 0; i < 20000; i++) { + if ((i % 2) == 0) { + int res = test5_1(a, true); + if (res != a.m()) { + System.out.println("test5 failed with class A"); + return false; + } + } else { + int res = test5_1(b, false); + if (res != b.m()) { + System.out.println("test5 failed with class B"); + return false; + } + } + } + return true; + } + + // Mix incompatible profiled types + static void test6_2(Object o) { + } + + static Object test6_1(Object o, boolean b) { + if (b) { + test6_2(o); + } else { + test6_2(o); + } + return o; + } + + static boolean test6() { + A a = new A(); + A[] aa = new A[10]; + + for (int i = 0; i < 20000; i++) { + if ((i % 2) == 0) { + test6_1(a, true); + } else { + test6_1(aa, false); + } + } + return true; + } + + // Mix a profiled type with an incompatible type + static void test7_2(Object o) { + } + + static Object test7_1(Object o, boolean b) { + if (b) { + test7_2(o); + } else { + Object oo = (A[])o; + } + return o; + } + + static boolean test7() { + A a = new A(); + A[] aa = new A[10]; + + for (int i = 0; i < 20000; i++) { + if ((i % 2) == 0) { + test7_1(a, true); + } else { + test7_1(aa, false); + } + } + return true; + } + + // Mix a profiled type with an interface + static void test8_2(Object o) { + } + + static I test8_1(Object o) { + test8_2(o); + return (I)o; + } + + static boolean test8() { + A a = new A(); + B b = new B(); + C c = new C(); + + for (int i = 0; i < 20000; i++) { + test8_1(b); + } + return true; + } + + // Mix a profiled type with a constant + static void test9_2(Object o) { + } + + static Object test9_1(Object o, boolean b) { + Object oo; + if (b) { + test9_2(o); + oo = o; + } else { + oo = "some string"; + } + return oo; + } + + static boolean test9() { + A a = new A(); + + for (int i = 0; i < 20000; i++) { + if ((i % 2) == 0) { + test9_1(a, true); + } else { + test9_1(a, false); + } + } + return true; + } + + static public void main(String[] args) { + boolean success = true; + + success = test1() && success; + + success = test2() && success; + + success = test3() && success; + + success = test4() && success; + + success = test5() && success; + + success = test6() && success; + + success = test7() && success; + + success = test8() && success; + + success = test9() && success; + + if (success) { + System.out.println("TEST PASSED"); + } else { + throw new RuntimeException("TEST FAILED: erroneous bound check elimination"); + } + } +} diff --git a/hotspot/test/compiler/uncommontrap/UncommonTrapStackBang.java b/hotspot/test/compiler/uncommontrap/UncommonTrapStackBang.java new file mode 100644 index 00000000000..164453b7b62 --- /dev/null +++ b/hotspot/test/compiler/uncommontrap/UncommonTrapStackBang.java @@ -0,0 +1,10908 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/** + * @test + * @bug 8026775 + * @summary Uncommon trap blob did not bang all the stack shadow pages + * + * @run main/othervm -server -XX:+IgnoreUnrecognizedVMOptions -XX:+TieredCompilation UncommonTrapStackBang + * @run main/othervm -server -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation UncommonTrapStackBang + * + * + * Note: This test does not reproduce the problem with absolute + * certainty. Empirically the bug reproduces on Windows some 80+% of + * the time. Setting everything up to fail in 100% of the cases turns + * out to be tricky at best. + * + * + * The goal of this test is to set up the following stack: + * + * doIt() + * eatStack() + * ... + * eatStack() + * run() + * + * + * When doIt() gets executed it will hit an uncommon trap and expand + * into a huge interpreter frame. The doIt method then calls the + * compiled version of StringBuilder.() which does a single + * stack bang StackShadowPages down. + * + * The uncommon trap blob is supposed to prepare for the interpreter + * by pre-touching stack pages. The bug was that it didn't correctly + * pre-touch all the stack shadow pages, leaving a "hole" on the stack + * which raises an exception on Windows when the stack bang in + * StringBuilder is performed. + */ +public class UncommonTrapStackBang extends Thread { + class Foo { } + + public static void main(String[] args) throws Exception { + doWarmup(); + + // Fork off a new thread to increase odds of the stack being unmapped + UncommonTrapStackBang htsb = new UncommonTrapStackBang(); + htsb.run(); + htsb.join(); + } + + // Make sure: + // + // a) StringBuilder.()V is compiled + // b) doIt() is compiled with an uncommon trap in the unlikely path + public static void doWarmup() { + for (int i = 0; i < 100_000; i++) { + new StringBuilder(); + + doIt(false); + } + } + + public void run() { + eatStack(200); + } + + // Consume some stack to get down to some unused/unmapped pages, + // then call doIt and provoke the uncommon trap/deoptimization + private void eatStack(int n) { + if (n <= 0) { + doIt(true); + return; + } + + eatStack(n - 1); + } + + static public void doIt(boolean unlikely) { + int i0; + int i1; + int i2; + int i3; + int i4; + int i5; + int i6; + int i7; + int i8; + int i9; + int i10; + int i11; + int i12; + int i13; + int i14; + int i15; + int i16; + int i17; + int i18; + int i19; + int i20; + int i21; + int i22; + int i23; + int i24; + int i25; + int i26; + int i27; + int i28; + int i29; + int i30; + int i31; + int i32; + int i33; + int i34; + int i35; + int i36; + int i37; + int i38; + int i39; + int i40; + int i41; + int i42; + int i43; + int i44; + int i45; + int i46; + int i47; + int i48; + int i49; + int i50; + int i51; + int i52; + int i53; + int i54; + int i55; + int i56; + int i57; + int i58; + int i59; + int i60; + int i61; + int i62; + int i63; + int i64; + int i65; + int i66; + int i67; + int i68; + int i69; + int i70; + int i71; + int i72; + int i73; + int i74; + int i75; + int i76; + int i77; + int i78; + int i79; + int i80; + int i81; + int i82; + int i83; + int i84; + int i85; + int i86; + int i87; + int i88; + int i89; + int i90; + int i91; + int i92; + int i93; + int i94; + int i95; + int i96; + int i97; + int i98; + int i99; + int i100; + int i101; + int i102; + int i103; + int i104; + int i105; + int i106; + int i107; + int i108; + int i109; + int i110; + int i111; + int i112; + int i113; + int i114; + int i115; + int i116; + int i117; + int i118; + int i119; + int i120; + int i121; + int i122; + int i123; + int i124; + int i125; + int i126; + int i127; + int i128; + int i129; + int i130; + int i131; + int i132; + int i133; + int i134; + int i135; + int i136; + int i137; + int i138; + int i139; + int i140; + int i141; + int i142; + int i143; + int i144; + int i145; + int i146; + int i147; + int i148; + int i149; + int i150; + int i151; + int i152; + int i153; + int i154; + int i155; + int i156; + int i157; + int i158; + int i159; + int i160; + int i161; + int i162; + int i163; + int i164; + int i165; + int i166; + int i167; + int i168; + int i169; + int i170; + int i171; + int i172; + int i173; + int i174; + int i175; + int i176; + int i177; + int i178; + int i179; + int i180; + int i181; + int i182; + int i183; + int i184; + int i185; + int i186; + int i187; + int i188; + int i189; + int i190; + int i191; + int i192; + int i193; + int i194; + int i195; + int i196; + int i197; + int i198; + int i199; + int i200; + int i201; + int i202; + int i203; + int i204; + int i205; + int i206; + int i207; + int i208; + int i209; + int i210; + int i211; + int i212; + int i213; + int i214; + int i215; + int i216; + int i217; + int i218; + int i219; + int i220; + int i221; + int i222; + int i223; + int i224; + int i225; + int i226; + int i227; + int i228; + int i229; + int i230; + int i231; + int i232; + int i233; + int i234; + int i235; + int i236; + int i237; + int i238; + int i239; + int i240; + int i241; + int i242; + int i243; + int i244; + int i245; + int i246; + int i247; + int i248; + int i249; + int i250; + int i251; + int i252; + int i253; + int i254; + int i255; + int i256; + int i257; + int i258; + int i259; + int i260; + int i261; + int i262; + int i263; + int i264; + int i265; + int i266; + int i267; + int i268; + int i269; + int i270; + int i271; + int i272; + int i273; + int i274; + int i275; + int i276; + int i277; + int i278; + int i279; + int i280; + int i281; + int i282; + int i283; + int i284; + int i285; + int i286; + int i287; + int i288; + int i289; + int i290; + int i291; + int i292; + int i293; + int i294; + int i295; + int i296; + int i297; + int i298; + int i299; + int i300; + int i301; + int i302; + int i303; + int i304; + int i305; + int i306; + int i307; + int i308; + int i309; + int i310; + int i311; + int i312; + int i313; + int i314; + int i315; + int i316; + int i317; + int i318; + int i319; + int i320; + int i321; + int i322; + int i323; + int i324; + int i325; + int i326; + int i327; + int i328; + int i329; + int i330; + int i331; + int i332; + int i333; + int i334; + int i335; + int i336; + int i337; + int i338; + int i339; + int i340; + int i341; + int i342; + int i343; + int i344; + int i345; + int i346; + int i347; + int i348; + int i349; + int i350; + int i351; + int i352; + int i353; + int i354; + int i355; + int i356; + int i357; + int i358; + int i359; + int i360; + int i361; + int i362; + int i363; + int i364; + int i365; + int i366; + int i367; + int i368; + int i369; + int i370; + int i371; + int i372; + int i373; + int i374; + int i375; + int i376; + int i377; + int i378; + int i379; + int i380; + int i381; + int i382; + int i383; + int i384; + int i385; + int i386; + int i387; + int i388; + int i389; + int i390; + int i391; + int i392; + int i393; + int i394; + int i395; + int i396; + int i397; + int i398; + int i399; + int i400; + int i401; + int i402; + int i403; + int i404; + int i405; + int i406; + int i407; + int i408; + int i409; + int i410; + int i411; + int i412; + int i413; + int i414; + int i415; + int i416; + int i417; + int i418; + int i419; + int i420; + int i421; + int i422; + int i423; + int i424; + int i425; + int i426; + int i427; + int i428; + int i429; + int i430; + int i431; + int i432; + int i433; + int i434; + int i435; + int i436; + int i437; + int i438; + int i439; + int i440; + int i441; + int i442; + int i443; + int i444; + int i445; + int i446; + int i447; + int i448; + int i449; + int i450; + int i451; + int i452; + int i453; + int i454; + int i455; + int i456; + int i457; + int i458; + int i459; + int i460; + int i461; + int i462; + int i463; + int i464; + int i465; + int i466; + int i467; + int i468; + int i469; + int i470; + int i471; + int i472; + int i473; + int i474; + int i475; + int i476; + int i477; + int i478; + int i479; + int i480; + int i481; + int i482; + int i483; + int i484; + int i485; + int i486; + int i487; + int i488; + int i489; + int i490; + int i491; + int i492; + int i493; + int i494; + int i495; + int i496; + int i497; + int i498; + int i499; + int i500; + int i501; + int i502; + int i503; + int i504; + int i505; + int i506; + int i507; + int i508; + int i509; + int i510; + int i511; + int i512; + int i513; + int i514; + int i515; + int i516; + int i517; + int i518; + int i519; + int i520; + int i521; + int i522; + int i523; + int i524; + int i525; + int i526; + int i527; + int i528; + int i529; + int i530; + int i531; + int i532; + int i533; + int i534; + int i535; + int i536; + int i537; + int i538; + int i539; + int i540; + int i541; + int i542; + int i543; + int i544; + int i545; + int i546; + int i547; + int i548; + int i549; + int i550; + int i551; + int i552; + int i553; + int i554; + int i555; + int i556; + int i557; + int i558; + int i559; + int i560; + int i561; + int i562; + int i563; + int i564; + int i565; + int i566; + int i567; + int i568; + int i569; + int i570; + int i571; + int i572; + int i573; + int i574; + int i575; + int i576; + int i577; + int i578; + int i579; + int i580; + int i581; + int i582; + int i583; + int i584; + int i585; + int i586; + int i587; + int i588; + int i589; + int i590; + int i591; + int i592; + int i593; + int i594; + int i595; + int i596; + int i597; + int i598; + int i599; + int i600; + int i601; + int i602; + int i603; + int i604; + int i605; + int i606; + int i607; + int i608; + int i609; + int i610; + int i611; + int i612; + int i613; + int i614; + int i615; + int i616; + int i617; + int i618; + int i619; + int i620; + int i621; + int i622; + int i623; + int i624; + int i625; + int i626; + int i627; + int i628; + int i629; + int i630; + int i631; + int i632; + int i633; + int i634; + int i635; + int i636; + int i637; + int i638; + int i639; + int i640; + int i641; + int i642; + int i643; + int i644; + int i645; + int i646; + int i647; + int i648; + int i649; + int i650; + int i651; + int i652; + int i653; + int i654; + int i655; + int i656; + int i657; + int i658; + int i659; + int i660; + int i661; + int i662; + int i663; + int i664; + int i665; + int i666; + int i667; + int i668; + int i669; + int i670; + int i671; + int i672; + int i673; + int i674; + int i675; + int i676; + int i677; + int i678; + int i679; + int i680; + int i681; + int i682; + int i683; + int i684; + int i685; + int i686; + int i687; + int i688; + int i689; + int i690; + int i691; + int i692; + int i693; + int i694; + int i695; + int i696; + int i697; + int i698; + int i699; + int i700; + int i701; + int i702; + int i703; + int i704; + int i705; + int i706; + int i707; + int i708; + int i709; + int i710; + int i711; + int i712; + int i713; + int i714; + int i715; + int i716; + int i717; + int i718; + int i719; + int i720; + int i721; + int i722; + int i723; + int i724; + int i725; + int i726; + int i727; + int i728; + int i729; + int i730; + int i731; + int i732; + int i733; + int i734; + int i735; + int i736; + int i737; + int i738; + int i739; + int i740; + int i741; + int i742; + int i743; + int i744; + int i745; + int i746; + int i747; + int i748; + int i749; + int i750; + int i751; + int i752; + int i753; + int i754; + int i755; + int i756; + int i757; + int i758; + int i759; + int i760; + int i761; + int i762; + int i763; + int i764; + int i765; + int i766; + int i767; + int i768; + int i769; + int i770; + int i771; + int i772; + int i773; + int i774; + int i775; + int i776; + int i777; + int i778; + int i779; + int i780; + int i781; + int i782; + int i783; + int i784; + int i785; + int i786; + int i787; + int i788; + int i789; + int i790; + int i791; + int i792; + int i793; + int i794; + int i795; + int i796; + int i797; + int i798; + int i799; + int i800; + int i801; + int i802; + int i803; + int i804; + int i805; + int i806; + int i807; + int i808; + int i809; + int i810; + int i811; + int i812; + int i813; + int i814; + int i815; + int i816; + int i817; + int i818; + int i819; + int i820; + int i821; + int i822; + int i823; + int i824; + int i825; + int i826; + int i827; + int i828; + int i829; + int i830; + int i831; + int i832; + int i833; + int i834; + int i835; + int i836; + int i837; + int i838; + int i839; + int i840; + int i841; + int i842; + int i843; + int i844; + int i845; + int i846; + int i847; + int i848; + int i849; + int i850; + int i851; + int i852; + int i853; + int i854; + int i855; + int i856; + int i857; + int i858; + int i859; + int i860; + int i861; + int i862; + int i863; + int i864; + int i865; + int i866; + int i867; + int i868; + int i869; + int i870; + int i871; + int i872; + int i873; + int i874; + int i875; + int i876; + int i877; + int i878; + int i879; + int i880; + int i881; + int i882; + int i883; + int i884; + int i885; + int i886; + int i887; + int i888; + int i889; + int i890; + int i891; + int i892; + int i893; + int i894; + int i895; + int i896; + int i897; + int i898; + int i899; + int i900; + int i901; + int i902; + int i903; + int i904; + int i905; + int i906; + int i907; + int i908; + int i909; + int i910; + int i911; + int i912; + int i913; + int i914; + int i915; + int i916; + int i917; + int i918; + int i919; + int i920; + int i921; + int i922; + int i923; + int i924; + int i925; + int i926; + int i927; + int i928; + int i929; + int i930; + int i931; + int i932; + int i933; + int i934; + int i935; + int i936; + int i937; + int i938; + int i939; + int i940; + int i941; + int i942; + int i943; + int i944; + int i945; + int i946; + int i947; + int i948; + int i949; + int i950; + int i951; + int i952; + int i953; + int i954; + int i955; + int i956; + int i957; + int i958; + int i959; + int i960; + int i961; + int i962; + int i963; + int i964; + int i965; + int i966; + int i967; + int i968; + int i969; + int i970; + int i971; + int i972; + int i973; + int i974; + int i975; + int i976; + int i977; + int i978; + int i979; + int i980; + int i981; + int i982; + int i983; + int i984; + int i985; + int i986; + int i987; + int i988; + int i989; + int i990; + int i991; + int i992; + int i993; + int i994; + int i995; + int i996; + int i997; + int i998; + int i999; + int i1000; + int i1001; + int i1002; + int i1003; + int i1004; + int i1005; + int i1006; + int i1007; + int i1008; + int i1009; + int i1010; + int i1011; + int i1012; + int i1013; + int i1014; + int i1015; + int i1016; + int i1017; + int i1018; + int i1019; + int i1020; + int i1021; + int i1022; + int i1023; + int i1024; + int i1025; + int i1026; + int i1027; + int i1028; + int i1029; + int i1030; + int i1031; + int i1032; + int i1033; + int i1034; + int i1035; + int i1036; + int i1037; + int i1038; + int i1039; + int i1040; + int i1041; + int i1042; + int i1043; + int i1044; + int i1045; + int i1046; + int i1047; + int i1048; + int i1049; + int i1050; + int i1051; + int i1052; + int i1053; + int i1054; + int i1055; + int i1056; + int i1057; + int i1058; + int i1059; + int i1060; + int i1061; + int i1062; + int i1063; + int i1064; + int i1065; + int i1066; + int i1067; + int i1068; + int i1069; + int i1070; + int i1071; + int i1072; + int i1073; + int i1074; + int i1075; + int i1076; + int i1077; + int i1078; + int i1079; + int i1080; + int i1081; + int i1082; + int i1083; + int i1084; + int i1085; + int i1086; + int i1087; + int i1088; + int i1089; + int i1090; + int i1091; + int i1092; + int i1093; + int i1094; + int i1095; + int i1096; + int i1097; + int i1098; + int i1099; + int i1100; + int i1101; + int i1102; + int i1103; + int i1104; + int i1105; + int i1106; + int i1107; + int i1108; + int i1109; + int i1110; + int i1111; + int i1112; + int i1113; + int i1114; + int i1115; + int i1116; + int i1117; + int i1118; + int i1119; + int i1120; + int i1121; + int i1122; + int i1123; + int i1124; + int i1125; + int i1126; + int i1127; + int i1128; + int i1129; + int i1130; + int i1131; + int i1132; + int i1133; + int i1134; + int i1135; + int i1136; + int i1137; + int i1138; + int i1139; + int i1140; + int i1141; + int i1142; + int i1143; + int i1144; + int i1145; + int i1146; + int i1147; + int i1148; + int i1149; + int i1150; + int i1151; + int i1152; + int i1153; + int i1154; + int i1155; + int i1156; + int i1157; + int i1158; + int i1159; + int i1160; + int i1161; + int i1162; + int i1163; + int i1164; + int i1165; + int i1166; + int i1167; + int i1168; + int i1169; + int i1170; + int i1171; + int i1172; + int i1173; + int i1174; + int i1175; + int i1176; + int i1177; + int i1178; + int i1179; + int i1180; + int i1181; + int i1182; + int i1183; + int i1184; + int i1185; + int i1186; + int i1187; + int i1188; + int i1189; + int i1190; + int i1191; + int i1192; + int i1193; + int i1194; + int i1195; + int i1196; + int i1197; + int i1198; + int i1199; + int i1200; + int i1201; + int i1202; + int i1203; + int i1204; + int i1205; + int i1206; + int i1207; + int i1208; + int i1209; + int i1210; + int i1211; + int i1212; + int i1213; + int i1214; + int i1215; + int i1216; + int i1217; + int i1218; + int i1219; + int i1220; + int i1221; + int i1222; + int i1223; + int i1224; + int i1225; + int i1226; + int i1227; + int i1228; + int i1229; + int i1230; + int i1231; + int i1232; + int i1233; + int i1234; + int i1235; + int i1236; + int i1237; + int i1238; + int i1239; + int i1240; + int i1241; + int i1242; + int i1243; + int i1244; + int i1245; + int i1246; + int i1247; + int i1248; + int i1249; + int i1250; + int i1251; + int i1252; + int i1253; + int i1254; + int i1255; + int i1256; + int i1257; + int i1258; + int i1259; + int i1260; + int i1261; + int i1262; + int i1263; + int i1264; + int i1265; + int i1266; + int i1267; + int i1268; + int i1269; + int i1270; + int i1271; + int i1272; + int i1273; + int i1274; + int i1275; + int i1276; + int i1277; + int i1278; + int i1279; + int i1280; + int i1281; + int i1282; + int i1283; + int i1284; + int i1285; + int i1286; + int i1287; + int i1288; + int i1289; + int i1290; + int i1291; + int i1292; + int i1293; + int i1294; + int i1295; + int i1296; + int i1297; + int i1298; + int i1299; + int i1300; + int i1301; + int i1302; + int i1303; + int i1304; + int i1305; + int i1306; + int i1307; + int i1308; + int i1309; + int i1310; + int i1311; + int i1312; + int i1313; + int i1314; + int i1315; + int i1316; + int i1317; + int i1318; + int i1319; + int i1320; + int i1321; + int i1322; + int i1323; + int i1324; + int i1325; + int i1326; + int i1327; + int i1328; + int i1329; + int i1330; + int i1331; + int i1332; + int i1333; + int i1334; + int i1335; + int i1336; + int i1337; + int i1338; + int i1339; + int i1340; + int i1341; + int i1342; + int i1343; + int i1344; + int i1345; + int i1346; + int i1347; + int i1348; + int i1349; + int i1350; + int i1351; + int i1352; + int i1353; + int i1354; + int i1355; + int i1356; + int i1357; + int i1358; + int i1359; + int i1360; + int i1361; + int i1362; + int i1363; + int i1364; + int i1365; + int i1366; + int i1367; + int i1368; + int i1369; + int i1370; + int i1371; + int i1372; + int i1373; + int i1374; + int i1375; + int i1376; + int i1377; + int i1378; + int i1379; + int i1380; + int i1381; + int i1382; + int i1383; + int i1384; + int i1385; + int i1386; + int i1387; + int i1388; + int i1389; + int i1390; + int i1391; + int i1392; + int i1393; + int i1394; + int i1395; + int i1396; + int i1397; + int i1398; + int i1399; + int i1400; + int i1401; + int i1402; + int i1403; + int i1404; + int i1405; + int i1406; + int i1407; + int i1408; + int i1409; + int i1410; + int i1411; + int i1412; + int i1413; + int i1414; + int i1415; + int i1416; + int i1417; + int i1418; + int i1419; + int i1420; + int i1421; + int i1422; + int i1423; + int i1424; + int i1425; + int i1426; + int i1427; + int i1428; + int i1429; + int i1430; + int i1431; + int i1432; + int i1433; + int i1434; + int i1435; + int i1436; + int i1437; + int i1438; + int i1439; + int i1440; + int i1441; + int i1442; + int i1443; + int i1444; + int i1445; + int i1446; + int i1447; + int i1448; + int i1449; + int i1450; + int i1451; + int i1452; + int i1453; + int i1454; + int i1455; + int i1456; + int i1457; + int i1458; + int i1459; + int i1460; + int i1461; + int i1462; + int i1463; + int i1464; + int i1465; + int i1466; + int i1467; + int i1468; + int i1469; + int i1470; + int i1471; + int i1472; + int i1473; + int i1474; + int i1475; + int i1476; + int i1477; + int i1478; + int i1479; + int i1480; + int i1481; + int i1482; + int i1483; + int i1484; + int i1485; + int i1486; + int i1487; + int i1488; + int i1489; + int i1490; + int i1491; + int i1492; + int i1493; + int i1494; + int i1495; + int i1496; + int i1497; + int i1498; + int i1499; + int i1500; + int i1501; + int i1502; + int i1503; + int i1504; + int i1505; + int i1506; + int i1507; + int i1508; + int i1509; + int i1510; + int i1511; + int i1512; + int i1513; + int i1514; + int i1515; + int i1516; + int i1517; + int i1518; + int i1519; + int i1520; + int i1521; + int i1522; + int i1523; + int i1524; + int i1525; + int i1526; + int i1527; + int i1528; + int i1529; + int i1530; + int i1531; + int i1532; + int i1533; + int i1534; + int i1535; + int i1536; + int i1537; + int i1538; + int i1539; + int i1540; + int i1541; + int i1542; + int i1543; + int i1544; + int i1545; + int i1546; + int i1547; + int i1548; + int i1549; + int i1550; + int i1551; + int i1552; + int i1553; + int i1554; + int i1555; + int i1556; + int i1557; + int i1558; + int i1559; + int i1560; + int i1561; + int i1562; + int i1563; + int i1564; + int i1565; + int i1566; + int i1567; + int i1568; + int i1569; + int i1570; + int i1571; + int i1572; + int i1573; + int i1574; + int i1575; + int i1576; + int i1577; + int i1578; + int i1579; + int i1580; + int i1581; + int i1582; + int i1583; + int i1584; + int i1585; + int i1586; + int i1587; + int i1588; + int i1589; + int i1590; + int i1591; + int i1592; + int i1593; + int i1594; + int i1595; + int i1596; + int i1597; + int i1598; + int i1599; + int i1600; + int i1601; + int i1602; + int i1603; + int i1604; + int i1605; + int i1606; + int i1607; + int i1608; + int i1609; + int i1610; + int i1611; + int i1612; + int i1613; + int i1614; + int i1615; + int i1616; + int i1617; + int i1618; + int i1619; + int i1620; + int i1621; + int i1622; + int i1623; + int i1624; + int i1625; + int i1626; + int i1627; + int i1628; + int i1629; + int i1630; + int i1631; + int i1632; + int i1633; + int i1634; + int i1635; + int i1636; + int i1637; + int i1638; + int i1639; + int i1640; + int i1641; + int i1642; + int i1643; + int i1644; + int i1645; + int i1646; + int i1647; + int i1648; + int i1649; + int i1650; + int i1651; + int i1652; + int i1653; + int i1654; + int i1655; + int i1656; + int i1657; + int i1658; + int i1659; + int i1660; + int i1661; + int i1662; + int i1663; + int i1664; + int i1665; + int i1666; + int i1667; + int i1668; + int i1669; + int i1670; + int i1671; + int i1672; + int i1673; + int i1674; + int i1675; + int i1676; + int i1677; + int i1678; + int i1679; + int i1680; + int i1681; + int i1682; + int i1683; + int i1684; + int i1685; + int i1686; + int i1687; + int i1688; + int i1689; + int i1690; + int i1691; + int i1692; + int i1693; + int i1694; + int i1695; + int i1696; + int i1697; + int i1698; + int i1699; + int i1700; + int i1701; + int i1702; + int i1703; + int i1704; + int i1705; + int i1706; + int i1707; + int i1708; + int i1709; + int i1710; + int i1711; + int i1712; + int i1713; + int i1714; + int i1715; + int i1716; + int i1717; + int i1718; + int i1719; + int i1720; + int i1721; + int i1722; + int i1723; + int i1724; + int i1725; + int i1726; + int i1727; + int i1728; + int i1729; + int i1730; + int i1731; + int i1732; + int i1733; + int i1734; + int i1735; + int i1736; + int i1737; + int i1738; + int i1739; + int i1740; + int i1741; + int i1742; + int i1743; + int i1744; + int i1745; + int i1746; + int i1747; + int i1748; + int i1749; + int i1750; + int i1751; + int i1752; + int i1753; + int i1754; + int i1755; + int i1756; + int i1757; + int i1758; + int i1759; + int i1760; + int i1761; + int i1762; + int i1763; + int i1764; + int i1765; + int i1766; + int i1767; + int i1768; + int i1769; + int i1770; + int i1771; + int i1772; + int i1773; + int i1774; + int i1775; + int i1776; + int i1777; + int i1778; + int i1779; + int i1780; + int i1781; + int i1782; + int i1783; + int i1784; + int i1785; + int i1786; + int i1787; + int i1788; + int i1789; + int i1790; + int i1791; + int i1792; + int i1793; + int i1794; + int i1795; + int i1796; + int i1797; + int i1798; + int i1799; + int i1800; + int i1801; + int i1802; + int i1803; + int i1804; + int i1805; + int i1806; + int i1807; + int i1808; + int i1809; + int i1810; + int i1811; + int i1812; + int i1813; + int i1814; + int i1815; + int i1816; + int i1817; + int i1818; + int i1819; + int i1820; + int i1821; + int i1822; + int i1823; + int i1824; + int i1825; + int i1826; + int i1827; + int i1828; + int i1829; + int i1830; + int i1831; + int i1832; + int i1833; + int i1834; + int i1835; + int i1836; + int i1837; + int i1838; + int i1839; + int i1840; + int i1841; + int i1842; + int i1843; + int i1844; + int i1845; + int i1846; + int i1847; + int i1848; + int i1849; + int i1850; + int i1851; + int i1852; + int i1853; + int i1854; + int i1855; + int i1856; + int i1857; + int i1858; + int i1859; + int i1860; + int i1861; + int i1862; + int i1863; + int i1864; + int i1865; + int i1866; + int i1867; + int i1868; + int i1869; + int i1870; + int i1871; + int i1872; + int i1873; + int i1874; + int i1875; + int i1876; + int i1877; + int i1878; + int i1879; + int i1880; + int i1881; + int i1882; + int i1883; + int i1884; + int i1885; + int i1886; + int i1887; + int i1888; + int i1889; + int i1890; + int i1891; + int i1892; + int i1893; + int i1894; + int i1895; + int i1896; + int i1897; + int i1898; + int i1899; + int i1900; + int i1901; + int i1902; + int i1903; + int i1904; + int i1905; + int i1906; + int i1907; + int i1908; + int i1909; + int i1910; + int i1911; + int i1912; + int i1913; + int i1914; + int i1915; + int i1916; + int i1917; + int i1918; + int i1919; + int i1920; + int i1921; + int i1922; + int i1923; + int i1924; + int i1925; + int i1926; + int i1927; + int i1928; + int i1929; + int i1930; + int i1931; + int i1932; + int i1933; + int i1934; + int i1935; + int i1936; + int i1937; + int i1938; + int i1939; + int i1940; + int i1941; + int i1942; + int i1943; + int i1944; + int i1945; + int i1946; + int i1947; + int i1948; + int i1949; + int i1950; + int i1951; + int i1952; + int i1953; + int i1954; + int i1955; + int i1956; + int i1957; + int i1958; + int i1959; + int i1960; + int i1961; + int i1962; + int i1963; + int i1964; + int i1965; + int i1966; + int i1967; + int i1968; + int i1969; + int i1970; + int i1971; + int i1972; + int i1973; + int i1974; + int i1975; + int i1976; + int i1977; + int i1978; + int i1979; + int i1980; + int i1981; + int i1982; + int i1983; + int i1984; + int i1985; + int i1986; + int i1987; + int i1988; + int i1989; + int i1990; + int i1991; + int i1992; + int i1993; + int i1994; + int i1995; + int i1996; + int i1997; + int i1998; + int i1999; + int i2000; + int i2001; + int i2002; + int i2003; + int i2004; + int i2005; + int i2006; + int i2007; + int i2008; + int i2009; + int i2010; + int i2011; + int i2012; + int i2013; + int i2014; + int i2015; + int i2016; + int i2017; + int i2018; + int i2019; + int i2020; + int i2021; + int i2022; + int i2023; + int i2024; + int i2025; + int i2026; + int i2027; + int i2028; + int i2029; + int i2030; + int i2031; + int i2032; + int i2033; + int i2034; + int i2035; + int i2036; + int i2037; + int i2038; + int i2039; + int i2040; + int i2041; + int i2042; + int i2043; + int i2044; + int i2045; + int i2046; + int i2047; + int i2048; + int i2049; + int i2050; + int i2051; + int i2052; + int i2053; + int i2054; + int i2055; + int i2056; + int i2057; + int i2058; + int i2059; + int i2060; + int i2061; + int i2062; + int i2063; + int i2064; + int i2065; + int i2066; + int i2067; + int i2068; + int i2069; + int i2070; + int i2071; + int i2072; + int i2073; + int i2074; + int i2075; + int i2076; + int i2077; + int i2078; + int i2079; + int i2080; + int i2081; + int i2082; + int i2083; + int i2084; + int i2085; + int i2086; + int i2087; + int i2088; + int i2089; + int i2090; + int i2091; + int i2092; + int i2093; + int i2094; + int i2095; + int i2096; + int i2097; + int i2098; + int i2099; + int i2100; + int i2101; + int i2102; + int i2103; + int i2104; + int i2105; + int i2106; + int i2107; + int i2108; + int i2109; + int i2110; + int i2111; + int i2112; + int i2113; + int i2114; + int i2115; + int i2116; + int i2117; + int i2118; + int i2119; + int i2120; + int i2121; + int i2122; + int i2123; + int i2124; + int i2125; + int i2126; + int i2127; + int i2128; + int i2129; + int i2130; + int i2131; + int i2132; + int i2133; + int i2134; + int i2135; + int i2136; + int i2137; + int i2138; + int i2139; + int i2140; + int i2141; + int i2142; + int i2143; + int i2144; + int i2145; + int i2146; + int i2147; + int i2148; + int i2149; + int i2150; + int i2151; + int i2152; + int i2153; + int i2154; + int i2155; + int i2156; + int i2157; + int i2158; + int i2159; + int i2160; + int i2161; + int i2162; + int i2163; + int i2164; + int i2165; + int i2166; + int i2167; + int i2168; + int i2169; + int i2170; + int i2171; + int i2172; + int i2173; + int i2174; + int i2175; + int i2176; + int i2177; + int i2178; + int i2179; + int i2180; + int i2181; + int i2182; + int i2183; + int i2184; + int i2185; + int i2186; + int i2187; + int i2188; + int i2189; + int i2190; + int i2191; + int i2192; + int i2193; + int i2194; + int i2195; + int i2196; + int i2197; + int i2198; + int i2199; + int i2200; + int i2201; + int i2202; + int i2203; + int i2204; + int i2205; + int i2206; + int i2207; + int i2208; + int i2209; + int i2210; + int i2211; + int i2212; + int i2213; + int i2214; + int i2215; + int i2216; + int i2217; + int i2218; + int i2219; + int i2220; + int i2221; + int i2222; + int i2223; + int i2224; + int i2225; + int i2226; + int i2227; + int i2228; + int i2229; + int i2230; + int i2231; + int i2232; + int i2233; + int i2234; + int i2235; + int i2236; + int i2237; + int i2238; + int i2239; + int i2240; + int i2241; + int i2242; + int i2243; + int i2244; + int i2245; + int i2246; + int i2247; + int i2248; + int i2249; + int i2250; + int i2251; + int i2252; + int i2253; + int i2254; + int i2255; + int i2256; + int i2257; + int i2258; + int i2259; + int i2260; + int i2261; + int i2262; + int i2263; + int i2264; + int i2265; + int i2266; + int i2267; + int i2268; + int i2269; + int i2270; + int i2271; + int i2272; + int i2273; + int i2274; + int i2275; + int i2276; + int i2277; + int i2278; + int i2279; + int i2280; + int i2281; + int i2282; + int i2283; + int i2284; + int i2285; + int i2286; + int i2287; + int i2288; + int i2289; + int i2290; + int i2291; + int i2292; + int i2293; + int i2294; + int i2295; + int i2296; + int i2297; + int i2298; + int i2299; + int i2300; + int i2301; + int i2302; + int i2303; + int i2304; + int i2305; + int i2306; + int i2307; + int i2308; + int i2309; + int i2310; + int i2311; + int i2312; + int i2313; + int i2314; + int i2315; + int i2316; + int i2317; + int i2318; + int i2319; + int i2320; + int i2321; + int i2322; + int i2323; + int i2324; + int i2325; + int i2326; + int i2327; + int i2328; + int i2329; + int i2330; + int i2331; + int i2332; + int i2333; + int i2334; + int i2335; + int i2336; + int i2337; + int i2338; + int i2339; + int i2340; + int i2341; + int i2342; + int i2343; + int i2344; + int i2345; + int i2346; + int i2347; + int i2348; + int i2349; + int i2350; + int i2351; + int i2352; + int i2353; + int i2354; + int i2355; + int i2356; + int i2357; + int i2358; + int i2359; + int i2360; + int i2361; + int i2362; + int i2363; + int i2364; + int i2365; + int i2366; + int i2367; + int i2368; + int i2369; + int i2370; + int i2371; + int i2372; + int i2373; + int i2374; + int i2375; + int i2376; + int i2377; + int i2378; + int i2379; + int i2380; + int i2381; + int i2382; + int i2383; + int i2384; + int i2385; + int i2386; + int i2387; + int i2388; + int i2389; + int i2390; + int i2391; + int i2392; + int i2393; + int i2394; + int i2395; + int i2396; + int i2397; + int i2398; + int i2399; + int i2400; + int i2401; + int i2402; + int i2403; + int i2404; + int i2405; + int i2406; + int i2407; + int i2408; + int i2409; + int i2410; + int i2411; + int i2412; + int i2413; + int i2414; + int i2415; + int i2416; + int i2417; + int i2418; + int i2419; + int i2420; + int i2421; + int i2422; + int i2423; + int i2424; + int i2425; + int i2426; + int i2427; + int i2428; + int i2429; + int i2430; + int i2431; + int i2432; + int i2433; + int i2434; + int i2435; + int i2436; + int i2437; + int i2438; + int i2439; + int i2440; + int i2441; + int i2442; + int i2443; + int i2444; + int i2445; + int i2446; + int i2447; + int i2448; + int i2449; + int i2450; + int i2451; + int i2452; + int i2453; + int i2454; + int i2455; + int i2456; + int i2457; + int i2458; + int i2459; + int i2460; + int i2461; + int i2462; + int i2463; + int i2464; + int i2465; + int i2466; + int i2467; + int i2468; + int i2469; + int i2470; + int i2471; + int i2472; + int i2473; + int i2474; + int i2475; + int i2476; + int i2477; + int i2478; + int i2479; + int i2480; + int i2481; + int i2482; + int i2483; + int i2484; + int i2485; + int i2486; + int i2487; + int i2488; + int i2489; + int i2490; + int i2491; + int i2492; + int i2493; + int i2494; + int i2495; + int i2496; + int i2497; + int i2498; + int i2499; + int i2500; + int i2501; + int i2502; + int i2503; + int i2504; + int i2505; + int i2506; + int i2507; + int i2508; + int i2509; + int i2510; + int i2511; + int i2512; + int i2513; + int i2514; + int i2515; + int i2516; + int i2517; + int i2518; + int i2519; + int i2520; + int i2521; + int i2522; + int i2523; + int i2524; + int i2525; + int i2526; + int i2527; + int i2528; + int i2529; + int i2530; + int i2531; + int i2532; + int i2533; + int i2534; + int i2535; + int i2536; + int i2537; + int i2538; + int i2539; + int i2540; + int i2541; + int i2542; + int i2543; + int i2544; + int i2545; + int i2546; + int i2547; + int i2548; + int i2549; + int i2550; + int i2551; + int i2552; + int i2553; + int i2554; + int i2555; + int i2556; + int i2557; + int i2558; + int i2559; + int i2560; + int i2561; + int i2562; + int i2563; + int i2564; + int i2565; + int i2566; + int i2567; + int i2568; + int i2569; + int i2570; + int i2571; + int i2572; + int i2573; + int i2574; + int i2575; + int i2576; + int i2577; + int i2578; + int i2579; + int i2580; + int i2581; + int i2582; + int i2583; + int i2584; + int i2585; + int i2586; + int i2587; + int i2588; + int i2589; + int i2590; + int i2591; + int i2592; + int i2593; + int i2594; + int i2595; + int i2596; + int i2597; + int i2598; + int i2599; + int i2600; + int i2601; + int i2602; + int i2603; + int i2604; + int i2605; + int i2606; + int i2607; + int i2608; + int i2609; + int i2610; + int i2611; + int i2612; + int i2613; + int i2614; + int i2615; + int i2616; + int i2617; + int i2618; + int i2619; + int i2620; + int i2621; + int i2622; + int i2623; + int i2624; + int i2625; + int i2626; + int i2627; + int i2628; + int i2629; + int i2630; + int i2631; + int i2632; + int i2633; + int i2634; + int i2635; + int i2636; + int i2637; + int i2638; + int i2639; + int i2640; + int i2641; + int i2642; + int i2643; + int i2644; + int i2645; + int i2646; + int i2647; + int i2648; + int i2649; + int i2650; + int i2651; + int i2652; + int i2653; + int i2654; + int i2655; + int i2656; + int i2657; + int i2658; + int i2659; + int i2660; + int i2661; + int i2662; + int i2663; + int i2664; + int i2665; + int i2666; + int i2667; + int i2668; + int i2669; + int i2670; + int i2671; + int i2672; + int i2673; + int i2674; + int i2675; + int i2676; + int i2677; + int i2678; + int i2679; + int i2680; + int i2681; + int i2682; + int i2683; + int i2684; + int i2685; + int i2686; + int i2687; + int i2688; + int i2689; + int i2690; + int i2691; + int i2692; + int i2693; + int i2694; + int i2695; + int i2696; + int i2697; + int i2698; + int i2699; + int i2700; + int i2701; + int i2702; + int i2703; + int i2704; + int i2705; + int i2706; + int i2707; + int i2708; + int i2709; + int i2710; + int i2711; + int i2712; + int i2713; + int i2714; + int i2715; + int i2716; + int i2717; + int i2718; + int i2719; + int i2720; + int i2721; + int i2722; + int i2723; + int i2724; + int i2725; + int i2726; + int i2727; + int i2728; + int i2729; + int i2730; + int i2731; + int i2732; + int i2733; + int i2734; + int i2735; + int i2736; + int i2737; + int i2738; + int i2739; + int i2740; + int i2741; + int i2742; + int i2743; + int i2744; + int i2745; + int i2746; + int i2747; + int i2748; + int i2749; + int i2750; + int i2751; + int i2752; + int i2753; + int i2754; + int i2755; + int i2756; + int i2757; + int i2758; + int i2759; + int i2760; + int i2761; + int i2762; + int i2763; + int i2764; + int i2765; + int i2766; + int i2767; + int i2768; + int i2769; + int i2770; + int i2771; + int i2772; + int i2773; + int i2774; + int i2775; + int i2776; + int i2777; + int i2778; + int i2779; + int i2780; + int i2781; + int i2782; + int i2783; + int i2784; + int i2785; + int i2786; + int i2787; + int i2788; + int i2789; + int i2790; + int i2791; + int i2792; + int i2793; + int i2794; + int i2795; + int i2796; + int i2797; + int i2798; + int i2799; + int i2800; + int i2801; + int i2802; + int i2803; + int i2804; + int i2805; + int i2806; + int i2807; + int i2808; + int i2809; + int i2810; + int i2811; + int i2812; + int i2813; + int i2814; + int i2815; + int i2816; + int i2817; + int i2818; + int i2819; + int i2820; + int i2821; + int i2822; + int i2823; + int i2824; + int i2825; + int i2826; + int i2827; + int i2828; + int i2829; + int i2830; + int i2831; + int i2832; + int i2833; + int i2834; + int i2835; + int i2836; + int i2837; + int i2838; + int i2839; + int i2840; + int i2841; + int i2842; + int i2843; + int i2844; + int i2845; + int i2846; + int i2847; + int i2848; + int i2849; + int i2850; + int i2851; + int i2852; + int i2853; + int i2854; + int i2855; + int i2856; + int i2857; + int i2858; + int i2859; + int i2860; + int i2861; + int i2862; + int i2863; + int i2864; + int i2865; + int i2866; + int i2867; + int i2868; + int i2869; + int i2870; + int i2871; + int i2872; + int i2873; + int i2874; + int i2875; + int i2876; + int i2877; + int i2878; + int i2879; + int i2880; + int i2881; + int i2882; + int i2883; + int i2884; + int i2885; + int i2886; + int i2887; + int i2888; + int i2889; + int i2890; + int i2891; + int i2892; + int i2893; + int i2894; + int i2895; + int i2896; + int i2897; + int i2898; + int i2899; + int i2900; + int i2901; + int i2902; + int i2903; + int i2904; + int i2905; + int i2906; + int i2907; + int i2908; + int i2909; + int i2910; + int i2911; + int i2912; + int i2913; + int i2914; + int i2915; + int i2916; + int i2917; + int i2918; + int i2919; + int i2920; + int i2921; + int i2922; + int i2923; + int i2924; + int i2925; + int i2926; + int i2927; + int i2928; + int i2929; + int i2930; + int i2931; + int i2932; + int i2933; + int i2934; + int i2935; + int i2936; + int i2937; + int i2938; + int i2939; + int i2940; + int i2941; + int i2942; + int i2943; + int i2944; + int i2945; + int i2946; + int i2947; + int i2948; + int i2949; + int i2950; + int i2951; + int i2952; + int i2953; + int i2954; + int i2955; + int i2956; + int i2957; + int i2958; + int i2959; + int i2960; + int i2961; + int i2962; + int i2963; + int i2964; + int i2965; + int i2966; + int i2967; + int i2968; + int i2969; + int i2970; + int i2971; + int i2972; + int i2973; + int i2974; + int i2975; + int i2976; + int i2977; + int i2978; + int i2979; + int i2980; + int i2981; + int i2982; + int i2983; + int i2984; + int i2985; + int i2986; + int i2987; + int i2988; + int i2989; + int i2990; + int i2991; + int i2992; + int i2993; + int i2994; + int i2995; + int i2996; + int i2997; + int i2998; + int i2999; + int i3000; + int i3001; + int i3002; + int i3003; + int i3004; + int i3005; + int i3006; + int i3007; + int i3008; + int i3009; + int i3010; + int i3011; + int i3012; + int i3013; + int i3014; + int i3015; + int i3016; + int i3017; + int i3018; + int i3019; + int i3020; + int i3021; + int i3022; + int i3023; + int i3024; + int i3025; + int i3026; + int i3027; + int i3028; + int i3029; + int i3030; + int i3031; + int i3032; + int i3033; + int i3034; + int i3035; + int i3036; + int i3037; + int i3038; + int i3039; + int i3040; + int i3041; + int i3042; + int i3043; + int i3044; + int i3045; + int i3046; + int i3047; + int i3048; + int i3049; + int i3050; + int i3051; + int i3052; + int i3053; + int i3054; + int i3055; + int i3056; + int i3057; + int i3058; + int i3059; + int i3060; + int i3061; + int i3062; + int i3063; + int i3064; + int i3065; + int i3066; + int i3067; + int i3068; + int i3069; + int i3070; + int i3071; + int i3072; + int i3073; + int i3074; + int i3075; + int i3076; + int i3077; + int i3078; + int i3079; + int i3080; + int i3081; + int i3082; + int i3083; + int i3084; + int i3085; + int i3086; + int i3087; + int i3088; + int i3089; + int i3090; + int i3091; + int i3092; + int i3093; + int i3094; + int i3095; + int i3096; + int i3097; + int i3098; + int i3099; + int i3100; + int i3101; + int i3102; + int i3103; + int i3104; + int i3105; + int i3106; + int i3107; + int i3108; + int i3109; + int i3110; + int i3111; + int i3112; + int i3113; + int i3114; + int i3115; + int i3116; + int i3117; + int i3118; + int i3119; + int i3120; + int i3121; + int i3122; + int i3123; + int i3124; + int i3125; + int i3126; + int i3127; + int i3128; + int i3129; + int i3130; + int i3131; + int i3132; + int i3133; + int i3134; + int i3135; + int i3136; + int i3137; + int i3138; + int i3139; + int i3140; + int i3141; + int i3142; + int i3143; + int i3144; + int i3145; + int i3146; + int i3147; + int i3148; + int i3149; + int i3150; + int i3151; + int i3152; + int i3153; + int i3154; + int i3155; + int i3156; + int i3157; + int i3158; + int i3159; + int i3160; + int i3161; + int i3162; + int i3163; + int i3164; + int i3165; + int i3166; + int i3167; + int i3168; + int i3169; + int i3170; + int i3171; + int i3172; + int i3173; + int i3174; + int i3175; + int i3176; + int i3177; + int i3178; + int i3179; + int i3180; + int i3181; + int i3182; + int i3183; + int i3184; + int i3185; + int i3186; + int i3187; + int i3188; + int i3189; + int i3190; + int i3191; + int i3192; + int i3193; + int i3194; + int i3195; + int i3196; + int i3197; + int i3198; + int i3199; + int i3200; + int i3201; + int i3202; + int i3203; + int i3204; + int i3205; + int i3206; + int i3207; + int i3208; + int i3209; + int i3210; + int i3211; + int i3212; + int i3213; + int i3214; + int i3215; + int i3216; + int i3217; + int i3218; + int i3219; + int i3220; + int i3221; + int i3222; + int i3223; + int i3224; + int i3225; + int i3226; + int i3227; + int i3228; + int i3229; + int i3230; + int i3231; + int i3232; + int i3233; + int i3234; + int i3235; + int i3236; + int i3237; + int i3238; + int i3239; + int i3240; + int i3241; + int i3242; + int i3243; + int i3244; + int i3245; + int i3246; + int i3247; + int i3248; + int i3249; + int i3250; + int i3251; + int i3252; + int i3253; + int i3254; + int i3255; + int i3256; + int i3257; + int i3258; + int i3259; + int i3260; + int i3261; + int i3262; + int i3263; + int i3264; + int i3265; + int i3266; + int i3267; + int i3268; + int i3269; + int i3270; + int i3271; + int i3272; + int i3273; + int i3274; + int i3275; + int i3276; + int i3277; + int i3278; + int i3279; + int i3280; + int i3281; + int i3282; + int i3283; + int i3284; + int i3285; + int i3286; + int i3287; + int i3288; + int i3289; + int i3290; + int i3291; + int i3292; + int i3293; + int i3294; + int i3295; + int i3296; + int i3297; + int i3298; + int i3299; + int i3300; + int i3301; + int i3302; + int i3303; + int i3304; + int i3305; + int i3306; + int i3307; + int i3308; + int i3309; + int i3310; + int i3311; + int i3312; + int i3313; + int i3314; + int i3315; + int i3316; + int i3317; + int i3318; + int i3319; + int i3320; + int i3321; + int i3322; + int i3323; + int i3324; + int i3325; + int i3326; + int i3327; + int i3328; + int i3329; + int i3330; + int i3331; + int i3332; + int i3333; + int i3334; + int i3335; + int i3336; + int i3337; + int i3338; + int i3339; + int i3340; + int i3341; + int i3342; + int i3343; + int i3344; + int i3345; + int i3346; + int i3347; + int i3348; + int i3349; + int i3350; + int i3351; + int i3352; + int i3353; + int i3354; + int i3355; + int i3356; + int i3357; + int i3358; + int i3359; + int i3360; + int i3361; + int i3362; + int i3363; + int i3364; + int i3365; + int i3366; + int i3367; + int i3368; + int i3369; + int i3370; + int i3371; + int i3372; + int i3373; + int i3374; + int i3375; + int i3376; + int i3377; + int i3378; + int i3379; + int i3380; + int i3381; + int i3382; + int i3383; + int i3384; + int i3385; + int i3386; + int i3387; + int i3388; + int i3389; + int i3390; + int i3391; + int i3392; + int i3393; + int i3394; + int i3395; + int i3396; + int i3397; + int i3398; + int i3399; + int i3400; + int i3401; + int i3402; + int i3403; + int i3404; + int i3405; + int i3406; + int i3407; + int i3408; + int i3409; + int i3410; + int i3411; + int i3412; + int i3413; + int i3414; + int i3415; + int i3416; + int i3417; + int i3418; + int i3419; + int i3420; + int i3421; + int i3422; + int i3423; + int i3424; + int i3425; + int i3426; + int i3427; + int i3428; + int i3429; + int i3430; + int i3431; + int i3432; + int i3433; + int i3434; + int i3435; + int i3436; + int i3437; + int i3438; + int i3439; + int i3440; + int i3441; + int i3442; + int i3443; + int i3444; + int i3445; + int i3446; + int i3447; + int i3448; + int i3449; + int i3450; + int i3451; + int i3452; + int i3453; + int i3454; + int i3455; + int i3456; + int i3457; + int i3458; + int i3459; + int i3460; + int i3461; + int i3462; + int i3463; + int i3464; + int i3465; + int i3466; + int i3467; + int i3468; + int i3469; + int i3470; + int i3471; + int i3472; + int i3473; + int i3474; + int i3475; + int i3476; + int i3477; + int i3478; + int i3479; + int i3480; + int i3481; + int i3482; + int i3483; + int i3484; + int i3485; + int i3486; + int i3487; + int i3488; + int i3489; + int i3490; + int i3491; + int i3492; + int i3493; + int i3494; + int i3495; + int i3496; + int i3497; + int i3498; + int i3499; + int i3500; + int i3501; + int i3502; + int i3503; + int i3504; + int i3505; + int i3506; + int i3507; + int i3508; + int i3509; + int i3510; + int i3511; + int i3512; + int i3513; + int i3514; + int i3515; + int i3516; + int i3517; + int i3518; + int i3519; + int i3520; + int i3521; + int i3522; + int i3523; + int i3524; + int i3525; + int i3526; + int i3527; + int i3528; + int i3529; + int i3530; + int i3531; + int i3532; + int i3533; + int i3534; + int i3535; + int i3536; + int i3537; + int i3538; + int i3539; + int i3540; + int i3541; + int i3542; + int i3543; + int i3544; + int i3545; + int i3546; + int i3547; + int i3548; + int i3549; + int i3550; + int i3551; + int i3552; + int i3553; + int i3554; + int i3555; + int i3556; + int i3557; + int i3558; + int i3559; + int i3560; + int i3561; + int i3562; + int i3563; + int i3564; + int i3565; + int i3566; + int i3567; + int i3568; + int i3569; + int i3570; + int i3571; + int i3572; + int i3573; + int i3574; + int i3575; + int i3576; + int i3577; + int i3578; + int i3579; + int i3580; + int i3581; + int i3582; + int i3583; + int i3584; + int i3585; + int i3586; + int i3587; + int i3588; + int i3589; + int i3590; + int i3591; + int i3592; + int i3593; + int i3594; + int i3595; + int i3596; + int i3597; + int i3598; + int i3599; + int i3600; + int i3601; + int i3602; + int i3603; + int i3604; + int i3605; + int i3606; + int i3607; + int i3608; + int i3609; + int i3610; + int i3611; + int i3612; + int i3613; + int i3614; + int i3615; + int i3616; + int i3617; + int i3618; + int i3619; + int i3620; + int i3621; + int i3622; + int i3623; + int i3624; + int i3625; + int i3626; + int i3627; + int i3628; + int i3629; + int i3630; + int i3631; + int i3632; + int i3633; + int i3634; + int i3635; + int i3636; + int i3637; + int i3638; + int i3639; + int i3640; + int i3641; + int i3642; + int i3643; + int i3644; + int i3645; + int i3646; + int i3647; + int i3648; + int i3649; + int i3650; + int i3651; + int i3652; + int i3653; + int i3654; + int i3655; + int i3656; + int i3657; + int i3658; + int i3659; + int i3660; + int i3661; + int i3662; + int i3663; + int i3664; + int i3665; + int i3666; + int i3667; + int i3668; + int i3669; + int i3670; + int i3671; + int i3672; + int i3673; + int i3674; + int i3675; + int i3676; + int i3677; + int i3678; + int i3679; + int i3680; + int i3681; + int i3682; + int i3683; + int i3684; + int i3685; + int i3686; + int i3687; + int i3688; + int i3689; + int i3690; + int i3691; + int i3692; + int i3693; + int i3694; + int i3695; + int i3696; + int i3697; + int i3698; + int i3699; + int i3700; + int i3701; + int i3702; + int i3703; + int i3704; + int i3705; + int i3706; + int i3707; + int i3708; + int i3709; + int i3710; + int i3711; + int i3712; + int i3713; + int i3714; + int i3715; + int i3716; + int i3717; + int i3718; + int i3719; + int i3720; + int i3721; + int i3722; + int i3723; + int i3724; + int i3725; + int i3726; + int i3727; + int i3728; + int i3729; + int i3730; + int i3731; + int i3732; + int i3733; + int i3734; + int i3735; + int i3736; + int i3737; + int i3738; + int i3739; + int i3740; + int i3741; + int i3742; + int i3743; + int i3744; + int i3745; + int i3746; + int i3747; + int i3748; + int i3749; + int i3750; + int i3751; + int i3752; + int i3753; + int i3754; + int i3755; + int i3756; + int i3757; + int i3758; + int i3759; + int i3760; + int i3761; + int i3762; + int i3763; + int i3764; + int i3765; + int i3766; + int i3767; + int i3768; + int i3769; + int i3770; + int i3771; + int i3772; + int i3773; + int i3774; + int i3775; + int i3776; + int i3777; + int i3778; + int i3779; + int i3780; + int i3781; + int i3782; + int i3783; + int i3784; + int i3785; + int i3786; + int i3787; + int i3788; + int i3789; + int i3790; + int i3791; + int i3792; + int i3793; + int i3794; + int i3795; + int i3796; + int i3797; + int i3798; + int i3799; + int i3800; + int i3801; + int i3802; + int i3803; + int i3804; + int i3805; + int i3806; + int i3807; + int i3808; + int i3809; + int i3810; + int i3811; + int i3812; + int i3813; + int i3814; + int i3815; + int i3816; + int i3817; + int i3818; + int i3819; + int i3820; + int i3821; + int i3822; + int i3823; + int i3824; + int i3825; + int i3826; + int i3827; + int i3828; + int i3829; + int i3830; + int i3831; + int i3832; + int i3833; + int i3834; + int i3835; + int i3836; + int i3837; + int i3838; + int i3839; + int i3840; + int i3841; + int i3842; + int i3843; + int i3844; + int i3845; + int i3846; + int i3847; + int i3848; + int i3849; + int i3850; + int i3851; + int i3852; + int i3853; + int i3854; + int i3855; + int i3856; + int i3857; + int i3858; + int i3859; + int i3860; + int i3861; + int i3862; + int i3863; + int i3864; + int i3865; + int i3866; + int i3867; + int i3868; + int i3869; + int i3870; + int i3871; + int i3872; + int i3873; + int i3874; + int i3875; + int i3876; + int i3877; + int i3878; + int i3879; + int i3880; + int i3881; + int i3882; + int i3883; + int i3884; + int i3885; + int i3886; + int i3887; + int i3888; + int i3889; + int i3890; + int i3891; + int i3892; + int i3893; + int i3894; + int i3895; + int i3896; + int i3897; + int i3898; + int i3899; + int i3900; + int i3901; + int i3902; + int i3903; + int i3904; + int i3905; + int i3906; + int i3907; + int i3908; + int i3909; + int i3910; + int i3911; + int i3912; + int i3913; + int i3914; + int i3915; + int i3916; + int i3917; + int i3918; + int i3919; + int i3920; + int i3921; + int i3922; + int i3923; + int i3924; + int i3925; + int i3926; + int i3927; + int i3928; + int i3929; + int i3930; + int i3931; + int i3932; + int i3933; + int i3934; + int i3935; + int i3936; + int i3937; + int i3938; + int i3939; + int i3940; + int i3941; + int i3942; + int i3943; + int i3944; + int i3945; + int i3946; + int i3947; + int i3948; + int i3949; + int i3950; + int i3951; + int i3952; + int i3953; + int i3954; + int i3955; + int i3956; + int i3957; + int i3958; + int i3959; + int i3960; + int i3961; + int i3962; + int i3963; + int i3964; + int i3965; + int i3966; + int i3967; + int i3968; + int i3969; + int i3970; + int i3971; + int i3972; + int i3973; + int i3974; + int i3975; + int i3976; + int i3977; + int i3978; + int i3979; + int i3980; + int i3981; + int i3982; + int i3983; + int i3984; + int i3985; + int i3986; + int i3987; + int i3988; + int i3989; + int i3990; + int i3991; + int i3992; + int i3993; + int i3994; + int i3995; + int i3996; + int i3997; + int i3998; + int i3999; + int i4000; + int i4001; + int i4002; + int i4003; + int i4004; + int i4005; + int i4006; + int i4007; + int i4008; + int i4009; + int i4010; + int i4011; + int i4012; + int i4013; + int i4014; + int i4015; + int i4016; + int i4017; + int i4018; + int i4019; + int i4020; + int i4021; + int i4022; + int i4023; + int i4024; + int i4025; + int i4026; + int i4027; + int i4028; + int i4029; + int i4030; + int i4031; + int i4032; + int i4033; + int i4034; + int i4035; + int i4036; + int i4037; + int i4038; + int i4039; + int i4040; + int i4041; + int i4042; + int i4043; + int i4044; + int i4045; + int i4046; + int i4047; + int i4048; + int i4049; + int i4050; + int i4051; + int i4052; + int i4053; + int i4054; + int i4055; + int i4056; + int i4057; + int i4058; + int i4059; + int i4060; + int i4061; + int i4062; + int i4063; + int i4064; + int i4065; + int i4066; + int i4067; + int i4068; + int i4069; + int i4070; + int i4071; + int i4072; + int i4073; + int i4074; + int i4075; + int i4076; + int i4077; + int i4078; + int i4079; + int i4080; + int i4081; + int i4082; + int i4083; + int i4084; + int i4085; + int i4086; + int i4087; + int i4088; + int i4089; + int i4090; + int i4091; + int i4092; + int i4093; + int i4094; + int i4095; + int i4096; + int i4097; + int i4098; + int i4099; + int i4100; + int i4101; + int i4102; + int i4103; + int i4104; + int i4105; + int i4106; + int i4107; + int i4108; + int i4109; + int i4110; + int i4111; + int i4112; + int i4113; + int i4114; + int i4115; + int i4116; + int i4117; + int i4118; + int i4119; + int i4120; + int i4121; + int i4122; + int i4123; + int i4124; + int i4125; + int i4126; + int i4127; + int i4128; + int i4129; + int i4130; + int i4131; + int i4132; + int i4133; + int i4134; + int i4135; + int i4136; + int i4137; + int i4138; + int i4139; + int i4140; + int i4141; + int i4142; + int i4143; + int i4144; + int i4145; + int i4146; + int i4147; + int i4148; + int i4149; + int i4150; + int i4151; + int i4152; + int i4153; + int i4154; + int i4155; + int i4156; + int i4157; + int i4158; + int i4159; + int i4160; + int i4161; + int i4162; + int i4163; + int i4164; + int i4165; + int i4166; + int i4167; + int i4168; + int i4169; + int i4170; + int i4171; + int i4172; + int i4173; + int i4174; + int i4175; + int i4176; + int i4177; + int i4178; + int i4179; + int i4180; + int i4181; + int i4182; + int i4183; + int i4184; + int i4185; + int i4186; + int i4187; + int i4188; + int i4189; + int i4190; + int i4191; + int i4192; + int i4193; + int i4194; + int i4195; + int i4196; + int i4197; + int i4198; + int i4199; + int i4200; + int i4201; + int i4202; + int i4203; + int i4204; + int i4205; + int i4206; + int i4207; + int i4208; + int i4209; + int i4210; + int i4211; + int i4212; + int i4213; + int i4214; + int i4215; + int i4216; + int i4217; + int i4218; + int i4219; + int i4220; + int i4221; + int i4222; + int i4223; + int i4224; + int i4225; + int i4226; + int i4227; + int i4228; + int i4229; + int i4230; + int i4231; + int i4232; + int i4233; + int i4234; + int i4235; + int i4236; + int i4237; + int i4238; + int i4239; + int i4240; + int i4241; + int i4242; + int i4243; + int i4244; + int i4245; + int i4246; + int i4247; + int i4248; + int i4249; + int i4250; + int i4251; + int i4252; + int i4253; + int i4254; + int i4255; + int i4256; + int i4257; + int i4258; + int i4259; + int i4260; + int i4261; + int i4262; + int i4263; + int i4264; + int i4265; + int i4266; + int i4267; + int i4268; + int i4269; + int i4270; + int i4271; + int i4272; + int i4273; + int i4274; + int i4275; + int i4276; + int i4277; + int i4278; + int i4279; + int i4280; + int i4281; + int i4282; + int i4283; + int i4284; + int i4285; + int i4286; + int i4287; + int i4288; + int i4289; + int i4290; + int i4291; + int i4292; + int i4293; + int i4294; + int i4295; + int i4296; + int i4297; + int i4298; + int i4299; + int i4300; + int i4301; + int i4302; + int i4303; + int i4304; + int i4305; + int i4306; + int i4307; + int i4308; + int i4309; + int i4310; + int i4311; + int i4312; + int i4313; + int i4314; + int i4315; + int i4316; + int i4317; + int i4318; + int i4319; + int i4320; + int i4321; + int i4322; + int i4323; + int i4324; + int i4325; + int i4326; + int i4327; + int i4328; + int i4329; + int i4330; + int i4331; + int i4332; + int i4333; + int i4334; + int i4335; + int i4336; + int i4337; + int i4338; + int i4339; + int i4340; + int i4341; + int i4342; + int i4343; + int i4344; + int i4345; + int i4346; + int i4347; + int i4348; + int i4349; + int i4350; + int i4351; + int i4352; + int i4353; + int i4354; + int i4355; + int i4356; + int i4357; + int i4358; + int i4359; + int i4360; + int i4361; + int i4362; + int i4363; + int i4364; + int i4365; + int i4366; + int i4367; + int i4368; + int i4369; + int i4370; + int i4371; + int i4372; + int i4373; + int i4374; + int i4375; + int i4376; + int i4377; + int i4378; + int i4379; + int i4380; + int i4381; + int i4382; + int i4383; + int i4384; + int i4385; + int i4386; + int i4387; + int i4388; + int i4389; + int i4390; + int i4391; + int i4392; + int i4393; + int i4394; + int i4395; + int i4396; + int i4397; + int i4398; + int i4399; + int i4400; + int i4401; + int i4402; + int i4403; + int i4404; + int i4405; + int i4406; + int i4407; + int i4408; + int i4409; + int i4410; + int i4411; + int i4412; + int i4413; + int i4414; + int i4415; + int i4416; + int i4417; + int i4418; + int i4419; + int i4420; + int i4421; + int i4422; + int i4423; + int i4424; + int i4425; + int i4426; + int i4427; + int i4428; + int i4429; + int i4430; + int i4431; + int i4432; + int i4433; + int i4434; + int i4435; + int i4436; + int i4437; + int i4438; + int i4439; + int i4440; + int i4441; + int i4442; + int i4443; + int i4444; + int i4445; + int i4446; + int i4447; + int i4448; + int i4449; + int i4450; + int i4451; + int i4452; + int i4453; + int i4454; + int i4455; + int i4456; + int i4457; + int i4458; + int i4459; + int i4460; + int i4461; + int i4462; + int i4463; + int i4464; + int i4465; + int i4466; + int i4467; + int i4468; + int i4469; + int i4470; + int i4471; + int i4472; + int i4473; + int i4474; + int i4475; + int i4476; + int i4477; + int i4478; + int i4479; + int i4480; + int i4481; + int i4482; + int i4483; + int i4484; + int i4485; + int i4486; + int i4487; + int i4488; + int i4489; + int i4490; + int i4491; + int i4492; + int i4493; + int i4494; + int i4495; + int i4496; + int i4497; + int i4498; + int i4499; + int i4500; + int i4501; + int i4502; + int i4503; + int i4504; + int i4505; + int i4506; + int i4507; + int i4508; + int i4509; + int i4510; + int i4511; + int i4512; + int i4513; + int i4514; + int i4515; + int i4516; + int i4517; + int i4518; + int i4519; + int i4520; + int i4521; + int i4522; + int i4523; + int i4524; + int i4525; + int i4526; + int i4527; + int i4528; + int i4529; + int i4530; + int i4531; + int i4532; + int i4533; + int i4534; + int i4535; + int i4536; + int i4537; + int i4538; + int i4539; + int i4540; + int i4541; + int i4542; + int i4543; + int i4544; + int i4545; + int i4546; + int i4547; + int i4548; + int i4549; + int i4550; + int i4551; + int i4552; + int i4553; + int i4554; + int i4555; + int i4556; + int i4557; + int i4558; + int i4559; + int i4560; + int i4561; + int i4562; + int i4563; + int i4564; + int i4565; + int i4566; + int i4567; + int i4568; + int i4569; + int i4570; + int i4571; + int i4572; + int i4573; + int i4574; + int i4575; + int i4576; + int i4577; + int i4578; + int i4579; + int i4580; + int i4581; + int i4582; + int i4583; + int i4584; + int i4585; + int i4586; + int i4587; + int i4588; + int i4589; + int i4590; + int i4591; + int i4592; + int i4593; + int i4594; + int i4595; + int i4596; + int i4597; + int i4598; + int i4599; + int i4600; + int i4601; + int i4602; + int i4603; + int i4604; + int i4605; + int i4606; + int i4607; + int i4608; + int i4609; + int i4610; + int i4611; + int i4612; + int i4613; + int i4614; + int i4615; + int i4616; + int i4617; + int i4618; + int i4619; + int i4620; + int i4621; + int i4622; + int i4623; + int i4624; + int i4625; + int i4626; + int i4627; + int i4628; + int i4629; + int i4630; + int i4631; + int i4632; + int i4633; + int i4634; + int i4635; + int i4636; + int i4637; + int i4638; + int i4639; + int i4640; + int i4641; + int i4642; + int i4643; + int i4644; + int i4645; + int i4646; + int i4647; + int i4648; + int i4649; + int i4650; + int i4651; + int i4652; + int i4653; + int i4654; + int i4655; + int i4656; + int i4657; + int i4658; + int i4659; + int i4660; + int i4661; + int i4662; + int i4663; + int i4664; + int i4665; + int i4666; + int i4667; + int i4668; + int i4669; + int i4670; + int i4671; + int i4672; + int i4673; + int i4674; + int i4675; + int i4676; + int i4677; + int i4678; + int i4679; + int i4680; + int i4681; + int i4682; + int i4683; + int i4684; + int i4685; + int i4686; + int i4687; + int i4688; + int i4689; + int i4690; + int i4691; + int i4692; + int i4693; + int i4694; + int i4695; + int i4696; + int i4697; + int i4698; + int i4699; + int i4700; + int i4701; + int i4702; + int i4703; + int i4704; + int i4705; + int i4706; + int i4707; + int i4708; + int i4709; + int i4710; + int i4711; + int i4712; + int i4713; + int i4714; + int i4715; + int i4716; + int i4717; + int i4718; + int i4719; + int i4720; + int i4721; + int i4722; + int i4723; + int i4724; + int i4725; + int i4726; + int i4727; + int i4728; + int i4729; + int i4730; + int i4731; + int i4732; + int i4733; + int i4734; + int i4735; + int i4736; + int i4737; + int i4738; + int i4739; + int i4740; + int i4741; + int i4742; + int i4743; + int i4744; + int i4745; + int i4746; + int i4747; + int i4748; + int i4749; + int i4750; + int i4751; + int i4752; + int i4753; + int i4754; + int i4755; + int i4756; + int i4757; + int i4758; + int i4759; + int i4760; + int i4761; + int i4762; + int i4763; + int i4764; + int i4765; + int i4766; + int i4767; + int i4768; + int i4769; + int i4770; + int i4771; + int i4772; + int i4773; + int i4774; + int i4775; + int i4776; + int i4777; + int i4778; + int i4779; + int i4780; + int i4781; + int i4782; + int i4783; + int i4784; + int i4785; + int i4786; + int i4787; + int i4788; + int i4789; + int i4790; + int i4791; + int i4792; + int i4793; + int i4794; + int i4795; + int i4796; + int i4797; + int i4798; + int i4799; + int i4800; + int i4801; + int i4802; + int i4803; + int i4804; + int i4805; + int i4806; + int i4807; + int i4808; + int i4809; + int i4810; + int i4811; + int i4812; + int i4813; + int i4814; + int i4815; + int i4816; + int i4817; + int i4818; + int i4819; + int i4820; + int i4821; + int i4822; + int i4823; + int i4824; + int i4825; + int i4826; + int i4827; + int i4828; + int i4829; + int i4830; + int i4831; + int i4832; + int i4833; + int i4834; + int i4835; + int i4836; + int i4837; + int i4838; + int i4839; + int i4840; + int i4841; + int i4842; + int i4843; + int i4844; + int i4845; + int i4846; + int i4847; + int i4848; + int i4849; + int i4850; + int i4851; + int i4852; + int i4853; + int i4854; + int i4855; + int i4856; + int i4857; + int i4858; + int i4859; + int i4860; + int i4861; + int i4862; + int i4863; + int i4864; + int i4865; + int i4866; + int i4867; + int i4868; + int i4869; + int i4870; + int i4871; + int i4872; + int i4873; + int i4874; + int i4875; + int i4876; + int i4877; + int i4878; + int i4879; + int i4880; + int i4881; + int i4882; + int i4883; + int i4884; + int i4885; + int i4886; + int i4887; + int i4888; + int i4889; + int i4890; + int i4891; + int i4892; + int i4893; + int i4894; + int i4895; + int i4896; + int i4897; + int i4898; + int i4899; + int i4900; + int i4901; + int i4902; + int i4903; + int i4904; + int i4905; + int i4906; + int i4907; + int i4908; + int i4909; + int i4910; + int i4911; + int i4912; + int i4913; + int i4914; + int i4915; + int i4916; + int i4917; + int i4918; + int i4919; + int i4920; + int i4921; + int i4922; + int i4923; + int i4924; + int i4925; + int i4926; + int i4927; + int i4928; + int i4929; + int i4930; + int i4931; + int i4932; + int i4933; + int i4934; + int i4935; + int i4936; + int i4937; + int i4938; + int i4939; + int i4940; + int i4941; + int i4942; + int i4943; + int i4944; + int i4945; + int i4946; + int i4947; + int i4948; + int i4949; + int i4950; + int i4951; + int i4952; + int i4953; + int i4954; + int i4955; + int i4956; + int i4957; + int i4958; + int i4959; + int i4960; + int i4961; + int i4962; + int i4963; + int i4964; + int i4965; + int i4966; + int i4967; + int i4968; + int i4969; + int i4970; + int i4971; + int i4972; + int i4973; + int i4974; + int i4975; + int i4976; + int i4977; + int i4978; + int i4979; + int i4980; + int i4981; + int i4982; + int i4983; + int i4984; + int i4985; + int i4986; + int i4987; + int i4988; + int i4989; + int i4990; + int i4991; + int i4992; + int i4993; + int i4994; + int i4995; + int i4996; + int i4997; + int i4998; + int i4999; + int i5000; + int i5001; + int i5002; + int i5003; + int i5004; + int i5005; + int i5006; + int i5007; + int i5008; + int i5009; + int i5010; + int i5011; + int i5012; + int i5013; + int i5014; + int i5015; + int i5016; + int i5017; + int i5018; + int i5019; + int i5020; + int i5021; + int i5022; + int i5023; + int i5024; + int i5025; + int i5026; + int i5027; + int i5028; + int i5029; + int i5030; + int i5031; + int i5032; + int i5033; + int i5034; + int i5035; + int i5036; + int i5037; + int i5038; + int i5039; + int i5040; + int i5041; + int i5042; + int i5043; + int i5044; + int i5045; + int i5046; + int i5047; + int i5048; + int i5049; + int i5050; + int i5051; + int i5052; + int i5053; + int i5054; + int i5055; + int i5056; + int i5057; + int i5058; + int i5059; + int i5060; + int i5061; + int i5062; + int i5063; + int i5064; + int i5065; + int i5066; + int i5067; + int i5068; + int i5069; + int i5070; + int i5071; + int i5072; + int i5073; + int i5074; + int i5075; + int i5076; + int i5077; + int i5078; + int i5079; + int i5080; + int i5081; + int i5082; + int i5083; + int i5084; + int i5085; + int i5086; + int i5087; + int i5088; + int i5089; + int i5090; + int i5091; + int i5092; + int i5093; + int i5094; + int i5095; + int i5096; + int i5097; + int i5098; + int i5099; + int i5100; + int i5101; + int i5102; + int i5103; + int i5104; + int i5105; + int i5106; + int i5107; + int i5108; + int i5109; + int i5110; + int i5111; + int i5112; + int i5113; + int i5114; + int i5115; + int i5116; + int i5117; + int i5118; + int i5119; + int i5120; + int i5121; + int i5122; + int i5123; + int i5124; + int i5125; + int i5126; + int i5127; + int i5128; + int i5129; + int i5130; + int i5131; + int i5132; + int i5133; + int i5134; + int i5135; + int i5136; + int i5137; + int i5138; + int i5139; + int i5140; + int i5141; + int i5142; + int i5143; + int i5144; + int i5145; + int i5146; + int i5147; + int i5148; + int i5149; + int i5150; + int i5151; + int i5152; + int i5153; + int i5154; + int i5155; + int i5156; + int i5157; + int i5158; + int i5159; + int i5160; + int i5161; + int i5162; + int i5163; + int i5164; + int i5165; + int i5166; + int i5167; + int i5168; + int i5169; + int i5170; + int i5171; + int i5172; + int i5173; + int i5174; + int i5175; + int i5176; + int i5177; + int i5178; + int i5179; + int i5180; + int i5181; + int i5182; + int i5183; + int i5184; + int i5185; + int i5186; + int i5187; + int i5188; + int i5189; + int i5190; + int i5191; + int i5192; + int i5193; + int i5194; + int i5195; + int i5196; + int i5197; + int i5198; + int i5199; + int i5200; + int i5201; + int i5202; + int i5203; + int i5204; + int i5205; + int i5206; + int i5207; + int i5208; + int i5209; + int i5210; + int i5211; + int i5212; + int i5213; + int i5214; + int i5215; + int i5216; + int i5217; + int i5218; + int i5219; + int i5220; + int i5221; + int i5222; + int i5223; + int i5224; + int i5225; + int i5226; + int i5227; + int i5228; + int i5229; + int i5230; + int i5231; + int i5232; + int i5233; + int i5234; + int i5235; + int i5236; + int i5237; + int i5238; + int i5239; + int i5240; + int i5241; + int i5242; + int i5243; + int i5244; + int i5245; + int i5246; + int i5247; + int i5248; + int i5249; + int i5250; + int i5251; + int i5252; + int i5253; + int i5254; + int i5255; + int i5256; + int i5257; + int i5258; + int i5259; + int i5260; + int i5261; + int i5262; + int i5263; + int i5264; + int i5265; + int i5266; + int i5267; + int i5268; + int i5269; + int i5270; + int i5271; + int i5272; + int i5273; + int i5274; + int i5275; + int i5276; + int i5277; + int i5278; + int i5279; + int i5280; + int i5281; + int i5282; + int i5283; + int i5284; + int i5285; + int i5286; + int i5287; + int i5288; + int i5289; + int i5290; + int i5291; + int i5292; + int i5293; + int i5294; + int i5295; + int i5296; + int i5297; + int i5298; + int i5299; + int i5300; + int i5301; + int i5302; + int i5303; + int i5304; + int i5305; + int i5306; + int i5307; + int i5308; + int i5309; + int i5310; + int i5311; + int i5312; + int i5313; + int i5314; + int i5315; + int i5316; + int i5317; + int i5318; + int i5319; + int i5320; + int i5321; + int i5322; + int i5323; + int i5324; + int i5325; + int i5326; + int i5327; + int i5328; + int i5329; + int i5330; + int i5331; + int i5332; + int i5333; + int i5334; + int i5335; + int i5336; + int i5337; + int i5338; + int i5339; + int i5340; + int i5341; + int i5342; + int i5343; + int i5344; + int i5345; + int i5346; + int i5347; + int i5348; + int i5349; + int i5350; + int i5351; + int i5352; + int i5353; + int i5354; + int i5355; + int i5356; + int i5357; + int i5358; + int i5359; + int i5360; + int i5361; + int i5362; + int i5363; + int i5364; + int i5365; + int i5366; + int i5367; + int i5368; + int i5369; + int i5370; + int i5371; + int i5372; + int i5373; + int i5374; + int i5375; + int i5376; + int i5377; + int i5378; + int i5379; + int i5380; + int i5381; + int i5382; + int i5383; + int i5384; + int i5385; + int i5386; + int i5387; + int i5388; + int i5389; + int i5390; + int i5391; + int i5392; + int i5393; + int i5394; + int i5395; + int i5396; + int i5397; + int i5398; + int i5399; + int i5400; + int i5401; + int i5402; + int i5403; + int i5404; + int i5405; + int i5406; + int i5407; + int i5408; + int i5409; + int i5410; + int i5411; + int i5412; + int i5413; + int i5414; + int i5415; + int i5416; + int i5417; + int i5418; + int i5419; + int i5420; + int i5421; + int i5422; + int i5423; + int i5424; + int i5425; + int i5426; + int i5427; + int i5428; + int i5429; + int i5430; + int i5431; + int i5432; + int i5433; + int i5434; + int i5435; + int i5436; + int i5437; + int i5438; + int i5439; + int i5440; + int i5441; + int i5442; + int i5443; + int i5444; + int i5445; + int i5446; + int i5447; + int i5448; + int i5449; + int i5450; + int i5451; + int i5452; + int i5453; + int i5454; + int i5455; + int i5456; + int i5457; + int i5458; + int i5459; + int i5460; + int i5461; + int i5462; + int i5463; + int i5464; + int i5465; + int i5466; + int i5467; + int i5468; + int i5469; + int i5470; + int i5471; + int i5472; + int i5473; + int i5474; + int i5475; + int i5476; + int i5477; + int i5478; + int i5479; + int i5480; + int i5481; + int i5482; + int i5483; + int i5484; + int i5485; + int i5486; + int i5487; + int i5488; + int i5489; + int i5490; + int i5491; + int i5492; + int i5493; + int i5494; + int i5495; + int i5496; + int i5497; + int i5498; + int i5499; + int i5500; + int i5501; + int i5502; + int i5503; + int i5504; + int i5505; + int i5506; + int i5507; + int i5508; + int i5509; + int i5510; + int i5511; + int i5512; + int i5513; + int i5514; + int i5515; + int i5516; + int i5517; + int i5518; + int i5519; + int i5520; + int i5521; + int i5522; + int i5523; + int i5524; + int i5525; + int i5526; + int i5527; + int i5528; + int i5529; + int i5530; + int i5531; + int i5532; + int i5533; + int i5534; + int i5535; + int i5536; + int i5537; + int i5538; + int i5539; + int i5540; + int i5541; + int i5542; + int i5543; + int i5544; + int i5545; + int i5546; + int i5547; + int i5548; + int i5549; + int i5550; + int i5551; + int i5552; + int i5553; + int i5554; + int i5555; + int i5556; + int i5557; + int i5558; + int i5559; + int i5560; + int i5561; + int i5562; + int i5563; + int i5564; + int i5565; + int i5566; + int i5567; + int i5568; + int i5569; + int i5570; + int i5571; + int i5572; + int i5573; + int i5574; + int i5575; + int i5576; + int i5577; + int i5578; + int i5579; + int i5580; + int i5581; + int i5582; + int i5583; + int i5584; + int i5585; + int i5586; + int i5587; + int i5588; + int i5589; + int i5590; + int i5591; + int i5592; + int i5593; + int i5594; + int i5595; + int i5596; + int i5597; + int i5598; + int i5599; + int i5600; + int i5601; + int i5602; + int i5603; + int i5604; + int i5605; + int i5606; + int i5607; + int i5608; + int i5609; + int i5610; + int i5611; + int i5612; + int i5613; + int i5614; + int i5615; + int i5616; + int i5617; + int i5618; + int i5619; + int i5620; + int i5621; + int i5622; + int i5623; + int i5624; + int i5625; + int i5626; + int i5627; + int i5628; + int i5629; + int i5630; + int i5631; + int i5632; + int i5633; + int i5634; + int i5635; + int i5636; + int i5637; + int i5638; + int i5639; + int i5640; + int i5641; + int i5642; + int i5643; + int i5644; + int i5645; + int i5646; + int i5647; + int i5648; + int i5649; + int i5650; + int i5651; + int i5652; + int i5653; + int i5654; + int i5655; + int i5656; + int i5657; + int i5658; + int i5659; + int i5660; + int i5661; + int i5662; + int i5663; + int i5664; + int i5665; + int i5666; + int i5667; + int i5668; + int i5669; + int i5670; + int i5671; + int i5672; + int i5673; + int i5674; + int i5675; + int i5676; + int i5677; + int i5678; + int i5679; + int i5680; + int i5681; + int i5682; + int i5683; + int i5684; + int i5685; + int i5686; + int i5687; + int i5688; + int i5689; + int i5690; + int i5691; + int i5692; + int i5693; + int i5694; + int i5695; + int i5696; + int i5697; + int i5698; + int i5699; + int i5700; + int i5701; + int i5702; + int i5703; + int i5704; + int i5705; + int i5706; + int i5707; + int i5708; + int i5709; + int i5710; + int i5711; + int i5712; + int i5713; + int i5714; + int i5715; + int i5716; + int i5717; + int i5718; + int i5719; + int i5720; + int i5721; + int i5722; + int i5723; + int i5724; + int i5725; + int i5726; + int i5727; + int i5728; + int i5729; + int i5730; + int i5731; + int i5732; + int i5733; + int i5734; + int i5735; + int i5736; + int i5737; + int i5738; + int i5739; + int i5740; + int i5741; + int i5742; + int i5743; + int i5744; + int i5745; + int i5746; + int i5747; + int i5748; + int i5749; + int i5750; + int i5751; + int i5752; + int i5753; + int i5754; + int i5755; + int i5756; + int i5757; + int i5758; + int i5759; + int i5760; + int i5761; + int i5762; + int i5763; + int i5764; + int i5765; + int i5766; + int i5767; + int i5768; + int i5769; + int i5770; + int i5771; + int i5772; + int i5773; + int i5774; + int i5775; + int i5776; + int i5777; + int i5778; + int i5779; + int i5780; + int i5781; + int i5782; + int i5783; + int i5784; + int i5785; + int i5786; + int i5787; + int i5788; + int i5789; + int i5790; + int i5791; + int i5792; + int i5793; + int i5794; + int i5795; + int i5796; + int i5797; + int i5798; + int i5799; + int i5800; + int i5801; + int i5802; + int i5803; + int i5804; + int i5805; + int i5806; + int i5807; + int i5808; + int i5809; + int i5810; + int i5811; + int i5812; + int i5813; + int i5814; + int i5815; + int i5816; + int i5817; + int i5818; + int i5819; + int i5820; + int i5821; + int i5822; + int i5823; + int i5824; + int i5825; + int i5826; + int i5827; + int i5828; + int i5829; + int i5830; + int i5831; + int i5832; + int i5833; + int i5834; + int i5835; + int i5836; + int i5837; + int i5838; + int i5839; + int i5840; + int i5841; + int i5842; + int i5843; + int i5844; + int i5845; + int i5846; + int i5847; + int i5848; + int i5849; + int i5850; + int i5851; + int i5852; + int i5853; + int i5854; + int i5855; + int i5856; + int i5857; + int i5858; + int i5859; + int i5860; + int i5861; + int i5862; + int i5863; + int i5864; + int i5865; + int i5866; + int i5867; + int i5868; + int i5869; + int i5870; + int i5871; + int i5872; + int i5873; + int i5874; + int i5875; + int i5876; + int i5877; + int i5878; + int i5879; + int i5880; + int i5881; + int i5882; + int i5883; + int i5884; + int i5885; + int i5886; + int i5887; + int i5888; + int i5889; + int i5890; + int i5891; + int i5892; + int i5893; + int i5894; + int i5895; + int i5896; + int i5897; + int i5898; + int i5899; + int i5900; + int i5901; + int i5902; + int i5903; + int i5904; + int i5905; + int i5906; + int i5907; + int i5908; + int i5909; + int i5910; + int i5911; + int i5912; + int i5913; + int i5914; + int i5915; + int i5916; + int i5917; + int i5918; + int i5919; + int i5920; + int i5921; + int i5922; + int i5923; + int i5924; + int i5925; + int i5926; + int i5927; + int i5928; + int i5929; + int i5930; + int i5931; + int i5932; + int i5933; + int i5934; + int i5935; + int i5936; + int i5937; + int i5938; + int i5939; + int i5940; + int i5941; + int i5942; + int i5943; + int i5944; + int i5945; + int i5946; + int i5947; + int i5948; + int i5949; + int i5950; + int i5951; + int i5952; + int i5953; + int i5954; + int i5955; + int i5956; + int i5957; + int i5958; + int i5959; + int i5960; + int i5961; + int i5962; + int i5963; + int i5964; + int i5965; + int i5966; + int i5967; + int i5968; + int i5969; + int i5970; + int i5971; + int i5972; + int i5973; + int i5974; + int i5975; + int i5976; + int i5977; + int i5978; + int i5979; + int i5980; + int i5981; + int i5982; + int i5983; + int i5984; + int i5985; + int i5986; + int i5987; + int i5988; + int i5989; + int i5990; + int i5991; + int i5992; + int i5993; + int i5994; + int i5995; + int i5996; + int i5997; + int i5998; + int i5999; + int i6000; + int i6001; + int i6002; + int i6003; + int i6004; + int i6005; + int i6006; + int i6007; + int i6008; + int i6009; + int i6010; + int i6011; + int i6012; + int i6013; + int i6014; + int i6015; + int i6016; + int i6017; + int i6018; + int i6019; + int i6020; + int i6021; + int i6022; + int i6023; + int i6024; + int i6025; + int i6026; + int i6027; + int i6028; + int i6029; + int i6030; + int i6031; + int i6032; + int i6033; + int i6034; + int i6035; + int i6036; + int i6037; + int i6038; + int i6039; + int i6040; + int i6041; + int i6042; + int i6043; + int i6044; + int i6045; + int i6046; + int i6047; + int i6048; + int i6049; + int i6050; + int i6051; + int i6052; + int i6053; + int i6054; + int i6055; + int i6056; + int i6057; + int i6058; + int i6059; + int i6060; + int i6061; + int i6062; + int i6063; + int i6064; + int i6065; + int i6066; + int i6067; + int i6068; + int i6069; + int i6070; + int i6071; + int i6072; + int i6073; + int i6074; + int i6075; + int i6076; + int i6077; + int i6078; + int i6079; + int i6080; + int i6081; + int i6082; + int i6083; + int i6084; + int i6085; + int i6086; + int i6087; + int i6088; + int i6089; + int i6090; + int i6091; + int i6092; + int i6093; + int i6094; + int i6095; + int i6096; + int i6097; + int i6098; + int i6099; + int i6100; + int i6101; + int i6102; + int i6103; + int i6104; + int i6105; + int i6106; + int i6107; + int i6108; + int i6109; + int i6110; + int i6111; + int i6112; + int i6113; + int i6114; + int i6115; + int i6116; + int i6117; + int i6118; + int i6119; + int i6120; + int i6121; + int i6122; + int i6123; + int i6124; + int i6125; + int i6126; + int i6127; + int i6128; + int i6129; + int i6130; + int i6131; + int i6132; + int i6133; + int i6134; + int i6135; + int i6136; + int i6137; + int i6138; + int i6139; + int i6140; + int i6141; + int i6142; + int i6143; + int i6144; + int i6145; + int i6146; + int i6147; + int i6148; + int i6149; + int i6150; + int i6151; + int i6152; + int i6153; + int i6154; + int i6155; + int i6156; + int i6157; + int i6158; + int i6159; + int i6160; + int i6161; + int i6162; + int i6163; + int i6164; + int i6165; + int i6166; + int i6167; + int i6168; + int i6169; + int i6170; + int i6171; + int i6172; + int i6173; + int i6174; + int i6175; + int i6176; + int i6177; + int i6178; + int i6179; + int i6180; + int i6181; + int i6182; + int i6183; + int i6184; + int i6185; + int i6186; + int i6187; + int i6188; + int i6189; + int i6190; + int i6191; + int i6192; + int i6193; + int i6194; + int i6195; + int i6196; + int i6197; + int i6198; + int i6199; + int i6200; + int i6201; + int i6202; + int i6203; + int i6204; + int i6205; + int i6206; + int i6207; + int i6208; + int i6209; + int i6210; + int i6211; + int i6212; + int i6213; + int i6214; + int i6215; + int i6216; + int i6217; + int i6218; + int i6219; + int i6220; + int i6221; + int i6222; + int i6223; + int i6224; + int i6225; + int i6226; + int i6227; + int i6228; + int i6229; + int i6230; + int i6231; + int i6232; + int i6233; + int i6234; + int i6235; + int i6236; + int i6237; + int i6238; + int i6239; + int i6240; + int i6241; + int i6242; + int i6243; + int i6244; + int i6245; + int i6246; + int i6247; + int i6248; + int i6249; + int i6250; + int i6251; + int i6252; + int i6253; + int i6254; + int i6255; + int i6256; + int i6257; + int i6258; + int i6259; + int i6260; + int i6261; + int i6262; + int i6263; + int i6264; + int i6265; + int i6266; + int i6267; + int i6268; + int i6269; + int i6270; + int i6271; + int i6272; + int i6273; + int i6274; + int i6275; + int i6276; + int i6277; + int i6278; + int i6279; + int i6280; + int i6281; + int i6282; + int i6283; + int i6284; + int i6285; + int i6286; + int i6287; + int i6288; + int i6289; + int i6290; + int i6291; + int i6292; + int i6293; + int i6294; + int i6295; + int i6296; + int i6297; + int i6298; + int i6299; + int i6300; + int i6301; + int i6302; + int i6303; + int i6304; + int i6305; + int i6306; + int i6307; + int i6308; + int i6309; + int i6310; + int i6311; + int i6312; + int i6313; + int i6314; + int i6315; + int i6316; + int i6317; + int i6318; + int i6319; + int i6320; + int i6321; + int i6322; + int i6323; + int i6324; + int i6325; + int i6326; + int i6327; + int i6328; + int i6329; + int i6330; + int i6331; + int i6332; + int i6333; + int i6334; + int i6335; + int i6336; + int i6337; + int i6338; + int i6339; + int i6340; + int i6341; + int i6342; + int i6343; + int i6344; + int i6345; + int i6346; + int i6347; + int i6348; + int i6349; + int i6350; + int i6351; + int i6352; + int i6353; + int i6354; + int i6355; + int i6356; + int i6357; + int i6358; + int i6359; + int i6360; + int i6361; + int i6362; + int i6363; + int i6364; + int i6365; + int i6366; + int i6367; + int i6368; + int i6369; + int i6370; + int i6371; + int i6372; + int i6373; + int i6374; + int i6375; + int i6376; + int i6377; + int i6378; + int i6379; + int i6380; + int i6381; + int i6382; + int i6383; + int i6384; + int i6385; + int i6386; + int i6387; + int i6388; + int i6389; + int i6390; + int i6391; + int i6392; + int i6393; + int i6394; + int i6395; + int i6396; + int i6397; + int i6398; + int i6399; + int i6400; + int i6401; + int i6402; + int i6403; + int i6404; + int i6405; + int i6406; + int i6407; + int i6408; + int i6409; + int i6410; + int i6411; + int i6412; + int i6413; + int i6414; + int i6415; + int i6416; + int i6417; + int i6418; + int i6419; + int i6420; + int i6421; + int i6422; + int i6423; + int i6424; + int i6425; + int i6426; + int i6427; + int i6428; + int i6429; + int i6430; + int i6431; + int i6432; + int i6433; + int i6434; + int i6435; + int i6436; + int i6437; + int i6438; + int i6439; + int i6440; + int i6441; + int i6442; + int i6443; + int i6444; + int i6445; + int i6446; + int i6447; + int i6448; + int i6449; + int i6450; + int i6451; + int i6452; + int i6453; + int i6454; + int i6455; + int i6456; + int i6457; + int i6458; + int i6459; + int i6460; + int i6461; + int i6462; + int i6463; + int i6464; + int i6465; + int i6466; + int i6467; + int i6468; + int i6469; + int i6470; + int i6471; + int i6472; + int i6473; + int i6474; + int i6475; + int i6476; + int i6477; + int i6478; + int i6479; + int i6480; + int i6481; + int i6482; + int i6483; + int i6484; + int i6485; + int i6486; + int i6487; + int i6488; + int i6489; + int i6490; + int i6491; + int i6492; + int i6493; + int i6494; + int i6495; + int i6496; + int i6497; + int i6498; + int i6499; + int i6500; + int i6501; + int i6502; + int i6503; + int i6504; + int i6505; + int i6506; + int i6507; + int i6508; + int i6509; + int i6510; + int i6511; + int i6512; + int i6513; + int i6514; + int i6515; + int i6516; + int i6517; + int i6518; + int i6519; + int i6520; + int i6521; + int i6522; + int i6523; + int i6524; + int i6525; + int i6526; + int i6527; + int i6528; + int i6529; + int i6530; + int i6531; + int i6532; + int i6533; + int i6534; + int i6535; + int i6536; + int i6537; + int i6538; + int i6539; + int i6540; + int i6541; + int i6542; + int i6543; + int i6544; + int i6545; + int i6546; + int i6547; + int i6548; + int i6549; + int i6550; + int i6551; + int i6552; + int i6553; + int i6554; + int i6555; + int i6556; + int i6557; + int i6558; + int i6559; + int i6560; + int i6561; + int i6562; + int i6563; + int i6564; + int i6565; + int i6566; + int i6567; + int i6568; + int i6569; + int i6570; + int i6571; + int i6572; + int i6573; + int i6574; + int i6575; + int i6576; + int i6577; + int i6578; + int i6579; + int i6580; + int i6581; + int i6582; + int i6583; + int i6584; + int i6585; + int i6586; + int i6587; + int i6588; + int i6589; + int i6590; + int i6591; + int i6592; + int i6593; + int i6594; + int i6595; + int i6596; + int i6597; + int i6598; + int i6599; + int i6600; + int i6601; + int i6602; + int i6603; + int i6604; + int i6605; + int i6606; + int i6607; + int i6608; + int i6609; + int i6610; + int i6611; + int i6612; + int i6613; + int i6614; + int i6615; + int i6616; + int i6617; + int i6618; + int i6619; + int i6620; + int i6621; + int i6622; + int i6623; + int i6624; + int i6625; + int i6626; + int i6627; + int i6628; + int i6629; + int i6630; + int i6631; + int i6632; + int i6633; + int i6634; + int i6635; + int i6636; + int i6637; + int i6638; + int i6639; + int i6640; + int i6641; + int i6642; + int i6643; + int i6644; + int i6645; + int i6646; + int i6647; + int i6648; + int i6649; + int i6650; + int i6651; + int i6652; + int i6653; + int i6654; + int i6655; + int i6656; + int i6657; + int i6658; + int i6659; + int i6660; + int i6661; + int i6662; + int i6663; + int i6664; + int i6665; + int i6666; + int i6667; + int i6668; + int i6669; + int i6670; + int i6671; + int i6672; + int i6673; + int i6674; + int i6675; + int i6676; + int i6677; + int i6678; + int i6679; + int i6680; + int i6681; + int i6682; + int i6683; + int i6684; + int i6685; + int i6686; + int i6687; + int i6688; + int i6689; + int i6690; + int i6691; + int i6692; + int i6693; + int i6694; + int i6695; + int i6696; + int i6697; + int i6698; + int i6699; + int i6700; + int i6701; + int i6702; + int i6703; + int i6704; + int i6705; + int i6706; + int i6707; + int i6708; + int i6709; + int i6710; + int i6711; + int i6712; + int i6713; + int i6714; + int i6715; + int i6716; + int i6717; + int i6718; + int i6719; + int i6720; + int i6721; + int i6722; + int i6723; + int i6724; + int i6725; + int i6726; + int i6727; + int i6728; + int i6729; + int i6730; + int i6731; + int i6732; + int i6733; + int i6734; + int i6735; + int i6736; + int i6737; + int i6738; + int i6739; + int i6740; + int i6741; + int i6742; + int i6743; + int i6744; + int i6745; + int i6746; + int i6747; + int i6748; + int i6749; + int i6750; + int i6751; + int i6752; + int i6753; + int i6754; + int i6755; + int i6756; + int i6757; + int i6758; + int i6759; + int i6760; + int i6761; + int i6762; + int i6763; + int i6764; + int i6765; + int i6766; + int i6767; + int i6768; + int i6769; + int i6770; + int i6771; + int i6772; + int i6773; + int i6774; + int i6775; + int i6776; + int i6777; + int i6778; + int i6779; + int i6780; + int i6781; + int i6782; + int i6783; + int i6784; + int i6785; + int i6786; + int i6787; + int i6788; + int i6789; + int i6790; + int i6791; + int i6792; + int i6793; + int i6794; + int i6795; + int i6796; + int i6797; + int i6798; + int i6799; + int i6800; + int i6801; + int i6802; + int i6803; + int i6804; + int i6805; + int i6806; + int i6807; + int i6808; + int i6809; + int i6810; + int i6811; + int i6812; + int i6813; + int i6814; + int i6815; + int i6816; + int i6817; + int i6818; + int i6819; + int i6820; + int i6821; + int i6822; + int i6823; + int i6824; + int i6825; + int i6826; + int i6827; + int i6828; + int i6829; + int i6830; + int i6831; + int i6832; + int i6833; + int i6834; + int i6835; + int i6836; + int i6837; + int i6838; + int i6839; + int i6840; + int i6841; + int i6842; + int i6843; + int i6844; + int i6845; + int i6846; + int i6847; + int i6848; + int i6849; + int i6850; + int i6851; + int i6852; + int i6853; + int i6854; + int i6855; + int i6856; + int i6857; + int i6858; + int i6859; + int i6860; + int i6861; + int i6862; + int i6863; + int i6864; + int i6865; + int i6866; + int i6867; + int i6868; + int i6869; + int i6870; + int i6871; + int i6872; + int i6873; + int i6874; + int i6875; + int i6876; + int i6877; + int i6878; + int i6879; + int i6880; + int i6881; + int i6882; + int i6883; + int i6884; + int i6885; + int i6886; + int i6887; + int i6888; + int i6889; + int i6890; + int i6891; + int i6892; + int i6893; + int i6894; + int i6895; + int i6896; + int i6897; + int i6898; + int i6899; + int i6900; + int i6901; + int i6902; + int i6903; + int i6904; + int i6905; + int i6906; + int i6907; + int i6908; + int i6909; + int i6910; + int i6911; + int i6912; + int i6913; + int i6914; + int i6915; + int i6916; + int i6917; + int i6918; + int i6919; + int i6920; + int i6921; + int i6922; + int i6923; + int i6924; + int i6925; + int i6926; + int i6927; + int i6928; + int i6929; + int i6930; + int i6931; + int i6932; + int i6933; + int i6934; + int i6935; + int i6936; + int i6937; + int i6938; + int i6939; + int i6940; + int i6941; + int i6942; + int i6943; + int i6944; + int i6945; + int i6946; + int i6947; + int i6948; + int i6949; + int i6950; + int i6951; + int i6952; + int i6953; + int i6954; + int i6955; + int i6956; + int i6957; + int i6958; + int i6959; + int i6960; + int i6961; + int i6962; + int i6963; + int i6964; + int i6965; + int i6966; + int i6967; + int i6968; + int i6969; + int i6970; + int i6971; + int i6972; + int i6973; + int i6974; + int i6975; + int i6976; + int i6977; + int i6978; + int i6979; + int i6980; + int i6981; + int i6982; + int i6983; + int i6984; + int i6985; + int i6986; + int i6987; + int i6988; + int i6989; + int i6990; + int i6991; + int i6992; + int i6993; + int i6994; + int i6995; + int i6996; + int i6997; + int i6998; + int i6999; + int i7000; + int i7001; + int i7002; + int i7003; + int i7004; + int i7005; + int i7006; + int i7007; + int i7008; + int i7009; + int i7010; + int i7011; + int i7012; + int i7013; + int i7014; + int i7015; + int i7016; + int i7017; + int i7018; + int i7019; + int i7020; + int i7021; + int i7022; + int i7023; + int i7024; + int i7025; + int i7026; + int i7027; + int i7028; + int i7029; + int i7030; + int i7031; + int i7032; + int i7033; + int i7034; + int i7035; + int i7036; + int i7037; + int i7038; + int i7039; + int i7040; + int i7041; + int i7042; + int i7043; + int i7044; + int i7045; + int i7046; + int i7047; + int i7048; + int i7049; + int i7050; + int i7051; + int i7052; + int i7053; + int i7054; + int i7055; + int i7056; + int i7057; + int i7058; + int i7059; + int i7060; + int i7061; + int i7062; + int i7063; + int i7064; + int i7065; + int i7066; + int i7067; + int i7068; + int i7069; + int i7070; + int i7071; + int i7072; + int i7073; + int i7074; + int i7075; + int i7076; + int i7077; + int i7078; + int i7079; + int i7080; + int i7081; + int i7082; + int i7083; + int i7084; + int i7085; + int i7086; + int i7087; + int i7088; + int i7089; + int i7090; + int i7091; + int i7092; + int i7093; + int i7094; + int i7095; + int i7096; + int i7097; + int i7098; + int i7099; + int i7100; + int i7101; + int i7102; + int i7103; + int i7104; + int i7105; + int i7106; + int i7107; + int i7108; + int i7109; + int i7110; + int i7111; + int i7112; + int i7113; + int i7114; + int i7115; + int i7116; + int i7117; + int i7118; + int i7119; + int i7120; + int i7121; + int i7122; + int i7123; + int i7124; + int i7125; + int i7126; + int i7127; + int i7128; + int i7129; + int i7130; + int i7131; + int i7132; + int i7133; + int i7134; + int i7135; + int i7136; + int i7137; + int i7138; + int i7139; + int i7140; + int i7141; + int i7142; + int i7143; + int i7144; + int i7145; + int i7146; + int i7147; + int i7148; + int i7149; + int i7150; + int i7151; + int i7152; + int i7153; + int i7154; + int i7155; + int i7156; + int i7157; + int i7158; + int i7159; + int i7160; + int i7161; + int i7162; + int i7163; + int i7164; + int i7165; + int i7166; + int i7167; + int i7168; + int i7169; + int i7170; + int i7171; + int i7172; + int i7173; + int i7174; + int i7175; + int i7176; + int i7177; + int i7178; + int i7179; + int i7180; + int i7181; + int i7182; + int i7183; + int i7184; + int i7185; + int i7186; + int i7187; + int i7188; + int i7189; + int i7190; + int i7191; + int i7192; + int i7193; + int i7194; + int i7195; + int i7196; + int i7197; + int i7198; + int i7199; + int i7200; + int i7201; + int i7202; + int i7203; + int i7204; + int i7205; + int i7206; + int i7207; + int i7208; + int i7209; + int i7210; + int i7211; + int i7212; + int i7213; + int i7214; + int i7215; + int i7216; + int i7217; + int i7218; + int i7219; + int i7220; + int i7221; + int i7222; + int i7223; + int i7224; + int i7225; + int i7226; + int i7227; + int i7228; + int i7229; + int i7230; + int i7231; + int i7232; + int i7233; + int i7234; + int i7235; + int i7236; + int i7237; + int i7238; + int i7239; + int i7240; + int i7241; + int i7242; + int i7243; + int i7244; + int i7245; + int i7246; + int i7247; + int i7248; + int i7249; + int i7250; + int i7251; + int i7252; + int i7253; + int i7254; + int i7255; + int i7256; + int i7257; + int i7258; + int i7259; + int i7260; + int i7261; + int i7262; + int i7263; + int i7264; + int i7265; + int i7266; + int i7267; + int i7268; + int i7269; + int i7270; + int i7271; + int i7272; + int i7273; + int i7274; + int i7275; + int i7276; + int i7277; + int i7278; + int i7279; + int i7280; + int i7281; + int i7282; + int i7283; + int i7284; + int i7285; + int i7286; + int i7287; + int i7288; + int i7289; + int i7290; + int i7291; + int i7292; + int i7293; + int i7294; + int i7295; + int i7296; + int i7297; + int i7298; + int i7299; + int i7300; + int i7301; + int i7302; + int i7303; + int i7304; + int i7305; + int i7306; + int i7307; + int i7308; + int i7309; + int i7310; + int i7311; + int i7312; + int i7313; + int i7314; + int i7315; + int i7316; + int i7317; + int i7318; + int i7319; + int i7320; + int i7321; + int i7322; + int i7323; + int i7324; + int i7325; + int i7326; + int i7327; + int i7328; + int i7329; + int i7330; + int i7331; + int i7332; + int i7333; + int i7334; + int i7335; + int i7336; + int i7337; + int i7338; + int i7339; + int i7340; + int i7341; + int i7342; + int i7343; + int i7344; + int i7345; + int i7346; + int i7347; + int i7348; + int i7349; + int i7350; + int i7351; + int i7352; + int i7353; + int i7354; + int i7355; + int i7356; + int i7357; + int i7358; + int i7359; + int i7360; + int i7361; + int i7362; + int i7363; + int i7364; + int i7365; + int i7366; + int i7367; + int i7368; + int i7369; + int i7370; + int i7371; + int i7372; + int i7373; + int i7374; + int i7375; + int i7376; + int i7377; + int i7378; + int i7379; + int i7380; + int i7381; + int i7382; + int i7383; + int i7384; + int i7385; + int i7386; + int i7387; + int i7388; + int i7389; + int i7390; + int i7391; + int i7392; + int i7393; + int i7394; + int i7395; + int i7396; + int i7397; + int i7398; + int i7399; + int i7400; + int i7401; + int i7402; + int i7403; + int i7404; + int i7405; + int i7406; + int i7407; + int i7408; + int i7409; + int i7410; + int i7411; + int i7412; + int i7413; + int i7414; + int i7415; + int i7416; + int i7417; + int i7418; + int i7419; + int i7420; + int i7421; + int i7422; + int i7423; + int i7424; + int i7425; + int i7426; + int i7427; + int i7428; + int i7429; + int i7430; + int i7431; + int i7432; + int i7433; + int i7434; + int i7435; + int i7436; + int i7437; + int i7438; + int i7439; + int i7440; + int i7441; + int i7442; + int i7443; + int i7444; + int i7445; + int i7446; + int i7447; + int i7448; + int i7449; + int i7450; + int i7451; + int i7452; + int i7453; + int i7454; + int i7455; + int i7456; + int i7457; + int i7458; + int i7459; + int i7460; + int i7461; + int i7462; + int i7463; + int i7464; + int i7465; + int i7466; + int i7467; + int i7468; + int i7469; + int i7470; + int i7471; + int i7472; + int i7473; + int i7474; + int i7475; + int i7476; + int i7477; + int i7478; + int i7479; + int i7480; + int i7481; + int i7482; + int i7483; + int i7484; + int i7485; + int i7486; + int i7487; + int i7488; + int i7489; + int i7490; + int i7491; + int i7492; + int i7493; + int i7494; + int i7495; + int i7496; + int i7497; + int i7498; + int i7499; + int i7500; + int i7501; + int i7502; + int i7503; + int i7504; + int i7505; + int i7506; + int i7507; + int i7508; + int i7509; + int i7510; + int i7511; + int i7512; + int i7513; + int i7514; + int i7515; + int i7516; + int i7517; + int i7518; + int i7519; + int i7520; + int i7521; + int i7522; + int i7523; + int i7524; + int i7525; + int i7526; + int i7527; + int i7528; + int i7529; + int i7530; + int i7531; + int i7532; + int i7533; + int i7534; + int i7535; + int i7536; + int i7537; + int i7538; + int i7539; + int i7540; + int i7541; + int i7542; + int i7543; + int i7544; + int i7545; + int i7546; + int i7547; + int i7548; + int i7549; + int i7550; + int i7551; + int i7552; + int i7553; + int i7554; + int i7555; + int i7556; + int i7557; + int i7558; + int i7559; + int i7560; + int i7561; + int i7562; + int i7563; + int i7564; + int i7565; + int i7566; + int i7567; + int i7568; + int i7569; + int i7570; + int i7571; + int i7572; + int i7573; + int i7574; + int i7575; + int i7576; + int i7577; + int i7578; + int i7579; + int i7580; + int i7581; + int i7582; + int i7583; + int i7584; + int i7585; + int i7586; + int i7587; + int i7588; + int i7589; + int i7590; + int i7591; + int i7592; + int i7593; + int i7594; + int i7595; + int i7596; + int i7597; + int i7598; + int i7599; + int i7600; + int i7601; + int i7602; + int i7603; + int i7604; + int i7605; + int i7606; + int i7607; + int i7608; + int i7609; + int i7610; + int i7611; + int i7612; + int i7613; + int i7614; + int i7615; + int i7616; + int i7617; + int i7618; + int i7619; + int i7620; + int i7621; + int i7622; + int i7623; + int i7624; + int i7625; + int i7626; + int i7627; + int i7628; + int i7629; + int i7630; + int i7631; + int i7632; + int i7633; + int i7634; + int i7635; + int i7636; + int i7637; + int i7638; + int i7639; + int i7640; + int i7641; + int i7642; + int i7643; + int i7644; + int i7645; + int i7646; + int i7647; + int i7648; + int i7649; + int i7650; + int i7651; + int i7652; + int i7653; + int i7654; + int i7655; + int i7656; + int i7657; + int i7658; + int i7659; + int i7660; + int i7661; + int i7662; + int i7663; + int i7664; + int i7665; + int i7666; + int i7667; + int i7668; + int i7669; + int i7670; + int i7671; + int i7672; + int i7673; + int i7674; + int i7675; + int i7676; + int i7677; + int i7678; + int i7679; + int i7680; + int i7681; + int i7682; + int i7683; + int i7684; + int i7685; + int i7686; + int i7687; + int i7688; + int i7689; + int i7690; + int i7691; + int i7692; + int i7693; + int i7694; + int i7695; + int i7696; + int i7697; + int i7698; + int i7699; + int i7700; + int i7701; + int i7702; + int i7703; + int i7704; + int i7705; + int i7706; + int i7707; + int i7708; + int i7709; + int i7710; + int i7711; + int i7712; + int i7713; + int i7714; + int i7715; + int i7716; + int i7717; + int i7718; + int i7719; + int i7720; + int i7721; + int i7722; + int i7723; + int i7724; + int i7725; + int i7726; + int i7727; + int i7728; + int i7729; + int i7730; + int i7731; + int i7732; + int i7733; + int i7734; + int i7735; + int i7736; + int i7737; + int i7738; + int i7739; + int i7740; + int i7741; + int i7742; + int i7743; + int i7744; + int i7745; + int i7746; + int i7747; + int i7748; + int i7749; + int i7750; + int i7751; + int i7752; + int i7753; + int i7754; + int i7755; + int i7756; + int i7757; + int i7758; + int i7759; + int i7760; + int i7761; + int i7762; + int i7763; + int i7764; + int i7765; + int i7766; + int i7767; + int i7768; + int i7769; + int i7770; + int i7771; + int i7772; + int i7773; + int i7774; + int i7775; + int i7776; + int i7777; + int i7778; + int i7779; + int i7780; + int i7781; + int i7782; + int i7783; + int i7784; + int i7785; + int i7786; + int i7787; + int i7788; + int i7789; + int i7790; + int i7791; + int i7792; + int i7793; + int i7794; + int i7795; + int i7796; + int i7797; + int i7798; + int i7799; + int i7800; + int i7801; + int i7802; + int i7803; + int i7804; + int i7805; + int i7806; + int i7807; + int i7808; + int i7809; + int i7810; + int i7811; + int i7812; + int i7813; + int i7814; + int i7815; + int i7816; + int i7817; + int i7818; + int i7819; + int i7820; + int i7821; + int i7822; + int i7823; + int i7824; + int i7825; + int i7826; + int i7827; + int i7828; + int i7829; + int i7830; + int i7831; + int i7832; + int i7833; + int i7834; + int i7835; + int i7836; + int i7837; + int i7838; + int i7839; + int i7840; + int i7841; + int i7842; + int i7843; + int i7844; + int i7845; + int i7846; + int i7847; + int i7848; + int i7849; + int i7850; + int i7851; + int i7852; + int i7853; + int i7854; + int i7855; + int i7856; + int i7857; + int i7858; + int i7859; + int i7860; + int i7861; + int i7862; + int i7863; + int i7864; + int i7865; + int i7866; + int i7867; + int i7868; + int i7869; + int i7870; + int i7871; + int i7872; + int i7873; + int i7874; + int i7875; + int i7876; + int i7877; + int i7878; + int i7879; + int i7880; + int i7881; + int i7882; + int i7883; + int i7884; + int i7885; + int i7886; + int i7887; + int i7888; + int i7889; + int i7890; + int i7891; + int i7892; + int i7893; + int i7894; + int i7895; + int i7896; + int i7897; + int i7898; + int i7899; + int i7900; + int i7901; + int i7902; + int i7903; + int i7904; + int i7905; + int i7906; + int i7907; + int i7908; + int i7909; + int i7910; + int i7911; + int i7912; + int i7913; + int i7914; + int i7915; + int i7916; + int i7917; + int i7918; + int i7919; + int i7920; + int i7921; + int i7922; + int i7923; + int i7924; + int i7925; + int i7926; + int i7927; + int i7928; + int i7929; + int i7930; + int i7931; + int i7932; + int i7933; + int i7934; + int i7935; + int i7936; + int i7937; + int i7938; + int i7939; + int i7940; + int i7941; + int i7942; + int i7943; + int i7944; + int i7945; + int i7946; + int i7947; + int i7948; + int i7949; + int i7950; + int i7951; + int i7952; + int i7953; + int i7954; + int i7955; + int i7956; + int i7957; + int i7958; + int i7959; + int i7960; + int i7961; + int i7962; + int i7963; + int i7964; + int i7965; + int i7966; + int i7967; + int i7968; + int i7969; + int i7970; + int i7971; + int i7972; + int i7973; + int i7974; + int i7975; + int i7976; + int i7977; + int i7978; + int i7979; + int i7980; + int i7981; + int i7982; + int i7983; + int i7984; + int i7985; + int i7986; + int i7987; + int i7988; + int i7989; + int i7990; + int i7991; + int i7992; + int i7993; + int i7994; + int i7995; + int i7996; + int i7997; + int i7998; + int i7999; + int i8000; + int i8001; + int i8002; + int i8003; + int i8004; + int i8005; + int i8006; + int i8007; + int i8008; + int i8009; + int i8010; + int i8011; + int i8012; + int i8013; + int i8014; + int i8015; + int i8016; + int i8017; + int i8018; + int i8019; + int i8020; + int i8021; + int i8022; + int i8023; + int i8024; + int i8025; + int i8026; + int i8027; + int i8028; + int i8029; + int i8030; + int i8031; + int i8032; + int i8033; + int i8034; + int i8035; + int i8036; + int i8037; + int i8038; + int i8039; + int i8040; + int i8041; + int i8042; + int i8043; + int i8044; + int i8045; + int i8046; + int i8047; + int i8048; + int i8049; + int i8050; + int i8051; + int i8052; + int i8053; + int i8054; + int i8055; + int i8056; + int i8057; + int i8058; + int i8059; + int i8060; + int i8061; + int i8062; + int i8063; + int i8064; + int i8065; + int i8066; + int i8067; + int i8068; + int i8069; + int i8070; + int i8071; + int i8072; + int i8073; + int i8074; + int i8075; + int i8076; + int i8077; + int i8078; + int i8079; + int i8080; + int i8081; + int i8082; + int i8083; + int i8084; + int i8085; + int i8086; + int i8087; + int i8088; + int i8089; + int i8090; + int i8091; + int i8092; + int i8093; + int i8094; + int i8095; + int i8096; + int i8097; + int i8098; + int i8099; + int i8100; + int i8101; + int i8102; + int i8103; + int i8104; + int i8105; + int i8106; + int i8107; + int i8108; + int i8109; + int i8110; + int i8111; + int i8112; + int i8113; + int i8114; + int i8115; + int i8116; + int i8117; + int i8118; + int i8119; + int i8120; + int i8121; + int i8122; + int i8123; + int i8124; + int i8125; + int i8126; + int i8127; + int i8128; + int i8129; + int i8130; + int i8131; + int i8132; + int i8133; + int i8134; + int i8135; + int i8136; + int i8137; + int i8138; + int i8139; + int i8140; + int i8141; + int i8142; + int i8143; + int i8144; + int i8145; + int i8146; + int i8147; + int i8148; + int i8149; + int i8150; + int i8151; + int i8152; + int i8153; + int i8154; + int i8155; + int i8156; + int i8157; + int i8158; + int i8159; + int i8160; + int i8161; + int i8162; + int i8163; + int i8164; + int i8165; + int i8166; + int i8167; + int i8168; + int i8169; + int i8170; + int i8171; + int i8172; + int i8173; + int i8174; + int i8175; + int i8176; + int i8177; + int i8178; + int i8179; + int i8180; + int i8181; + int i8182; + int i8183; + int i8184; + int i8185; + int i8186; + int i8187; + int i8188; + int i8189; + int i8190; + int i8191; + int i8192; + int i8193; + int i8194; + int i8195; + int i8196; + int i8197; + int i8198; + int i8199; + int i8200; + int i8201; + int i8202; + int i8203; + int i8204; + int i8205; + int i8206; + int i8207; + int i8208; + int i8209; + int i8210; + int i8211; + int i8212; + int i8213; + int i8214; + int i8215; + int i8216; + int i8217; + int i8218; + int i8219; + int i8220; + int i8221; + int i8222; + int i8223; + int i8224; + int i8225; + int i8226; + int i8227; + int i8228; + int i8229; + int i8230; + int i8231; + int i8232; + int i8233; + int i8234; + int i8235; + int i8236; + int i8237; + int i8238; + int i8239; + int i8240; + int i8241; + int i8242; + int i8243; + int i8244; + int i8245; + int i8246; + int i8247; + int i8248; + int i8249; + int i8250; + int i8251; + int i8252; + int i8253; + int i8254; + int i8255; + int i8256; + int i8257; + int i8258; + int i8259; + int i8260; + int i8261; + int i8262; + int i8263; + int i8264; + int i8265; + int i8266; + int i8267; + int i8268; + int i8269; + int i8270; + int i8271; + int i8272; + int i8273; + int i8274; + int i8275; + int i8276; + int i8277; + int i8278; + int i8279; + int i8280; + int i8281; + int i8282; + int i8283; + int i8284; + int i8285; + int i8286; + int i8287; + int i8288; + int i8289; + int i8290; + int i8291; + int i8292; + int i8293; + int i8294; + int i8295; + int i8296; + int i8297; + int i8298; + int i8299; + int i8300; + int i8301; + int i8302; + int i8303; + int i8304; + int i8305; + int i8306; + int i8307; + int i8308; + int i8309; + int i8310; + int i8311; + int i8312; + int i8313; + int i8314; + int i8315; + int i8316; + int i8317; + int i8318; + int i8319; + int i8320; + int i8321; + int i8322; + int i8323; + int i8324; + int i8325; + int i8326; + int i8327; + int i8328; + int i8329; + int i8330; + int i8331; + int i8332; + int i8333; + int i8334; + int i8335; + int i8336; + int i8337; + int i8338; + int i8339; + int i8340; + int i8341; + int i8342; + int i8343; + int i8344; + int i8345; + int i8346; + int i8347; + int i8348; + int i8349; + int i8350; + int i8351; + int i8352; + int i8353; + int i8354; + int i8355; + int i8356; + int i8357; + int i8358; + int i8359; + int i8360; + int i8361; + int i8362; + int i8363; + int i8364; + int i8365; + int i8366; + int i8367; + int i8368; + int i8369; + int i8370; + int i8371; + int i8372; + int i8373; + int i8374; + int i8375; + int i8376; + int i8377; + int i8378; + int i8379; + int i8380; + int i8381; + int i8382; + int i8383; + int i8384; + int i8385; + int i8386; + int i8387; + int i8388; + int i8389; + int i8390; + int i8391; + int i8392; + int i8393; + int i8394; + int i8395; + int i8396; + int i8397; + int i8398; + int i8399; + int i8400; + int i8401; + int i8402; + int i8403; + int i8404; + int i8405; + int i8406; + int i8407; + int i8408; + int i8409; + int i8410; + int i8411; + int i8412; + int i8413; + int i8414; + int i8415; + int i8416; + int i8417; + int i8418; + int i8419; + int i8420; + int i8421; + int i8422; + int i8423; + int i8424; + int i8425; + int i8426; + int i8427; + int i8428; + int i8429; + int i8430; + int i8431; + int i8432; + int i8433; + int i8434; + int i8435; + int i8436; + int i8437; + int i8438; + int i8439; + int i8440; + int i8441; + int i8442; + int i8443; + int i8444; + int i8445; + int i8446; + int i8447; + int i8448; + int i8449; + int i8450; + int i8451; + int i8452; + int i8453; + int i8454; + int i8455; + int i8456; + int i8457; + int i8458; + int i8459; + int i8460; + int i8461; + int i8462; + int i8463; + int i8464; + int i8465; + int i8466; + int i8467; + int i8468; + int i8469; + int i8470; + int i8471; + int i8472; + int i8473; + int i8474; + int i8475; + int i8476; + int i8477; + int i8478; + int i8479; + int i8480; + int i8481; + int i8482; + int i8483; + int i8484; + int i8485; + int i8486; + int i8487; + int i8488; + int i8489; + int i8490; + int i8491; + int i8492; + int i8493; + int i8494; + int i8495; + int i8496; + int i8497; + int i8498; + int i8499; + int i8500; + int i8501; + int i8502; + int i8503; + int i8504; + int i8505; + int i8506; + int i8507; + int i8508; + int i8509; + int i8510; + int i8511; + int i8512; + int i8513; + int i8514; + int i8515; + int i8516; + int i8517; + int i8518; + int i8519; + int i8520; + int i8521; + int i8522; + int i8523; + int i8524; + int i8525; + int i8526; + int i8527; + int i8528; + int i8529; + int i8530; + int i8531; + int i8532; + int i8533; + int i8534; + int i8535; + int i8536; + int i8537; + int i8538; + int i8539; + int i8540; + int i8541; + int i8542; + int i8543; + int i8544; + int i8545; + int i8546; + int i8547; + int i8548; + int i8549; + int i8550; + int i8551; + int i8552; + int i8553; + int i8554; + int i8555; + int i8556; + int i8557; + int i8558; + int i8559; + int i8560; + int i8561; + int i8562; + int i8563; + int i8564; + int i8565; + int i8566; + int i8567; + int i8568; + int i8569; + int i8570; + int i8571; + int i8572; + int i8573; + int i8574; + int i8575; + int i8576; + int i8577; + int i8578; + int i8579; + int i8580; + int i8581; + int i8582; + int i8583; + int i8584; + int i8585; + int i8586; + int i8587; + int i8588; + int i8589; + int i8590; + int i8591; + int i8592; + int i8593; + int i8594; + int i8595; + int i8596; + int i8597; + int i8598; + int i8599; + int i8600; + int i8601; + int i8602; + int i8603; + int i8604; + int i8605; + int i8606; + int i8607; + int i8608; + int i8609; + int i8610; + int i8611; + int i8612; + int i8613; + int i8614; + int i8615; + int i8616; + int i8617; + int i8618; + int i8619; + int i8620; + int i8621; + int i8622; + int i8623; + int i8624; + int i8625; + int i8626; + int i8627; + int i8628; + int i8629; + int i8630; + int i8631; + int i8632; + int i8633; + int i8634; + int i8635; + int i8636; + int i8637; + int i8638; + int i8639; + int i8640; + int i8641; + int i8642; + int i8643; + int i8644; + int i8645; + int i8646; + int i8647; + int i8648; + int i8649; + int i8650; + int i8651; + int i8652; + int i8653; + int i8654; + int i8655; + int i8656; + int i8657; + int i8658; + int i8659; + int i8660; + int i8661; + int i8662; + int i8663; + int i8664; + int i8665; + int i8666; + int i8667; + int i8668; + int i8669; + int i8670; + int i8671; + int i8672; + int i8673; + int i8674; + int i8675; + int i8676; + int i8677; + int i8678; + int i8679; + int i8680; + int i8681; + int i8682; + int i8683; + int i8684; + int i8685; + int i8686; + int i8687; + int i8688; + int i8689; + int i8690; + int i8691; + int i8692; + int i8693; + int i8694; + int i8695; + int i8696; + int i8697; + int i8698; + int i8699; + int i8700; + int i8701; + int i8702; + int i8703; + int i8704; + int i8705; + int i8706; + int i8707; + int i8708; + int i8709; + int i8710; + int i8711; + int i8712; + int i8713; + int i8714; + int i8715; + int i8716; + int i8717; + int i8718; + int i8719; + int i8720; + int i8721; + int i8722; + int i8723; + int i8724; + int i8725; + int i8726; + int i8727; + int i8728; + int i8729; + int i8730; + int i8731; + int i8732; + int i8733; + int i8734; + int i8735; + int i8736; + int i8737; + int i8738; + int i8739; + int i8740; + int i8741; + int i8742; + int i8743; + int i8744; + int i8745; + int i8746; + int i8747; + int i8748; + int i8749; + int i8750; + int i8751; + int i8752; + int i8753; + int i8754; + int i8755; + int i8756; + int i8757; + int i8758; + int i8759; + int i8760; + int i8761; + int i8762; + int i8763; + int i8764; + int i8765; + int i8766; + int i8767; + int i8768; + int i8769; + int i8770; + int i8771; + int i8772; + int i8773; + int i8774; + int i8775; + int i8776; + int i8777; + int i8778; + int i8779; + int i8780; + int i8781; + int i8782; + int i8783; + int i8784; + int i8785; + int i8786; + int i8787; + int i8788; + int i8789; + int i8790; + int i8791; + int i8792; + int i8793; + int i8794; + int i8795; + int i8796; + int i8797; + int i8798; + int i8799; + int i8800; + int i8801; + int i8802; + int i8803; + int i8804; + int i8805; + int i8806; + int i8807; + int i8808; + int i8809; + int i8810; + int i8811; + int i8812; + int i8813; + int i8814; + int i8815; + int i8816; + int i8817; + int i8818; + int i8819; + int i8820; + int i8821; + int i8822; + int i8823; + int i8824; + int i8825; + int i8826; + int i8827; + int i8828; + int i8829; + int i8830; + int i8831; + int i8832; + int i8833; + int i8834; + int i8835; + int i8836; + int i8837; + int i8838; + int i8839; + int i8840; + int i8841; + int i8842; + int i8843; + int i8844; + int i8845; + int i8846; + int i8847; + int i8848; + int i8849; + int i8850; + int i8851; + int i8852; + int i8853; + int i8854; + int i8855; + int i8856; + int i8857; + int i8858; + int i8859; + int i8860; + int i8861; + int i8862; + int i8863; + int i8864; + int i8865; + int i8866; + int i8867; + int i8868; + int i8869; + int i8870; + int i8871; + int i8872; + int i8873; + int i8874; + int i8875; + int i8876; + int i8877; + int i8878; + int i8879; + int i8880; + int i8881; + int i8882; + int i8883; + int i8884; + int i8885; + int i8886; + int i8887; + int i8888; + int i8889; + int i8890; + int i8891; + int i8892; + int i8893; + int i8894; + int i8895; + int i8896; + int i8897; + int i8898; + int i8899; + int i8900; + int i8901; + int i8902; + int i8903; + int i8904; + int i8905; + int i8906; + int i8907; + int i8908; + int i8909; + int i8910; + int i8911; + int i8912; + int i8913; + int i8914; + int i8915; + int i8916; + int i8917; + int i8918; + int i8919; + int i8920; + int i8921; + int i8922; + int i8923; + int i8924; + int i8925; + int i8926; + int i8927; + int i8928; + int i8929; + int i8930; + int i8931; + int i8932; + int i8933; + int i8934; + int i8935; + int i8936; + int i8937; + int i8938; + int i8939; + int i8940; + int i8941; + int i8942; + int i8943; + int i8944; + int i8945; + int i8946; + int i8947; + int i8948; + int i8949; + int i8950; + int i8951; + int i8952; + int i8953; + int i8954; + int i8955; + int i8956; + int i8957; + int i8958; + int i8959; + int i8960; + int i8961; + int i8962; + int i8963; + int i8964; + int i8965; + int i8966; + int i8967; + int i8968; + int i8969; + int i8970; + int i8971; + int i8972; + int i8973; + int i8974; + int i8975; + int i8976; + int i8977; + int i8978; + int i8979; + int i8980; + int i8981; + int i8982; + int i8983; + int i8984; + int i8985; + int i8986; + int i8987; + int i8988; + int i8989; + int i8990; + int i8991; + int i8992; + int i8993; + int i8994; + int i8995; + int i8996; + int i8997; + int i8998; + int i8999; + int i9000; + int i9001; + int i9002; + int i9003; + int i9004; + int i9005; + int i9006; + int i9007; + int i9008; + int i9009; + int i9010; + int i9011; + int i9012; + int i9013; + int i9014; + int i9015; + int i9016; + int i9017; + int i9018; + int i9019; + int i9020; + int i9021; + int i9022; + int i9023; + int i9024; + int i9025; + int i9026; + int i9027; + int i9028; + int i9029; + int i9030; + int i9031; + int i9032; + int i9033; + int i9034; + int i9035; + int i9036; + int i9037; + int i9038; + int i9039; + int i9040; + int i9041; + int i9042; + int i9043; + int i9044; + int i9045; + int i9046; + int i9047; + int i9048; + int i9049; + int i9050; + int i9051; + int i9052; + int i9053; + int i9054; + int i9055; + int i9056; + int i9057; + int i9058; + int i9059; + int i9060; + int i9061; + int i9062; + int i9063; + int i9064; + int i9065; + int i9066; + int i9067; + int i9068; + int i9069; + int i9070; + int i9071; + int i9072; + int i9073; + int i9074; + int i9075; + int i9076; + int i9077; + int i9078; + int i9079; + int i9080; + int i9081; + int i9082; + int i9083; + int i9084; + int i9085; + int i9086; + int i9087; + int i9088; + int i9089; + int i9090; + int i9091; + int i9092; + int i9093; + int i9094; + int i9095; + int i9096; + int i9097; + int i9098; + int i9099; + int i9100; + int i9101; + int i9102; + int i9103; + int i9104; + int i9105; + int i9106; + int i9107; + int i9108; + int i9109; + int i9110; + int i9111; + int i9112; + int i9113; + int i9114; + int i9115; + int i9116; + int i9117; + int i9118; + int i9119; + int i9120; + int i9121; + int i9122; + int i9123; + int i9124; + int i9125; + int i9126; + int i9127; + int i9128; + int i9129; + int i9130; + int i9131; + int i9132; + int i9133; + int i9134; + int i9135; + int i9136; + int i9137; + int i9138; + int i9139; + int i9140; + int i9141; + int i9142; + int i9143; + int i9144; + int i9145; + int i9146; + int i9147; + int i9148; + int i9149; + int i9150; + int i9151; + int i9152; + int i9153; + int i9154; + int i9155; + int i9156; + int i9157; + int i9158; + int i9159; + int i9160; + int i9161; + int i9162; + int i9163; + int i9164; + int i9165; + int i9166; + int i9167; + int i9168; + int i9169; + int i9170; + int i9171; + int i9172; + int i9173; + int i9174; + int i9175; + int i9176; + int i9177; + int i9178; + int i9179; + int i9180; + int i9181; + int i9182; + int i9183; + int i9184; + int i9185; + int i9186; + int i9187; + int i9188; + int i9189; + int i9190; + int i9191; + int i9192; + int i9193; + int i9194; + int i9195; + int i9196; + int i9197; + int i9198; + int i9199; + int i9200; + int i9201; + int i9202; + int i9203; + int i9204; + int i9205; + int i9206; + int i9207; + int i9208; + int i9209; + int i9210; + int i9211; + int i9212; + int i9213; + int i9214; + int i9215; + int i9216; + int i9217; + int i9218; + int i9219; + int i9220; + int i9221; + int i9222; + int i9223; + int i9224; + int i9225; + int i9226; + int i9227; + int i9228; + int i9229; + int i9230; + int i9231; + int i9232; + int i9233; + int i9234; + int i9235; + int i9236; + int i9237; + int i9238; + int i9239; + int i9240; + int i9241; + int i9242; + int i9243; + int i9244; + int i9245; + int i9246; + int i9247; + int i9248; + int i9249; + int i9250; + int i9251; + int i9252; + int i9253; + int i9254; + int i9255; + int i9256; + int i9257; + int i9258; + int i9259; + int i9260; + int i9261; + int i9262; + int i9263; + int i9264; + int i9265; + int i9266; + int i9267; + int i9268; + int i9269; + int i9270; + int i9271; + int i9272; + int i9273; + int i9274; + int i9275; + int i9276; + int i9277; + int i9278; + int i9279; + int i9280; + int i9281; + int i9282; + int i9283; + int i9284; + int i9285; + int i9286; + int i9287; + int i9288; + int i9289; + int i9290; + int i9291; + int i9292; + int i9293; + int i9294; + int i9295; + int i9296; + int i9297; + int i9298; + int i9299; + int i9300; + int i9301; + int i9302; + int i9303; + int i9304; + int i9305; + int i9306; + int i9307; + int i9308; + int i9309; + int i9310; + int i9311; + int i9312; + int i9313; + int i9314; + int i9315; + int i9316; + int i9317; + int i9318; + int i9319; + int i9320; + int i9321; + int i9322; + int i9323; + int i9324; + int i9325; + int i9326; + int i9327; + int i9328; + int i9329; + int i9330; + int i9331; + int i9332; + int i9333; + int i9334; + int i9335; + int i9336; + int i9337; + int i9338; + int i9339; + int i9340; + int i9341; + int i9342; + int i9343; + int i9344; + int i9345; + int i9346; + int i9347; + int i9348; + int i9349; + int i9350; + int i9351; + int i9352; + int i9353; + int i9354; + int i9355; + int i9356; + int i9357; + int i9358; + int i9359; + int i9360; + int i9361; + int i9362; + int i9363; + int i9364; + int i9365; + int i9366; + int i9367; + int i9368; + int i9369; + int i9370; + int i9371; + int i9372; + int i9373; + int i9374; + int i9375; + int i9376; + int i9377; + int i9378; + int i9379; + int i9380; + int i9381; + int i9382; + int i9383; + int i9384; + int i9385; + int i9386; + int i9387; + int i9388; + int i9389; + int i9390; + int i9391; + int i9392; + int i9393; + int i9394; + int i9395; + int i9396; + int i9397; + int i9398; + int i9399; + int i9400; + int i9401; + int i9402; + int i9403; + int i9404; + int i9405; + int i9406; + int i9407; + int i9408; + int i9409; + int i9410; + int i9411; + int i9412; + int i9413; + int i9414; + int i9415; + int i9416; + int i9417; + int i9418; + int i9419; + int i9420; + int i9421; + int i9422; + int i9423; + int i9424; + int i9425; + int i9426; + int i9427; + int i9428; + int i9429; + int i9430; + int i9431; + int i9432; + int i9433; + int i9434; + int i9435; + int i9436; + int i9437; + int i9438; + int i9439; + int i9440; + int i9441; + int i9442; + int i9443; + int i9444; + int i9445; + int i9446; + int i9447; + int i9448; + int i9449; + int i9450; + int i9451; + int i9452; + int i9453; + int i9454; + int i9455; + int i9456; + int i9457; + int i9458; + int i9459; + int i9460; + int i9461; + int i9462; + int i9463; + int i9464; + int i9465; + int i9466; + int i9467; + int i9468; + int i9469; + int i9470; + int i9471; + int i9472; + int i9473; + int i9474; + int i9475; + int i9476; + int i9477; + int i9478; + int i9479; + int i9480; + int i9481; + int i9482; + int i9483; + int i9484; + int i9485; + int i9486; + int i9487; + int i9488; + int i9489; + int i9490; + int i9491; + int i9492; + int i9493; + int i9494; + int i9495; + int i9496; + int i9497; + int i9498; + int i9499; + int i9500; + int i9501; + int i9502; + int i9503; + int i9504; + int i9505; + int i9506; + int i9507; + int i9508; + int i9509; + int i9510; + int i9511; + int i9512; + int i9513; + int i9514; + int i9515; + int i9516; + int i9517; + int i9518; + int i9519; + int i9520; + int i9521; + int i9522; + int i9523; + int i9524; + int i9525; + int i9526; + int i9527; + int i9528; + int i9529; + int i9530; + int i9531; + int i9532; + int i9533; + int i9534; + int i9535; + int i9536; + int i9537; + int i9538; + int i9539; + int i9540; + int i9541; + int i9542; + int i9543; + int i9544; + int i9545; + int i9546; + int i9547; + int i9548; + int i9549; + int i9550; + int i9551; + int i9552; + int i9553; + int i9554; + int i9555; + int i9556; + int i9557; + int i9558; + int i9559; + int i9560; + int i9561; + int i9562; + int i9563; + int i9564; + int i9565; + int i9566; + int i9567; + int i9568; + int i9569; + int i9570; + int i9571; + int i9572; + int i9573; + int i9574; + int i9575; + int i9576; + int i9577; + int i9578; + int i9579; + int i9580; + int i9581; + int i9582; + int i9583; + int i9584; + int i9585; + int i9586; + int i9587; + int i9588; + int i9589; + int i9590; + int i9591; + int i9592; + int i9593; + int i9594; + int i9595; + int i9596; + int i9597; + int i9598; + int i9599; + int i9600; + int i9601; + int i9602; + int i9603; + int i9604; + int i9605; + int i9606; + int i9607; + int i9608; + int i9609; + int i9610; + int i9611; + int i9612; + int i9613; + int i9614; + int i9615; + int i9616; + int i9617; + int i9618; + int i9619; + int i9620; + int i9621; + int i9622; + int i9623; + int i9624; + int i9625; + int i9626; + int i9627; + int i9628; + int i9629; + int i9630; + int i9631; + int i9632; + int i9633; + int i9634; + int i9635; + int i9636; + int i9637; + int i9638; + int i9639; + int i9640; + int i9641; + int i9642; + int i9643; + int i9644; + int i9645; + int i9646; + int i9647; + int i9648; + int i9649; + int i9650; + int i9651; + int i9652; + int i9653; + int i9654; + int i9655; + int i9656; + int i9657; + int i9658; + int i9659; + int i9660; + int i9661; + int i9662; + int i9663; + int i9664; + int i9665; + int i9666; + int i9667; + int i9668; + int i9669; + int i9670; + int i9671; + int i9672; + int i9673; + int i9674; + int i9675; + int i9676; + int i9677; + int i9678; + int i9679; + int i9680; + int i9681; + int i9682; + int i9683; + int i9684; + int i9685; + int i9686; + int i9687; + int i9688; + int i9689; + int i9690; + int i9691; + int i9692; + int i9693; + int i9694; + int i9695; + int i9696; + int i9697; + int i9698; + int i9699; + int i9700; + int i9701; + int i9702; + int i9703; + int i9704; + int i9705; + int i9706; + int i9707; + int i9708; + int i9709; + int i9710; + int i9711; + int i9712; + int i9713; + int i9714; + int i9715; + int i9716; + int i9717; + int i9718; + int i9719; + int i9720; + int i9721; + int i9722; + int i9723; + int i9724; + int i9725; + int i9726; + int i9727; + int i9728; + int i9729; + int i9730; + int i9731; + int i9732; + int i9733; + int i9734; + int i9735; + int i9736; + int i9737; + int i9738; + int i9739; + int i9740; + int i9741; + int i9742; + int i9743; + int i9744; + int i9745; + int i9746; + int i9747; + int i9748; + int i9749; + int i9750; + int i9751; + int i9752; + int i9753; + int i9754; + int i9755; + int i9756; + int i9757; + int i9758; + int i9759; + int i9760; + int i9761; + int i9762; + int i9763; + int i9764; + int i9765; + int i9766; + int i9767; + int i9768; + int i9769; + int i9770; + int i9771; + int i9772; + int i9773; + int i9774; + int i9775; + int i9776; + int i9777; + int i9778; + int i9779; + int i9780; + int i9781; + int i9782; + int i9783; + int i9784; + int i9785; + int i9786; + int i9787; + int i9788; + int i9789; + int i9790; + int i9791; + int i9792; + int i9793; + int i9794; + int i9795; + int i9796; + int i9797; + int i9798; + int i9799; + int i9800; + int i9801; + int i9802; + int i9803; + int i9804; + int i9805; + int i9806; + int i9807; + int i9808; + int i9809; + int i9810; + int i9811; + int i9812; + int i9813; + int i9814; + int i9815; + int i9816; + int i9817; + int i9818; + int i9819; + int i9820; + int i9821; + int i9822; + int i9823; + int i9824; + int i9825; + int i9826; + int i9827; + int i9828; + int i9829; + int i9830; + int i9831; + int i9832; + int i9833; + int i9834; + int i9835; + int i9836; + int i9837; + int i9838; + int i9839; + int i9840; + int i9841; + int i9842; + int i9843; + int i9844; + int i9845; + int i9846; + int i9847; + int i9848; + int i9849; + int i9850; + int i9851; + int i9852; + int i9853; + int i9854; + int i9855; + int i9856; + int i9857; + int i9858; + int i9859; + int i9860; + int i9861; + int i9862; + int i9863; + int i9864; + int i9865; + int i9866; + int i9867; + int i9868; + int i9869; + int i9870; + int i9871; + int i9872; + int i9873; + int i9874; + int i9875; + int i9876; + int i9877; + int i9878; + int i9879; + int i9880; + int i9881; + int i9882; + int i9883; + int i9884; + int i9885; + int i9886; + int i9887; + int i9888; + int i9889; + int i9890; + int i9891; + int i9892; + int i9893; + int i9894; + int i9895; + int i9896; + int i9897; + int i9898; + int i9899; + int i9900; + int i9901; + int i9902; + int i9903; + int i9904; + int i9905; + int i9906; + int i9907; + int i9908; + int i9909; + int i9910; + int i9911; + int i9912; + int i9913; + int i9914; + int i9915; + int i9916; + int i9917; + int i9918; + int i9919; + int i9920; + int i9921; + int i9922; + int i9923; + int i9924; + int i9925; + int i9926; + int i9927; + int i9928; + int i9929; + int i9930; + int i9931; + int i9932; + int i9933; + int i9934; + int i9935; + int i9936; + int i9937; + int i9938; + int i9939; + int i9940; + int i9941; + int i9942; + int i9943; + int i9944; + int i9945; + int i9946; + int i9947; + int i9948; + int i9949; + int i9950; + int i9951; + int i9952; + int i9953; + int i9954; + int i9955; + int i9956; + int i9957; + int i9958; + int i9959; + int i9960; + int i9961; + int i9962; + int i9963; + int i9964; + int i9965; + int i9966; + int i9967; + int i9968; + int i9969; + int i9970; + int i9971; + int i9972; + int i9973; + int i9974; + int i9975; + int i9976; + int i9977; + int i9978; + int i9979; + int i9980; + int i9981; + int i9982; + int i9983; + int i9984; + int i9985; + int i9986; + int i9987; + int i9988; + int i9989; + int i9990; + int i9991; + int i9992; + int i9993; + int i9994; + int i9995; + int i9996; + int i9997; + int i9998; + int i9999; + int i10000; + int i10001; + int i10002; + int i10003; + int i10004; + int i10005; + int i10006; + int i10007; + int i10008; + int i10009; + int i10010; + int i10011; + int i10012; + int i10013; + int i10014; + int i10015; + int i10016; + int i10017; + int i10018; + int i10019; + int i10020; + int i10021; + int i10022; + int i10023; + int i10024; + int i10025; + int i10026; + int i10027; + int i10028; + int i10029; + int i10030; + int i10031; + int i10032; + int i10033; + int i10034; + int i10035; + int i10036; + int i10037; + int i10038; + int i10039; + int i10040; + int i10041; + int i10042; + int i10043; + int i10044; + int i10045; + int i10046; + int i10047; + int i10048; + int i10049; + int i10050; + int i10051; + int i10052; + int i10053; + int i10054; + int i10055; + int i10056; + int i10057; + int i10058; + int i10059; + int i10060; + int i10061; + int i10062; + int i10063; + int i10064; + int i10065; + int i10066; + int i10067; + int i10068; + int i10069; + int i10070; + int i10071; + int i10072; + int i10073; + int i10074; + int i10075; + int i10076; + int i10077; + int i10078; + int i10079; + int i10080; + int i10081; + int i10082; + int i10083; + int i10084; + int i10085; + int i10086; + int i10087; + int i10088; + int i10089; + int i10090; + int i10091; + int i10092; + int i10093; + int i10094; + int i10095; + int i10096; + int i10097; + int i10098; + int i10099; + int i10100; + int i10101; + int i10102; + int i10103; + int i10104; + int i10105; + int i10106; + int i10107; + int i10108; + int i10109; + int i10110; + int i10111; + int i10112; + int i10113; + int i10114; + int i10115; + int i10116; + int i10117; + int i10118; + int i10119; + int i10120; + int i10121; + int i10122; + int i10123; + int i10124; + int i10125; + int i10126; + int i10127; + int i10128; + int i10129; + int i10130; + int i10131; + int i10132; + int i10133; + int i10134; + int i10135; + int i10136; + int i10137; + int i10138; + int i10139; + int i10140; + int i10141; + int i10142; + int i10143; + int i10144; + int i10145; + int i10146; + int i10147; + int i10148; + int i10149; + int i10150; + int i10151; + int i10152; + int i10153; + int i10154; + int i10155; + int i10156; + int i10157; + int i10158; + int i10159; + int i10160; + int i10161; + int i10162; + int i10163; + int i10164; + int i10165; + int i10166; + int i10167; + int i10168; + int i10169; + int i10170; + int i10171; + int i10172; + int i10173; + int i10174; + int i10175; + int i10176; + int i10177; + int i10178; + int i10179; + int i10180; + int i10181; + int i10182; + int i10183; + int i10184; + int i10185; + int i10186; + int i10187; + int i10188; + int i10189; + int i10190; + int i10191; + int i10192; + int i10193; + int i10194; + int i10195; + int i10196; + int i10197; + int i10198; + int i10199; + int i10200; + int i10201; + int i10202; + int i10203; + int i10204; + int i10205; + int i10206; + int i10207; + int i10208; + int i10209; + int i10210; + int i10211; + int i10212; + int i10213; + int i10214; + int i10215; + int i10216; + int i10217; + int i10218; + int i10219; + int i10220; + int i10221; + int i10222; + int i10223; + int i10224; + int i10225; + int i10226; + int i10227; + int i10228; + int i10229; + int i10230; + int i10231; + int i10232; + int i10233; + int i10234; + int i10235; + int i10236; + int i10237; + int i10238; + int i10239; + int i10240; + int i10241; + int i10242; + int i10243; + int i10244; + int i10245; + int i10246; + int i10247; + int i10248; + int i10249; + int i10250; + int i10251; + int i10252; + int i10253; + int i10254; + int i10255; + int i10256; + int i10257; + int i10258; + int i10259; + int i10260; + int i10261; + int i10262; + int i10263; + int i10264; + int i10265; + int i10266; + int i10267; + int i10268; + int i10269; + int i10270; + int i10271; + int i10272; + int i10273; + int i10274; + int i10275; + int i10276; + int i10277; + int i10278; + int i10279; + int i10280; + int i10281; + int i10282; + int i10283; + int i10284; + int i10285; + int i10286; + int i10287; + int i10288; + int i10289; + int i10290; + int i10291; + int i10292; + int i10293; + int i10294; + int i10295; + int i10296; + int i10297; + int i10298; + int i10299; + int i10300; + int i10301; + int i10302; + int i10303; + int i10304; + int i10305; + int i10306; + int i10307; + int i10308; + int i10309; + int i10310; + int i10311; + int i10312; + int i10313; + int i10314; + int i10315; + int i10316; + int i10317; + int i10318; + int i10319; + int i10320; + int i10321; + int i10322; + int i10323; + int i10324; + int i10325; + int i10326; + int i10327; + int i10328; + int i10329; + int i10330; + int i10331; + int i10332; + int i10333; + int i10334; + int i10335; + int i10336; + int i10337; + int i10338; + int i10339; + int i10340; + int i10341; + int i10342; + int i10343; + int i10344; + int i10345; + int i10346; + int i10347; + int i10348; + int i10349; + int i10350; + int i10351; + int i10352; + int i10353; + int i10354; + int i10355; + int i10356; + int i10357; + int i10358; + int i10359; + int i10360; + int i10361; + int i10362; + int i10363; + int i10364; + int i10365; + int i10366; + int i10367; + int i10368; + int i10369; + int i10370; + int i10371; + int i10372; + int i10373; + int i10374; + int i10375; + int i10376; + int i10377; + int i10378; + int i10379; + int i10380; + int i10381; + int i10382; + int i10383; + int i10384; + int i10385; + int i10386; + int i10387; + int i10388; + int i10389; + int i10390; + int i10391; + int i10392; + int i10393; + int i10394; + int i10395; + int i10396; + int i10397; + int i10398; + int i10399; + int i10400; + int i10401; + int i10402; + int i10403; + int i10404; + int i10405; + int i10406; + int i10407; + int i10408; + int i10409; + int i10410; + int i10411; + int i10412; + int i10413; + int i10414; + int i10415; + int i10416; + int i10417; + int i10418; + int i10419; + int i10420; + int i10421; + int i10422; + int i10423; + int i10424; + int i10425; + int i10426; + int i10427; + int i10428; + int i10429; + int i10430; + int i10431; + int i10432; + int i10433; + int i10434; + int i10435; + int i10436; + int i10437; + int i10438; + int i10439; + int i10440; + int i10441; + int i10442; + int i10443; + int i10444; + int i10445; + int i10446; + int i10447; + int i10448; + int i10449; + int i10450; + int i10451; + int i10452; + int i10453; + int i10454; + int i10455; + int i10456; + int i10457; + int i10458; + int i10459; + int i10460; + int i10461; + int i10462; + int i10463; + int i10464; + int i10465; + int i10466; + int i10467; + int i10468; + int i10469; + int i10470; + int i10471; + int i10472; + int i10473; + int i10474; + int i10475; + int i10476; + int i10477; + int i10478; + int i10479; + int i10480; + int i10481; + int i10482; + int i10483; + int i10484; + int i10485; + int i10486; + int i10487; + int i10488; + int i10489; + int i10490; + int i10491; + int i10492; + int i10493; + int i10494; + int i10495; + int i10496; + int i10497; + int i10498; + int i10499; + int i10500; + int i10501; + int i10502; + int i10503; + int i10504; + int i10505; + int i10506; + int i10507; + int i10508; + int i10509; + int i10510; + int i10511; + int i10512; + int i10513; + int i10514; + int i10515; + int i10516; + int i10517; + int i10518; + int i10519; + int i10520; + int i10521; + int i10522; + int i10523; + int i10524; + int i10525; + int i10526; + int i10527; + int i10528; + int i10529; + int i10530; + int i10531; + int i10532; + int i10533; + int i10534; + int i10535; + int i10536; + int i10537; + int i10538; + int i10539; + int i10540; + int i10541; + int i10542; + int i10543; + int i10544; + int i10545; + int i10546; + int i10547; + int i10548; + int i10549; + int i10550; + int i10551; + int i10552; + int i10553; + int i10554; + int i10555; + int i10556; + int i10557; + int i10558; + int i10559; + int i10560; + int i10561; + int i10562; + int i10563; + int i10564; + int i10565; + int i10566; + int i10567; + int i10568; + int i10569; + int i10570; + int i10571; + int i10572; + int i10573; + int i10574; + int i10575; + int i10576; + int i10577; + int i10578; + int i10579; + int i10580; + int i10581; + int i10582; + int i10583; + int i10584; + int i10585; + int i10586; + int i10587; + int i10588; + int i10589; + int i10590; + int i10591; + int i10592; + int i10593; + int i10594; + int i10595; + int i10596; + int i10597; + int i10598; + int i10599; + int i10600; + int i10601; + int i10602; + int i10603; + int i10604; + int i10605; + int i10606; + int i10607; + int i10608; + int i10609; + int i10610; + int i10611; + int i10612; + int i10613; + int i10614; + int i10615; + int i10616; + int i10617; + int i10618; + int i10619; + int i10620; + int i10621; + int i10622; + int i10623; + int i10624; + int i10625; + int i10626; + int i10627; + int i10628; + int i10629; + int i10630; + int i10631; + int i10632; + int i10633; + int i10634; + int i10635; + int i10636; + int i10637; + int i10638; + int i10639; + int i10640; + int i10641; + int i10642; + int i10643; + int i10644; + int i10645; + int i10646; + int i10647; + int i10648; + int i10649; + int i10650; + int i10651; + int i10652; + int i10653; + int i10654; + int i10655; + int i10656; + int i10657; + int i10658; + int i10659; + int i10660; + int i10661; + int i10662; + int i10663; + int i10664; + int i10665; + int i10666; + int i10667; + int i10668; + int i10669; + int i10670; + int i10671; + int i10672; + int i10673; + int i10674; + int i10675; + int i10676; + int i10677; + int i10678; + int i10679; + int i10680; + int i10681; + int i10682; + int i10683; + int i10684; + int i10685; + int i10686; + int i10687; + int i10688; + int i10689; + int i10690; + int i10691; + int i10692; + int i10693; + int i10694; + int i10695; + int i10696; + int i10697; + int i10698; + int i10699; + int i10700; + int i10701; + int i10702; + int i10703; + int i10704; + int i10705; + int i10706; + int i10707; + int i10708; + int i10709; + int i10710; + int i10711; + int i10712; + int i10713; + int i10714; + int i10715; + int i10716; + int i10717; + int i10718; + int i10719; + int i10720; + int i10721; + int i10722; + int i10723; + int i10724; + int i10725; + int i10726; + int i10727; + int i10728; + int i10729; + int i10730; + int i10731; + int i10732; + int i10733; + int i10734; + int i10735; + int i10736; + int i10737; + int i10738; + int i10739; + int i10740; + int i10741; + int i10742; + int i10743; + int i10744; + int i10745; + int i10746; + int i10747; + int i10748; + int i10749; + int i10750; + int i10751; + int i10752; + int i10753; + int i10754; + int i10755; + int i10756; + int i10757; + int i10758; + int i10759; + int i10760; + int i10761; + int i10762; + int i10763; + int i10764; + int i10765; + int i10766; + int i10767; + int i10768; + int i10769; + int i10770; + int i10771; + int i10772; + int i10773; + int i10774; + int i10775; + int i10776; + int i10777; + int i10778; + int i10779; + int i10780; + int i10781; + int i10782; + int i10783; + int i10784; + int i10785; + int i10786; + int i10787; + int i10788; + int i10789; + int i10790; + int i10791; + int i10792; + int i10793; + int i10794; + int i10795; + int i10796; + int i10797; + int i10798; + int i10799; + + if (unlikely) { + // Since Foo is not loaded this will turn into an uncommon trap + Class c = Foo.class; + + StringBuilder sb = new StringBuilder(); + } + } +} diff --git a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java index f6c2414f17d..5265947a3fc 100644 --- a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java +++ b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java @@ -74,11 +74,13 @@ public abstract class CompilerWhiteBoxTest { protected static final int THRESHOLD; /** count of invocation to triger OSR compilation */ protected static final long BACKEDGE_THRESHOLD; + /** Value of {@code java.vm.info} (interpreted|mixed|comp mode) */ + protected static final String MODE + = System.getProperty("java.vm.info"); static { if (TIERED_COMPILATION) { - THRESHOLD = 150000; - BACKEDGE_THRESHOLD = 0xFFFFFFFFL; + BACKEDGE_THRESHOLD = THRESHOLD = 150000; } else { THRESHOLD = COMPILE_THRESHOLD; BACKEDGE_THRESHOLD = COMPILE_THRESHOLD * Long.parseLong(getVMOption( @@ -202,7 +204,7 @@ public abstract class CompilerWhiteBoxTest { if (WHITE_BOX.getMethodCompilationLevel(method, true) != 0) { throw new RuntimeException(method + " osr_comp_level must be == 0"); } - } + } /** * Checks, that {@linkplain #method} is compiled. @@ -361,7 +363,7 @@ enum TestCase { /** OSR constructor test case */ OSR_CONSTRUCTOR_TEST(Helper.OSR_CONSTRUCTOR, Helper.OSR_CONSTRUCTOR_CALLABLE, true), - /** OSR method test case */ + /** OSR method test case */ OSR_METOD_TEST(Helper.OSR_METHOD, Helper.OSR_METHOD_CALLABLE, true), /** OSR static method test case */ OSR_STATIC_TEST(Helper.OSR_STATIC, Helper.OSR_STATIC_CALLABLE, true); @@ -370,7 +372,7 @@ enum TestCase { final Executable executable; /** object to invoke {@linkplain #executable} */ final Callable callable; - /** flag for OSR test case */ + /** flag for OSR test case */ final boolean isOsr; private TestCase(Executable executable, Callable callable, diff --git a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java index 2f49d054a48..61d8b599845 100644 --- a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java +++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java @@ -53,6 +53,12 @@ public class DeoptimizeAllTest extends CompilerWhiteBoxTest { */ @Override protected void test() throws Exception { + if (testCase.isOsr && CompilerWhiteBoxTest.MODE.startsWith( + "compiled ")) { + System.err.printf("Warning: %s is not applicable in %s%n", + testCase.name(), CompilerWhiteBoxTest.MODE); + return; + } compile(); checkCompiled(); WHITE_BOX.deoptimizeAll(); diff --git a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java index 502c9b77fb7..8ac065bd1e8 100644 --- a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java +++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java @@ -53,6 +53,12 @@ public class DeoptimizeMethodTest extends CompilerWhiteBoxTest { */ @Override protected void test() throws Exception { + if (testCase.isOsr && CompilerWhiteBoxTest.MODE.startsWith( + "compiled ")) { + System.err.printf("Warning: %s is not applicable in %s%n", + testCase.name(), CompilerWhiteBoxTest.MODE); + return; + } compile(); checkCompiled(); deoptimize(); diff --git a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java index 909a9fda281..6d14d9211e2 100644 --- a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java +++ b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java @@ -70,12 +70,10 @@ public class EnqueueMethodForCompilationTest extends CompilerWhiteBoxTest { int compLevel = getCompLevel(); int bci = WHITE_BOX.getMethodEntryBci(method); - System.out.println("bci = " + bci); - printInfo(); deoptimize(); - printInfo(); checkNotCompiled(); - printInfo(); + WHITE_BOX.clearMethodState(method); + WHITE_BOX.enqueueMethodForCompilation(method, compLevel, bci); checkCompiled(); deoptimize(); diff --git a/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java b/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java index e9817deb1d3..a17fcb82f40 100644 --- a/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java +++ b/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java @@ -68,6 +68,12 @@ public class IsMethodCompilableTest extends CompilerWhiteBoxTest { */ @Override protected void test() throws Exception { + if (testCase.isOsr && CompilerWhiteBoxTest.MODE.startsWith( + "compiled ")) { + System.err.printf("Warning: %s is not applicable in %s%n", + testCase.name(), CompilerWhiteBoxTest.MODE); + return; + } if (!isCompilable()) { throw new RuntimeException(method + " must be compilable"); } diff --git a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java index 3768b3b0191..6a1e3613fec 100644 --- a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java +++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java @@ -62,6 +62,12 @@ public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest { */ @Override protected void test() throws Exception { + if (testCase.isOsr && CompilerWhiteBoxTest.MODE.startsWith( + "compiled ")) { + System.err.printf("Warning: %s is not applicable in %s%n", + testCase.name(), CompilerWhiteBoxTest.MODE); + return; + } checkNotCompiled(); if (!isCompilable()) { throw new RuntimeException(method + " must be compilable"); diff --git a/hotspot/test/gc/7168848/HumongousAlloc.java b/hotspot/test/gc/7168848/HumongousAlloc.java deleted file mode 100644 index 7ac6074bd67..00000000000 --- a/hotspot/test/gc/7168848/HumongousAlloc.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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 Humongous.java - * @bug 7168848 - * @summary G1: humongous object allocations should initiate marking cycles when necessary - * @run main/othervm -Xms100m -Xmx100m -XX:+PrintGC -XX:G1HeapRegionSize=1m -XX:+UseG1GC HumongousAlloc - * - */ -import java.lang.management.GarbageCollectorMXBean; -import java.lang.management.ManagementFactory; -import java.util.List; - -public class HumongousAlloc { - - public static byte[] dummy; - private static int sleepFreq = 40; - private static int sleepTime = 1000; - private static double size = 0.75; - private static int iterations = 50; - private static int MB = 1024 * 1024; - - public static void allocate(int size, int sleepTime, int sleepFreq) throws InterruptedException { - System.out.println("Will allocate objects of size: " + size - + " bytes and sleep for " + sleepTime - + " ms after every " + sleepFreq + "th allocation."); - int count = 0; - while (count < iterations) { - for (int i = 0; i < sleepFreq; i++) { - dummy = new byte[size - 16]; - } - Thread.sleep(sleepTime); - count++; - } - } - - public static void main(String[] args) throws InterruptedException { - allocate((int) (size * MB), sleepTime, sleepFreq); - List collectors = ManagementFactory.getGarbageCollectorMXBeans(); - for (GarbageCollectorMXBean collector : collectors) { - if (collector.getName().contains("G1 Old")) { - long count = collector.getCollectionCount(); - if (count > 0) { - throw new RuntimeException("Failed: FullGCs should not have happened. The number of FullGC run is " + count); - } - else { - System.out.println("Passed."); - } - } - } - } -} - diff --git a/hotspot/test/gc/TestSystemGC.java b/hotspot/test/gc/TestSystemGC.java new file mode 100644 index 00000000000..b882f9fc72d --- /dev/null +++ b/hotspot/test/gc/TestSystemGC.java @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* This code is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 only, as +* published by the Free Software Foundation. +* +* This code is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +* version 2 for more details (a copy is included in the LICENSE file that +* accompanied this code). +* +* You should have received a copy of the GNU General Public License version +* 2 along with this work; if not, write to the Free Software Foundation, +* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +* or visit www.oracle.com if you need additional information or have any +* questions. +*/ + +/* + * @test TestSystemGC + * @key gc + * @summary Runs System.gc() with different flags. + * @run main/othervm TestSystemGC + * @run main/othervm -XX:+UseSerialGC TestSystemGC + * @run main/othervm -XX:+UseParNewGC TestSystemGC + * @run main/othervm -XX:+UseParallelGC TestSystemGC + * @run main/othervm -XX:+UseParallelGC -XX:-UseParallelOldGC TestSystemGC + * @run main/othervm -XX:+UseConcMarkSweepGC TestSystemGC + * @run main/othervm -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent TestSystemGC + * @run main/othervm -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParNewGC TestSystemGC + * @run main/othervm -XX:+UseG1GC TestSystemGC + * @run main/othervm -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent TestSystemGC + * @run main/othervm -XX:+UseLargePages TestSystemGC + * @run main/othervm -XX:+UseLargePages -XX:+UseLargePagesInMetaspace TestSystemGC + */ + +public class TestSystemGC { + public static void main(String args[]) throws Exception { + System.gc(); + } +} diff --git a/hotspot/test/gc/arguments/TestHeapFreeRatio.java b/hotspot/test/gc/arguments/TestHeapFreeRatio.java new file mode 100644 index 00000000000..11e259df038 --- /dev/null +++ b/hotspot/test/gc/arguments/TestHeapFreeRatio.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test TestHeapFreeRatio + * @key gc + * @bug 8025661 + * @summary Test parsing of -Xminf and -Xmaxf + * @library /testlibrary + * @run main/othervm TestHeapFreeRatio + */ + +import com.oracle.java.testlibrary.*; + +public class TestHeapFreeRatio { + + enum Validation { + VALID, + MIN_INVALID, + MAX_INVALID, + COMBINATION_INVALID + } + + private static void testMinMaxFreeRatio(String min, String max, Validation type) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-Xminf" + min, + "-Xmaxf" + max, + "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + + switch (type) { + case VALID: + output.shouldNotContain("Error"); + output.shouldHaveExitValue(0); + break; + case MIN_INVALID: + output.shouldContain("Bad min heap free percentage size: -Xminf" + min); + output.shouldContain("Error"); + output.shouldHaveExitValue(1); + break; + case MAX_INVALID: + output.shouldContain("Bad max heap free percentage size: -Xmaxf" + max); + output.shouldContain("Error"); + output.shouldHaveExitValue(1); + break; + case COMBINATION_INVALID: + output.shouldContain("must be less than or equal to MaxHeapFreeRatio"); + output.shouldContain("Error"); + output.shouldHaveExitValue(1); + break; + default: + throw new IllegalStateException("Must specify expected validation type"); + } + + System.out.println(output.getOutput()); + } + + public static void main(String args[]) throws Exception { + testMinMaxFreeRatio( "0.1", "0.5", Validation.VALID); + testMinMaxFreeRatio( ".1", ".5", Validation.VALID); + testMinMaxFreeRatio( "0.5", "0.5", Validation.VALID); + + testMinMaxFreeRatio("-0.1", "0.5", Validation.MIN_INVALID); + testMinMaxFreeRatio( "1.1", "0.5", Validation.MIN_INVALID); + testMinMaxFreeRatio("=0.1", "0.5", Validation.MIN_INVALID); + testMinMaxFreeRatio("0.1f", "0.5", Validation.MIN_INVALID); + testMinMaxFreeRatio( + "INVALID", "0.5", Validation.MIN_INVALID); + testMinMaxFreeRatio( + "2147483647", "0.5", Validation.MIN_INVALID); + + testMinMaxFreeRatio( "0.1", "-0.5", Validation.MAX_INVALID); + testMinMaxFreeRatio( "0.1", "1.5", Validation.MAX_INVALID); + testMinMaxFreeRatio( "0.1", "0.5f", Validation.MAX_INVALID); + testMinMaxFreeRatio( "0.1", "=0.5", Validation.MAX_INVALID); + testMinMaxFreeRatio( + "0.1", "INVALID", Validation.MAX_INVALID); + testMinMaxFreeRatio( + "0.1", "2147483647", Validation.MAX_INVALID); + + testMinMaxFreeRatio( "0.5", "0.1", Validation.COMBINATION_INVALID); + testMinMaxFreeRatio( ".5", ".10", Validation.COMBINATION_INVALID); + testMinMaxFreeRatio("0.12","0.100", Validation.COMBINATION_INVALID); + } +} diff --git a/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java b/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java new file mode 100644 index 00000000000..468ad423f37 --- /dev/null +++ b/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java @@ -0,0 +1,75 @@ +/* + * 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 TestHumongousAllocInitialMark + * @bug 7168848 + * @summary G1: humongous object allocations should initiate marking cycles when necessary + * @library /testlibrary + */ + +import com.oracle.java.testlibrary.*; + +public class TestHumongousAllocInitialMark { + private static final int heapSize = 200; // MB + private static final int heapRegionSize = 1; // MB + private static final int initiatingHeapOccupancyPercent = 50; // % + + public static void main(String[] args) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UseG1GC", + "-Xms" + heapSize + "m", + "-Xmx" + heapSize + "m", + "-XX:G1HeapRegionSize=" + heapRegionSize + "m", + "-XX:InitiatingHeapOccupancyPercent=" + initiatingHeapOccupancyPercent, + "-XX:+PrintGC", + HumongousObjectAllocator.class.getName()); + + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("GC pause (G1 Humongous Allocation) (young) (initial-mark)"); + output.shouldNotContain("Full GC"); + output.shouldHaveExitValue(0); + } + + static class HumongousObjectAllocator { + private static byte[] dummy; + + public static void main(String [] args) throws Exception { + // Make object size 75% of region size + final int humongousObjectSize = + (int)(heapRegionSize * 1024 * 1024 * 0.75); + + // Number of objects to allocate to go above IHOP + final int humongousObjectAllocations = + (int)((heapSize * initiatingHeapOccupancyPercent / 100.0) / heapRegionSize) + 1; + + // Allocate + for (int i = 1; i <= humongousObjectAllocations; i++) { + System.out.println("Allocating humongous object " + i + "/" + humongousObjectAllocations + + " of size " + humongousObjectSize + " bytes"); + dummy = new byte[humongousObjectSize]; + } + } + } +} + diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStats.java b/hotspot/test/gc/g1/TestSummarizeRSetStats.java index 1990d4c6f39..e78e2df21a3 100644 --- a/hotspot/test/gc/g1/TestSummarizeRSetStats.java +++ b/hotspot/test/gc/g1/TestSummarizeRSetStats.java @@ -25,140 +25,61 @@ * @test TestSummarizeRSetStats.java * @bug 8013895 * @library /testlibrary - * @build TestSummarizeRSetStats + * @build TestSummarizeRSetStatsTools TestSummarizeRSetStats * @summary Verify output of -XX:+G1SummarizeRSetStats * @run main TestSummarizeRSetStats * * Test the output of G1SummarizeRSetStats in conjunction with G1SummarizeRSetStatsPeriod. */ -import com.oracle.java.testlibrary.*; -import java.lang.Thread; -import java.util.ArrayList; -import java.util.Arrays; - -class RunSystemGCs { - // 4M size, both are directly allocated into the old gen - static Object[] largeObject1 = new Object[1024 * 1024]; - static Object[] largeObject2 = new Object[1024 * 1024]; - - static int[] temp; - - public static void main(String[] args) { - // create some cross-references between these objects - for (int i = 0; i < largeObject1.length; i++) { - largeObject1[i] = largeObject2; - } - - for (int i = 0; i < largeObject2.length; i++) { - largeObject2[i] = largeObject1; - } - - int numGCs = Integer.parseInt(args[0]); - - if (numGCs > 0) { - // try to force a minor collection: the young gen is 4M, the - // amount of data allocated below is roughly that (4*1024*1024 + - // some header data) - for (int i = 0; i < 1024 ; i++) { - temp = new int[1024]; - } - } - - for (int i = 0; i < numGCs - 1; i++) { - System.gc(); - } - } -} - public class TestSummarizeRSetStats { - public static String runTest(String[] additionalArgs, int numGCs) throws Exception { - ArrayList finalargs = new ArrayList(); - String[] defaultArgs = new String[] { - "-XX:+UseG1GC", - "-Xmn4m", - "-Xmx20m", - "-XX:InitiatingHeapOccupancyPercent=100", // we don't want the additional GCs due to initial marking - "-XX:+PrintGC", - "-XX:+UnlockDiagnosticVMOptions", - "-XX:G1HeapRegionSize=1M", - }; - - finalargs.addAll(Arrays.asList(defaultArgs)); - - if (additionalArgs != null) { - finalargs.addAll(Arrays.asList(additionalArgs)); - } - - finalargs.add(RunSystemGCs.class.getName()); - finalargs.add(String.valueOf(numGCs)); - - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - finalargs.toArray(new String[0])); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - - output.shouldHaveExitValue(0); - - String result = output.getStdout(); - return result; - } - - private static void expectStatistics(String result, int expectedCumulative, int expectedPeriodic) throws Exception { - int actualTotal = result.split("Concurrent RS processed").length - 1; - int actualCumulative = result.split("Cumulative RS summary").length - 1; - - if (expectedCumulative != actualCumulative) { - throw new Exception("Incorrect amount of RSet summaries at the end. Expected " + expectedCumulative + ", got " + actualCumulative); - } - - if (expectedPeriodic != (actualTotal - actualCumulative)) { - throw new Exception("Incorrect amount of per-period RSet summaries at the end. Expected " + expectedPeriodic + ", got " + (actualTotal - actualCumulative)); - } - } - public static void main(String[] args) throws Exception { String result; - // no RSet statistics output - result = runTest(null, 0); - expectStatistics(result, 0, 0); + if (!TestSummarizeRSetStatsTools.testingG1GC()) { + return; + } - // no RSet statistics output - result = runTest(null, 2); - expectStatistics(result, 0, 0); + // no remembered set summary output + result = TestSummarizeRSetStatsTools.runTest(null, 0); + TestSummarizeRSetStatsTools.expectRSetSummaries(result, 0, 0); - // no RSet statistics output - result = runTest(new String[] { "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); - expectStatistics(result, 0, 0); + // no remembered set summary output + result = TestSummarizeRSetStatsTools.runTest(null, 2); + TestSummarizeRSetStatsTools.expectRSetSummaries(result, 0, 0); - // single RSet statistics output at the end - result = runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 0); - expectStatistics(result, 1, 0); + // no remembered set summary output + result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); + TestSummarizeRSetStatsTools.expectRSetSummaries(result, 0, 0); - // single RSet statistics output at the end - result = runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 2); - expectStatistics(result, 1, 0); + // single remembered set summary output at the end + result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 0); + TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 0); - // single RSet statistics output - result = runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 0); - expectStatistics(result, 1, 0); + // single remembered set summary output at the end + result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 2); + TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 0); - // two times RSet statistics output - result = runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 1); - expectStatistics(result, 1, 1); + // single remembered set summary output + result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 0); + TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 0); - // four times RSet statistics output - result = runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); - expectStatistics(result, 1, 3); + // two times remembered set summary output + result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 1); + TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 2); - // three times RSet statistics output - result = runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=2" }, 3); - expectStatistics(result, 1, 2); + // four times remembered set summary output + result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); + TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 6); - // single RSet statistics output - result = runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=100" }, 3); - expectStatistics(result, 1, 1); + // three times remembered set summary output + result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=2" }, 3); + TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 4); + + // single remembered set summary output + result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=100" }, 3); + TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 2); } } diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java b/hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java new file mode 100644 index 00000000000..437cbc2c70e --- /dev/null +++ b/hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test TestSummarizeRSetStatsPerRegion.java + * @bug 8014078 + * @library /testlibrary + * @build TestSummarizeRSetStatsTools TestSummarizeRSetStatsPerRegion + * @summary Verify output of -XX:+G1SummarizeRSetStats in regards to per-region type output + * @run main TestSummarizeRSetStatsPerRegion + */ + +import com.oracle.java.testlibrary.*; +import java.lang.Thread; +import java.util.ArrayList; +import java.util.Arrays; + +public class TestSummarizeRSetStatsPerRegion { + + public static void main(String[] args) throws Exception { + String result; + + if (!TestSummarizeRSetStatsTools.testingG1GC()) { + return; + } + + // single remembered set summary output at the end + result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 0); + TestSummarizeRSetStatsTools.expectPerRegionRSetSummaries(result, 1, 0); + + // two times remembered set summary output + result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 1); + TestSummarizeRSetStatsTools.expectPerRegionRSetSummaries(result, 1, 2); + } +} diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java b/hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java new file mode 100644 index 00000000000..99014e0cdf1 --- /dev/null +++ b/hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test TestSummarizeRSetStatsThreads + * @bug 8025441 + * @summary Ensure that various values of worker threads/concurrent + * refinement threads do not crash the VM. + * @key gc + * @library /testlibrary + */ + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import com.oracle.java.testlibrary.ProcessTools; +import com.oracle.java.testlibrary.OutputAnalyzer; + +public class TestSummarizeRSetStatsThreads { + + private static void runTest(int refinementThreads, int workerThreads) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+G1SummarizeRSetStats", + "-XX:G1ConcRefinementThreads=" + refinementThreads, + "-XX:ParallelGCThreads=" + workerThreads, + "-version"); + + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + + // check output to contain the string "Concurrent RS threads times (s)" followed by + // the correct number of values in the next line. + + // a zero in refinement thread numbers indicates that the value in ParallelGCThreads should be used. + // Additionally use at least one thread. + int expectedNumRefinementThreads = refinementThreads == 0 ? workerThreads : refinementThreads; + expectedNumRefinementThreads = Math.max(1, expectedNumRefinementThreads); + // create the pattern made up of n copies of a floating point number pattern + String numberPattern = String.format("%0" + expectedNumRefinementThreads + "d", 0) + .replace("0", "\\s+\\d+\\.\\d+"); + String pattern = "Concurrent RS threads times \\(s\\)$" + numberPattern + "$"; + Matcher m = Pattern.compile(pattern, Pattern.MULTILINE).matcher(output.getStdout()); + + if (!m.find()) { + throw new Exception("Could not find correct output for concurrent RS threads times in stdout," + + " should match the pattern \"" + pattern + "\", but stdout is \n" + output.getStdout()); + } + output.shouldHaveExitValue(0); + } + + public static void main(String[] args) throws Exception { + if (!TestSummarizeRSetStatsTools.testingG1GC()) { + return; + } + // different valid combinations of number of refinement and gc worker threads + runTest(0, 0); + runTest(0, 5); + runTest(5, 0); + runTest(10, 10); + runTest(1, 2); + runTest(4, 3); + } +} diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java b/hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java new file mode 100644 index 00000000000..096a7c675b5 --- /dev/null +++ b/hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * Common helpers for TestSummarizeRSetStats* tests + */ + +import sun.management.ManagementFactoryHelper; +import com.sun.management.HotSpotDiagnosticMXBean; +import com.sun.management.VMOption; + +import com.oracle.java.testlibrary.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.lang.Thread; +import java.util.ArrayList; +import java.util.Arrays; + +class VerifySummaryOutput { + // 4M size, both are directly allocated into the old gen + static Object[] largeObject1 = new Object[1024 * 1024]; + static Object[] largeObject2 = new Object[1024 * 1024]; + + static int[] temp; + + public static void main(String[] args) { + // create some cross-references between these objects + for (int i = 0; i < largeObject1.length; i++) { + largeObject1[i] = largeObject2; + } + + for (int i = 0; i < largeObject2.length; i++) { + largeObject2[i] = largeObject1; + } + + int numGCs = Integer.parseInt(args[0]); + + if (numGCs > 0) { + // try to force a minor collection: the young gen is 4M, the + // amount of data allocated below is roughly that (4*1024*1024 + + // some header data) + for (int i = 0; i < 1024 ; i++) { + temp = new int[1024]; + } + } + + for (int i = 0; i < numGCs - 1; i++) { + System.gc(); + } + } +} + +public class TestSummarizeRSetStatsTools { + + // the VM is currently run using G1GC, i.e. trying to test G1 functionality. + public static boolean testingG1GC() { + HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean(); + + VMOption option = diagnostic.getVMOption("UseG1GC"); + if (option.getValue().equals("false")) { + System.out.println("Skipping this test. It is only a G1 test."); + return false; + } + return true; + } + + public static String runTest(String[] additionalArgs, int numGCs) throws Exception { + ArrayList finalargs = new ArrayList(); + String[] defaultArgs = new String[] { + "-XX:+UseG1GC", + "-XX:+UseCompressedOops", + "-Xmn4m", + "-Xmx20m", + "-XX:InitiatingHeapOccupancyPercent=100", // we don't want the additional GCs due to initial marking + "-XX:+PrintGC", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:G1HeapRegionSize=1M", + }; + + finalargs.addAll(Arrays.asList(defaultArgs)); + + if (additionalArgs != null) { + finalargs.addAll(Arrays.asList(additionalArgs)); + } + + finalargs.add(VerifySummaryOutput.class.getName()); + finalargs.add(String.valueOf(numGCs)); + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + finalargs.toArray(new String[0])); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + + output.shouldHaveExitValue(0); + + String result = output.getStdout(); + return result; + } + + private static void checkCounts(int expected, int actual, String which) throws Exception { + if (expected != actual) { + throw new Exception("RSet summaries mention " + which + " regions an incorrect number of times. Expected " + expected + ", got " + actual); + } + } + + public static void expectPerRegionRSetSummaries(String result, int expectedCumulative, int expectedPeriodic) throws Exception { + expectRSetSummaries(result, expectedCumulative, expectedPeriodic); + int actualYoung = result.split("Young regions").length - 1; + int actualHumonguous = result.split("Humonguous regions").length - 1; + int actualFree = result.split("Free regions").length - 1; + int actualOther = result.split("Old regions").length - 1; + + // the strings we check for above are printed four times per summary + int expectedPerRegionTypeInfo = (expectedCumulative + expectedPeriodic) * 4; + + checkCounts(expectedPerRegionTypeInfo, actualYoung, "Young"); + checkCounts(expectedPerRegionTypeInfo, actualHumonguous, "Humonguous"); + checkCounts(expectedPerRegionTypeInfo, actualFree, "Free"); + checkCounts(expectedPerRegionTypeInfo, actualOther, "Old"); + } + + public static void expectRSetSummaries(String result, int expectedCumulative, int expectedPeriodic) throws Exception { + int actualTotal = result.split("concurrent refinement").length - 1; + int actualCumulative = result.split("Cumulative RS summary").length - 1; + + if (expectedCumulative != actualCumulative) { + throw new Exception("Incorrect amount of RSet summaries at the end. Expected " + expectedCumulative + ", got " + actualCumulative); + } + + if (expectedPeriodic != (actualTotal - actualCumulative)) { + throw new Exception("Incorrect amount of per-period RSet summaries at the end. Expected " + expectedPeriodic + ", got " + (actualTotal - actualCumulative)); + } + } +} + diff --git a/hotspot/test/gc/metaspace/G1AddMetaspaceDependency.java b/hotspot/test/gc/metaspace/G1AddMetaspaceDependency.java index 39716b977ae..b8e8b1ad598 100644 --- a/hotspot/test/gc/metaspace/G1AddMetaspaceDependency.java +++ b/hotspot/test/gc/metaspace/G1AddMetaspaceDependency.java @@ -107,7 +107,6 @@ public class G1AddMetaspaceDependency { Loader f_loader = new Loader(b_name, b_bytes, a_name, a_loader); Loader g_loader = new Loader(b_name, b_bytes, a_name, a_loader); - byte[] b = new byte[20 * 2 << 20]; Class c; c = b_loader.loadClass(b_name); c = c_loader.loadClass(b_name); diff --git a/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java b/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java index e26aa6eee57..ac708bf7701 100644 --- a/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java +++ b/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java @@ -29,10 +29,11 @@ import static com.oracle.java.testlibrary.Asserts.*; /* @test TestPerfCountersAndMemoryPools * @bug 8023476 + * @library /testlibrary * @summary Tests that a MemoryPoolMXBeans and PerfCounters for metaspace * report the same data. - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedKlassPointers -XX:+UseSerialGC -XX:+UsePerfData TestPerfCountersAndMemoryPools - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedKlassPointers -XX:+UseSerialGC -XX:+UsePerfData TestPerfCountersAndMemoryPools + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedKlassPointers -XX:+UseSerialGC -XX:+UsePerfData -Xint TestPerfCountersAndMemoryPools + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedKlassPointers -XX:+UseSerialGC -XX:+UsePerfData -Xint TestPerfCountersAndMemoryPools */ public class TestPerfCountersAndMemoryPools { public static void main(String[] args) throws Exception { @@ -43,11 +44,11 @@ public class TestPerfCountersAndMemoryPools { } } - private static MemoryUsage getMemoryUsage(String memoryPoolName) { + private static MemoryPoolMXBean getMemoryPool(String memoryPoolName) { List pools = ManagementFactory.getMemoryPoolMXBeans(); for (MemoryPoolMXBean pool : pools) { if (pool.getName().equals(memoryPoolName)) { - return pool.getUsage(); + return pool; } } @@ -57,19 +58,18 @@ public class TestPerfCountersAndMemoryPools { private static void checkMemoryUsage(String memoryPoolName, String perfNS) throws Exception { - // Need to do a gc before each comparison to update the perf counters + MemoryPoolMXBean pool = getMemoryPool(memoryPoolName); + // Must do a GC to update performance counters System.gc(); - MemoryUsage mu = getMemoryUsage(memoryPoolName); - assertEQ(getMinCapacity(perfNS), mu.getInit()); + assertEQ(getMinCapacity(perfNS), pool.getUsage().getInit()); + // Must do a second GC to update the perfomance counters again, since + // the call pool.getUsage().getInit() could have allocated some + // metadata. System.gc(); - mu = getMemoryUsage(memoryPoolName); - assertEQ(getUsed(perfNS), mu.getUsed()); - - System.gc(); - mu = getMemoryUsage(memoryPoolName); - assertEQ(getCapacity(perfNS), mu.getCommitted()); + assertEQ(getUsed(perfNS), pool.getUsage().getUsed()); + assertEQ(getCapacity(perfNS), pool.getUsage().getCommitted()); } private static long getMinCapacity(String ns) throws Exception { diff --git a/hotspot/test/gc/startup_warnings/TestCMS.java b/hotspot/test/gc/startup_warnings/TestCMS.java index 22a0719576a..93bb56311e2 100644 --- a/hotspot/test/gc/startup_warnings/TestCMS.java +++ b/hotspot/test/gc/startup_warnings/TestCMS.java @@ -38,7 +38,7 @@ public class TestCMS { public static void main(String args[]) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseConcMarkSweepGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldNotContain("warning"); + output.shouldNotContain("deprecated"); output.shouldNotContain("error"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/startup_warnings/TestCMSForegroundFlags.java b/hotspot/test/gc/startup_warnings/TestCMSForegroundFlags.java new file mode 100644 index 00000000000..ead8788524a --- /dev/null +++ b/hotspot/test/gc/startup_warnings/TestCMSForegroundFlags.java @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* This code is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 only, as +* published by the Free Software Foundation. +* +* This code is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +* version 2 for more details (a copy is included in the LICENSE file that +* accompanied this code). +* +* You should have received a copy of the GNU General Public License version +* 2 along with this work; if not, write to the Free Software Foundation, +* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +* or visit www.oracle.com if you need additional information or have any +* questions. +*/ + +/* +* @test TestCMSForegroundFlags +* @key gc +* @bug 8027132 +* @summary Test that the deprecated CMS foreground collector flags print warning messages +* @library /testlibrary +* @run main TestCMSForegroundFlags -XX:-UseCMSCompactAtFullCollection UseCMSCompactAtFullCollection +* @run main TestCMSForegroundFlags -XX:CMSFullGCsBeforeCompaction=4 CMSFullGCsBeforeCompaction +* @run main TestCMSForegroundFlags -XX:-UseCMSCollectionPassing UseCMSCollectionPassing +*/ + +import com.oracle.java.testlibrary.OutputAnalyzer; +import com.oracle.java.testlibrary.ProcessTools; + +public class TestCMSForegroundFlags { + public static void main(String[] args) throws Exception { + if (args.length != 2) { + throw new Exception("Expected two arguments,flagValue and flagName"); + } + String flagValue = args[0]; + String flagName = args[1]; + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(flagValue, "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("warning: " + flagName + " is deprecated and will likely be removed in a future release."); + output.shouldNotContain("error"); + output.shouldHaveExitValue(0); + } +} diff --git a/hotspot/test/gc/startup_warnings/TestCMSNoIncrementalMode.java b/hotspot/test/gc/startup_warnings/TestCMSNoIncrementalMode.java index f2180904eba..0d329fbe57e 100644 --- a/hotspot/test/gc/startup_warnings/TestCMSNoIncrementalMode.java +++ b/hotspot/test/gc/startup_warnings/TestCMSNoIncrementalMode.java @@ -37,7 +37,7 @@ public class TestCMSNoIncrementalMode { public static void main(String args[]) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseConcMarkSweepGC", "-XX:-CMSIncrementalMode", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldNotContain("warning"); + output.shouldNotContain("deprecated"); output.shouldNotContain("error"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/startup_warnings/TestG1.java b/hotspot/test/gc/startup_warnings/TestG1.java index 536612bbcea..b1dfaa427f2 100644 --- a/hotspot/test/gc/startup_warnings/TestG1.java +++ b/hotspot/test/gc/startup_warnings/TestG1.java @@ -37,7 +37,7 @@ public class TestG1 { public static void main(String args[]) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldNotContain("warning"); + output.shouldNotContain("deprecated"); output.shouldNotContain("error"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/startup_warnings/TestParNewCMS.java b/hotspot/test/gc/startup_warnings/TestParNewCMS.java index f74d65c662d..3f8bfb42d2f 100644 --- a/hotspot/test/gc/startup_warnings/TestParNewCMS.java +++ b/hotspot/test/gc/startup_warnings/TestParNewCMS.java @@ -38,7 +38,7 @@ public class TestParNewCMS { public static void main(String args[]) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseParNewGC", "-XX:+UseConcMarkSweepGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldNotContain("warning"); + output.shouldNotContain("deprecated"); output.shouldNotContain("error"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/startup_warnings/TestParallelGC.java b/hotspot/test/gc/startup_warnings/TestParallelGC.java index 7a0766ebc45..e21630913c0 100644 --- a/hotspot/test/gc/startup_warnings/TestParallelGC.java +++ b/hotspot/test/gc/startup_warnings/TestParallelGC.java @@ -38,7 +38,7 @@ public class TestParallelGC { public static void main(String args[]) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseParallelGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldNotContain("warning"); + output.shouldNotContain("deprecated"); output.shouldNotContain("error"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/startup_warnings/TestParallelScavengeSerialOld.java b/hotspot/test/gc/startup_warnings/TestParallelScavengeSerialOld.java index 27a25b23db0..5d1cbddb025 100644 --- a/hotspot/test/gc/startup_warnings/TestParallelScavengeSerialOld.java +++ b/hotspot/test/gc/startup_warnings/TestParallelScavengeSerialOld.java @@ -38,7 +38,7 @@ public class TestParallelScavengeSerialOld { public static void main(String args[]) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseParallelGC", "-XX:-UseParallelOldGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldNotContain("warning"); + output.shouldNotContain("deprecated"); output.shouldNotContain("error"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/startup_warnings/TestSerialGC.java b/hotspot/test/gc/startup_warnings/TestSerialGC.java index d84fd5d969b..4ce1af2b440 100644 --- a/hotspot/test/gc/startup_warnings/TestSerialGC.java +++ b/hotspot/test/gc/startup_warnings/TestSerialGC.java @@ -38,7 +38,7 @@ public class TestSerialGC { public static void main(String args[]) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseSerialGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldNotContain("warning"); + output.shouldNotContain("deprecated"); output.shouldNotContain("error"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/runtime/6888954/vmerrors.sh b/hotspot/test/runtime/6888954/vmerrors.sh index 3e3121e40f5..ebd91490e09 100644 --- a/hotspot/test/runtime/6888954/vmerrors.sh +++ b/hotspot/test/runtime/6888954/vmerrors.sh @@ -1,3 +1,25 @@ +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + # @test # @bug 6888954 # @bug 8015884 @@ -63,6 +85,7 @@ do [ $i -lt 10 ] && i2=0$i "$TESTJAVA/bin/java" $TESTVMOPTS -XX:+IgnoreUnrecognizedVMOptions \ + -XX:-TransmitErrorReport \ -XX:ErrorHandlerTest=${i} -version > ${i2}.out 2>&1 # If ErrorHandlerTest is ignored (product build), stop. diff --git a/hotspot/test/runtime/8024804/RegisterNatives.java b/hotspot/test/runtime/8024804/RegisterNatives.java new file mode 100644 index 00000000000..8a5772a88b9 --- /dev/null +++ b/hotspot/test/runtime/8024804/RegisterNatives.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8024804 + * @summary registerNatives() interface resolution should receive IAE + * @run main RegisterNatives + */ +public class RegisterNatives { + interface I { void registerNatives(); } + interface J extends I {} + static class B implements J { public void registerNatives() { System.out.println("B"); } } + public static void main(String... args) { + System.out.println("Regression test for JDK-8024804, crash when InterfaceMethodref resolves to Object.registerNatives\n"); + J val = new B(); + try { + val.registerNatives(); + } catch (IllegalAccessError e) { + System.out.println("TEST PASSES - according to current JVM spec, IAE expected\n"); + return; + } + System.out.println("TEST FAILS - no IAE resulted\n"); + System.exit(1); + } +} diff --git a/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java b/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java new file mode 100644 index 00000000000..c3de30edf86 --- /dev/null +++ b/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026365 + * @summary Test invokespecial of host class method from an anonymous class + * @author Robert Field + * @library /testlibrary + * @compile -XDignore.symbol.file InvokeSpecialAnonTest.java + * @run main ClassFileInstaller InvokeSpecialAnonTest AnonTester + * @run main/othervm -Xbootclasspath/a:. -Xverify:all InvokeSpecialAnonTest + */ +import jdk.internal.org.objectweb.asm.*; +import java.lang.reflect.Constructor; +import sun.misc.Unsafe; + +public class InvokeSpecialAnonTest implements Opcodes { + + static byte[] anonClassBytes() throws Exception { + ClassWriter cw = new ClassWriter(0); + MethodVisitor mv; + + cw.visit(V1_8, ACC_FINAL + ACC_SUPER, "Anon", null, "java/lang/Object", null); + + { + mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V"); + mv.visitInsn(RETURN); + mv.visitMaxs(2, 2); + mv.visitEnd(); + } + { + mv = cw.visitMethod(ACC_PUBLIC, "m", "(LInvokeSpecialAnonTest;)I", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitVarInsn(ALOAD, 1); + mv.visitMethodInsn(INVOKESPECIAL, "InvokeSpecialAnonTest", "privMethod", "()I"); + mv.visitInsn(IRETURN); + mv.visitMaxs(2, 3); + mv.visitEnd(); + } + cw.visitEnd(); + + return cw.toByteArray(); + } + + private int privMethod() { return 1234; } + + public static void main(String[] args) throws Exception { + Class klass = InvokeSpecialAnonTest.class; + try { + Class result = AnonTester.defineTest(klass, anonClassBytes()); + System.out.println("Passed."); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } +} + + +class AnonTester { + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); + + public static Class defineTest(Class targetClass, byte[] classBytes) throws Exception { + return UNSAFE.defineAnonymousClass(targetClass, classBytes, null); + } +} diff --git a/hotspot/test/runtime/8026394/InterfaceObjectTest.java b/hotspot/test/runtime/8026394/InterfaceObjectTest.java new file mode 100644 index 00000000000..03ae6300bc1 --- /dev/null +++ b/hotspot/test/runtime/8026394/InterfaceObjectTest.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026394 + * @summary clone() and finalize() interface resolution should not receive IAE + * @run main InterfaceObjectTest + */ +interface IClone extends Cloneable { + void finalize() throws Throwable; + Object clone(); +} + +interface ICloneExtend extends IClone { } + +public class InterfaceObjectTest implements ICloneExtend { + + public Object clone() { + System.out.println("In InterfaceObjectTest's clone() method\n"); + return null; + } + + public void finalize() throws Throwable { + try { + System.out.println("In InterfaceObjectTest's finalize() method\n"); + } catch (Throwable t) { + throw new AssertionError(t); + } + } + + public static void tryIt(ICloneExtend o1) { + try { + Object o2 = o1.clone(); + o1.finalize(); + } catch (Throwable t) { + if (t instanceof IllegalAccessError) { + System.out.println("TEST FAILS - IAE resulted\n"); + System.exit(1); + } + } + } + + public static void main(String[] args) { + InterfaceObjectTest o1 = new InterfaceObjectTest(); + tryIt(o1); + System.out.println("TEST PASSES - no IAE resulted\n"); + } +} diff --git a/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java b/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java index 7f36977ec70..9bd68e11733 100644 --- a/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java +++ b/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java @@ -33,16 +33,9 @@ import com.oracle.java.testlibrary.*; public class XShareAuto { public static void main(String[] args) throws Exception { - if (!Platform.is64bit()) { - System.out.println("ObjectAlignmentInBytes for CDS is only " + - "supported on 64bit platforms; this plaform is " + - System.getProperty("sun.arch.data.model")); - System.out.println("Skipping the test"); - return; - } ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", - "-Xshare:dump"); + "-server", "-XX:+UnlockDiagnosticVMOptions", + "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Loading classes to share"); output.shouldHaveExitValue(0); diff --git a/hotspot/test/runtime/CommandLine/PrintGCApplicationConcurrentTime.java b/hotspot/test/runtime/CommandLine/PrintGCApplicationConcurrentTime.java new file mode 100644 index 00000000000..e6cf34962a4 --- /dev/null +++ b/hotspot/test/runtime/CommandLine/PrintGCApplicationConcurrentTime.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + /* + * @test + * @bug 8026041 + * @run main/othervm -XX:+PrintGCApplicationConcurrentTime -Xcomp PrintGCApplicationConcurrentTime + */ + +public class PrintGCApplicationConcurrentTime { + + public static void main(String args[]) throws Exception { + } +} diff --git a/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java new file mode 100644 index 00000000000..1892e6fd0b5 --- /dev/null +++ b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8024927 + * @summary Testing address of compressed class pointer space as best as possible. + * @library /testlibrary + */ + +import com.oracle.java.testlibrary.*; + +public class CompressedClassPointers { + + public static void smallHeapTest() throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:SharedBaseAddress=8g", + "-Xmx128m", + "-XX:+PrintCompressedOopsMode", + "-XX:+VerifyBeforeGC", "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("Narrow klass base: 0x0000000000000000"); + output.shouldHaveExitValue(0); + } + + public static void smallHeapTestWith3G() throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:CompressedClassSpaceSize=3g", + "-Xmx128m", + "-XX:+PrintCompressedOopsMode", + "-XX:+VerifyBeforeGC", "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("Narrow klass base: 0x0000000000000000, Narrow klass shift: 3"); + output.shouldHaveExitValue(0); + } + + public static void largeHeapTest() throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-Xmx30g", + "-XX:+PrintCompressedOopsMode", + "-XX:+VerifyBeforeGC", "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldNotContain("Narrow klass base: 0x0000000000000000"); + output.shouldContain("Narrow klass shift: 0"); + output.shouldHaveExitValue(0); + } + + public static void largePagesTest() throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-Xmx128m", + "-XX:+UseLargePages", + "-XX:+PrintCompressedOopsMode", + "-XX:+VerifyBeforeGC", "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("Narrow klass base:"); + output.shouldHaveExitValue(0); + } + + public static void sharingTest() throws Exception { + // Test small heaps + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:SharedArchiveFile=./sample.jsa", + "-Xmx128m", + "-XX:SharedBaseAddress=8g", + "-XX:+PrintCompressedOopsMode", + "-XX:+VerifyBeforeGC", + "-Xshare:dump"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + try { + output.shouldContain("Loading classes to share"); + output.shouldHaveExitValue(0); + + pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:SharedArchiveFile=./sample.jsa", + "-Xmx128m", + "-XX:SharedBaseAddress=8g", + "-XX:+PrintCompressedOopsMode", + "-Xshare:on", + "-version"); + output = new OutputAnalyzer(pb.start()); + output.shouldContain("sharing"); + output.shouldHaveExitValue(0); + + } catch (RuntimeException e) { + output.shouldContain("Unable to use shared archive"); + output.shouldHaveExitValue(1); + } + } + + public static void main(String[] args) throws Exception { + if (!Platform.is64bit()) { + // Can't test this on 32 bit, just pass + System.out.println("Skipping test on 32bit"); + return; + } + // Solaris 10 can't mmap compressed oops space without a base + if (Platform.isSolaris()) { + String name = System.getProperty("os.version"); + if (name.equals("5.10")) { + System.out.println("Skipping test on Solaris 10"); + return; + } + } + smallHeapTest(); + smallHeapTestWith3G(); + largeHeapTest(); + largePagesTest(); + sharingTest(); + } +} diff --git a/hotspot/test/runtime/memory/LargePages/TestLargePagesFlags.java b/hotspot/test/runtime/memory/LargePages/TestLargePagesFlags.java new file mode 100644 index 00000000000..58044c695e9 --- /dev/null +++ b/hotspot/test/runtime/memory/LargePages/TestLargePagesFlags.java @@ -0,0 +1,389 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test TestLargePagesFlags + * @summary Tests how large pages are choosen depending on the given large pages flag combinations. + * @library /testlibrary + * @run main TestLargePagesFlags + */ + +import com.oracle.java.testlibrary.OutputAnalyzer; +import com.oracle.java.testlibrary.Platform; +import com.oracle.java.testlibrary.ProcessTools; +import java.util.ArrayList; + +public class TestLargePagesFlags { + + public static void main(String [] args) throws Exception { + if (!Platform.isLinux()) { + System.out.println("Skipping. TestLargePagesFlags has only been implemented for Linux."); + return; + } + + testUseTransparentHugePages(); + testUseHugeTLBFS(); + testUseSHM(); + testCombinations(); + } + + public static void testUseTransparentHugePages() throws Exception { + if (!canUse(UseTransparentHugePages(true))) { + System.out.println("Skipping testUseTransparentHugePages"); + return; + } + + // -XX:-UseLargePages overrides all other flags. + new FlagTester() + .use(UseLargePages(false), + UseTransparentHugePages(true)) + .expect( + UseLargePages(false), + UseTransparentHugePages(false), + UseHugeTLBFS(false), + UseSHM(false)); + + // Explicitly turn on UseTransparentHugePages. + new FlagTester() + .use(UseTransparentHugePages(true)) + .expect( + UseLargePages(true), + UseTransparentHugePages(true), + UseHugeTLBFS(false), + UseSHM(false)); + + new FlagTester() + .use(UseLargePages(true), + UseTransparentHugePages(true)) + .expect( + UseLargePages(true), + UseTransparentHugePages(true), + UseHugeTLBFS(false), + UseSHM(false)); + + // Setting a specific large pages flag will turn + // off heuristics to choose large pages type. + new FlagTester() + .use(UseLargePages(true), + UseTransparentHugePages(false)) + .expect( + UseLargePages(false), + UseTransparentHugePages(false), + UseHugeTLBFS(false), + UseSHM(false)); + + // Don't turn on UseTransparentHugePages + // unless the user explicitly asks for them. + new FlagTester() + .use(UseLargePages(true)) + .expect( + UseTransparentHugePages(false)); + } + + public static void testUseHugeTLBFS() throws Exception { + if (!canUse(UseHugeTLBFS(true))) { + System.out.println("Skipping testUseHugeTLBFS"); + return; + } + + // -XX:-UseLargePages overrides all other flags. + new FlagTester() + .use(UseLargePages(false), + UseHugeTLBFS(true)) + .expect( + UseLargePages(false), + UseTransparentHugePages(false), + UseHugeTLBFS(false), + UseSHM(false)); + + // Explicitly turn on UseHugeTLBFS. + new FlagTester() + .use(UseHugeTLBFS(true)) + .expect( + UseLargePages(true), + UseTransparentHugePages(false), + UseHugeTLBFS(true), + UseSHM(false)); + + new FlagTester() + .use(UseLargePages(true), + UseHugeTLBFS(true)) + .expect( + UseLargePages(true), + UseTransparentHugePages(false), + UseHugeTLBFS(true), + UseSHM(false)); + + // Setting a specific large pages flag will turn + // off heuristics to choose large pages type. + new FlagTester() + .use(UseLargePages(true), + UseHugeTLBFS(false)) + .expect( + UseLargePages(false), + UseTransparentHugePages(false), + UseHugeTLBFS(false), + UseSHM(false)); + + // Using UseLargePages will default to UseHugeTLBFS large pages. + new FlagTester() + .use(UseLargePages(true)) + .expect( + UseLargePages(true), + UseTransparentHugePages(false), + UseHugeTLBFS(true), + UseSHM(false)); + } + + public static void testUseSHM() throws Exception { + if (!canUse(UseSHM(true))) { + System.out.println("Skipping testUseSHM"); + return; + } + + // -XX:-UseLargePages overrides all other flags. + new FlagTester() + .use(UseLargePages(false), + UseSHM(true)) + .expect( + UseLargePages(false), + UseTransparentHugePages(false), + UseHugeTLBFS(false), + UseSHM(false)); + + // Explicitly turn on UseSHM. + new FlagTester() + .use(UseSHM(true)) + .expect( + UseLargePages(true), + UseTransparentHugePages(false), + UseHugeTLBFS(false), + UseSHM(true)) ; + + new FlagTester() + .use(UseLargePages(true), + UseSHM(true)) + .expect( + UseLargePages(true), + UseTransparentHugePages(false), + UseHugeTLBFS(false), + UseSHM(true)) ; + + // Setting a specific large pages flag will turn + // off heuristics to choose large pages type. + new FlagTester() + .use(UseLargePages(true), + UseSHM(false)) + .expect( + UseLargePages(false), + UseTransparentHugePages(false), + UseHugeTLBFS(false), + UseSHM(false)); + + // Setting UseLargePages can allow the system to choose + // UseHugeTLBFS instead of UseSHM, but never UseTransparentHugePages. + new FlagTester() + .use(UseLargePages(true)) + .expect( + UseLargePages(true), + UseTransparentHugePages(false)); + } + + public static void testCombinations() throws Exception { + if (!canUse(UseSHM(true)) || !canUse(UseHugeTLBFS(true))) { + System.out.println("Skipping testUseHugeTLBFSAndUseSHMCombination"); + return; + } + + // UseHugeTLBFS takes precedence over SHM. + + new FlagTester() + .use(UseLargePages(true), + UseHugeTLBFS(true), + UseSHM(true)) + .expect( + UseLargePages(true), + UseTransparentHugePages(false), + UseHugeTLBFS(true), + UseSHM(false)); + + new FlagTester() + .use(UseLargePages(true), + UseHugeTLBFS(false), + UseSHM(true)) + .expect( + UseLargePages(true), + UseTransparentHugePages(false), + UseHugeTLBFS(false), + UseSHM(true)); + + new FlagTester() + .use(UseLargePages(true), + UseHugeTLBFS(true), + UseSHM(false)) + .expect( + UseLargePages(true), + UseTransparentHugePages(false), + UseHugeTLBFS(true), + UseSHM(false)); + + new FlagTester() + .use(UseLargePages(true), + UseHugeTLBFS(false), + UseSHM(false)) + .expect( + UseLargePages(false), + UseTransparentHugePages(false), + UseHugeTLBFS(false), + UseSHM(false)); + + + if (!canUse(UseTransparentHugePages(true))) { + return; + } + + // UseTransparentHugePages takes precedence. + + new FlagTester() + .use(UseLargePages(true), + UseTransparentHugePages(true), + UseHugeTLBFS(true), + UseSHM(true)) + .expect( + UseLargePages(true), + UseTransparentHugePages(true), + UseHugeTLBFS(false), + UseSHM(false)); + + new FlagTester() + .use(UseTransparentHugePages(true), + UseHugeTLBFS(true), + UseSHM(true)) + .expect( + UseLargePages(true), + UseTransparentHugePages(true), + UseHugeTLBFS(false), + UseSHM(false)); + } + + private static class FlagTester { + private Flag [] useFlags; + + public FlagTester use(Flag... useFlags) { + this.useFlags = useFlags; + return this; + } + + public void expect(Flag... expectedFlags) throws Exception { + if (useFlags == null) { + throw new IllegalStateException("Must run use() before expect()"); + } + + OutputAnalyzer output = executeNewJVM(useFlags); + + for (Flag flag : expectedFlags) { + System.out.println("Looking for: " + flag.flagString()); + String strValue = output.firstMatch(".* " + flag.name() + " .* :?= (\\S+).*", 1); + + if (strValue == null) { + throw new RuntimeException("Flag " + flag.name() + " couldn't be found"); + } + + if (!flag.value().equals(strValue)) { + throw new RuntimeException("Wrong value for: " + flag.name() + + " expected: " + flag.value() + + " got: " + strValue); + } + } + + output.shouldHaveExitValue(0); + } + } + + private static OutputAnalyzer executeNewJVM(Flag... flags) throws Exception { + ArrayList args = new ArrayList<>(); + for (Flag flag : flags) { + args.add(flag.flagString()); + } + args.add("-XX:+PrintFlagsFinal"); + args.add("-version"); + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args.toArray(new String[args.size()])); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + + return output; + } + + private static boolean canUse(Flag flag) { + try { + new FlagTester().use(flag).expect(flag); + } catch (Exception e) { + return false; + } + + return true; + } + + private static Flag UseLargePages(boolean value) { + return new BooleanFlag("UseLargePages", value); + } + + private static Flag UseTransparentHugePages(boolean value) { + return new BooleanFlag("UseTransparentHugePages", value); + } + + private static Flag UseHugeTLBFS(boolean value) { + return new BooleanFlag("UseHugeTLBFS", value); + } + + private static Flag UseSHM(boolean value) { + return new BooleanFlag("UseSHM", value); + } + + private static class BooleanFlag implements Flag { + private String name; + private boolean value; + + BooleanFlag(String name, boolean value) { + this.name = name; + this.value = value; + } + + public String flagString() { + return "-XX:" + (value ? "+" : "-") + name; + } + + public String name() { + return name; + } + + public String value() { + return Boolean.toString(value); + } + } + + private static interface Flag { + public String flagString(); + public String name(); + public String value(); + } +} diff --git a/hotspot/test/runtime/memory/ReserveMemory.java b/hotspot/test/runtime/memory/ReserveMemory.java index 4d234d34d80..9e37d52ccda 100644 --- a/hotspot/test/runtime/memory/ReserveMemory.java +++ b/hotspot/test/runtime/memory/ReserveMemory.java @@ -56,6 +56,7 @@ public class ReserveMemory { "-Xbootclasspath/a:.", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", + "-XX:-TransmitErrorReport", "ReserveMemory", "test"); diff --git a/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapProc.java b/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapProc.java new file mode 100644 index 00000000000..c3dced229db --- /dev/null +++ b/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapProc.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; + +import sun.management.VMManagement; + +public class JMapHProfLargeHeapProc { + private static final List heapGarbage = new ArrayList<>(); + + public static void main(String[] args) throws Exception { + + buildLargeHeap(args); + + // Print our pid on stdout + System.out.println("PID[" + getProcessId() + "]"); + + // Wait for input before termination + System.in.read(); + } + + private static void buildLargeHeap(String[] args) { + for (long i = 0; i < Integer.parseInt(args[0]); i++) { + heapGarbage.add(new byte[1024]); + } + } + + public static int getProcessId() throws Exception { + + // Get the current process id using a reflection hack + RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); + Field jvm = runtime.getClass().getDeclaredField("jvm"); + + jvm.setAccessible(true); + VMManagement mgmt = (sun.management.VMManagement) jvm.get(runtime); + + Method pid_method = mgmt.getClass().getDeclaredMethod("getProcessId"); + + pid_method.setAccessible(true); + + int pid = (Integer) pid_method.invoke(mgmt); + + return pid; + } + +} diff --git a/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java b/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java new file mode 100644 index 00000000000..df6ecb28f14 --- /dev/null +++ b/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; +import java.nio.CharBuffer; +import java.util.Arrays; +import java.util.Scanner; + +import com.oracle.java.testlibrary.Asserts; +import com.oracle.java.testlibrary.JDKToolFinder; +import com.oracle.java.testlibrary.JDKToolLauncher; +import com.oracle.java.testlibrary.OutputAnalyzer; +import com.oracle.java.testlibrary.Platform; +import com.oracle.java.testlibrary.ProcessTools; + +/* + * @test + * @bug 6313383 + * @key regression + * @summary Regression test for hprof export issue due to large heaps (>2G) + * @library /testlibrary + * @compile JMapHProfLargeHeapProc.java + * @run main JMapHProfLargeHeapTest + */ + +public class JMapHProfLargeHeapTest { + private static final String HEAP_DUMP_FILE_NAME = "heap.hprof"; + private static final String HPROF_HEADER_1_0_1 = "JAVA PROFILE 1.0.1"; + private static final String HPROF_HEADER_1_0_2 = "JAVA PROFILE 1.0.2"; + private static final long M = 1024L; + private static final long G = 1024L * M; + + public static void main(String[] args) throws Exception { + // If we are on MacOSX, test if JMap tool is signed, otherwise return + // since test will fail with privilege error. + if (Platform.isOSX()) { + String jmapToolPath = JDKToolFinder.getTestJDKTool("jmap"); + ProcessBuilder codesignProcessBuilder = new ProcessBuilder( + "codesign", "-v", jmapToolPath); + Process codesignProcess = codesignProcessBuilder.start(); + OutputAnalyzer analyser = new OutputAnalyzer(codesignProcess); + try { + analyser.shouldNotContain("code object is not signed at all"); + System.out.println("Signed jmap found at: " + jmapToolPath); + } catch (Exception e) { + // Abort since we can't know if the test will work + System.out + .println("Test aborted since we are on MacOSX and the jmap tool is not signed."); + return; + } + } + + // Small heap 22 megabytes, should create 1.0.1 file format + testHProfFileFormat("-Xmx1g", 22 * M, HPROF_HEADER_1_0_1); + + /** + * This test was deliberately commented out since the test system lacks + * support to handle the requirements for this kind of heap size in a + * good way. If or when it becomes possible to run this kind of tests in + * the test environment the test should be enabled again. + * */ + // Large heap 2,2 gigabytes, should create 1.0.2 file format + // testHProfFileFormat("-Xmx4g", 2 * G + 2 * M, HPROF_HEADER_1_0_2); + } + + private static void testHProfFileFormat(String vmArgs, long heapSize, + String expectedFormat) throws Exception, IOException, + InterruptedException, FileNotFoundException { + ProcessBuilder procBuilder = ProcessTools.createJavaProcessBuilder( + vmArgs, "JMapHProfLargeHeapProc", String.valueOf(heapSize)); + procBuilder.redirectError(ProcessBuilder.Redirect.INHERIT); + Process largeHeapProc = procBuilder.start(); + + try (Scanner largeHeapScanner = new Scanner( + largeHeapProc.getInputStream());) { + String pidstring = null; + while ((pidstring = largeHeapScanner.findInLine("PID\\[[0-9].*\\]")) == null) { + Thread.sleep(500); + } + int pid = Integer.parseInt(pidstring.substring(4, + pidstring.length() - 1)); + System.out.println("Extracted pid: " + pid); + + JDKToolLauncher jMapLauncher = JDKToolLauncher + .createUsingTestJDK("jmap"); + jMapLauncher.addToolArg("-dump:format=b,file=" + pid + "-" + + HEAP_DUMP_FILE_NAME); + jMapLauncher.addToolArg(String.valueOf(pid)); + + ProcessBuilder jMapProcessBuilder = new ProcessBuilder( + jMapLauncher.getCommand()); + System.out.println("jmap command: " + + Arrays.toString(jMapLauncher.getCommand())); + + Process jMapProcess = jMapProcessBuilder.start(); + OutputAnalyzer analyzer = new OutputAnalyzer(jMapProcess); + analyzer.shouldHaveExitValue(0); + analyzer.shouldContain(pid + "-" + HEAP_DUMP_FILE_NAME); + analyzer.shouldContain("Heap dump file created"); + + largeHeapProc.getOutputStream().write('\n'); + + File dumpFile = new File(pid + "-" + HEAP_DUMP_FILE_NAME); + Asserts.assertTrue(dumpFile.exists(), "Heap dump file not found."); + + try (Reader reader = new BufferedReader(new FileReader(dumpFile))) { + CharBuffer buf = CharBuffer.allocate(expectedFormat.length()); + reader.read(buf); + buf.clear(); + Asserts.assertEQ(buf.toString(), expectedFormat, + "Wrong file format. Expected '" + expectedFormat + + "', but found '" + buf.toString() + "'"); + } + + System.out.println("Success!"); + + } finally { + largeHeapProc.destroyForcibly(); + } + } +} diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java index 0f0c0a49d33..4534a8fe2f6 100644 --- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java +++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java @@ -23,20 +23,17 @@ package com.oracle.java.testlibrary; -import java.util.List; import java.util.ArrayList; import java.util.Arrays; - -import com.oracle.java.testlibrary.JDKToolFinder; -import com.oracle.java.testlibrary.ProcessTools; +import java.util.List; /** * A utility for constructing command lines for starting JDK tool processes. * * The JDKToolLauncher can in particular be combined with a - * java.lang.ProcessBuilder to easily run a JDK tool. For example, the - * following code run {@code jmap -heap} against a process with GC logging - * turned on for the {@code jmap} process: + * java.lang.ProcessBuilder to easily run a JDK tool. For example, the following + * code run {@code jmap -heap} against a process with GC logging turned on for + * the {@code jmap} process: * *
  * {@code
@@ -55,19 +52,37 @@ public class JDKToolLauncher {
     private final List vmArgs = new ArrayList();
     private final List toolArgs = new ArrayList();
 
-    private JDKToolLauncher(String tool) {
-        executable = JDKToolFinder.getJDKTool(tool);
+    private JDKToolLauncher(String tool, boolean useCompilerJDK) {
+        if (useCompilerJDK) {
+            executable = JDKToolFinder.getJDKTool(tool);
+        } else {
+            executable = JDKToolFinder.getTestJDKTool(tool);
+        }
         vmArgs.addAll(Arrays.asList(ProcessTools.getPlatformSpecificVMArgs()));
     }
 
     /**
-     * Creates a new JDKToolLauncher for the specified tool.
+     * Creates a new JDKToolLauncher for the specified tool. Using tools path
+     * from the compiler JDK.
      *
-     * @param tool The name of the tool
+     * @param tool
+     *            The name of the tool
      * @return A new JDKToolLauncher
      */
     public static JDKToolLauncher create(String tool) {
-        return new JDKToolLauncher(tool);
+        return new JDKToolLauncher(tool, true);
+    }
+
+    /**
+     * Creates a new JDKToolLauncher for the specified tool in the Tested JDK.
+     *
+     * @param tool
+     *            The name of the tool
+     *
+     * @return A new JDKToolLauncher
+     */
+    public static JDKToolLauncher createUsingTestJDK(String tool) {
+        return new JDKToolLauncher(tool, false);
     }
 
     /**
@@ -80,18 +95,20 @@ public class JDKToolLauncher {
      * automatically added.
      *
      *
-     * @param arg The argument to VM running the tool
+     * @param arg
+     *            The argument to VM running the tool
      * @return The JDKToolLauncher instance
      */
     public JDKToolLauncher addVMArg(String arg) {
-        vmArgs.add("-J" + arg);
+        vmArgs.add(arg);
         return this;
     }
 
     /**
      * Adds an argument to the tool.
      *
-     * @param arg The argument to the tool
+     * @param arg
+     *            The argument to the tool
      * @return The JDKToolLauncher instance
      */
     public JDKToolLauncher addToolArg(String arg) {
@@ -107,7 +124,10 @@ public class JDKToolLauncher {
     public String[] getCommand() {
         List command = new ArrayList();
         command.add(executable);
-        command.addAll(vmArgs);
+        // Add -J in front of all vmArgs
+        for (String arg : vmArgs) {
+            command.add("-J" + arg);
+        }
         command.addAll(toolArgs);
         return command.toArray(new String[command.size()]);
     }
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java
index 8e5d303317d..a2e5f82ad71 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java
@@ -24,50 +24,80 @@
 package com.oracle.java.testlibrary;
 
 public class Platform {
-  private static final String osName = System.getProperty("os.name");
-  private static final String dataModel = System.getProperty("sun.arch.data.model");
-  private static final String vmVersion = System.getProperty("java.vm.version");
-  private static final String osArch = System.getProperty("os.arch");
+    private static final String osName      = System.getProperty("os.name");
+    private static final String dataModel   = System.getProperty("sun.arch.data.model");
+    private static final String vmVersion   = System.getProperty("java.vm.version");
+    private static final String osArch      = System.getProperty("os.arch");
 
-  public static boolean is64bit() {
-    return dataModel.equals("64");
-  }
+    public static boolean is32bit() {
+        return dataModel.equals("32");
+    }
 
-  public static boolean isSolaris() {
-    return osName.toLowerCase().startsWith("sunos");
-  }
+    public static boolean is64bit() {
+        return dataModel.equals("64");
+    }
 
-  public static boolean isWindows() {
-    return osName.toLowerCase().startsWith("win");
-  }
+    public static boolean isSolaris() {
+        return isOs("sunos");
+    }
 
-  public static boolean isOSX() {
-    return osName.toLowerCase().startsWith("mac");
-  }
+    public static boolean isWindows() {
+        return isOs("win");
+    }
 
-  public static boolean isLinux() {
-    return osName.toLowerCase().startsWith("linux");
-  }
+    public static boolean isOSX() {
+        return isOs("mac");
+    }
 
-  public static String getOsName() {
-    return osName;
-  }
+    public static boolean isLinux() {
+        return isOs("linux");
+    }
 
-  public static boolean isDebugBuild() {
-    return vmVersion.toLowerCase().contains("debug");
-  }
+    private static boolean isOs(String osname) {
+        return osName.toLowerCase().startsWith(osname.toLowerCase());
+    }
 
-  public static String getVMVersion() {
-    return vmVersion;
-  }
+    public static String getOsName() {
+        return osName;
+    }
 
-  // Returns true for sparc and sparcv9.
-  public static boolean isSparc() {
-    return osArch.toLowerCase().startsWith("sparc");
-  }
+    public static boolean isDebugBuild() {
+        return vmVersion.toLowerCase().contains("debug");
+    }
 
-  public static String getOsArch() {
-    return osArch;
-  }
+    public static String getVMVersion() {
+        return vmVersion;
+    }
+
+    // Returns true for sparc and sparcv9.
+    public static boolean isSparc() {
+        return isArch("sparc");
+    }
+
+    public static boolean isARM() {
+        return isArch("arm");
+    }
+
+    public static boolean isPPC() {
+        return isArch("ppc");
+    }
+
+    public static boolean isX86() {
+        // On Linux it's 'i386', Windows 'x86'
+        return (isArch("i386") || isArch("x86"));
+    }
+
+    public static boolean isX64() {
+        // On OSX it's 'x86_64' and on other (Linux, Windows and Solaris) platforms it's 'amd64'
+        return (isArch("amd64") || isArch("x86_64"));
+    }
+
+    private static boolean isArch(String archname) {
+        return osArch.toLowerCase().startsWith(archname.toLowerCase());
+    }
+
+    public static String getOsArch() {
+        return osArch;
+    }
 
 }
diff --git a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathDirEntry.java b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathDirEntry.java
index 3ee3526568d..b1e8fe294f4 100644
--- a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathDirEntry.java
+++ b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathDirEntry.java
@@ -36,8 +36,7 @@ import java.nio.file.*;
 import java.nio.file.attribute.*;
 
 /**
- * * Handler for dirs containing classes to compile.
- * @author igor.ignatyev@oracle.com
+ * Handler for dirs containing classes to compile.
  */
 public class ClassPathDirEntry extends PathHandler {
 
diff --git a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarEntry.java b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarEntry.java
index 3d39f1b2573..a639a637159 100644
--- a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarEntry.java
+++ b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarEntry.java
@@ -35,7 +35,6 @@ import java.nio.file.*;
 
 /**
  * Handler for jar-files containing classes to compile.
- * @author igor.ignatyev@oracle.com
  */
 public class ClassPathJarEntry extends PathHandler {
 
diff --git a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarInDirEntry.java b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarInDirEntry.java
index 328280a2d88..a9f7c8a964e 100644
--- a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarInDirEntry.java
+++ b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathJarInDirEntry.java
@@ -31,8 +31,6 @@ import java.util.concurrent.Executor;
 
 /**
  * Handler for dirs containing jar-files with classes to compile.
- *
- * @author igor.ignatyev@oracle.com
  */
 public class ClassPathJarInDirEntry extends PathHandler {
 
diff --git a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassesListInFile.java b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassesListInFile.java
index 6f36d8b5c6d..d25364ad561 100644
--- a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassesListInFile.java
+++ b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassesListInFile.java
@@ -32,8 +32,6 @@ import java.util.concurrent.Executor;
 
 /**
  * Handler for files containing a list of classes to compile.
- *
- * @author igor.ignatyev@oracle.com
  */
 public class ClassesListInFile extends PathHandler {
     public ClassesListInFile(Path root, Executor executor) {
diff --git a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java
index f1d46526d31..12d09434d7b 100644
--- a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java
+++ b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java
@@ -32,9 +32,6 @@ import java.nio.file.Paths;
 import java.util.List;
 import java.util.concurrent.*;
 
-/**
- * @author igor.ignatyev@oracle.com
- */
 public class CompileTheWorld {
     /**
      * Entry point. Compiles classes in {@code args}, or all classes in
diff --git a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java
index ccb2d3ae53a..1a5a034869a 100644
--- a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java
+++ b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java
@@ -36,8 +36,6 @@ import java.util.concurrent.atomic.AtomicLong;
 /**
  * Provide method to compile whole class.
  * Also contains compiled methods and classes counters.
- *
- * @author igor.ignatyev@oracle.com
  */
 public class Compiler {
     private Compiler() { }
diff --git a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java
index 5c284f896a8..04b23e75770 100644
--- a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java
+++ b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java
@@ -35,10 +35,7 @@ import java.util.concurrent.Executor;
 
 /**
  * Abstract handler for path.
- * 

* Concrete subclasses should implement method {@link #process()}. - * - * @author igor.ignatyev@oracle.com */ public abstract class PathHandler { private static final Pattern JAR_IN_DIR_PATTERN diff --git a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java index 5ffd06cee8b..ea621cb7b39 100644 --- a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java +++ b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java @@ -31,8 +31,6 @@ import java.util.regex.Pattern; /** * Auxiliary methods. - * - * @author igor.ignatyev@oracle.com */ public class Utils { /** diff --git a/hotspot/test/testlibrary/AssertsTest.java b/hotspot/test/testlibrary_tests/AssertsTest.java similarity index 100% rename from hotspot/test/testlibrary/AssertsTest.java rename to hotspot/test/testlibrary_tests/AssertsTest.java diff --git a/hotspot/test/testlibrary/OutputAnalyzerReportingTest.java b/hotspot/test/testlibrary_tests/OutputAnalyzerReportingTest.java similarity index 100% rename from hotspot/test/testlibrary/OutputAnalyzerReportingTest.java rename to hotspot/test/testlibrary_tests/OutputAnalyzerReportingTest.java diff --git a/hotspot/test/testlibrary/OutputAnalyzerTest.java b/hotspot/test/testlibrary_tests/OutputAnalyzerTest.java similarity index 100% rename from hotspot/test/testlibrary/OutputAnalyzerTest.java rename to hotspot/test/testlibrary_tests/OutputAnalyzerTest.java diff --git a/jaxp/.hgtags b/jaxp/.hgtags index f3166e9d9df..43356fd5d4d 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -230,3 +230,10 @@ a22fe9bd01e6c7e7ddc7995dfc9471711692b8d1 jdk8-b104 d3be8e3b429df917e72c1c23e7920c651219b587 jdk8-b106 d6a32e3831aab20a9a3bc78cdc0a60aaad725c6c jdk8-b107 8ade3eed63da87067a7137c111f684a821e9e531 jdk8-b108 +02bfab2aa93899e0f02584f1e85537485a196553 jdk8-b109 +4c84c5b447b09aff27f3b72667ab3a5401e85968 jdk8-b110 +17ee0d3e97fdb412e48f14d87f504946a708f846 jdk8-b111 +c1f9158fbb9c2da50f6946fffd974e8236e08447 jdk8-b112 +0046d2278204b7eff76803fc4623cb48c7e6384d jdk8-b113 +1b1e12117fe2840e5d21ae9a4b309e4f981f3ea8 jdk8-b114 +f610fd46463e6b0533dd92bce11a1e7d84984e64 jdk8-b115 diff --git a/jaxp/make/jprt.properties b/jaxp/make/jprt.properties index b03c53ca656..5dfce3c118c 100644 --- a/jaxp/make/jprt.properties +++ b/jaxp/make/jprt.properties @@ -33,9 +33,7 @@ jprt.build.flavors=product,fastdebug # Standard list of jprt build targets for this source tree jprt.build.targets= \ - solaris_sparc_5.10-{product|fastdebug}, \ solaris_sparcv9_5.10-{product|fastdebug}, \ - solaris_i586_5.10-{product|fastdebug}, \ solaris_x64_5.10-{product|fastdebug}, \ linux_i586_2.6-{product|fastdebug}, \ linux_x64_2.6-{product|fastdebug}, \ diff --git a/jaxp/makefiles/BuildJaxp.gmk b/jaxp/makefiles/BuildJaxp.gmk index 749046481a3..7950b0cf8a1 100644 --- a/jaxp/makefiles/BuildJaxp.gmk +++ b/jaxp/makefiles/BuildJaxp.gmk @@ -30,25 +30,25 @@ default: all include MakeBase.gmk include JavaCompilation.gmk -DISABLE_JAXP_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough +DISABLE_JAXP_WARNINGS := -Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough # The generate new bytecode uses the new compiler for to generate bytecode # for the new jdk that is being built. The code compiled by this setup # cannot necessarily be run with the boot jdk. -$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG,\ - JVM:=$(JAVA),\ - JAVAC:=$(NEW_JAVAC),\ - FLAGS:=-XDignore.symbol.file=true $(DISABLE_JAXP_WARNINGS) -g,\ - SERVER_DIR:=$(SJAVAC_SERVER_DIR),\ - SERVER_JVM:=$(SJAVAC_SERVER_JAVA))) +$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG, \ + JVM := $(JAVA), \ + JAVAC := $(NEW_JAVAC), \ + FLAGS := -XDignore.symbol.file=true $(DISABLE_JAXP_WARNINGS) -g, \ + SERVER_DIR := $(SJAVAC_SERVER_DIR), \ + SERVER_JVM := $(SJAVAC_SERVER_JAVA))) -$(eval $(call SetupJavaCompilation,BUILD_JAXP,\ - SETUP:=GENERATE_NEWBYTECODE_DEBUG,\ - SRC:=$(JAXP_TOPDIR)/src,\ - BIN:=$(JAXP_OUTPUTDIR)/classes,\ - SRCZIP:=$(JAXP_OUTPUTDIR)/dist/lib/src.zip)) +$(eval $(call SetupJavaCompilation,BUILD_JAXP, \ + SETUP := GENERATE_NEWBYTECODE_DEBUG, \ + SRC := $(JAXP_TOPDIR)/src, \ + BIN := $(JAXP_OUTPUTDIR)/classes, \ + SRCZIP := $(JAXP_OUTPUTDIR)/dist/lib/src.zip)) -# Imitate the property cleaning mechanism in the old build. This will likely be replaced +# Imitate the property cleaning mechanism in the old build. This will likely be replaced # by the unified functionality in JavaCompilation.gmk, but keep it the same as old build # for now, even though it actually breaks properties containing # in the value. # Using nawk to avoid solaris sed. @@ -59,13 +59,13 @@ $(JAXP_OUTPUTDIR)/classes/%.properties: $(JAXP_TOPDIR)/src/%.properties $(MV) $@.tmp $@ SRC_PROP_FILES := $(shell $(FIND) $(JAXP_TOPDIR)/src -name "*.properties") -TARGET_PROP_FILES := $(patsubst $(JAXP_TOPDIR)/src/%,$(JAXP_OUTPUTDIR)/classes/%,$(SRC_PROP_FILES)) +TARGET_PROP_FILES := $(patsubst $(JAXP_TOPDIR)/src/%, $(JAXP_OUTPUTDIR)/classes/%, $(SRC_PROP_FILES)) -$(eval $(call SetupArchive,ARCHIVE_JAXP,$(BUILD_JAXP) $(TARGET_PROP_FILES),\ - SRCS:=$(JAXP_OUTPUTDIR)/classes,\ - SUFFIXES:=.class .properties,\ - JAR:=$(JAXP_OUTPUTDIR)/dist/lib/classes.jar)) +$(eval $(call SetupArchive,ARCHIVE_JAXP, $(BUILD_JAXP) $(TARGET_PROP_FILES), \ + SRCS := $(JAXP_OUTPUTDIR)/classes, \ + SUFFIXES := .class .properties, \ + JAR := $(JAXP_OUTPUTDIR)/dist/lib/classes.jar)) all: $(JAXP_OUTPUTDIR)/dist/lib/classes.jar $(JAXP_OUTPUTDIR)/dist/lib/src.zip -.PHONY: default all +.PHONY: default all diff --git a/jaxp/makefiles/Makefile b/jaxp/makefiles/Makefile index 9539fe0e255..c7d0dd00cbb 100644 --- a/jaxp/makefiles/Makefile +++ b/jaxp/makefiles/Makefile @@ -24,19 +24,19 @@ # # Locate this Makefile -ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),) - makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST)) +ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))), ) + makefile_path := $(CURDIR)/$(lastword $(MAKEFILE_LIST)) else - makefile_path:=$(lastword $(MAKEFILE_LIST)) + makefile_path := $(lastword $(MAKEFILE_LIST)) endif -repo_dir:=$(patsubst %/makefiles/Makefile,%,$(makefile_path)) +repo_dir := $(patsubst %/makefiles/Makefile, %, $(makefile_path)) # What is the name of this subsystem (langtools, corba, etc)? -subsystem_name:=$(notdir $(repo_dir)) +subsystem_name := $(notdir $(repo_dir)) # Try to locate top-level makefile -top_level_makefile:=$(repo_dir)/../common/makefiles/Makefile -ifneq ($(wildcard $(top_level_makefile)),) +top_level_makefile := $(repo_dir)/../common/makefiles/Makefile +ifneq ($(wildcard $(top_level_makefile)), ) $(info Will run $(subsystem_name) target on top-level Makefile) $(info WARNING: This is a non-recommended way of building!) $(info ===================================================) diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java b/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java index ce50626a612..c3f3a915f96 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java @@ -39,6 +39,116 @@ public final class XalanConstants { // // Constants // + //Xerces security manager + public static final String SECURITY_MANAGER = + "http://apache.org/xml/properties/security-manager"; + + // + // Implementation limits: API properties + // + /** Oracle JAXP property prefix ("http://www.oracle.com/xml/jaxp/properties/"). */ + public static final String ORACLE_JAXP_PROPERTY_PREFIX = + "http://www.oracle.com/xml/jaxp/properties/"; + /** + * JDK entity expansion limit; Note that the existing system property + * "entityExpansionLimit" with no prefix is still observed + */ + public static final String JDK_ENTITY_EXPANSION_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "entityExpansionLimit"; + + /** + * JDK element attribute limit; Note that the existing system property + * "elementAttributeLimit" with no prefix is still observed + */ + public static final String JDK_ELEMENT_ATTRIBUTE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "elementAttributeLimit"; + + /** + * JDK maxOccur limit; Note that the existing system property + * "maxOccurLimit" with no prefix is still observed + */ + public static final String JDK_MAX_OCCUR_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxOccurLimit"; + + /** + * JDK total entity size limit + */ + public static final String JDK_TOTAL_ENTITY_SIZE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "totalEntitySizeLimit"; + + /** + * JDK maximum general entity size limit + */ + public static final String JDK_GENEAL_ENTITY_SIZE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxGeneralEntitySizeLimit"; + /** + * JDK maximum parameter entity size limit + */ + public static final String JDK_PARAMETER_ENTITY_SIZE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxParameterEntitySizeLimit"; + /** + * JDK maximum XML name limit + */ + public static final String JDK_XML_NAME_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxXMLNameLimit"; + /** + * JDK property indicating whether the parser shall print out entity + * count information + * Value: a string "yes" means print, "no" or any other string means not. + */ + public static final String JDK_ENTITY_COUNT_INFO = + ORACLE_JAXP_PROPERTY_PREFIX + "getEntityCountInfo"; + + // + // Implementation limits: corresponding System Properties of the above + // API properties + // + /** + * JDK entity expansion limit; Note that the existing system property + * "entityExpansionLimit" with no prefix is still observed + */ + public static final String SP_ENTITY_EXPANSION_LIMIT = "jdk.xml.entityExpansionLimit"; + + /** + * JDK element attribute limit; Note that the existing system property + * "elementAttributeLimit" with no prefix is still observed + */ + public static final String SP_ELEMENT_ATTRIBUTE_LIMIT = "jdk.xml.elementAttributeLimit"; + + /** + * JDK maxOccur limit; Note that the existing system property + * "maxOccurLimit" with no prefix is still observed + */ + public static final String SP_MAX_OCCUR_LIMIT = "jdk.xml.maxOccurLimit"; + + /** + * JDK total entity size limit + */ + public static final String SP_TOTAL_ENTITY_SIZE_LIMIT = "jdk.xml.totalEntitySizeLimit"; + + /** + * JDK maximum general entity size limit + */ + public static final String SP_GENEAL_ENTITY_SIZE_LIMIT = "jdk.xml.maxGeneralEntitySizeLimit"; + /** + * JDK maximum parameter entity size limit + */ + public static final String SP_PARAMETER_ENTITY_SIZE_LIMIT = "jdk.xml.maxParameterEntitySizeLimit"; + /** + * JDK maximum XML name limit + */ + public static final String SP_XML_NAME_LIMIT = "jdk.xml.maxXMLNameLimit"; + + //legacy System Properties + public final static String ENTITY_EXPANSION_LIMIT = "entityExpansionLimit"; + public static final String ELEMENT_ATTRIBUTE_LIMIT = "elementAttributeLimit" ; + public final static String MAX_OCCUR_LIMIT = "maxOccurLimit"; + + /** + * A string "yes" that can be used for properties such as getEntityCountInfo + */ + public static final String JDK_YES = "yes"; + // Oracle Feature: /** *

Use Service Mechanism

@@ -51,21 +161,16 @@ public final class XalanConstants { *
  • * {@code false} instruct an object to skip service mechanism and * use the default implementation for that service. - *
  • - * - */ - + * + * + */ public static final String ORACLE_FEATURE_SERVICE_MECHANISM = "http://www.oracle.com/feature/use-service-mechanism"; - /** Oracle JAXP property prefix ("http://www.oracle.com/xml/jaxp/properties/"). */ - public static final String ORACLE_JAXP_PROPERTY_PREFIX = - "http://www.oracle.com/xml/jaxp/properties/"; //System Properties corresponding to ACCESS_EXTERNAL_* properties public static final String SP_ACCESS_EXTERNAL_STYLESHEET = "javax.xml.accessExternalStylesheet"; public static final String SP_ACCESS_EXTERNAL_DTD = "javax.xml.accessExternalDTD"; - //all access keyword public static final String ACCESS_EXTERNAL_ALL = "all"; @@ -82,6 +187,19 @@ public final class XalanConstants { public static final String XML_SECURITY_PROPERTY_MANAGER = ORACLE_JAXP_PROPERTY_PREFIX + "xmlSecurityPropertyManager"; + /** + * Feature enableExtensionFunctions + */ + public static final String ORACLE_ENABLE_EXTENSION_FUNCTION = + ORACLE_JAXP_PROPERTY_PREFIX + "enableExtensionFunctions"; + public static final String SP_ORACLE_ENABLE_EXTENSION_FUNCTION = "javax.xml.enableExtensionFunctions"; + + /** + * Values for a feature + */ + public static final String FEATURE_TRUE = "true"; + public static final String FEATURE_FALSE = "false"; + /** * Check if we're in jdk8 or above */ diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java index aea4fffa668..1a85fc3ba9b 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java @@ -471,7 +471,13 @@ public class XSLTErrorResources extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java index d528a26f957..c9cea1d299c 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XSLTErrorResources_de.java,v 1.2.4.1 2005/09/13 10:08:18 pvedula Exp $ + * $Id: XSLTErrorResources_de.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 04:56:10 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.res; @@ -471,7 +471,13 @@ public class XSLTErrorResources_de extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1207,7 +1213,7 @@ public class XSLTErrorResources_de extends ListResourceBundle "Funktionsname darf nicht null sein."}, { ER_XPATH_RESOLVER_NEGATIVE_ARITY, - "Anzahl von Argumenten darf nicht negativ sein."}, + "Argumentanzahl darf nicht negativ sein."}, // Warnings... { WG_FOUND_CURLYBRACE, @@ -1359,7 +1365,7 @@ public class XSLTErrorResources_de extends ListResourceBundle { "optionQ", " [-Q (Stiller Modus)]"}, { "optionLF", " [-LF (Nur Zeilenvorsch\u00FCbe bei Ausgabe verwenden {Standard ist CR/LF})]"}, { "optionCR", " [-CR (Nur Zeilenschaltungen bei Ausgabe verwenden {Standard ist CR/LF})]"}, - { "optionESCAPE", " [-ESCAPE (Escape-Zeichen {Standard ist <>&\"\'\r\n}]"}, + { "optionESCAPE", " [-ESCAPE (Escapezeichen {Standard ist <>&\"'\r\n}]"}, { "optionINDENT", " [-INDENT (Steuern, wie viele Leerzeichen der Einzug enthalten soll {Standard ist 0})]"}, { "optionTT", " [-TT (Vorlagen verfolgen, wenn diese aufgerufen werden.)]"}, { "optionTG", " [-TG (Jedes Generierungsereignis verfolgen.)]"}, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_de extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java index 68fda6d4971..7294a36feeb 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XSLTErrorResources_es.java,v 1.2.4.1 2005/09/13 10:16:43 pvedula Exp $ + * $Id: XSLTErrorResources_es.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 09:06:34 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.res; @@ -471,7 +471,13 @@ public class XSLTErrorResources_es extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1359,7 +1365,7 @@ public class XSLTErrorResources_es extends ListResourceBundle { "optionQ", " [-Q (Modo Silencioso)]"}, { "optionLF", " [-LF (Utilizar saltos de l\u00EDnea s\u00F3lo en la salida {el valor por defecto es CR/LF})]"}, { "optionCR", " [-CR (Utilizar retornos de carro s\u00F3lo en la salida {el valor por defecto es CR/LF})]"}, - { "optionESCAPE", " [-ESCAPE (Caracteres para introducir escape {el valor por defecto es <>&\"\'\\r\\n}]"}, + { "optionESCAPE", " [-ESCAPE (Caracteres para introducir escape {el valor por defecto es <>&\"'\\r\\n}]"}, { "optionINDENT", " [-INDENT (Control del n\u00FAmero de espacios para el sangrado {el valor por defecto es 0})]"}, { "optionTT", " [-TT (Rastrear las plantillas como si se estuviesen llamando.)]"}, { "optionTG", " [-TG (Rastrear cada evento de generaci\u00F3n.)]"}, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_es extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java index eb373095af1..1748506a255 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XSLTErrorResources_fr.java,v 1.2.4.1 2005/09/13 10:20:30 pvedula Exp $ + * $Id: XSLTErrorResources_fr.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 07:05:15 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.res; @@ -471,7 +471,13 @@ public class XSLTErrorResources_fr extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -925,7 +931,7 @@ public class XSLTErrorResources_fr extends ListResourceBundle "Gestionnaire de contenu NULL"}, { ER_NULL_ERROR_HANDLER, - "Gestionnaire d'erreur NULL"}, + "Gestionnaire d'erreurs NULL"}, { ER_CANNOT_CALL_PARSE, "impossible d'appeler l'analyse si le gestionnaire de contenu n'est pas d\u00E9fini"}, @@ -1359,7 +1365,7 @@ public class XSLTErrorResources_fr extends ListResourceBundle { "optionQ", " [-Q (Mode silencieux)]"}, { "optionLF", " [-LF (Utiliser les retours \u00E0 la ligne uniquement en sortie {valeur par d\u00E9faut : CR/LF})]"}, { "optionCR", " [-CR (Utiliser les retours chariot uniquement en sortie {valeur par d\u00E9faut : CR/LF})]"}, - { "optionESCAPE", " [-ESCAPE (Avec caract\u00E8res d'espacement {valeur par d\u00E9faut : <>&\"\'\\r\\n}]"}, + { "optionESCAPE", " [-ESCAPE (Avec caract\u00E8res d'espacement {valeur par d\u00E9faut : <>&\"'\\r\\n}]"}, { "optionINDENT", " [-INDENT (Contr\u00F4ler le nombre d'espaces \u00E0 mettre en retrait {valeur par d\u00E9faut : 0})]"}, { "optionTT", " [-TT (G\u00E9n\u00E9rer une trace des mod\u00E8les pendant qu'ils sont appel\u00E9s.)]"}, { "optionTG", " [-TG (G\u00E9n\u00E9rer une trace de chaque \u00E9v\u00E9nement de g\u00E9n\u00E9ration.)]"}, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_fr extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java index ff335021637..d25eb67d962 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XSLTErrorResources_it.java,v 1.2.4.1 2005/09/13 10:23:57 pvedula Exp $ + * $Id: XSLTErrorResources_it.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 07:02:00 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.res; @@ -471,7 +471,13 @@ public class XSLTErrorResources_it extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1359,7 +1365,7 @@ public class XSLTErrorResources_it extends ListResourceBundle { "optionQ", " [-Q (modalit\u00E0 silenziosa)]"}, { "optionLF", " [-LF (usa avanzamenti riga solo nell'output {il valore predefinito \u00E8 CR/LF})]"}, { "optionCR", " [-CR (usa ritorni a capo solo nell'output {il valore predefinito \u00E8 CR/LF})]"}, - { "optionESCAPE", " [-ESCAPE (caratteri da sottoporre a escape {il valore predefinito \u00E8 <>&\"\'\\r\\n}]"}, + { "optionESCAPE", " [-ESCAPE (caratteri da sottoporre a escape {il valore predefinito \u00E8 <>&\"'\\r\\n}]"}, { "optionINDENT", " [-INDENT (determina il numero di spazi da indentare {il valore predefinito \u00E8 0})]"}, { "optionTT", " [-TT (tiene traccia dei modelli mentre vengono richiamati.)]"}, { "optionTG", " [-TG (tiene traccia di ogni evento di generazione.)]"}, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_it extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java index ed1a0243585..50028e76907 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XSLTErrorResources_ja.java,v 1.2.4.1 2005/09/13 10:34:30 pvedula Exp $ + * $Id: XSLTErrorResources_ja.java /st_wptg_1.8.0.0.0jdk/2 2013/09/12 17:39:58 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.res; @@ -471,7 +471,13 @@ public class XSLTErrorResources_ja extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1359,7 +1365,7 @@ public class XSLTErrorResources_ja extends ListResourceBundle { "optionQ", " [-Q (\u6291\u5236\u30E2\u30FC\u30C9)]"}, { "optionLF", " [-LF (\u51FA\u529B\u3067\u306E\u307F\u6539\u884C\u3092\u4F7F\u7528{\u30C7\u30D5\u30A9\u30EB\u30C8\u306FCR/LF})]"}, { "optionCR", " [-CR (\u51FA\u529B\u3067\u306E\u307F\u6539\u884C\u3092\u4F7F\u7528{\u30C7\u30D5\u30A9\u30EB\u30C8\u306FCR/LF})]"}, - { "optionESCAPE", " [-ESCAPE (\u30A8\u30B9\u30B1\u30FC\u30D7\u3059\u308B\u6587\u5B57{\u30C7\u30D5\u30A9\u30EB\u30C8\u306F<>&\"\'\\r\\n}]"}, + { "optionESCAPE", " [-ESCAPE (\u30A8\u30B9\u30B1\u30FC\u30D7\u3059\u308B\u6587\u5B57{\u30C7\u30D5\u30A9\u30EB\u30C8\u306F<>&\"'\\r\\n}]"}, { "optionINDENT", " [-INDENT (\u30A4\u30F3\u30C7\u30F3\u30C8\u3059\u308B\u7A7A\u767D\u6587\u5B57\u6570\u3092\u5236\u5FA1{\u30C7\u30D5\u30A9\u30EB\u30C8\u306F0})]"}, { "optionTT", " [-TT (\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304C\u547C\u3073\u51FA\u3055\u308C\u305F\u3068\u304D\u306B\u30C8\u30EC\u30FC\u30B9\u3059\u308B\u3002)]"}, { "optionTG", " [-TG (\u5404\u751F\u6210\u30A4\u30D9\u30F3\u30C8\u3092\u30C8\u30EC\u30FC\u30B9\u3059\u308B\u3002)]"}, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_ja extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java index 9a57758af14..d4b9b32b3b3 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XSLTErrorResources_ko.java,v 1.2.4.1 2005/09/13 11:03:57 pvedula Exp $ + * $Id: XSLTErrorResources_ko.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 02:31:33 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.res; @@ -471,7 +471,13 @@ public class XSLTErrorResources_ko extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1359,7 +1365,7 @@ public class XSLTErrorResources_ko extends ListResourceBundle { "optionQ", " [-Q(\uC790\uB3D9 \uBAA8\uB4DC)]"}, { "optionLF", " [-LF(\uCD9C\uB825\uC5D0\uB9CC \uC904 \uBC14\uAFC8 \uC0AC\uC6A9 {\uAE30\uBCF8\uAC12: CR/LF})]"}, { "optionCR", " [-CR(\uCD9C\uB825\uC5D0\uB9CC \uCE90\uB9AC\uC9C0 \uB9AC\uD134 \uC0AC\uC6A9 {\uAE30\uBCF8\uAC12: CR/LF})]"}, - { "optionESCAPE", " [-ESCAPE(\uC774\uC2A4\uCF00\uC774\uD504 \uBB38\uC790 {\uAE30\uBCF8\uAC12: <>&\"\'\\r\\n}]"}, + { "optionESCAPE", " [-ESCAPE(\uC774\uC2A4\uCF00\uC774\uD504 \uBB38\uC790 {\uAE30\uBCF8\uAC12: <>&\"'\\r\\n}]"}, { "optionINDENT", " [-INDENT(\uB4E4\uC5EC \uC4F8 \uACF5\uBC31 \uC218 \uC81C\uC5B4 {\uAE30\uBCF8\uAC12: 0})]"}, { "optionTT", " [-TT(\uD15C\uD50C\uB9AC\uD2B8 \uD638\uCD9C \uC2DC \uCD94\uC801)]"}, { "optionTG", " [-TG(\uAC01 \uC0DD\uC131 \uC774\uBCA4\uD2B8 \uCD94\uC801)]"}, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_ko extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java index 62341a60b83..b79cfabe162 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,9 +17,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - /* - * $Id: XSLTErrorResources_pt_BR.java 3023 2011-03-01 00:53:34Z joehw $ + * $Id: XSLTErrorResources_pt_BR.java /st_wptg_1.8.0.0.0jdk/2 2013/09/11 12:46:53 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.res; @@ -472,7 +471,13 @@ public class XSLTErrorResources_pt_BR extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -625,7 +630,7 @@ public class XSLTErrorResources_pt_BR extends ListResourceBundle "Falha ao processar a folha de estilos!"}, { ER_COULDNT_PARSE_DOC, - "N\u00E3o foi poss\u00EDvel fazer parse do documento {0}!"}, + "N\u00E3o foi poss\u00EDvel fazer parsing do documento {0}!"}, { ER_COULDNT_FIND_FRAGMENT, "N\u00E3o foi poss\u00EDvel localizar o fragmento: {0}"}, @@ -929,7 +934,7 @@ public class XSLTErrorResources_pt_BR extends ListResourceBundle "Handler de erro nulo"}, { ER_CANNOT_CALL_PARSE, - "o parse n\u00E3o poder\u00E1 ser chamado se o ContentHandler n\u00E3o tiver sido definido"}, + "o parsing n\u00E3o poder\u00E1 ser chamado se o ContentHandler n\u00E3o tiver sido definido"}, { ER_NO_PARENT_FOR_FILTER, "Nenhum pai para o filtro"}, @@ -963,7 +968,7 @@ public class XSLTErrorResources_pt_BR extends ListResourceBundle //in locale specific files like XSLTErrorResources_de.java, XSLTErrorResources_fr.java etc. //NOTE: Not only the key name but message has also been changed. { ER_VALUE_SHOULD_BE_NUMBER, - "O valor para {0} deve conter um n\u00FAmero pass\u00EDvel de parse"}, + "O valor para {0} deve conter um n\u00FAmero pass\u00EDvel de parsing"}, { ER_VALUE_SHOULD_EQUAL, "O valor para {0} deve ser igual a sim ou n\u00E3o"}, @@ -1248,7 +1253,7 @@ public class XSLTErrorResources_pt_BR extends ListResourceBundle "Conflitos de especificidade encontrados: {0} Ser\u00E1 usado o \u00FAltimo encontrado na folha de estilos."}, { WG_PARSING_AND_PREPARING, - "========= Fazendo parse e preparando {0} =========="}, + "========= Fazendo parsing e preparando {0} =========="}, { WG_ATTR_TEMPLATE, "Modelo do Atributo, {0}"}, @@ -1360,7 +1365,7 @@ public class XSLTErrorResources_pt_BR extends ListResourceBundle { "optionQ", " [-Q (Modo Silencioso)]"}, { "optionLF", " [-LF (Usar alimenta\u00E7\u00F5es de linha somente na sa\u00EDda {o default \u00E9 CR/LF})]"}, { "optionCR", " [-CR (Use retornos de carro somente na sa\u00EDda {o default \u00E9 CR/LF})]"}, - { "optionESCAPE", " [-ESCAPE (Quais caracteres devem ser identificados como escape {o default \u00E9 <>&\"\'\\r\\n}]"}, + { "optionESCAPE", " [-ESCAPE (Quais caracteres devem ser identificados como escape {o default \u00E9 <>&\"'\\r\\n}]"}, { "optionINDENT", " [-INDENT (Controla quantos espa\u00E7os devem ser recuados {o default \u00E9 0})]"}, { "optionTT", " [-TT (Rastreia os modelos \u00E0 medida que s\u00E3o chamados.)]"}, { "optionTG", " [-TG (Rastreia cada evento de gera\u00E7\u00E3o.)]"}, @@ -1396,7 +1401,7 @@ public class XSLTErrorResources_pt_BR extends ListResourceBundle { "optionXO", " [-XO [transletName] (atribui o nome ao translet gerado)]"}, { "optionXD", " [-XD destinationDirectory (especificar um diret\u00F3rio de destino para translet)]"}, { "optionXJ", " [-XJ jarfile (empacotar classes do translet em um arquivo jar com o nome )]"}, - { "optionXP", " [-XP package (especifica um prefixo de nome do pacote para todas as classes translet geradas)]"}, + { "optionXP", " [-XP pacote (especifica um prefixo de nome do pacote para todas as classes translet geradas)]"}, //AddITIONAL STRINGS that need L10n // Note to translators: The following message describes usage of a particular @@ -1413,13 +1418,6 @@ public class XSLTErrorResources_pt_BR extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== @@ -1449,5 +1447,4 @@ public class XSLTErrorResources_pt_BR extends ListResourceBundle public static final String QUERY_HEADER = "PATTERN "; - -} + } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java index ee85426b0dc..53e943cce24 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XSLTErrorResources_sv.java,v 1.2.4.1 2005/09/13 11:12:11 pvedula Exp $ + * $Id: XSLTErrorResources_sv.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 06:50:58 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.res; @@ -471,7 +471,13 @@ public class XSLTErrorResources_sv extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -495,7 +501,7 @@ public class XSLTErrorResources_sv extends ListResourceBundle "{0} m\u00E5ste ha ett namnattribut."}, {ER_TEMPLATE_NOT_FOUND, - "Kunde inte hitta mallen med namnet: {0}"}, + "Hittade inte mallen med namnet: {0}"}, {ER_CANT_RESOLVE_NAME_AVT, "Kunde inte matcha namn-AVT i xsl:call-template."}, @@ -510,10 +516,10 @@ public class XSLTErrorResources_sv extends ListResourceBundle "Felaktigt v\u00E4rde i niv\u00E5attribut: {0}"}, {ER_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML, - "Namn p\u00E5 processing-instruction kan inte vara 'xml'"}, + "Namn p\u00E5 bearbetningsinstruktion kan inte vara 'xml'"}, { ER_PROCESSINGINSTRUCTION_NOTVALID_NCNAME, - "Namn p\u00E5 processing-instruction m\u00E5ste vara ett giltigt NCName: {0}"}, + "Namn p\u00E5 bearbetningsinstruktion m\u00E5ste vara ett giltigt NCName: {0}"}, { ER_NEED_MATCH_ATTRIB, "{0} m\u00E5ste ha ett matchningsattribut n\u00E4r det anger ett l\u00E4ge."}, @@ -588,7 +594,7 @@ public class XSLTErrorResources_sv extends ListResourceBundle "Fick IO-undantag med formatmallfil: {0}"}, { ER_NO_HREF_ATTRIB, - "(StylesheetHandler) Kunde inte hitta href-attribut f\u00F6r {0}"}, + "(StylesheetHandler) Hittade inte href-attribut f\u00F6r {0}"}, { ER_STYLESHEET_INCLUDES_ITSELF, "(StylesheetHandler) {0} inkluderar, direkt eller indirekt, sig sj\u00E4lv!"}, @@ -627,7 +633,7 @@ public class XSLTErrorResources_sv extends ListResourceBundle "Kunde inte tolka dokumentet {0}!"}, { ER_COULDNT_FIND_FRAGMENT, - "Kunde inte hitta fragment: {0}"}, + "Hittade inte fragment: {0}"}, { ER_NODE_NOT_ELEMENT, "Nod som pekades p\u00E5 av fragment-identifierare var inte ett element: {0}"}, @@ -796,7 +802,7 @@ public class XSLTErrorResources_sv extends ListResourceBundle "Ogiltigt funktionsanrop: rekursiva key()-anrop \u00E4r inte till\u00E5tna"}, { ER_REFERENCING_ITSELF, - "Variabel {0} h\u00E4nvisar, direkt eller indirekt, till sig sj\u00E4lv!"}, + "Variabeln {0} refererar, direkt eller indirekt, till sig sj\u00E4lv!"}, { ER_ILLEGAL_DOMSOURCE_INPUT, "Indatanoden till en DOMSource f\u00F6r newTemplates f\u00E5r inte vara null!"}, @@ -995,7 +1001,7 @@ public class XSLTErrorResources_sv extends ListResourceBundle "F\u00F6rs\u00F6ker formatera ett tal som \u00E4r st\u00F6rre \u00E4n det st\u00F6rsta l\u00E5nga heltalet"}, { ER_CANNOT_FIND_SAX1_DRIVER, - "Kan inte hitta SAX1-drivrutinen klass {0}"}, + "Hittar inte SAX1-drivrutinen klass {0}"}, { ER_SAX1_DRIVER_NOT_LOADED, "SAX1-drivrutinen klass {0} hittades, men kan inte laddas"}, @@ -1058,7 +1064,7 @@ public class XSLTErrorResources_sv extends ListResourceBundle // 'RedundentExprEliminator' is the name of a class, and should not be // translated. { ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR, - "Programmerarverifiering i RedundentExprEliminator: {0}"}, + "Programmerarens utsaga i RedundentExprEliminator: {0}"}, { ER_NOT_ALLOWED_IN_POSITION, "{0} \u00E4r inte till\u00E5ten i denna position i formatmallen!"}, @@ -1223,7 +1229,7 @@ public class XSLTErrorResources_sv extends ListResourceBundle "Xalan hanterar \u00E4nnu inte spr\u00E5knamnet i funktionen format-number."}, { WG_LOCALE_NOT_FOUND, - "Varning: Kunde inte hitta spr\u00E5kinst\u00E4llning f\u00F6r xml:lang={0}"}, + "Varning: Hittade inte spr\u00E5kinst\u00E4llning f\u00F6r xml:lang={0}"}, { WG_CANNOT_MAKE_URL_FROM, "Kan inte skapa URL fr\u00E5n: {0}"}, @@ -1232,7 +1238,7 @@ public class XSLTErrorResources_sv extends ListResourceBundle "Kan inte ladda beg\u00E4rt dokument: {0}"}, { WG_CANNOT_FIND_COLLATOR, - "Hittade inte uppsamlare f\u00F6r &\"\'\\r\\n}]"}, + { "optionESCAPE", " [-ESCAPE (Vilka tecken \u00E4r skiftningstecken {standard \u00E4r <>&\"'\\r\\n}]"}, { "optionINDENT", " [-INDENT (Best\u00E4m antal blanksteg f\u00F6r indrag {standard \u00E4r 0})]"}, { "optionTT", " [-TT (Sp\u00E5ra mallar vid anrop.)]"}, { "optionTG", " [-TG (Sp\u00E5ra varje generationsh\u00E4ndelse.)]"}, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_sv extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java index 1c3a0c7cc2c..3c4544056ec 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XSLTErrorResources_zh_CN.java,v 1.2.4.1 2005/09/13 11:14:39 pvedula Exp $ + * $Id: XSLTErrorResources_zh_CN.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 04:44:25 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.res; @@ -471,7 +471,13 @@ public class XSLTErrorResources_zh_CN extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1359,7 +1365,7 @@ public class XSLTErrorResources_zh_CN extends ListResourceBundle { "optionQ", " [-Q (\u65E0\u63D0\u793A\u6A21\u5F0F)]"}, { "optionLF", " [-LF (\u4EC5\u5728\u8F93\u51FA\u65F6\u4F7F\u7528\u6362\u884C\u7B26 {\u9ED8\u8BA4\u503C\u4E3A CR/LF})]"}, { "optionCR", " [-CR (\u4EC5\u5728\u8F93\u51FA\u65F6\u4F7F\u7528\u56DE\u8F66 {\u9ED8\u8BA4\u503C\u4E3A CR/LF})]"}, - { "optionESCAPE", " [-ESCAPE (\u8981\u8F6C\u79FB\u7684\u5B57\u7B26 {\u9ED8\u8BA4\u503C\u4E3A <>&\"\'\\r\\n}]"}, + { "optionESCAPE", " [-ESCAPE (\u8981\u8F6C\u79FB\u7684\u5B57\u7B26 {\u9ED8\u8BA4\u503C\u4E3A <>&\"'\\r\\n}]"}, { "optionINDENT", " [-INDENT (\u63A7\u5236\u8981\u7F29\u8FDB\u7684\u7A7A\u683C\u6570 {\u9ED8\u8BA4\u503C\u4E3A 0})]"}, { "optionTT", " [-TT (\u5728\u8C03\u7528\u6A21\u677F\u65F6\u8DDF\u8E2A\u6A21\u677F\u3002)]"}, { "optionTG", " [-TG (\u8DDF\u8E2A\u6BCF\u4E2A\u751F\u6210\u4E8B\u4EF6\u3002)]"}, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_zh_CN extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java index 07ad5afa9c0..a842dfa8020 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XSLTErrorResources_zh_TW.java,v 1.2.4.1 2005/09/13 11:19:31 pvedula Exp $ + * $Id: XSLTErrorResources_zh_TW.java /st_wptg_1.8.0.0.0jdk/2 2013/09/14 02:16:34 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.res; @@ -471,7 +471,13 @@ public class XSLTErrorResources_zh_TW extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1359,7 +1365,7 @@ public class XSLTErrorResources_zh_TW extends ListResourceBundle { "optionQ", " [-Q (\u975C\u97F3\u6A21\u5F0F)]"}, { "optionLF", " [-LF (\u8F38\u51FA\u4E0A\u50C5\u4F7F\u7528\u63DB\u884C\u5B57\u5143 {\u9810\u8A2D\u70BA CR/LF})]"}, { "optionCR", " [-CR (\u8F38\u51FA\u4E0A\u50C5\u4F7F\u7528\u6B78\u4F4D\u5B57\u5143 {\u9810\u8A2D\u70BA CR/LF})]"}, - { "optionESCAPE", " [-ESCAPE (\u8981\u9041\u96E2\u7684\u5B57\u5143 {\u9810\u8A2D\u70BA <>&\"\'\\r\\n}]"}, + { "optionESCAPE", " [-ESCAPE (\u8981\u9041\u96E2\u7684\u5B57\u5143 {\u9810\u8A2D\u70BA <>&\"'\\r\\n}]"}, { "optionINDENT", " [-INDENT (\u63A7\u5236\u8981\u7E2E\u6392\u7684\u7A7A\u9593 {\u9810\u8A2D\u70BA 0})]"}, { "optionTT", " [-TT (\u8FFD\u8E64\u547C\u53EB\u7684\u6A23\u677F\u3002)]"}, { "optionTG", " [-TG (\u8FFD\u8E64\u6BCF\u500B\u7522\u751F\u4E8B\u4EF6\u3002)]"}, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_zh_TW extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/utils/FeatureManager.java b/jaxp/src/com/sun/org/apache/xalan/internal/utils/FeatureManager.java new file mode 100644 index 00000000000..644e3c14c2d --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/FeatureManager.java @@ -0,0 +1,124 @@ +/* + * 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 + * 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.org.apache.xalan.internal.utils; + + +import com.sun.org.apache.xalan.internal.XalanConstants; + +/** + * This class manages security related properties + * + */ +public final class FeatureManager extends FeaturePropertyBase { + + /** + * States of the settings of a property, in the order: default value, value + * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system + * properties, and jaxp api properties + */ + public static enum State { + //this order reflects the overriding order + DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY + } + + /** + * Xalan Features + */ + public static enum Feature { + ORACLE_ENABLE_EXTENSION_FUNCTION(XalanConstants.ORACLE_ENABLE_EXTENSION_FUNCTION, + "true"); + + final String name; + final String defaultValue; + + Feature(String name, String value) { + this.name = name; + this.defaultValue = value; + } + + public boolean equalsName(String propertyName) { + return (propertyName == null) ? false : name.equals(propertyName); + } + + String defaultValue() { + return defaultValue; + } + } + + /** + * Default constructor. Establishes default values + */ + public FeatureManager() { + values = new String[Feature.values().length]; + for (Feature feature : Feature.values()) { + values[feature.ordinal()] = feature.defaultValue(); + } + //read system properties or jaxp.properties + readSystemProperties(); + } + + + /** + * Check if the feature is enabled + * @param feature name of the feature + * @return true if enabled, false otherwise + */ + public boolean isFeatureEnabled(Feature feature) { + return Boolean.parseBoolean(values[feature.ordinal()]); + } + + /** + * Check if the feature is enabled + * @param propertyName name of the feature + * @return true if enabled, false otherwise + */ + public boolean isFeatureEnabled(String propertyName) { + return Boolean.parseBoolean(values[getIndex(propertyName)]); + } + + /** + * Get the index by property name + * @param propertyName property name + * @return the index of the property if found; return -1 if not + */ + public int getIndex(String propertyName){ + for (Feature feature : Feature.values()) { + if (feature.equalsName(propertyName)) { + return feature.ordinal(); + } + } + return -1; + } + + /** + * Read from system properties, or those in jaxp.properties + */ + private void readSystemProperties() { + getSystemProperty(Feature.ORACLE_ENABLE_EXTENSION_FUNCTION, + XalanConstants.SP_ORACLE_ENABLE_EXTENSION_FUNCTION); + } + +} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/utils/FeaturePropertyBase.java b/jaxp/src/com/sun/org/apache/xalan/internal/utils/FeaturePropertyBase.java new file mode 100644 index 00000000000..a831d33fff2 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/FeaturePropertyBase.java @@ -0,0 +1,215 @@ +/* + * 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 + * 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.org.apache.xalan.internal.utils; + +import com.sun.org.apache.xalan.internal.XalanConstants; + +/** + * This is the base class for features and properties + * + */ +public abstract class FeaturePropertyBase { + + /** + * States of the settings of a property, in the order: default value, value + * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system + * properties, and jaxp api properties + */ + public static enum State { + //this order reflects the overriding order + DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY + } + + + /** + * Values of the properties as defined in enum Properties + */ + String[] values = null; + /** + * States of the settings for each property in Properties above + */ + State[] states = {State.DEFAULT, State.DEFAULT}; + + + /** + * Set the value for a specific property. + * + * @param property the property + * @param state the state of the property + * @param value the value of the property + */ + public void setValue(Enum property, State state, String value) { + //only update if it shall override + if (state.compareTo(states[property.ordinal()]) >= 0) { + values[property.ordinal()] = value; + states[property.ordinal()] = state; + } + } + + /** + * Set the value of a property by its index + * @param index the index of the property + * @param state the state of the property + * @param value the value of the property + */ + public void setValue(int index, State state, String value) { + //only update if it shall override + if (state.compareTo(states[index]) >= 0) { + values[index] = value; + states[index] = state; + } + } + + /** + * Set value by property name and state + * @param propertyName property name + * @param state the state of the property + * @param value the value of the property + * @return true if the property is managed by the security property manager; + * false if otherwise. + */ + public boolean setValue(String propertyName, State state, Object value) { + int index = getIndex(propertyName); + if (index > -1) { + setValue(index, state, (String)value); + return true; + } + return false; + } + + /** + * Set value by property name and state + * @param propertyName property name + * @param state the state of the property + * @param value the value of the property + * @return true if the property is managed by the security property manager; + * false if otherwise. + */ + public boolean setValue(String propertyName, State state, boolean value) { + int index = getIndex(propertyName); + if (index > -1) { + if (value) { + setValue(index, state, XalanConstants.FEATURE_TRUE); + } else { + setValue(index, state, XalanConstants.FEATURE_FALSE); + } + return true; + } + return false; + } + + /** + * Return the value of the specified property + * + * @param property the property + * @return the value of the property + */ + public String getValue(Enum property) { + return values[property.ordinal()]; + } + + /** + * Return the value of the specified property + * + * @param property the property + * @return the value of the property + */ + public String getValue(String property) { + int index = getIndex(property); + if (index > -1) { + return getValueByIndex(index); + } + return null; + } + + /** + * Return the value of the specified property. + * + * @param propertyName the property name + * @return the value of the property as a string. If a property is managed + * by this manager, its value shall not be null. + */ + public String getValueAsString(String propertyName) { + int index = getIndex(propertyName); + if (index > -1) { + return getValueByIndex(index); + } + + return null; + } + + /** + * Return the value of a property by its ordinal + * @param index the index of a property + * @return value of a property + */ + public String getValueByIndex(int index) { + return values[index]; + } + + /** + * Get the index by property name + * @param propertyName property name + * @return the index of the property if found; return -1 if not + */ + public abstract int getIndex(String propertyName); + + public > int getIndex(Class property, String propertyName) { + for (Enum enumItem : property.getEnumConstants()) { + if (enumItem.toString().equals(propertyName)) { + //internally, ordinal is used as index + return enumItem.ordinal(); + } + } + return -1; + }; + + + /** + * Read from system properties, or those in jaxp.properties + * + * @param property the property + * @param systemProperty the name of the system property + */ + void getSystemProperty(Enum property, String systemProperty) { + try { + String value = SecuritySupport.getSystemProperty(systemProperty); + if (value != null) { + values[property.ordinal()] = value; + states[property.ordinal()] = State.SYSTEMPROPERTY; + return; + } + + value = SecuritySupport.readJAXPProperty(systemProperty); + if (value != null) { + values[property.ordinal()] = value; + states[property.ordinal()] = State.JAXPDOTPROPERTIES; + } + } catch (NumberFormatException e) { + //invalid setting ignored + } + } +} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java new file mode 100644 index 00000000000..e861c21c3a0 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java @@ -0,0 +1,435 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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.org.apache.xalan.internal.utils; + +import com.sun.org.apache.xalan.internal.XalanConstants; + + +/** + * This class is not the same as that in Xerces. It is used to manage the + * state of corresponding Xerces properties and pass the values over to + * the Xerces Security Manager. + * + * @author Joe Wang Oracle Corp. + * + */ +public final class XMLSecurityManager { + + /** + * States of the settings of a property, in the order: default value, value + * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system + * properties, and jaxp api properties + */ + public static enum State { + //this order reflects the overriding order + + DEFAULT("default"), FSP("FEATURE_SECURE_PROCESSING"), + JAXPDOTPROPERTIES("jaxp.properties"), SYSTEMPROPERTY("system property"), + APIPROPERTY("property"); + + final String literal; + State(String literal) { + this.literal = literal; + } + + String literal() { + return literal; + } + } + + /** + * Limits managed by the security manager + */ + public static enum Limit { + + ENTITY_EXPANSION_LIMIT(XalanConstants.JDK_ENTITY_EXPANSION_LIMIT, + XalanConstants.SP_ENTITY_EXPANSION_LIMIT, 0, 64000), + MAX_OCCUR_NODE_LIMIT(XalanConstants.JDK_MAX_OCCUR_LIMIT, + XalanConstants.SP_MAX_OCCUR_LIMIT, 0, 5000), + ELEMENT_ATTRIBUTE_LIMIT(XalanConstants.JDK_ELEMENT_ATTRIBUTE_LIMIT, + XalanConstants.SP_ELEMENT_ATTRIBUTE_LIMIT, 0, 10000), + TOTAL_ENTITY_SIZE_LIMIT(XalanConstants.JDK_TOTAL_ENTITY_SIZE_LIMIT, + XalanConstants.SP_TOTAL_ENTITY_SIZE_LIMIT, 0, 50000000), + GENEAL_ENTITY_SIZE_LIMIT(XalanConstants.JDK_GENEAL_ENTITY_SIZE_LIMIT, + XalanConstants.SP_GENEAL_ENTITY_SIZE_LIMIT, 0, 0), + PARAMETER_ENTITY_SIZE_LIMIT(XalanConstants.JDK_PARAMETER_ENTITY_SIZE_LIMIT, + XalanConstants.SP_PARAMETER_ENTITY_SIZE_LIMIT, 0, 1000000); + + final String apiProperty; + final String systemProperty; + final int defaultValue; + final int secureValue; + + Limit(String apiProperty, String systemProperty, int value, int secureValue) { + this.apiProperty = apiProperty; + this.systemProperty = systemProperty; + this.defaultValue = value; + this.secureValue = secureValue; + } + + public boolean equalsAPIPropertyName(String propertyName) { + return (propertyName == null) ? false : apiProperty.equals(propertyName); + } + + public boolean equalsSystemPropertyName(String propertyName) { + return (propertyName == null) ? false : systemProperty.equals(propertyName); + } + + public String apiProperty() { + return apiProperty; + } + + String systemProperty() { + return systemProperty; + } + + int defaultValue() { + return defaultValue; + } + + int secureValue() { + return secureValue; + } + } + + /** + * Map old property names with the new ones + */ + public static enum NameMap { + + ENTITY_EXPANSION_LIMIT(XalanConstants.SP_ENTITY_EXPANSION_LIMIT, + XalanConstants.ENTITY_EXPANSION_LIMIT), + MAX_OCCUR_NODE_LIMIT(XalanConstants.SP_MAX_OCCUR_LIMIT, + XalanConstants.MAX_OCCUR_LIMIT), + ELEMENT_ATTRIBUTE_LIMIT(XalanConstants.SP_ELEMENT_ATTRIBUTE_LIMIT, + XalanConstants.ELEMENT_ATTRIBUTE_LIMIT); + final String newName; + final String oldName; + + NameMap(String newName, String oldName) { + this.newName = newName; + this.oldName = oldName; + } + + String getOldName(String newName) { + if (newName.equals(this.newName)) { + return oldName; + } + return null; + } + } + /** + * Values of the properties + */ + private final int[] values; + /** + * States of the settings for each property + */ + private State[] states; + /** + * States that determine if properties are set explicitly + */ + private boolean[] isSet; + + + /** + * Index of the special entityCountInfo property + */ + private int indexEntityCountInfo = 10000; + private String printEntityCountInfo = ""; + + /** + * Default constructor. Establishes default values for known security + * vulnerabilities. + */ + public XMLSecurityManager() { + this(false); + } + + /** + * Instantiate Security Manager in accordance with the status of + * secure processing + * @param secureProcessing + */ + public XMLSecurityManager(boolean secureProcessing) { + values = new int[Limit.values().length]; + states = new State[Limit.values().length]; + isSet = new boolean[Limit.values().length]; + for (Limit limit : Limit.values()) { + if (secureProcessing) { + values[limit.ordinal()] = limit.secureValue(); + states[limit.ordinal()] = State.FSP; + } else { + values[limit.ordinal()] = limit.defaultValue(); + states[limit.ordinal()] = State.DEFAULT; + } + } + //read system properties or jaxp.properties + readSystemProperties(); + } + + /** + * Setting FEATURE_SECURE_PROCESSING explicitly + */ + public void setSecureProcessing(boolean secure) { + for (Limit limit : Limit.values()) { + if (secure) { + setLimit(limit.ordinal(), State.FSP, limit.secureValue()); + } else { + setLimit(limit.ordinal(), State.FSP, limit.defaultValue()); + } + } + } + + /** + * Set limit by property name and state + * @param propertyName property name + * @param state the state of the property + * @param value the value of the property + * @return true if the property is managed by the security manager; false + * if otherwise. + */ + public boolean setLimit(String propertyName, State state, Object value) { + int index = getIndex(propertyName); + if (index > -1) { + setLimit(index, state, value); + return true; + } + return false; + } + + /** + * Set the value for a specific limit. + * + * @param limit the limit + * @param state the state of the property + * @param value the value of the property + */ + public void setLimit(Limit limit, State state, int value) { + setLimit(limit.ordinal(), state, value); + } + + /** + * Set the value of a property by its index + * + * @param index the index of the property + * @param state the state of the property + * @param value the value of the property + */ + public void setLimit(int index, State state, Object value) { + if (index == indexEntityCountInfo) { + //if it's explicitly set, it's treated as yes no matter the value + printEntityCountInfo = (String)value; + } else { + int temp = 0; + try { + temp = Integer.parseInt((String) value); + if (temp < 0) { + temp = 0; + } + } catch (NumberFormatException e) {} + setLimit(index, state, temp); } + } + + /** + * Set the value of a property by its index + * + * @param index the index of the property + * @param state the state of the property + * @param value the value of the property + */ + public void setLimit(int index, State state, int value) { + if (index == indexEntityCountInfo) { + //if it's explicitly set, it's treated as yes no matter the value + printEntityCountInfo = XalanConstants.JDK_YES; + } else { + //only update if it shall override + if (state.compareTo(states[index]) >= 0) { + values[index] = value; + states[index] = state; + isSet[index] = true; + } + } + } + + + /** + * Return the value of the specified property. + * + * @param propertyName the property name + * @return the value of the property as a string. If a property is managed + * by this manager, its value shall not be null. + */ + public String getLimitAsString(String propertyName) { + int index = getIndex(propertyName); + if (index > -1) { + return getLimitValueByIndex(index); + } + + return null; + } + + /** + * Return the value of a property by its ordinal + * + * @param limit the property + * @return value of a property + */ + public String getLimitValueAsString(Limit limit) { + return Integer.toString(values[limit.ordinal()]); + } + + /** + * Return the value of the specified property + * + * @param limit the property + * @return the value of the property + */ + public int getLimit(Limit limit) { + return values[limit.ordinal()]; + } + + /** + * Return the value of a property by its ordinal + * + * @param index the index of a property + * @return value of a property + */ + public int getLimitByIndex(int index) { + return values[index]; + } + /** + * Return the value of a property by its index + * + * @param index the index of a property + * @return limit of a property as a string + */ + public String getLimitValueByIndex(int index) { + if (index == indexEntityCountInfo) { + return printEntityCountInfo; + } + + return Integer.toString(values[index]); + } + /** + * Return the state of the limit property + * + * @param limit the limit + * @return the state of the limit property + */ + public State getState(Limit limit) { + return states[limit.ordinal()]; + } + + /** + * Return the state of the limit property + * + * @param limit the limit + * @return the state of the limit property + */ + public String getStateLiteral(Limit limit) { + return states[limit.ordinal()].literal(); + } + + /** + * Get the index by property name + * + * @param propertyName property name + * @return the index of the property if found; return -1 if not + */ + public int getIndex(String propertyName) { + for (Limit limit : Limit.values()) { + if (limit.equalsAPIPropertyName(propertyName)) { + //internally, ordinal is used as index + return limit.ordinal(); + } + } + //special property to return entity count info + if (propertyName.equals(XalanConstants.JDK_ENTITY_COUNT_INFO)) { + return indexEntityCountInfo; + } + return -1; + } + + /** + * Indicate if a property is set explicitly + * @param index + * @return + */ + public boolean isSet(int index) { + return isSet[index]; + } + + public boolean printEntityCountInfo() { + return printEntityCountInfo.equals(XalanConstants.JDK_YES); + } + /** + * Read from system properties, or those in jaxp.properties + */ + private void readSystemProperties() { + + for (Limit limit : Limit.values()) { + if (!getSystemProperty(limit, limit.systemProperty())) { + //if system property is not found, try the older form if any + for (NameMap nameMap : NameMap.values()) { + String oldName = nameMap.getOldName(limit.systemProperty()); + if (oldName != null) { + getSystemProperty(limit, oldName); + } + } + } + } + + } + + /** + * Read from system properties, or those in jaxp.properties + * + * @param property the type of the property + * @param sysPropertyName the name of system property + */ + private boolean getSystemProperty(Limit limit, String sysPropertyName) { + try { + String value = SecuritySupport.getSystemProperty(sysPropertyName); + if (value != null && !value.equals("")) { + values[limit.ordinal()] = Integer.parseInt(value); + states[limit.ordinal()] = State.SYSTEMPROPERTY; + return true; + } + + value = SecuritySupport.readJAXPProperty(sysPropertyName); + if (value != null && !value.equals("")) { + values[limit.ordinal()] = Integer.parseInt(value); + states[limit.ordinal()] = State.JAXPDOTPROPERTIES; + return true; + } + } catch (NumberFormatException e) { + //invalid setting + throw new NumberFormatException("Invalid setting for system property: " + limit.systemProperty()); + } + return false; + } +} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java index 5f5501a3434..611120baffc 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,20 +33,10 @@ import javax.xml.XMLConstants; * This class manages security related properties * */ -public final class XMLSecurityPropertyManager { +public final class XMLSecurityPropertyManager extends FeaturePropertyBase { /** - * States of the settings of a property, in the order: default value, value - * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system - * properties, and jaxp api properties - */ - public static enum State { - //this order reflects the overriding order - DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY - } - - /** - * Limits managed by the security manager + * Properties managed by the security property manager */ public static enum Property { ACCESS_EXTERNAL_DTD(XMLConstants.ACCESS_EXTERNAL_DTD, @@ -72,15 +62,6 @@ public final class XMLSecurityPropertyManager { } - /** - * Values of the properties as defined in enum Properties - */ - private final String[] values; - /** - * States of the settings for each property in Properties above - */ - private State[] states = {State.DEFAULT, State.DEFAULT}; - /** * Default constructor. Establishes default values */ @@ -93,53 +74,6 @@ public final class XMLSecurityPropertyManager { readSystemProperties(); } - /** - * Set the value for a specific property. - * - * @param property the property - * @param state the state of the property - * @param value the value of the property - */ - public void setValue(Property property, State state, String value) { - //only update if it shall override - if (state.compareTo(states[property.ordinal()]) >= 0) { - values[property.ordinal()] = value; - states[property.ordinal()] = state; - } - } - - /** - * Set the value of a property by its index - * @param index the index of the property - * @param state the state of the property - * @param value the value of the property - */ - public void setValue(int index, State state, String value) { - //only update if it shall override - if (state.compareTo(states[index]) >= 0) { - values[index] = value; - states[index] = state; - } - } - /** - * Return the value of the specified property - * - * @param property the property - * @return the value of the property - */ - public String getValue(Property property) { - return values[property.ordinal()]; - } - - /** - * Return the value of a property by its ordinal - * @param index the index of a property - * @return value of a property - */ - public String getValueByIndex(int index) { - return values[index]; - } - /** * Get the index by property name * @param propertyName property name @@ -165,28 +99,4 @@ public final class XMLSecurityPropertyManager { XalanConstants.SP_ACCESS_EXTERNAL_STYLESHEET); } - /** - * Read from system properties, or those in jaxp.properties - * - * @param property the property - * @param systemProperty the name of the system property - */ - private void getSystemProperty(Property property, String systemProperty) { - try { - String value = SecuritySupport.getSystemProperty(systemProperty); - if (value != null) { - values[property.ordinal()] = value; - states[property.ordinal()] = State.SYSTEMPROPERTY; - return; - } - - value = SecuritySupport.readJAXPProperty(systemProperty); - if (value != null) { - values[property.ordinal()] = value; - states[property.ordinal()] = State.JAXPDOTPROPERTIES; - } - } catch (NumberFormatException e) { - //invalid setting ignored - } - } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java index b6cdff01c0b..9ab7e30bec6 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java @@ -23,6 +23,7 @@ package com.sun.org.apache.xalan.internal.xsltc.cmdline; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; import java.io.File; import java.net.URL; import java.util.Vector; @@ -77,7 +78,7 @@ public final class Compile { final GetOpt getopt = new GetOpt(args, "o:d:j:p:uxhsinv"); if (args.length < 1) printUsage(); - final XSLTC xsltc = new XSLTC(true); + final XSLTC xsltc = new XSLTC(true, new FeatureManager()); xsltc.init(); int c; diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java index 76c4643f21b..56bebd88e2c 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java @@ -42,6 +42,7 @@ import com.sun.org.apache.bcel.internal.generic.InvokeInstruction; import com.sun.org.apache.bcel.internal.generic.LocalVariableGen; import com.sun.org.apache.bcel.internal.generic.NEW; import com.sun.org.apache.bcel.internal.generic.PUSH; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; @@ -717,6 +718,8 @@ class FunctionCall extends Expression { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); final boolean isSecureProcessing = classGen.getParser().getXSLTC().isSecureProcessing(); + final boolean isExtensionFunctionEnabled = classGen.getParser().getXSLTC() + .getFeature(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION); int index; // Translate calls to methods in the BasisLibrary @@ -760,7 +763,7 @@ class FunctionCall extends Expression { il.append(new INVOKESTATIC(index)); } else if (_isExtConstructor) { - if (isSecureProcessing) + if (isSecureProcessing && !isExtensionFunctionEnabled) translateUnallowedExtension(cpg, il); final String clazz = @@ -822,7 +825,7 @@ class FunctionCall extends Expression { } // Invoke function calls that are handled in separate classes else { - if (isSecureProcessing) + if (isSecureProcessing && !isExtensionFunctionEnabled) translateUnallowedExtension(cpg, il); final String clazz = _chosenMethod.getDeclaringClass().getName(); diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java index fdfbe178d1d..e1971d35c06 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java @@ -86,7 +86,7 @@ final class Import extends TopLevelElement { if (input == null) { docToLoad = SystemIDResolver.getAbsoluteURI(docToLoad, currLoadedDoc); String accessError = SecuritySupport.checkAccess(docToLoad, - xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET), + (String)xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET), XalanConstants.ACCESS_EXTERNAL_ALL); if (accessError != null) { diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java index 71c129f7cca..5bf12f8dc1b 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java @@ -87,7 +87,7 @@ final class Include extends TopLevelElement { if (input == null) { docToLoad = SystemIDResolver.getAbsoluteURI(docToLoad, currLoadedDoc); String accessError = SecuritySupport.checkAccess(docToLoad, - xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET), + (String)xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET), XalanConstants.ACCESS_EXTERNAL_ALL); if (accessError != null) { diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java index 3c186a1172b..0903d9a9ef6 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java @@ -28,6 +28,7 @@ import com.sun.org.apache.xalan.internal.XalanConstants; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; import com.sun.org.apache.xalan.internal.utils.ObjectFactory; import com.sun.org.apache.xalan.internal.utils.SecuritySupport; +import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type; @@ -487,6 +488,20 @@ public class Parser implements Constants, ContentHandler { } final XMLReader reader = parser.getXMLReader(); + try { + XMLSecurityManager securityManager = + (XMLSecurityManager)_xsltc.getProperty(XalanConstants.SECURITY_MANAGER); + for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) { + reader.setProperty(limit.apiProperty(), securityManager.getLimitValueAsString(limit)); + } + if (securityManager.printEntityCountInfo()) { + parser.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES); + } + } catch (SAXException se) { + System.err.println("Warning: " + reader.getClass().getName() + ": " + + se.getMessage()); + } + return(parse(reader, input)); } catch (ParserConfigurationException e) { @@ -565,7 +580,7 @@ public class Parser implements Constants, ContentHandler { } path = SystemIDResolver.getAbsoluteURI(path); String accessError = SecuritySupport.checkAccess(path, - _xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET), + (String)_xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET), XalanConstants.ACCESS_EXTERNAL_ALL); if (accessError != null) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ACCESSING_XSLT_TARGET_ERR, diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java index 97fff3bf2e0..b6f81f7ba97 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java @@ -43,12 +43,14 @@ import javax.xml.XMLConstants; import com.sun.org.apache.bcel.internal.classfile.JavaClass; import com.sun.org.apache.xalan.internal.XalanConstants; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; +import com.sun.org.apache.xalan.internal.utils.FeatureManager.Feature; import com.sun.org.apache.xalan.internal.utils.SecuritySupport; +import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util; import com.sun.org.apache.xml.internal.dtm.DTM; -import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import org.xml.sax.InputSource; import org.xml.sax.XMLReader; @@ -146,12 +148,16 @@ public final class XSLTC { */ private String _accessExternalDTD = XalanConstants.EXTERNAL_ACCESS_DEFAULT; + private XMLSecurityManager _xmlSecurityManager; + + private final FeatureManager _featureManager; /** * XSLTC compiler constructor */ - public XSLTC(boolean useServicesMechanism) { + public XSLTC(boolean useServicesMechanism, FeatureManager featureManager) { _parser = new Parser(this, useServicesMechanism); + _featureManager = featureManager; } /** @@ -181,15 +187,26 @@ public final class XSLTC { _useServicesMechanism = flag; } + /** + * Return the value of the specified feature + * @param name name of the feature + * @return true if the feature is enabled, false otherwise + */ + public boolean getFeature(Feature name) { + return _featureManager.isFeatureEnabled(name); + } + /** * Return allowed protocols for accessing external stylesheet. */ - public String getProperty(String name) { + public Object getProperty(String name) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)) { return _accessExternalStylesheet; } else if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { return _accessExternalDTD; + } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { + return _xmlSecurityManager; } return null; } @@ -197,12 +214,14 @@ public final class XSLTC { /** * Set allowed protocols for accessing external stylesheet. */ - public void setProperty(String name, String value) { + public void setProperty(String name, Object value) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)) { _accessExternalStylesheet = (String)value; } else if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { _accessExternalDTD = (String)value; + } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { + _xmlSecurityManager = (XMLSecurityManager)value; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java index 8595d82bc21..500c3fce26a 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java @@ -90,7 +90,13 @@ public class ErrorMessages extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "More than one stylesheet defined in the same file."}, @@ -1012,12 +1018,5 @@ public class ErrorMessages extends ListResourceBundle { }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ca.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ca.java index fa28ddc2d2f..708f7444b89 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ca.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ca.java @@ -90,7 +90,13 @@ public class ErrorMessages_ca extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "S'ha definit m\u00e9s d'un full d'estils en el mateix fitxer."}, @@ -853,12 +859,5 @@ public class ErrorMessages_ca extends ListResourceBundle { "FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present."} }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_cs.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_cs.java index 4220efd8f04..f172643766d 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_cs.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_cs.java @@ -90,7 +90,13 @@ public class ErrorMessages_cs extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "V\u00edce ne\u017e jedna p\u0159edloha stylu je definov\u00e1na ve stejn\u00e9m souboru."}, @@ -853,12 +859,5 @@ public class ErrorMessages_cs extends ListResourceBundle { "FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present."} }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java index 1ae98c19170..9807d06f41c 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: ErrorMessages_de.java,v 1.2.4.1 2005/09/15 10:02:28 pvedula Exp $ + * $Id: ErrorMessages_de.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 04:56:10 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.xsltc.compiler.util; @@ -90,7 +90,13 @@ public class ErrorMessages_de extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "Mehrere Stylesheets in derselben Datei definiert."}, @@ -447,7 +453,7 @@ public class ErrorMessages_de extends ListResourceBundle { * Note to translators: access to the stylesheet target is denied */ {ErrorMsg.ACCESSING_XSLT_TARGET_ERR, - "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed."}, + "Stylesheet-Ziel \"{0}\" konnte nicht gelesen werden, weil der \"{1}\"-Zugriff wegen einer von der Eigenschaft accessExternalStylesheet festgelegten Einschr\u00E4nkung nicht zul\u00E4ssig ist."}, /* * Note to translators: This message represents an internal error in @@ -771,7 +777,7 @@ public class ErrorMessages_de extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.WARNING_PLUS_WRAPPED_MSG, - "WARNING: \"{0}\"\n :{1}"}, + "WARNING: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -787,7 +793,7 @@ public class ErrorMessages_de extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, - "FATAL ERROR: \"{0}\"\n :{1}"}, + "FATAL ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -803,7 +809,7 @@ public class ErrorMessages_de extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.ERROR_PLUS_WRAPPED_MSG, - "ERROR: \"{0}\"\n :{1}"}, + "ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -910,15 +916,59 @@ public class ErrorMessages_de extends ListResourceBundle { "Das Feature \"{0}\" kann nicht f\u00FCr diese TransformerFactory festgelegt werden."}, {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE, - "FEATURE_SECURE_PROCESSING: Feature kann nicht auf \"false\" gesetzt werden, wenn Security Manager vorhanden ist."} + "FEATURE_SECURE_PROCESSING: Feature kann nicht auf \"false\" gesetzt werden, wenn Security Manager vorhanden ist."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method, and "try-catch-finally block" + * refers to the Java keywords with those names. "Outlined" is a + * technical term internal to XSLTC and should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_TRY_CATCH, + "Interner XSLTC-Fehler: Der generierte Bytecode enth\u00E4lt einen Try-Catch-Finally-Block. Outline nicht m\u00F6glich."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The terms "OutlineableChunkStart" and + * "OutlineableChunkEnd" are the names of classes internal to XSLTC and + * should not be translated. The message indicates that for every + * "start" there must be a corresponding "end", and vice versa, and + * that if one of a pair of "start" and "end" appears between another + * pair of corresponding "start" and "end", then the other half of the + * pair must also be between that same enclosing pair. + */ + {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS, + "Interner XSLTC-Fehler: Die Marker OutlineableChunkStart und OutlineableChunkEnd m\u00FCssen ausgeglichen und ordnungsgem\u00E4\u00DF platziert sein."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method. The "method" that is being + * referred to is a Java method in a translet that XSLTC is generating + * in processing a stylesheet. The "instruction" that is being + * referred to is one of the instrutions in the Java byte code in that + * method. "Outlined" is a technical term internal to XSLTC and + * should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_DELETED_TARGET, + "Interner XSLTC-Fehler: Eine Anweisung, die Teil eines Bytecodeblocks war, f\u00FCr den ein Outline erstellt wurde, wird nach wie vor in der Originalmethode referenziert." + }, + + + /* + * Note to translators: This message describes an internal error in the + * processor. The "method" that is being referred to is a Java method + * in a translet that XSLTC is generating. + * + */ + {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG, + "Interner XSLTC-Fehler: Eine Methode im Translet \u00FCberschreitet die Java Virtual Machine-L\u00E4ngeneinschr\u00E4nkung einer Methode von 64 KB. Ursache hierf\u00FCr sind in der Regel sehr gro\u00DFe Vorlagen in einem Stylesheet. Versuchen Sie, das Stylesheet mit kleineren Vorlagen umzustrukturieren." + }, + + {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "Wenn die Java-Sicherheit aktiviert ist, ist die Unterst\u00FCtzung f\u00FCr das Deserialisieren von TemplatesImpl deaktiviert. Dies kann durch Setzen der Systemeigenschaft jdk.xml.enableTemplatesImplDeserialization auf \"True\" au\u00DFer Kraft gesetzt werden."} + }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java index 7aa0deb8c0a..1225bd9cfbe 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: ErrorMessages_es.java,v 1.2.4.1 2005/09/15 10:03:56 pvedula Exp $ + * $Id: ErrorMessages_es.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 09:06:34 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.xsltc.compiler.util; @@ -90,7 +90,13 @@ public class ErrorMessages_es extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "Se ha definido m\u00E1s de una hoja de estilo en el mismo archivo."}, @@ -447,7 +453,7 @@ public class ErrorMessages_es extends ListResourceBundle { * Note to translators: access to the stylesheet target is denied */ {ErrorMsg.ACCESSING_XSLT_TARGET_ERR, - "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed."}, + "No se ha podido leer el destino de hoja de estilos ''{0}'', porque no se permite el acceso ''{1}'' debido a una restricci\u00F3n definida por la propiedad accessExternalStylesheet."}, /* * Note to translators: This message represents an internal error in @@ -771,7 +777,7 @@ public class ErrorMessages_es extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.WARNING_PLUS_WRAPPED_MSG, - "ADVERTENCIA: ''{0}''\n :{1}"}, + "WARNING: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -787,7 +793,7 @@ public class ErrorMessages_es extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, - "ERROR FATAL: ''{0}''\n :{1}"}, + "FATAL ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -803,7 +809,7 @@ public class ErrorMessages_es extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.ERROR_PLUS_WRAPPED_MSG, - "ERROR: ''{0}''\n :{1}"}, + "ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -910,15 +916,59 @@ public class ErrorMessages_es extends ListResourceBundle { "No se puede definir la funci\u00F3n ''{0}''en esta f\u00E1brica del transformador."}, {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE, - "FEATURE_SECURE_PROCESSING: no se puede definir la funci\u00F3n en false cuando est\u00E1 presente el gestor de seguridad."} + "FEATURE_SECURE_PROCESSING: no se puede definir la funci\u00F3n en false cuando est\u00E1 presente el gestor de seguridad."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method, and "try-catch-finally block" + * refers to the Java keywords with those names. "Outlined" is a + * technical term internal to XSLTC and should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_TRY_CATCH, + "Error interno de XSLTC: el c\u00F3digo de bytes generado contiene un bloque try-catch-finally y no se puede delimitar."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The terms "OutlineableChunkStart" and + * "OutlineableChunkEnd" are the names of classes internal to XSLTC and + * should not be translated. The message indicates that for every + * "start" there must be a corresponding "end", and vice versa, and + * that if one of a pair of "start" and "end" appears between another + * pair of corresponding "start" and "end", then the other half of the + * pair must also be between that same enclosing pair. + */ + {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS, + "Error interno de XSLTC: los marcadores OutlineableChunkStart y OutlineableChunkEnd deben estar equilibrados y correctamente anidados."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method. The "method" that is being + * referred to is a Java method in a translet that XSLTC is generating + * in processing a stylesheet. The "instruction" that is being + * referred to is one of the instrutions in the Java byte code in that + * method. "Outlined" is a technical term internal to XSLTC and + * should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_DELETED_TARGET, + "Error interno de XSLTC: todav\u00EDa se hace referencia a una instrucci\u00F3n que formaba parte de un bloque de c\u00F3digo de bytes delimitado en el m\u00E9todo original." + }, + + + /* + * Note to translators: This message describes an internal error in the + * processor. The "method" that is being referred to is a Java method + * in a translet that XSLTC is generating. + * + */ + {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG, + "Error interno de XSLTC: un m\u00E9todo en el translet excede la limitaci\u00F3n de Java Virtual Machine de longitud de un m\u00E9todo de 64 kilobytes. Normalmente, esto lo causan plantillas en una hoja de estilos demasiado grandes. Pruebe a reestructurar la hoja de estilos para utilizar plantillas m\u00E1s peque\u00F1as." + }, + + {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "Cuando la seguridad de Java est\u00E1 activada, el soporte para anular la serializaci\u00F3n de TemplatesImpl est\u00E1 desactivado. Esto se puede sustituir definiendo la propiedad del sistema jdk.xml.enableTemplatesImplDeserialization en true."} + }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java index 39151c785b9..588e02df1ad 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: ErrorMessages_fr.java,v 1.2.4.1 2005/09/15 10:04:47 pvedula Exp $ + * $Id: ErrorMessages_fr.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 07:05:15 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.xsltc.compiler.util; @@ -90,7 +90,13 @@ public class ErrorMessages_fr extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "Plusieurs feuilles de style d\u00E9finies dans le m\u00EAme fichier."}, @@ -447,7 +453,7 @@ public class ErrorMessages_fr extends ListResourceBundle { * Note to translators: access to the stylesheet target is denied */ {ErrorMsg.ACCESSING_XSLT_TARGET_ERR, - "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed."}, + "Impossible de lire la cible de feuille de style ''{0}'' car l''acc\u00E8s \u00E0 ''{1}'' n''est pas autoris\u00E9 en raison d''une restriction d\u00E9finie par la propri\u00E9t\u00E9 accessExternalStylesheet."}, /* * Note to translators: This message represents an internal error in @@ -771,7 +777,7 @@ public class ErrorMessages_fr extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.WARNING_PLUS_WRAPPED_MSG, - "AVERTISSEMENT : ''{0}''\n :{1}"}, + "WARNING: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -787,7 +793,7 @@ public class ErrorMessages_fr extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, - "ERREUR FATALE : ''{0}''\n :{1}"}, + "FATAL ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -803,7 +809,7 @@ public class ErrorMessages_fr extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.ERROR_PLUS_WRAPPED_MSG, - "ERREUR : ''{0}''\n :{1}"}, + "ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -910,15 +916,59 @@ public class ErrorMessages_fr extends ListResourceBundle { "Impossible de d\u00E9finir la fonctionnalit\u00E9 ''{0}'' sur cette propri\u00E9t\u00E9 TransformerFactory."}, {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE, - "FEATURE_SECURE_PROCESSING : impossible de d\u00E9finir la fonctionnalit\u00E9 sur False en pr\u00E9sence du gestionnaire de s\u00E9curit\u00E9."} + "FEATURE_SECURE_PROCESSING : impossible de d\u00E9finir la fonctionnalit\u00E9 sur False en pr\u00E9sence du gestionnaire de s\u00E9curit\u00E9."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method, and "try-catch-finally block" + * refers to the Java keywords with those names. "Outlined" is a + * technical term internal to XSLTC and should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_TRY_CATCH, + "Erreur XSLTC interne : le code ex\u00E9cutable g\u00E9n\u00E9r\u00E9 contient un bloc try-catch-finally et ne peut pas \u00EAtre d\u00E9limit\u00E9."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The terms "OutlineableChunkStart" and + * "OutlineableChunkEnd" are the names of classes internal to XSLTC and + * should not be translated. The message indicates that for every + * "start" there must be a corresponding "end", and vice versa, and + * that if one of a pair of "start" and "end" appears between another + * pair of corresponding "start" and "end", then the other half of the + * pair must also be between that same enclosing pair. + */ + {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS, + "Erreur XSLTC interne : les marqueurs OutlineableChunkStart et OutlineableChunkEnd doivent \u00EAtre \u00E9quilibr\u00E9s et correctement imbriqu\u00E9s."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method. The "method" that is being + * referred to is a Java method in a translet that XSLTC is generating + * in processing a stylesheet. The "instruction" that is being + * referred to is one of the instrutions in the Java byte code in that + * method. "Outlined" is a technical term internal to XSLTC and + * should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_DELETED_TARGET, + "Erreur XSLTC interne : une instruction ayant fait partie d'un bloc de code ex\u00E9cutable d\u00E9limit\u00E9 est toujours r\u00E9f\u00E9renc\u00E9e dans la m\u00E9thode d'origine." + }, + + + /* + * Note to translators: This message describes an internal error in the + * processor. The "method" that is being referred to is a Java method + * in a translet that XSLTC is generating. + * + */ + {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG, + "Erreur XSLTC interne : une m\u00E9thode dans le translet d\u00E9passe la limite de la JVM concernant la longueur d'une m\u00E9thode de 64 kilo-octets. En g\u00E9n\u00E9ral, ceci est d\u00FB \u00E0 de tr\u00E8s grands mod\u00E8les dans une feuille de style. Essayez de restructurer la feuille de style pour utiliser des mod\u00E8les plus petits." + }, + + {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "Lorsque la s\u00E9curit\u00E9 Java est activ\u00E9e, la prise en charge de la d\u00E9s\u00E9rialisation de TemplatesImpl est d\u00E9sactiv\u00E9e. La d\u00E9finition de la propri\u00E9t\u00E9 syst\u00E8me jdk.xml.enableTemplatesImplDeserialization sur True permet de remplacer ce param\u00E8tre."} + }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java index b8f68b95aac..030ea71a00a 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: ErrorMessages_it.java,v 1.2.4.1 2005/09/15 10:07:02 pvedula Exp $ + * $Id: ErrorMessages_it.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 07:02:00 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.xsltc.compiler.util; @@ -90,7 +90,13 @@ public class ErrorMessages_it extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "Sono stati definiti pi\u00F9 fogli di stile nello stesso file."}, @@ -447,7 +453,7 @@ public class ErrorMessages_it extends ListResourceBundle { * Note to translators: access to the stylesheet target is denied */ {ErrorMsg.ACCESSING_XSLT_TARGET_ERR, - "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed."}, + "Impossibile leggere la destinazione del foglio di stile ''{0}''. Accesso ''{1}'' non consentito a causa della limitazione definita dalla propriet\u00E0 accessExternalStylesheet."}, /* * Note to translators: This message represents an internal error in @@ -771,7 +777,7 @@ public class ErrorMessages_it extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.WARNING_PLUS_WRAPPED_MSG, - "Avvertenza: ''{0}''\n :{1}"}, + "WARNING: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -787,7 +793,7 @@ public class ErrorMessages_it extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, - "ERRORE IRREVERSIBILE: ''{0}''\n :{1}"}, + "FATAL ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -803,7 +809,7 @@ public class ErrorMessages_it extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.ERROR_PLUS_WRAPPED_MSG, - "ERRORE: ''{0}''\n :{1}"}, + "ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -910,15 +916,59 @@ public class ErrorMessages_it extends ListResourceBundle { "Impossibile impostare la funzione ''{0}'' in questo TransformerFactory."}, {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE, - "FEATURE_SECURE_PROCESSING: impossibile impostare la funzione su false se \u00E8 presente Security Manager."} + "FEATURE_SECURE_PROCESSING: impossibile impostare la funzione su false se \u00E8 presente Security Manager."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method, and "try-catch-finally block" + * refers to the Java keywords with those names. "Outlined" is a + * technical term internal to XSLTC and should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_TRY_CATCH, + "Errore XSLTC interno: il bytecode generato contiene un blocco try-catch-finally e non pu\u00F2 essere di tipo outlined."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The terms "OutlineableChunkStart" and + * "OutlineableChunkEnd" are the names of classes internal to XSLTC and + * should not be translated. The message indicates that for every + * "start" there must be a corresponding "end", and vice versa, and + * that if one of a pair of "start" and "end" appears between another + * pair of corresponding "start" and "end", then the other half of the + * pair must also be between that same enclosing pair. + */ + {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS, + "Errore XSLTC interno: gli indicatori OutlineableChunkStart e OutlineableChunkEnd devono essere bilanciati e nidificati correttamente."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method. The "method" that is being + * referred to is a Java method in a translet that XSLTC is generating + * in processing a stylesheet. The "instruction" that is being + * referred to is one of the instrutions in the Java byte code in that + * method. "Outlined" is a technical term internal to XSLTC and + * should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_DELETED_TARGET, + "Errore XSLTC interno: a un'istruzione che faceva parte di un blocco di bytecode di tipo outlined viene ancora fatto riferimento nel metodo originale." + }, + + + /* + * Note to translators: This message describes an internal error in the + * processor. The "method" that is being referred to is a Java method + * in a translet that XSLTC is generating. + * + */ + {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG, + "Errore XSLTC interno: un metodo nel translet supera la limitazione Java Virtual Machine relativa alla lunghezza per un metodo di 64 kilobyte. Ci\u00F2 \u00E8 generalmente causato dalle grandi dimensioni dei modelli in un foglio di stile. Provare a ristrutturare il foglio di stile per utilizzare modelli di dimensioni inferiori." + }, + + {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "Quando la sicurezza Java \u00E8 abilitata, il supporto per la deserializzazione TemplatesImpl \u00E8 disabilitato. \u00C8 possibile ignorare questa condizione impostando su true la propriet\u00E0 di sistema jdk.xml.enableTemplatesImplDeserialization."} + }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java index 28c15eaf02b..efd13271a2e 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: ErrorMessages_ja.java,v 1.2.4.1 2005/09/15 10:08:16 pvedula Exp $ + * $Id: ErrorMessages_ja.java /st_wptg_1.8.0.0.0jdk/2 2013/09/12 17:39:58 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.xsltc.compiler.util; @@ -90,7 +90,13 @@ public class ErrorMessages_ja extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "\u540C\u3058\u30D5\u30A1\u30A4\u30EB\u306B\u8907\u6570\u306E\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u304C\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059\u3002"}, @@ -447,7 +453,7 @@ public class ErrorMessages_ja extends ListResourceBundle { * Note to translators: access to the stylesheet target is denied */ {ErrorMsg.ACCESSING_XSLT_TARGET_ERR, - "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed."}, + "accessExternalStylesheet\u30D7\u30ED\u30D1\u30C6\u30A3\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650\u306B\u3088\u308A''{1}''\u30A2\u30AF\u30BB\u30B9\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u30FB\u30BF\u30FC\u30B2\u30C3\u30C8''{0}''\u3092\u8AAD\u307F\u53D6\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002"}, /* * Note to translators: This message represents an internal error in @@ -771,7 +777,7 @@ public class ErrorMessages_ja extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.WARNING_PLUS_WRAPPED_MSG, - "\u8B66\u544A: ''{0}''\n :{1}"}, + "WARNING: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -787,7 +793,7 @@ public class ErrorMessages_ja extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, - "\u81F4\u547D\u7684\u30A8\u30E9\u30FC: ''{0}''\n :{1}"}, + "FATAL ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -803,7 +809,7 @@ public class ErrorMessages_ja extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.ERROR_PLUS_WRAPPED_MSG, - "\u30A8\u30E9\u30FC: ''{0}''\n :{1}"}, + "ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -910,15 +916,59 @@ public class ErrorMessages_ja extends ListResourceBundle { "\u6A5F\u80FD''{0}''\u3092\u3053\u306ETransformerFactory\u306B\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002"}, {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE, - "FEATURE_SECURE_PROCESSING: \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30FB\u30DE\u30CD\u30FC\u30B8\u30E3\u304C\u5B58\u5728\u3059\u308B\u3068\u304D\u3001\u6A5F\u80FD\u3092false\u306B\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002"} + "FEATURE_SECURE_PROCESSING: \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30FB\u30DE\u30CD\u30FC\u30B8\u30E3\u304C\u5B58\u5728\u3059\u308B\u3068\u304D\u3001\u6A5F\u80FD\u3092false\u306B\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002"}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method, and "try-catch-finally block" + * refers to the Java keywords with those names. "Outlined" is a + * technical term internal to XSLTC and should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_TRY_CATCH, + "\u5185\u90E8XSLTC\u30A8\u30E9\u30FC: \u751F\u6210\u3055\u308C\u305F\u30D0\u30A4\u30C8\u30FB\u30B3\u30FC\u30C9\u306F\u3001try-catch-finally\u30D6\u30ED\u30C3\u30AF\u3092\u542B\u3093\u3067\u3044\u308B\u305F\u3081\u3001\u30A2\u30A6\u30C8\u30E9\u30A4\u30F3\u5316\u3067\u304D\u307E\u305B\u3093\u3002"}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The terms "OutlineableChunkStart" and + * "OutlineableChunkEnd" are the names of classes internal to XSLTC and + * should not be translated. The message indicates that for every + * "start" there must be a corresponding "end", and vice versa, and + * that if one of a pair of "start" and "end" appears between another + * pair of corresponding "start" and "end", then the other half of the + * pair must also be between that same enclosing pair. + */ + {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS, + "\u5185\u90E8XSLTC\u30A8\u30E9\u30FC: OutlineableChunkStart\u30DE\u30FC\u30AB\u30FC\u3068OutlineableChunkEnd\u30DE\u30FC\u30AB\u30FC\u306F\u3001\u5BFE\u306B\u306A\u3063\u3066\u304A\u308A\u3001\u304B\u3064\u6B63\u3057\u304F\u30CD\u30B9\u30C8\u3055\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method. The "method" that is being + * referred to is a Java method in a translet that XSLTC is generating + * in processing a stylesheet. The "instruction" that is being + * referred to is one of the instrutions in the Java byte code in that + * method. "Outlined" is a technical term internal to XSLTC and + * should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_DELETED_TARGET, + "\u5185\u90E8XSLTC\u30A8\u30E9\u30FC: \u30A2\u30A6\u30C8\u30E9\u30A4\u30F3\u5316\u3055\u308C\u305F\u30D0\u30A4\u30C8\u30FB\u30B3\u30FC\u30C9\u306E\u30D6\u30ED\u30C3\u30AF\u306E\u4E00\u90E8\u3067\u3042\u3063\u305F\u547D\u4EE4\u306F\u3001\u5143\u306E\u30E1\u30BD\u30C3\u30C9\u306E\u4E2D\u3067\u307E\u3060\u53C2\u7167\u3055\u308C\u3066\u3044\u307E\u3059\u3002" + }, + + + /* + * Note to translators: This message describes an internal error in the + * processor. The "method" that is being referred to is a Java method + * in a translet that XSLTC is generating. + * + */ + {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG, + "\u5185\u90E8XSLTC\u30A8\u30E9\u30FC: \u30C8\u30E9\u30F3\u30B9\u30EC\u30C3\u30C8\u5185\u306E\u30E1\u30BD\u30C3\u30C9\u304C\u3001Java\u4EEE\u60F3\u30DE\u30B7\u30F3\u306E\u5236\u9650(1\u30E1\u30BD\u30C3\u30C9\u306E\u9577\u3055\u306F\u6700\u592764\u30AD\u30ED\u30D0\u30A4\u30C8)\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\u3002\u4E00\u822C\u7684\u306B\u3001\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u5185\u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u30B5\u30A4\u30BA\u304C\u5927\u304D\u904E\u304E\u308B\u3053\u3068\u304C\u539F\u56E0\u3068\u3057\u3066\u8003\u3048\u3089\u308C\u307E\u3059\u3002\u5C0F\u3055\u3044\u30B5\u30A4\u30BA\u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u4F7F\u7528\u3057\u3066\u3001\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u3092\u518D\u69CB\u6210\u3057\u3066\u304F\u3060\u3055\u3044\u3002" + }, + + {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "Java\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u304C\u6709\u52B9\u5316\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001TemplatesImpl\u306E\u30C7\u30B7\u30EA\u30A2\u30E9\u30A4\u30BA\u306E\u30B5\u30DD\u30FC\u30C8\u306F\u7121\u52B9\u5316\u3055\u308C\u307E\u3059\u3002\u3053\u308C\u306F\u3001jdk.xml.enableTemplatesImplDeserialization\u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092true\u306B\u8A2D\u5B9A\u3057\u3066\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3067\u304D\u307E\u3059\u3002"} + }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java index 33853810638..3921af4e764 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: ErrorMessages_ko.java,v 1.2.4.1 2005/09/15 10:10:07 pvedula Exp $ + * $Id: ErrorMessages_ko.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 02:31:33 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.xsltc.compiler.util; @@ -90,7 +90,13 @@ public class ErrorMessages_ko extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "\uB3D9\uC77C\uD55C \uD30C\uC77C\uC5D0 \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uAC00 \uB450 \uAC1C \uC774\uC0C1 \uC815\uC758\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}, @@ -447,7 +453,7 @@ public class ErrorMessages_ko extends ListResourceBundle { * Note to translators: access to the stylesheet target is denied */ {ErrorMsg.ACCESSING_XSLT_TARGET_ERR, - "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed."}, + "accessExternalStylesheet \uC18D\uC131\uC73C\uB85C \uC124\uC815\uB41C \uC81C\uD55C\uC73C\uB85C \uC778\uD574 ''{1}'' \uC561\uC138\uC2A4\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC73C\uBBC0\uB85C \uC2A4\uD0C0\uC77C\uC2DC\uD2B8 \uB300\uC0C1 ''{0}''\uC744(\uB97C) \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, /* * Note to translators: This message represents an internal error in @@ -771,7 +777,7 @@ public class ErrorMessages_ko extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.WARNING_PLUS_WRAPPED_MSG, - "\uACBD\uACE0: ''{0}''\n :{1}"}, + "WARNING: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -787,7 +793,7 @@ public class ErrorMessages_ko extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, - "\uCE58\uBA85\uC801\uC778 \uC624\uB958: ''{0}''\n :{1}"}, + "FATAL ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -803,7 +809,7 @@ public class ErrorMessages_ko extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.ERROR_PLUS_WRAPPED_MSG, - "\uC624\uB958: ''{0}''\n :{1}"}, + "ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -910,15 +916,59 @@ public class ErrorMessages_ko extends ListResourceBundle { "\uC774 TransformerFactory\uC5D0\uC11C ''{0}'' \uAE30\uB2A5\uC744 \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE, - "FEATURE_SECURE_PROCESSING: \uBCF4\uC548 \uAD00\uB9AC\uC790\uAC00 \uC788\uC744 \uACBD\uC6B0 \uAE30\uB2A5\uC744 false\uB85C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."} + "FEATURE_SECURE_PROCESSING: \uBCF4\uC548 \uAD00\uB9AC\uC790\uAC00 \uC788\uC744 \uACBD\uC6B0 \uAE30\uB2A5\uC744 false\uB85C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method, and "try-catch-finally block" + * refers to the Java keywords with those names. "Outlined" is a + * technical term internal to XSLTC and should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_TRY_CATCH, + "\uB0B4\uBD80 XSLTC \uC624\uB958: \uC0DD\uC131\uB41C \uBC14\uC774\uD2B8 \uCF54\uB4DC\uAC00 try-catch-finally \uBE14\uB85D\uC744 \uD3EC\uD568\uD558\uBBC0\uB85C outlined \uCC98\uB9AC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The terms "OutlineableChunkStart" and + * "OutlineableChunkEnd" are the names of classes internal to XSLTC and + * should not be translated. The message indicates that for every + * "start" there must be a corresponding "end", and vice versa, and + * that if one of a pair of "start" and "end" appears between another + * pair of corresponding "start" and "end", then the other half of the + * pair must also be between that same enclosing pair. + */ + {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS, + "\uB0B4\uBD80 XSLTC \uC624\uB958: OutlineableChunkStart \uBC0F OutlineableChunkEnd \uD45C\uC2DC\uC790\uC758 \uC9DD\uC774 \uB9DE\uC544\uC57C \uD558\uACE0 \uC62C\uBC14\uB974\uAC8C \uC911\uCCA9\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method. The "method" that is being + * referred to is a Java method in a translet that XSLTC is generating + * in processing a stylesheet. The "instruction" that is being + * referred to is one of the instrutions in the Java byte code in that + * method. "Outlined" is a technical term internal to XSLTC and + * should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_DELETED_TARGET, + "\uB0B4\uBD80 XSLTC \uC624\uB958: outlined \uCC98\uB9AC\uB41C \uBC14\uC774\uD2B8 \uCF54\uB4DC \uBE14\uB85D\uC5D0 \uC18D\uD55C \uBA85\uB839\uC774 \uC5EC\uC804\uD788 \uC6D0\uB798 \uBA54\uC18C\uB4DC\uC5D0\uC11C \uCC38\uC870\uB429\uB2C8\uB2E4." + }, + + + /* + * Note to translators: This message describes an internal error in the + * processor. The "method" that is being referred to is a Java method + * in a translet that XSLTC is generating. + * + */ + {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG, + "\uB0B4\uBD80 XSLTC \uC624\uB958: translet\uC758 \uBA54\uC18C\uB4DC\uAC00 Java Virtual Machine\uC758 \uBA54\uC18C\uB4DC \uAE38\uC774 \uC81C\uD55C\uC778 64KB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4. \uB300\uAC1C \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uC758 \uD15C\uD50C\uB9AC\uD2B8\uAC00 \uB9E4\uC6B0 \uD06C\uAE30 \uB54C\uBB38\uC5D0 \uBC1C\uC0DD\uD569\uB2C8\uB2E4. \uB354 \uC791\uC740 \uD15C\uD50C\uB9AC\uD2B8\uB97C \uC0AC\uC6A9\uD558\uB3C4\uB85D \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uB97C \uC7AC\uAD6C\uC131\uD574 \uBCF4\uC2ED\uC2DC\uC624." + }, + + {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "Java \uBCF4\uC548\uC774 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 TemplatesImpl \uC9C1\uB82C\uD654 \uD574\uC81C\uC5D0 \uB300\uD55C \uC9C0\uC6D0\uC774 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uB429\uB2C8\uB2E4. jdk.xml.enableTemplatesImplDeserialization \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 true\uB85C \uC124\uC815\uD558\uBA74 \uC774\uB97C \uBB34\uD6A8\uD654\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."} + }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java index c6b369edc1b..6760941be9d 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,10 +17,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - /* - * $Id: ErrorMessages_pt_BR.java 3023 2011-03-01 00:53:34Z joehw $ + * $Id: ErrorMessages_pt_BR.java /st_wptg_1.8.0.0.0jdk/2 2013/09/11 12:46:53 gmolloy Exp $ */ + package com.sun.org.apache.xalan.internal.xsltc.compiler.util; import java.util.ListResourceBundle; @@ -90,7 +90,13 @@ public class ErrorMessages_pt_BR extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "Mais de uma folha de estilos definida no mesmo arquivo."}, @@ -208,7 +214,7 @@ public class ErrorMessages_pt_BR extends ListResourceBundle { * the expression. */ {ErrorMsg.XPATH_PARSER_ERR, - "Erro durante o parse da express\u00E3o XPath ''{0}''."}, + "Erro durante o parsing da express\u00E3o XPath ''{0}''."}, /* * Note to translators: An element in the stylesheet requires a @@ -447,7 +453,7 @@ public class ErrorMessages_pt_BR extends ListResourceBundle { * Note to translators: access to the stylesheet target is denied */ {ErrorMsg.ACCESSING_XSLT_TARGET_ERR, - "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed."}, + "N\u00E3o foi poss\u00EDvel ler o alvo ''{0}'' da folha de estilos, porque o acesso a ''{1}'' n\u00E3o \u00E9 permitido em virtude da restri\u00E7\u00E3o definida pela propriedade accessExternalStylesheet."}, /* * Note to translators: This message represents an internal error in @@ -469,7 +475,7 @@ public class ErrorMessages_pt_BR extends ListResourceBundle { * encountered in the stylesheet but is not recognized. */ {ErrorMsg.ELEMENT_PARSE_ERR, - "N\u00E3o foi poss\u00EDvel fazer parse do elemento ''{0}''"}, + "N\u00E3o foi poss\u00EDvel fazer parsing do elemento ''{0}''"}, /* * Note to translators: "use", "", "node", "node-set", "string" @@ -513,7 +519,7 @@ public class ErrorMessages_pt_BR extends ListResourceBundle { * contains the expression that was in error. */ {ErrorMsg.ATTR_VAL_TEMPLATE_ERR, - "N\u00E3o \u00E9 poss\u00EDvel fazer parse do modelo do valor do atributo ''{0}''."}, + "N\u00E3o \u00E9 poss\u00EDvel fazer parsing do modelo do valor do atributo ''{0}''."}, /* * Note to translators: ??? @@ -771,7 +777,7 @@ public class ErrorMessages_pt_BR extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.WARNING_PLUS_WRAPPED_MSG, - "ADVERT\u00CANCIA: ''{0}''\n :{1}"}, + "WARNING: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -787,7 +793,7 @@ public class ErrorMessages_pt_BR extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, - "ERRO FATAL: ''{0}''\n :{1}"}, + "FATAL ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -803,7 +809,7 @@ public class ErrorMessages_pt_BR extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.ERROR_PLUS_WRAPPED_MSG, - "ERRO: ''{0}''\n :{1}"}, + "ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -910,15 +916,59 @@ public class ErrorMessages_pt_BR extends ListResourceBundle { "N\u00E3o \u00E9 poss\u00EDvel definir o recurso ''{0}'' nesta TransformerFactory."}, {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE, - "FEATURE_SECURE_PROCESSING: N\u00E3o \u00E9 poss\u00EDvel definir o recurso como falso quando o gerenciador de seguran\u00E7a est\u00E1 presente."} + "FEATURE_SECURE_PROCESSING: N\u00E3o \u00E9 poss\u00EDvel definir o recurso como falso quando o gerenciador de seguran\u00E7a est\u00E1 presente."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method, and "try-catch-finally block" + * refers to the Java keywords with those names. "Outlined" is a + * technical term internal to XSLTC and should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_TRY_CATCH, + "Erro interno de XSLTC: o byte code gerado cont\u00E9m um bloco try-catch-finally e n\u00E3o pode ser outlined."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The terms "OutlineableChunkStart" and + * "OutlineableChunkEnd" are the names of classes internal to XSLTC and + * should not be translated. The message indicates that for every + * "start" there must be a corresponding "end", and vice versa, and + * that if one of a pair of "start" and "end" appears between another + * pair of corresponding "start" and "end", then the other half of the + * pair must also be between that same enclosing pair. + */ + {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS, + "Erro interno de XSLTC: os marcadores OutlineableChunkStart e OutlineableChunkEnd devem ser balanceados e aninhados corretamente."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method. The "method" that is being + * referred to is a Java method in a translet that XSLTC is generating + * in processing a stylesheet. The "instruction" that is being + * referred to is one of the instrutions in the Java byte code in that + * method. "Outlined" is a technical term internal to XSLTC and + * should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_DELETED_TARGET, + "Erro interno de XSLTC: ainda h\u00E1 refer\u00EAncia no m\u00E9todo original a uma instru\u00E7\u00E3o que fazia parte de um bloco de byte code que foi outlined." + }, + + + /* + * Note to translators: This message describes an internal error in the + * processor. The "method" that is being referred to is a Java method + * in a translet that XSLTC is generating. + * + */ + {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG, + "Erro interno de XSLTC: um m\u00E9todo no translet excede a limita\u00E7\u00E3o da M\u00E1quina Virtual Java quanto ao tamanho de um m\u00E9todo de de 64 kilobytes. Em geral, essa situa\u00E7\u00E3o \u00E9 causada por modelos de uma folha de estilos que s\u00E3o muito grandes. Tente reestruturar sua folha de estilos de forma a usar modelos menores." + }, + + {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "Quando a seguran\u00E7a do Java est\u00E1 ativada, o suporte para desserializar TemplatesImpl fica desativado. Essa situa\u00E7\u00E3o pode ser corrigida definindo a propriedade do sistema jdk.xml.enableTemplatesImplDeserialization como true."} + }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sk.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sk.java index 1a76afc2403..17646e9c51d 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sk.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sk.java @@ -90,7 +90,13 @@ public class ErrorMessages_sk extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "Viac ne\u017e jeden \u0161t\u00fdl dokumentu bol definovan\u00fd v rovnakom s\u00fabore."}, @@ -853,12 +859,5 @@ public class ErrorMessages_sk extends ListResourceBundle { "FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present."} }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java index 07aa76cb122..93edfa9cae2 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,10 +17,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - /* - * $Id: ErrorMessages_sv.java 3023 2011-03-01 00:53:34Z joehw $ + * $Id: ErrorMessages_sv.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 06:50:58 gmolloy Exp $ */ + package com.sun.org.apache.xalan.internal.xsltc.compiler.util; import java.util.ListResourceBundle; @@ -90,7 +90,13 @@ public class ErrorMessages_sv extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "Fler \u00E4n en formatmall har definierats i samma fil."}, @@ -407,7 +413,7 @@ public class ErrorMessages_sv extends ListResourceBundle { * encountered. */ {ErrorMsg.INTERNAL_ERR, - "Irreparabelt XSLTC-internfel: ''{0}''"}, + "O\u00E5terkalleligt internt XSLTC-fel: ''{0}''"}, /* * Note to translators: The stylesheet contained an element that was @@ -447,7 +453,7 @@ public class ErrorMessages_sv extends ListResourceBundle { * Note to translators: access to the stylesheet target is denied */ {ErrorMsg.ACCESSING_XSLT_TARGET_ERR, - "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed."}, + "Kunde inte l\u00E4sa formatmallen ''{0}'', eftersom ''{1}''-\u00E5tkomst inte till\u00E5ts p\u00E5 grund av begr\u00E4nsning som anges av egenskapen accessExternalStylesheet."}, /* * Note to translators: This message represents an internal error in @@ -771,7 +777,7 @@ public class ErrorMessages_sv extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.WARNING_PLUS_WRAPPED_MSG, - "VARNING: ''{0}''\n :{1}"}, + "WARNING: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -787,7 +793,7 @@ public class ErrorMessages_sv extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, - "O\u00C5TERKALLELIGT FEL: ''{0}''\n :{1}"}, + "FATAL ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -803,7 +809,7 @@ public class ErrorMessages_sv extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.ERROR_PLUS_WRAPPED_MSG, - "FEL: ''{0}''\n :{1}"}, + "ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -876,7 +882,7 @@ public class ErrorMessages_sv extends ListResourceBundle { * substitution text contains the actual value of the attribute. */ {ErrorMsg.INVALID_QNAME_ERR, - "Ett attribut vars v\u00E4rde m\u00E5ste vara ett QName eller en blankteckenseparerad lista med QNames hade v\u00E4rdet ''{0}''"}, + "Ett attribut vars v\u00E4rde m\u00E5ste vara ett QName eller en blankteckenavgr\u00E4nsad lista med QNames hade v\u00E4rdet ''{0}''"}, /* * Note to translators: An attribute whose value is required to @@ -910,15 +916,59 @@ public class ErrorMessages_sv extends ListResourceBundle { "Kan inte st\u00E4lla in funktionen ''{0}'' i denna TransformerFactory."}, {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE, - "FEATURE_SECURE_PROCESSING: Funktionen kan inte anges till false om s\u00E4kerhetshanteraren anv\u00E4nds."} + "FEATURE_SECURE_PROCESSING: Funktionen kan inte anges till false om s\u00E4kerhetshanteraren anv\u00E4nds."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method, and "try-catch-finally block" + * refers to the Java keywords with those names. "Outlined" is a + * technical term internal to XSLTC and should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_TRY_CATCH, + "Internt XSLTC-fel: den genererade bytekoden inneh\u00E5ller ett try-catch-finally-block och kan inte g\u00F6ras till en disposition."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The terms "OutlineableChunkStart" and + * "OutlineableChunkEnd" are the names of classes internal to XSLTC and + * should not be translated. The message indicates that for every + * "start" there must be a corresponding "end", and vice versa, and + * that if one of a pair of "start" and "end" appears between another + * pair of corresponding "start" and "end", then the other half of the + * pair must also be between that same enclosing pair. + */ + {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS, + "Internt XSLTC-fel: mark\u00F6rerna OutlineableChunkStart och OutlineableChunkEnd m\u00E5ste vara balanserade och korrekt kapslade."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method. The "method" that is being + * referred to is a Java method in a translet that XSLTC is generating + * in processing a stylesheet. The "instruction" that is being + * referred to is one of the instrutions in the Java byte code in that + * method. "Outlined" is a technical term internal to XSLTC and + * should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_DELETED_TARGET, + "Internt XSLTC-fel: originalmetoden refererar fortfarande till en instruktion som var en del av ett bytekodsblock som gjordes till en disposition." + }, + + + /* + * Note to translators: This message describes an internal error in the + * processor. The "method" that is being referred to is a Java method + * in a translet that XSLTC is generating. + * + */ + {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG, + "Internt XSLTC-fel: en metod i transleten \u00F6verstiger Java Virtual Machines l\u00E4ngdbegr\u00E4nsning f\u00F6r en metod p\u00E5 64 kilobytes. Det h\u00E4r orsakas vanligen av mycket stora mallar i en formatmall. F\u00F6rs\u00F6k att omstrukturera formatmallen att anv\u00E4nda mindre mallar." + }, + + {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "N\u00E4r Java-s\u00E4kerheten \u00E4r aktiverad \u00E4r st\u00F6det f\u00F6r avserialisering av TemplatesImpl avaktiverat. Du kan \u00E5sidos\u00E4tta det h\u00E4r genom att st\u00E4lla in systemegenskapen jdk.xml.enableTemplatesImplDeserialization till sant."} + }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java index 1b12156b326..93889c37085 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: ErrorMessages_zh_CN.java,v 1.2.4.1 2005/09/15 10:15:21 pvedula Exp $ + * $Id: ErrorMessages_zh_CN.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 04:44:25 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.xsltc.compiler.util; @@ -90,7 +90,13 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "\u540C\u4E00\u6587\u4EF6\u4E2D\u5B9A\u4E49\u4E86\u591A\u4E2A\u6837\u5F0F\u8868\u3002"}, @@ -208,7 +214,7 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { * the expression. */ {ErrorMsg.XPATH_PARSER_ERR, - "\u5BF9 XPath \u8868\u8FBE\u5F0F ''{0}'' \u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u65F6\u51FA\u9519\u3002"}, + "\u89E3\u6790 XPath \u8868\u8FBE\u5F0F ''{0}'' \u65F6\u51FA\u9519\u3002"}, /* * Note to translators: An element in the stylesheet requires a @@ -400,7 +406,7 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { * XSLTC to process the XML input document had a configuration problem. */ {ErrorMsg.SAX_PARSER_CONFIG_ERR, - "JAXP \u8BED\u6CD5\u5206\u6790\u5668\u672A\u6B63\u786E\u914D\u7F6E"}, + "JAXP \u89E3\u6790\u5668\u672A\u6B63\u786E\u914D\u7F6E"}, /* * Note to translators: The substitution text names the internal error @@ -447,7 +453,7 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { * Note to translators: access to the stylesheet target is denied */ {ErrorMsg.ACCESSING_XSLT_TARGET_ERR, - "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed."}, + "\u7531\u4E8E accessExternalStylesheet \u5C5E\u6027\u8BBE\u7F6E\u7684\u9650\u5236\u800C\u4E0D\u5141\u8BB8 ''{1}'' \u8BBF\u95EE, \u56E0\u6B64\u65E0\u6CD5\u8BFB\u53D6\u6837\u5F0F\u8868\u76EE\u6807 ''{0}''\u3002"}, /* * Note to translators: This message represents an internal error in @@ -469,7 +475,7 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { * encountered in the stylesheet but is not recognized. */ {ErrorMsg.ELEMENT_PARSE_ERR, - "\u65E0\u6CD5\u5BF9\u5143\u7D20 ''{0}'' \u8FDB\u884C\u8BED\u6CD5\u5206\u6790"}, + "\u65E0\u6CD5\u89E3\u6790\u5143\u7D20 ''{0}''"}, /* * Note to translators: "use", "", "node", "node-set", "string" @@ -513,7 +519,7 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { * contains the expression that was in error. */ {ErrorMsg.ATTR_VAL_TEMPLATE_ERR, - "\u65E0\u6CD5\u5BF9\u5C5E\u6027\u503C\u6A21\u677F ''{0}'' \u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u3002"}, + "\u65E0\u6CD5\u89E3\u6790\u5C5E\u6027\u503C\u6A21\u677F ''{0}''\u3002"}, /* * Note to translators: ??? @@ -771,7 +777,7 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.WARNING_PLUS_WRAPPED_MSG, - "\u8B66\u544A: ''{0}''\n :{1}"}, + "WARNING: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -787,7 +793,7 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, - "\u81F4\u547D\u9519\u8BEF: ''{0}''\n :{1}"}, + "FATAL ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -803,7 +809,7 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.ERROR_PLUS_WRAPPED_MSG, - "\u9519\u8BEF: ''{0}''\n :{1}"}, + "ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -910,15 +916,59 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { "\u65E0\u6CD5\u5BF9\u6B64 TransformerFactory \u8BBE\u7F6E\u529F\u80FD ''{0}''\u3002"}, {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE, - "FEATURE_SECURE_PROCESSING: \u5B58\u5728 Security Manager \u65F6, \u65E0\u6CD5\u5C06\u6B64\u529F\u80FD\u8BBE\u7F6E\u4E3A\u201C\u5047\u201D\u3002"} + "FEATURE_SECURE_PROCESSING: \u5B58\u5728 Security Manager \u65F6, \u65E0\u6CD5\u5C06\u6B64\u529F\u80FD\u8BBE\u7F6E\u4E3A\u201C\u5047\u201D\u3002"}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method, and "try-catch-finally block" + * refers to the Java keywords with those names. "Outlined" is a + * technical term internal to XSLTC and should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_TRY_CATCH, + "\u5185\u90E8 XSLTC \u9519\u8BEF: \u751F\u6210\u7684\u5B57\u8282\u4EE3\u7801\u5305\u542B try-catch-finally \u5757, \u65E0\u6CD5\u8FDB\u884C Outlined\u3002"}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The terms "OutlineableChunkStart" and + * "OutlineableChunkEnd" are the names of classes internal to XSLTC and + * should not be translated. The message indicates that for every + * "start" there must be a corresponding "end", and vice versa, and + * that if one of a pair of "start" and "end" appears between another + * pair of corresponding "start" and "end", then the other half of the + * pair must also be between that same enclosing pair. + */ + {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS, + "\u5185\u90E8 XSLTC \u9519\u8BEF: OutlineableChunkStart \u548C OutlineableChunkEnd \u6807\u8BB0\u5FC5\u987B\u914D\u5BF9\u5E76\u4E14\u6B63\u786E\u5D4C\u5957\u3002"}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method. The "method" that is being + * referred to is a Java method in a translet that XSLTC is generating + * in processing a stylesheet. The "instruction" that is being + * referred to is one of the instrutions in the Java byte code in that + * method. "Outlined" is a technical term internal to XSLTC and + * should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_DELETED_TARGET, + "\u5185\u90E8 XSLTC \u9519\u8BEF: \u5C5E\u4E8E\u5DF2\u8FDB\u884C Outlined \u7684\u5B57\u8282\u4EE3\u7801\u5757\u7684\u6307\u4EE4\u5728\u539F\u59CB\u65B9\u6CD5\u4E2D\u4ECD\u88AB\u5F15\u7528\u3002" + }, + + + /* + * Note to translators: This message describes an internal error in the + * processor. The "method" that is being referred to is a Java method + * in a translet that XSLTC is generating. + * + */ + {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG, + "\u5185\u90E8 XSLTC \u9519\u8BEF: translet \u4E2D\u7684\u65B9\u6CD5\u8D85\u8FC7\u4E86 Java \u865A\u62DF\u673A\u7684\u65B9\u6CD5\u957F\u5EA6\u9650\u5236 64 KB\u3002\u8FD9\u901A\u5E38\u662F\u7531\u4E8E\u6837\u5F0F\u8868\u4E2D\u7684\u6A21\u677F\u975E\u5E38\u5927\u9020\u6210\u7684\u3002\u8BF7\u5C1D\u8BD5\u4F7F\u7528\u8F83\u5C0F\u7684\u6A21\u677F\u91CD\u65B0\u6784\u5EFA\u6837\u5F0F\u8868\u3002" + }, + + {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "\u542F\u7528\u4E86 Java \u5B89\u5168\u65F6, \u5C06\u7981\u7528\u5BF9\u53CD\u5E8F\u5217\u5316 TemplatesImpl \u7684\u652F\u6301\u3002\u53EF\u4EE5\u901A\u8FC7\u5C06 jdk.xml.enableTemplatesImplDeserialization \u7CFB\u7EDF\u5C5E\u6027\u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u6765\u8986\u76D6\u6B64\u8BBE\u7F6E\u3002"} + }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java index f813e667d1c..d99e7ec2a2b 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: ErrorMessages_zh_TW.java,v 1.2.4.1 2005/09/15 10:16:08 pvedula Exp $ + * $Id: ErrorMessages_zh_TW.java /st_wptg_1.8.0.0.0jdk/2 2013/09/14 02:16:34 gmolloy Exp $ */ package com.sun.org.apache.xalan.internal.xsltc.compiler.util; @@ -90,7 +90,13 @@ public class ErrorMessages_zh_TW extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "\u76F8\u540C\u6A94\u6848\u4E2D\u5B9A\u7FA9\u4E86\u8D85\u904E\u4E00\u500B\u6A23\u5F0F\u8868\u3002"}, @@ -447,7 +453,7 @@ public class ErrorMessages_zh_TW extends ListResourceBundle { * Note to translators: access to the stylesheet target is denied */ {ErrorMsg.ACCESSING_XSLT_TARGET_ERR, - "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed."}, + "\u7121\u6CD5\u8B80\u53D6\u6A23\u5F0F\u8868\u76EE\u6A19 ''{0}''\uFF0C\u56E0\u70BA accessExternalStylesheet \u5C6C\u6027\u8A2D\u5B9A\u7684\u9650\u5236\uFF0C\u6240\u4EE5\u4E0D\u5141\u8A31 ''{1}'' \u5B58\u53D6\u3002"}, /* * Note to translators: This message represents an internal error in @@ -771,7 +777,7 @@ public class ErrorMessages_zh_TW extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.WARNING_PLUS_WRAPPED_MSG, - "\u8B66\u544A: ''{0}''\n :{1}"}, + "WARNING: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -787,7 +793,7 @@ public class ErrorMessages_zh_TW extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, - "\u56B4\u91CD\u932F\u8AA4: ''{0}''\n :{1}"}, + "FATAL ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -803,7 +809,7 @@ public class ErrorMessages_zh_TW extends ListResourceBundle { * it the same amount as the first in English. */ {ErrorMsg.ERROR_PLUS_WRAPPED_MSG, - "\u932F\u8AA4: ''{0}''\n :{1}"}, + "ERROR: ''{0}''\n :{1}"}, /* * Note to translators: This message is used to indicate the severity @@ -910,15 +916,59 @@ public class ErrorMessages_zh_TW extends ListResourceBundle { "\u7121\u6CD5\u5728\u6B64 TransformerFactory \u4E0A\u8A2D\u5B9A\u529F\u80FD ''{0}''\u3002"}, {ErrorMsg.JAXP_SECUREPROCESSING_FEATURE, - "FEATURE_SECURE_PROCESSING: \u5B89\u5168\u7BA1\u7406\u7A0B\u5F0F\u5B58\u5728\u6642\uFF0C\u7121\u6CD5\u5C07\u529F\u80FD\u8A2D\u70BA\u507D\u3002"} + "FEATURE_SECURE_PROCESSING: \u5B89\u5168\u7BA1\u7406\u7A0B\u5F0F\u5B58\u5728\u6642\uFF0C\u7121\u6CD5\u5C07\u529F\u80FD\u8A2D\u70BA\u507D\u3002"}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method, and "try-catch-finally block" + * refers to the Java keywords with those names. "Outlined" is a + * technical term internal to XSLTC and should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_TRY_CATCH, + "\u5167\u90E8 XSLTC \u932F\u8AA4: \u7522\u751F\u7684\u4F4D\u5143\u7D44\u78BC\u5305\u542B try-catch-finally \u5340\u584A\uFF0C\u7121\u6CD5\u52A0\u4EE5 outlined."}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The terms "OutlineableChunkStart" and + * "OutlineableChunkEnd" are the names of classes internal to XSLTC and + * should not be translated. The message indicates that for every + * "start" there must be a corresponding "end", and vice versa, and + * that if one of a pair of "start" and "end" appears between another + * pair of corresponding "start" and "end", then the other half of the + * pair must also be between that same enclosing pair. + */ + {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS, + "\u5167\u90E8 XSLTC \u932F\u8AA4: OutlineableChunkStart \u548C OutlineableChunkEnd \u6A19\u8A18\u5FC5\u9808\u6210\u5C0D\u51FA\u73FE\uFF0C\u4E26\u4F7F\u7528\u6B63\u78BA\u7684\u5DE2\u72C0\u7D50\u69CB\u3002"}, + + /* + * Note to translators: This message describes an internal error in the + * processor. The term "byte code" is a Java technical term for the + * executable code in a Java method. The "method" that is being + * referred to is a Java method in a translet that XSLTC is generating + * in processing a stylesheet. The "instruction" that is being + * referred to is one of the instrutions in the Java byte code in that + * method. "Outlined" is a technical term internal to XSLTC and + * should not be translated. + */ + {ErrorMsg.OUTLINE_ERR_DELETED_TARGET, + "\u5167\u90E8 XSLTC \u932F\u8AA4: \u539F\u59CB\u65B9\u6CD5\u4E2D\u4ECD\u7136\u53C3\u7167\u5C6C\u65BC outlined \u4F4D\u5143\u7D44\u78BC\u5340\u584A\u4E00\u90E8\u5206\u7684\u6307\u793A\u3002" + }, + + + /* + * Note to translators: This message describes an internal error in the + * processor. The "method" that is being referred to is a Java method + * in a translet that XSLTC is generating. + * + */ + {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG, + "\u5167\u90E8 XSLTC \u932F\u8AA4: translet \u4E2D\u7684\u65B9\u6CD5\u8D85\u904E Java \u865B\u64EC\u6A5F\u5668\u5C0D\u65BC\u65B9\u6CD5\u9577\u5EA6 64 KB \u7684\u9650\u5236\u3002\u9019\u901A\u5E38\u662F\u56E0\u70BA\u6A23\u5F0F\u8868\u4E2D\u6709\u975E\u5E38\u5927\u7684\u6A23\u677F\u3002\u8ACB\u5617\u8A66\u91CD\u65B0\u7D44\u7E54\u60A8\u7684\u6A23\u5F0F\u8868\u4EE5\u4F7F\u7528\u8F03\u5C0F\u7684\u6A23\u677F\u3002" + }, + + {ErrorMsg.DESERIALIZE_TRANSLET_ERR, "\u555F\u7528 Java \u5B89\u5168\u6642\uFF0C\u6703\u505C\u7528\u9084\u539F\u5E8F\u5217\u5316 TemplatesImpl \u7684\u652F\u63F4\u3002\u5C07 jdk.xml.enableTemplatesImplDeserialization \u7CFB\u7D71\u5C6C\u6027\u8A2D\u70BA\u771F\u5373\u53EF\u8986\u5BEB\u6B64\u8A2D\u5B9A\u3002"} + }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java index 37b4176f3b1..e1fd9e38df3 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java @@ -81,7 +81,13 @@ public class ErrorMessages extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "Use of the extension element ''{0}'' is not allowed when the secure processing feature is set to true."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java index 1f1c461680d..a2b2ba14caa 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java @@ -79,7 +79,13 @@ public class ErrorMessages_ca extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -223,13 +229,6 @@ public class ErrorMessages_ca extends ListResourceBundle { "No s''ha pogut resoldre la refer\u00e8ncia d''URI ''{0}''."} }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java index 497367b8689..88409e1a507 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java @@ -79,7 +79,13 @@ public class ErrorMessages_cs extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -223,13 +229,6 @@ public class ErrorMessages_cs extends ListResourceBundle { "Nelze p\u0159elo\u017eit odkazy URI ''{0}''."} }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java index 181b4e17af5..747ae526d4e 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java @@ -81,7 +81,13 @@ public class ErrorMessages_de extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_de extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "Verwendung des Erweiterungselements \"{0}\" ist nicht zul\u00E4ssig, wenn das Feature f\u00FCr die sichere Verarbeitung auf \"true\" gesetzt ist."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java index a5979582a1c..7810adaf78e 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java @@ -81,7 +81,13 @@ public class ErrorMessages_es extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_es extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "El uso del elemento de extensi\u00F3n ''{0}'' no est\u00E1 permitido cuando la funci\u00F3n de procesamiento seguro se ha definido en true."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java index 5319304f456..28089e97bb3 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java @@ -81,7 +81,13 @@ public class ErrorMessages_fr extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_fr extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "L''utilisation de l''\u00E9l\u00E9ment d''extension ''{0}'' n''est pas autoris\u00E9e lorsque la fonctionnalit\u00E9 de traitement s\u00E9curis\u00E9 est d\u00E9finie sur True."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java index da6622e48c4..3fa594b215e 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java @@ -81,7 +81,13 @@ public class ErrorMessages_it extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_it extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "Non \u00E8 consentito utilizzare l''elemento di estensione ''{0}'' se la funzione di elaborazione sicura \u00E8 impostata su true."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java index 54dc000aa39..ce4f1708f5e 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java @@ -81,7 +81,13 @@ public class ErrorMessages_ja extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_ja extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "\u30BB\u30AD\u30E5\u30A2\u51E6\u7406\u6A5F\u80FD\u304Ctrue\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u3068\u304D\u3001\u62E1\u5F35\u8981\u7D20''{0}''\u306E\u4F7F\u7528\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java index 87b532349b3..6ede7dfdd8a 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java @@ -81,7 +81,13 @@ public class ErrorMessages_ko extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_ko extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "\uBCF4\uC548 \uCC98\uB9AC \uAE30\uB2A5\uC774 true\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 \uD655\uC7A5 \uC694\uC18C ''{0}''\uC744(\uB97C) \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java index 9d8ab460300..6004632a832 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,10 +17,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - /* - * $Id: ErrorMessages_pt_BR.java 3023 2011-03-01 00:53:34Z joehw $ + * $Id: ErrorMessages_pt_BR.java /st_wptg_1.8.0.0.0jdk/2 2013/09/11 12:46:53 gmolloy Exp $ */ + package com.sun.org.apache.xalan.internal.xsltc.runtime; import java.util.ListResourceBundle; @@ -81,7 +81,13 @@ public class ErrorMessages_pt_BR extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_pt_BR extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "O uso do elemento da extens\u00E3o ''{0}'' n\u00E3o ser\u00E1 permitido quando o recurso de processamento seguro for definido como verdadeiro."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java index cf23692df73..6ee58b7c614 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java @@ -79,7 +79,13 @@ public class ErrorMessages_sk extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -223,13 +229,6 @@ public class ErrorMessages_sk extends ListResourceBundle { "Nebolo mo\u017en\u00e9 rozl\u00ed\u0161i\u0165 referenciu URI ''{0}''."} }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java index de29ceb20d7..14f6797117a 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,10 +17,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - /* - * $Id: ErrorMessages_sv.java 3023 2011-03-01 00:53:34Z joehw $ + * $Id: ErrorMessages_sv.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 06:50:58 gmolloy Exp $ */ + package com.sun.org.apache.xalan.internal.xsltc.runtime; import java.util.ListResourceBundle; @@ -81,7 +81,13 @@ public class ErrorMessages_sv extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_sv extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "Anv\u00E4ndning av till\u00E4ggselementet ''{0}'' \u00E4r inte till\u00E5tet n\u00E4r s\u00E4ker bearbetning till\u00E4mpas."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java index 2900d55f057..c673f2b5234 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java @@ -81,7 +81,13 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "\u5F53\u5B89\u5168\u5904\u7406\u529F\u80FD\u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u65F6, \u4E0D\u5141\u8BB8\u4F7F\u7528\u6269\u5C55\u5143\u7D20 ''{0}''\u3002"}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java index 8e591a223ee..50972c6cb2e 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java @@ -81,7 +81,13 @@ public class ErrorMessages_zh_TW extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_zh_TW extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "\u7576\u5B89\u5168\u8655\u7406\u529F\u80FD\u8A2D\u70BA\u771F\u6642\uFF0C\u4E0D\u5141\u8A31\u4F7F\u7528\u64F4\u5145\u5957\u4EF6\u5143\u7D20 ''{0}''\u3002"}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java index a26f093ee08..8cf62c05fa0 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java @@ -74,12 +74,12 @@ public class SAX2DOM implements ContentHandler, LexicalHandler, Constants { DocumentBuilderFactory.newInstance(); private boolean _internal = true; - public SAX2DOM(boolean useServicesMachnism) throws ParserConfigurationException { - _document = createDocument(useServicesMachnism); + public SAX2DOM(boolean useServicesMechanism) throws ParserConfigurationException { + _document = createDocument(useServicesMechanism); _root = _document; } - public SAX2DOM(Node root, Node nextSibling, boolean useServicesMachnism) throws ParserConfigurationException { + public SAX2DOM(Node root, Node nextSibling, boolean useServicesMechanism) throws ParserConfigurationException { _root = root; if (root instanceof Document) { _document = (Document)root; @@ -88,15 +88,15 @@ public class SAX2DOM implements ContentHandler, LexicalHandler, Constants { _document = root.getOwnerDocument(); } else { - _document = createDocument(useServicesMachnism); + _document = createDocument(useServicesMechanism); _root = _document; } _nextSibling = nextSibling; } - public SAX2DOM(Node root, boolean useServicesMachnism) throws ParserConfigurationException { - this(root, null, useServicesMachnism); + public SAX2DOM(Node root, boolean useServicesMechanism) throws ParserConfigurationException { + this(root, null, useServicesMechanism); } public Node getDOM() { @@ -308,18 +308,19 @@ public class SAX2DOM implements ContentHandler, LexicalHandler, Constants { public void startDTD(String name, String publicId, String systemId) throws SAXException {} - private Document createDocument(boolean useServicesMachnism) throws ParserConfigurationException { + private Document createDocument(boolean useServicesMechanism) throws ParserConfigurationException { if (_factory == null) { - if (useServicesMachnism) + if (useServicesMechanism) { _factory = DocumentBuilderFactory.newInstance(); if (!(_factory instanceof com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl)) { _internal = false; } - else + } else { _factory = DocumentBuilderFactory.newInstance( "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", SAX2DOM.class.getClassLoader() ); + } } Document doc; if (_internal) { diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java index 879c1cb4de0..8bbc5410695 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java @@ -29,7 +29,7 @@ import javax.xml.transform.Templates; import javax.xml.transform.TransformerException; import javax.xml.transform.URIResolver; import javax.xml.transform.sax.TemplatesHandler; - +import com.sun.org.apache.xalan.internal.XalanConstants; import com.sun.org.apache.xalan.internal.xsltc.compiler.CompilerException; import com.sun.org.apache.xalan.internal.xsltc.compiler.Parser; import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader; @@ -95,7 +95,7 @@ public class TemplatesHandlerImpl _tfactory = tfactory; // Instantiate XSLTC and get reference to parser object - XSLTC xsltc = new XSLTC(tfactory.useServicesMechnism()); + XSLTC xsltc = new XSLTC(tfactory.useServicesMechnism(), tfactory.getFeatureManager()); if (tfactory.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) xsltc.setSecureProcessing(true); @@ -103,6 +103,8 @@ public class TemplatesHandlerImpl (String)tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)); xsltc.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, (String)tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_DTD)); + xsltc.setProperty(XalanConstants.SECURITY_MANAGER, + tfactory.getAttribute(XalanConstants.SECURITY_MANAGER)); if ("true".equals(tfactory.getAttribute(TransformerFactoryImpl.ENABLE_INLINING))) diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java index 874892942f9..46866fdb0ad 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java @@ -25,11 +25,14 @@ package com.sun.org.apache.xalan.internal.xsltc.trax; import com.sun.org.apache.xalan.internal.XalanConstants; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; +import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase; import com.sun.org.apache.xalan.internal.utils.ObjectFactory; import com.sun.org.apache.xalan.internal.utils.SecuritySupport; +import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager; import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.Property; -import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.State; +import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase.State; import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants; import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader; import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC; @@ -218,13 +221,15 @@ public class TransformerFactoryImpl * protocols allowed for external references set by the stylesheet processing instruction, Import and Include element. */ private String _accessExternalStylesheet = XalanConstants.EXTERNAL_ACCESS_DEFAULT; - /** * protocols allowed for external DTD references in source file and/or stylesheet. */ private String _accessExternalDTD = XalanConstants.EXTERNAL_ACCESS_DEFAULT; private XMLSecurityPropertyManager _xmlSecurityPropertyMgr; + private XMLSecurityManager _xmlSecurityManager; + + private final FeatureManager _featureManager; /** * javax.xml.transform.sax.TransformerFactory implementation. @@ -239,10 +244,13 @@ public class TransformerFactoryImpl private TransformerFactoryImpl(boolean useServicesMechanism) { this._useServicesMechanism = useServicesMechanism; + _featureManager = new FeatureManager(); if (System.getSecurityManager() != null) { _isSecureMode = true; _isNotSecureProcessing = false; + _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION, + FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE); } _xmlSecurityPropertyMgr = new XMLSecurityPropertyManager(); @@ -250,6 +258,9 @@ public class TransformerFactoryImpl Property.ACCESS_EXTERNAL_DTD); _accessExternalStylesheet = _xmlSecurityPropertyMgr.getValue( Property.ACCESS_EXTERNAL_STYLESHEET); + + //Parser's security manager + _xmlSecurityManager = new XMLSecurityManager(true); } /** @@ -311,11 +322,21 @@ public class TransformerFactoryImpl return Boolean.TRUE; else return Boolean.FALSE; + } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { + return _xmlSecurityManager; } - int index = _xmlSecurityPropertyMgr.getIndex(name); - if (index > -1) { - return _xmlSecurityPropertyMgr.getValueByIndex(index); + /** Check to see if the property is managed by the security manager **/ + String propertyValue = (_xmlSecurityManager != null) ? + _xmlSecurityManager.getLimitAsString(name) : null; + if (propertyValue != null) { + return propertyValue; + } else { + propertyValue = (_xmlSecurityPropertyMgr != null) ? + _xmlSecurityPropertyMgr.getValue(name) : null; + if (propertyValue != null) { + return propertyValue; + } } // Throw an exception for all other attributes @@ -419,10 +440,13 @@ public class TransformerFactoryImpl } } - int index = _xmlSecurityPropertyMgr.getIndex(name); - if (index > -1) { - _xmlSecurityPropertyMgr.setValue(index, - State.APIPROPERTY, (String)value); + if (_xmlSecurityManager != null && + _xmlSecurityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, value)) { + return; + } + + if (_xmlSecurityPropertyMgr != null && + _xmlSecurityPropertyMgr.setValue(name, XMLSecurityPropertyManager.State.APIPROPERTY, value)) { _accessExternalDTD = _xmlSecurityPropertyMgr.getValue( Property.ACCESS_EXTERNAL_DTD); _accessExternalStylesheet = _xmlSecurityPropertyMgr.getValue( @@ -473,6 +497,7 @@ public class TransformerFactoryImpl throw new TransformerConfigurationException(err.toString()); } _isNotSecureProcessing = !value; + _xmlSecurityManager.setSecureProcessing(value); // set external access restriction when FSP is explicitly set if (value && XalanConstants.IS_JDK8_OR_ABOVE) { @@ -486,6 +511,10 @@ public class TransformerFactoryImpl Property.ACCESS_EXTERNAL_STYLESHEET); } + if (value && _featureManager != null) { + _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION, + FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE); + } return; } else if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) { @@ -494,6 +523,11 @@ public class TransformerFactoryImpl _useServicesMechanism = value; } else { + if (_featureManager != null && + _featureManager.setValue(name, State.APIPROPERTY, value)) { + return; + } + // unknown feature ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name); throw new TransformerConfigurationException(err.toString()); @@ -543,6 +577,13 @@ public class TransformerFactoryImpl return !_isNotSecureProcessing; } + /** Check to see if the property is managed by the security manager **/ + String propertyValue = (_featureManager != null) ? + _featureManager.getValueAsString(name) : null; + if (propertyValue != null) { + return Boolean.parseBoolean(propertyValue); + } + // Feature not supported return false; } @@ -553,6 +594,13 @@ public class TransformerFactoryImpl return _useServicesMechanism; } + /** + * @return the feature manager + */ + public FeatureManager getFeatureManager() { + return _featureManager; + } + /** * javax.xml.transform.sax.TransformerFactory implementation. * Get the object that is used by default during the transformation to @@ -839,7 +887,7 @@ public class TransformerFactoryImpl } // Create and initialize a stylesheet compiler - final XSLTC xsltc = new XSLTC(_useServicesMechanism); + final XSLTC xsltc = new XSLTC(_useServicesMechanism, _featureManager); if (_debug) xsltc.setDebug(true); if (_enableInlining) xsltc.setTemplateInlining(true); @@ -849,6 +897,7 @@ public class TransformerFactoryImpl if (!_isNotSecureProcessing) xsltc.setSecureProcessing(true); xsltc.setProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, _accessExternalStylesheet); xsltc.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD); + xsltc.setProperty(XalanConstants.SECURITY_MANAGER, _xmlSecurityManager); xsltc.init(); // Set a document loader (for xsl:include/import) if defined diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java index 63446e734e2..6bf365fe2a7 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java @@ -25,6 +25,7 @@ package com.sun.org.apache.xalan.internal.xsltc.trax; import com.sun.org.apache.xalan.internal.XalanConstants; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; +import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -214,6 +215,7 @@ public final class TransformerImpl extends Transformer */ private String _accessExternalDTD = XalanConstants.EXTERNAL_ACCESS_DEFAULT; + private XMLSecurityManager _securityManager; /** * A hashtable to store parameters for the identity transform. These * are not needed during the transformation, but we must keep track of @@ -269,8 +271,11 @@ public final class TransformerImpl extends Transformer _useServicesMechanism = _tfactory.useServicesMechnism(); _accessExternalStylesheet = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET); _accessExternalDTD = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_DTD); + _securityManager = (XMLSecurityManager)_tfactory.getAttribute(XalanConstants.SECURITY_MANAGER); _readerManager = XMLReaderManager.getInstance(_useServicesMechanism); _readerManager.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD); + _readerManager.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _isSecureProcessing); + _readerManager.setProperty(XalanConstants.SECURITY_MANAGER, _securityManager); //_isIncremental = tfactory._incremental; } @@ -286,6 +291,7 @@ public final class TransformerImpl extends Transformer */ public void setSecureProcessing(boolean flag) { _isSecureProcessing = flag; + _readerManager.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _isSecureProcessing); } /** * Return the state of the services mechanism feature. diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java index 25c45c04be9..4c6e02936c3 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java @@ -23,6 +23,7 @@ package com.sun.org.apache.xalan.internal.xsltc.trax; +import com.sun.org.apache.xalan.internal.XalanConstants; import java.io.InputStream; import java.io.Reader; @@ -43,6 +44,7 @@ import javax.xml.transform.stax.StAXSource; import javax.xml.transform.stream.StreamSource; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; +import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager; import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; @@ -105,6 +107,13 @@ public final class Util { if (reader == null) { try { reader= XMLReaderFactory.createXMLReader(); + try { + reader.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, + xsltc.isSecureProcessing()); + } catch (SAXNotRecognizedException e) { + System.err.println("Warning: " + reader.getClass().getName() + ": " + + e.getMessage()); + } } catch (Exception e ) { try { @@ -144,6 +153,22 @@ public final class Util { + e.getMessage()); } + try { + XMLSecurityManager securityManager = + (XMLSecurityManager)xsltc.getProperty(XalanConstants.SECURITY_MANAGER); + if (securityManager != null) { + for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) { + reader.setProperty(limit.apiProperty(), + securityManager.getLimitValueAsString(limit)); + } + if (securityManager.printEntityCountInfo()) { + reader.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES); + } + } + } catch (SAXException se) { + System.err.println("Warning: " + reader.getClass().getName() + ": " + + se.getMessage()); + } xsltc.setXMLReader(reader); }catch (SAXNotRecognizedException snre ) { throw new TransformerConfigurationException diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java index 832724ac586..1e8dcd98817 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java @@ -33,6 +33,7 @@ import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings; import com.sun.org.apache.xerces.internal.util.PropertyState; import com.sun.org.apache.xerces.internal.util.SymbolTable; import com.sun.org.apache.xerces.internal.utils.ObjectFactory; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler; import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler; @@ -59,6 +60,7 @@ import org.w3c.dom.DOMStringList; import org.w3c.dom.ls.LSResourceResolver; + /** * Xerces implementation of DOMConfiguration that maintains a table of recognized parameters. * @@ -156,6 +158,9 @@ public class DOMConfigurationImpl extends ParserConfigurationSettings protected static final String SCHEMA_DV_FACTORY = Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY; + /** Property identifier: Security manager. */ + private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER; + /** Property identifier: Security property manager. */ private static final String XML_SECURITY_PROPERTY_MANAGER = Constants.XML_SECURITY_PROPERTY_MANAGER; @@ -279,6 +284,7 @@ public class DOMConfigurationImpl extends ParserConfigurationSettings JAXP_SCHEMA_LANGUAGE, DTD_VALIDATOR_FACTORY_PROPERTY, SCHEMA_DV_FACTORY, + SECURITY_MANAGER, XML_SECURITY_PROPERTY_MANAGER }; addRecognizedProperties(recognizedProperties); @@ -313,6 +319,8 @@ public class DOMConfigurationImpl extends ParserConfigurationSettings fValidationManager = createValidationManager(); setProperty(VALIDATION_MANAGER, fValidationManager); + setProperty(SECURITY_MANAGER, new XMLSecurityManager(true)); + setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, new XMLSecurityPropertyManager()); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java index bcc2a796b08..579622a7270 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java @@ -174,8 +174,6 @@ public final class Constants { /** JAXP schemaSource language: when used internally may include DTD namespace (DOM) */ public static final String SCHEMA_LANGUAGE = "schemaLanguage"; - public static final String SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT = "elementAttributeLimit" ; - /** JAXP Standard property prefix ("http://javax.xml.XMLConstants/property/"). */ public static final String JAXPAPI_PROPERTY_PREFIX = "http://javax.xml.XMLConstants/property/"; @@ -208,6 +206,107 @@ public final class Constants { */ public static final boolean IS_JDK8_OR_ABOVE = isJavaVersionAtLeast(8); + // + // Implementation limits: corresponding System Properties of the above + // API properties + // + /** + * JDK entity expansion limit; Note that the existing system property + * "entityExpansionLimit" with no prefix is still observed + */ + public static final String JDK_ENTITY_EXPANSION_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "entityExpansionLimit"; + + /** + * JDK element attribute limit; Note that the existing system property + * "elementAttributeLimit" with no prefix is still observed + */ + public static final String JDK_ELEMENT_ATTRIBUTE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "elementAttributeLimit"; + + /** + * JDK maxOccur limit; Note that the existing system property + * "maxOccurLimit" with no prefix is still observed + */ + public static final String JDK_MAX_OCCUR_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxOccurLimit"; + + /** + * JDK total entity size limit + */ + public static final String JDK_TOTAL_ENTITY_SIZE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "totalEntitySizeLimit"; + + /** + * JDK maximum general entity size limit + */ + public static final String JDK_GENEAL_ENTITY_SIZE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxGeneralEntitySizeLimit"; + /** + * JDK maximum parameter entity size limit + */ + public static final String JDK_PARAMETER_ENTITY_SIZE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxParameterEntitySizeLimit"; + /** + * JDK maximum XML name limit + */ + public static final String JDK_XML_NAME_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxXMLNameLimit"; + /** + * JDK property to allow printing out information from the limit analyzer + */ + public static final String JDK_ENTITY_COUNT_INFO = + ORACLE_JAXP_PROPERTY_PREFIX + "getEntityCountInfo"; + + // + // Implementation limits: API properties + // + /** + * JDK entity expansion limit; Note that the existing system property + * "entityExpansionLimit" with no prefix is still observed + */ + public static final String SP_ENTITY_EXPANSION_LIMIT = "jdk.xml.entityExpansionLimit"; + + /** + * JDK element attribute limit; Note that the existing system property + * "elementAttributeLimit" with no prefix is still observed + */ + public static final String SP_ELEMENT_ATTRIBUTE_LIMIT = "jdk.xml.elementAttributeLimit"; + + /** + * JDK maxOccur limit; Note that the existing system property + * "maxOccurLimit" with no prefix is still observed + */ + public static final String SP_MAX_OCCUR_LIMIT = "jdk.xml.maxOccurLimit"; + + /** + * JDK total entity size limit + */ + public static final String SP_TOTAL_ENTITY_SIZE_LIMIT = "jdk.xml.totalEntitySizeLimit"; + + /** + * JDK maximum general entity size limit + */ + public static final String SP_GENEAL_ENTITY_SIZE_LIMIT = "jdk.xml.maxGeneralEntitySizeLimit"; + /** + * JDK maximum parameter entity size limit + */ + public static final String SP_PARAMETER_ENTITY_SIZE_LIMIT = "jdk.xml.maxParameterEntitySizeLimit"; + /** + * JDK maximum XML name limit + */ + public static final String SP_XML_NAME_LIMIT = "jdk.xml.maxXMLNameLimit"; + + //legacy System Properties + public final static String ENTITY_EXPANSION_LIMIT = "entityExpansionLimit"; + public static final String ELEMENT_ATTRIBUTE_LIMIT = "elementAttributeLimit" ; + public final static String MAX_OCCUR_LIMIT = "maxOccurLimit"; + + /** + * A string "yes" that can be used for properties such as getEntityCountInfo + */ + public static final String JDK_YES = "yes"; + // // DOM features // @@ -443,7 +542,7 @@ public final class Constants { public static final String LOCALE_PROPERTY = "locale"; /** property identifier: security manager. */ - protected static final String SECURITY_MANAGER = + public static final String SECURITY_MANAGER = Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY; @@ -511,9 +610,6 @@ public final class Constants { */ public final static String ATTRIBUTE_DECLARED = "ATTRIBUTE_DECLARED"; - public final static String ENTITY_EXPANSION_LIMIT = "entityExpansionLimit"; - - public final static String MAX_OCCUR_LIMIT = "maxOccurLimit"; /** * {@link org.w3c.dom.TypeInfo} associated with current element/attribute diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java index 0f5119d1fb1..2c8f3aff2c2 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java @@ -25,6 +25,7 @@ package com.sun.org.apache.xerces.internal.impl; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.xml.internal.stream.StaxEntityResolverWrapper; import java.util.HashMap; @@ -50,12 +51,16 @@ public class PropertyManager { private static final String STRING_INTERNING = "http://xml.org/sax/features/string-interning"; + /** Property identifier: Security manager. */ + private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER; + /** Property identifier: Security property manager. */ private static final String XML_SECURITY_PROPERTY_MANAGER = Constants.XML_SECURITY_PROPERTY_MANAGER; HashMap supportedProps = new HashMap(); + private XMLSecurityManager fSecurityManager; private XMLSecurityPropertyManager fSecurityPropertyMgr; public static final int CONTEXT_READER = 1; @@ -82,6 +87,7 @@ public class PropertyManager { HashMap properties = propertyManager.getProperties(); supportedProps.putAll(properties); + fSecurityManager = (XMLSecurityManager)getProperty(SECURITY_MANAGER); fSecurityPropertyMgr = (XMLSecurityPropertyManager)getProperty(XML_SECURITY_PROPERTY_MANAGER); } @@ -124,6 +130,8 @@ public class PropertyManager { supportedProps.put(Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ENTITYDEF_FEATURE, new Boolean(false)); supportedProps.put(Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_UNDECLARED_ELEMDEF_FEATURE, new Boolean(false)); + fSecurityManager = new XMLSecurityManager(true); + supportedProps.put(SECURITY_MANAGER, fSecurityManager); fSecurityPropertyMgr = new XMLSecurityPropertyManager(); supportedProps.put(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); } @@ -142,6 +150,7 @@ public class PropertyManager { */ public boolean containsProperty(String property){ return supportedProps.containsKey(property) || + (fSecurityManager != null && fSecurityManager.getIndex(property) > -1) || (fSecurityPropertyMgr!=null && fSecurityPropertyMgr.getIndex(property) > -1) ; } @@ -169,12 +178,34 @@ public class PropertyManager { supportedProps.put( Constants.XERCES_PROPERTY_PREFIX + Constants.STAX_ENTITY_RESOLVER_PROPERTY , new StaxEntityResolverWrapper((XMLResolver)value)) ; } - int index = (fSecurityPropertyMgr != null) ? fSecurityPropertyMgr.getIndex(property) : -1; - if (index > -1) { - fSecurityPropertyMgr.setValue(index, - XMLSecurityPropertyManager.State.APIPROPERTY, (String)value); - } else { - supportedProps.put(property, value); + /** + * It's possible for users to set a security manager through the interface. + * If it's the old SecurityManager, convert it to the new XMLSecurityManager + */ + if (property.equals(Constants.SECURITY_MANAGER)) { + fSecurityManager = XMLSecurityManager.convert(value, fSecurityManager); + supportedProps.put(Constants.SECURITY_MANAGER, fSecurityManager); + return; + } + if (property.equals(Constants.XML_SECURITY_PROPERTY_MANAGER)) { + if (value == null) { + fSecurityPropertyMgr = new XMLSecurityPropertyManager(); + } else { + fSecurityPropertyMgr = (XMLSecurityPropertyManager)value; + } + supportedProps.put(Constants.XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); + return; + } + + //check if the property is managed by security manager + if (fSecurityManager == null || + !fSecurityManager.setLimit(property, XMLSecurityManager.State.APIPROPERTY, value)) { + //check if the property is managed by security property manager + if (fSecurityPropertyMgr == null || + !fSecurityPropertyMgr.setValue(property, XMLSecurityPropertyManager.State.APIPROPERTY, value)) { + //fall back to the existing property manager + supportedProps.put(property, value); + } } if(equivalentProperty != null){ diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java index dbfd46a5d5f..7a826dfcc97 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java @@ -108,6 +108,7 @@ import javax.xml.stream.events.XMLEvent; * @author Elena Litani, IBM * @author Michael Glavassevich, IBM * @author Sunitha Reddy, Sun Microsystems + * @version $Id: XML11NSDocumentScannerImpl.java,v 1.6 2010-11-01 04:39:40 joehw Exp $ */ public class XML11NSDocumentScannerImpl extends XML11DocumentScannerImpl { @@ -236,7 +237,8 @@ public class XML11NSDocumentScannerImpl extends XML11DocumentScannerImpl { // attributes scanAttribute(fAttributes); - if (fSecurityManager != null && fAttributes.getLength() > fElementAttributeLimit){ + if (fSecurityManager != null && (!fSecurityManager.isNoLimit(fElementAttributeLimit)) && + fAttributes.getLength() > fElementAttributeLimit){ fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, "ElementAttributeLimit", new Object[]{rawname, new Integer(fElementAttributeLimit) }, diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java index 6c5553c7979..18a9902d1b7 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java @@ -44,6 +44,8 @@ import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter; import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler; import com.sun.org.apache.xerces.internal.impl.Constants; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; +import com.sun.xml.internal.stream.Entity; /** * This class is responsible for scanning the declarations found @@ -66,7 +68,7 @@ import com.sun.org.apache.xerces.internal.impl.Constants; * @author Glenn Marcy, IBM * @author Eric Ye, IBM * - * @version $Id: XMLDTDScannerImpl.java,v 1.7 2007/09/26 12:52:40 ndw Exp $ + * @version $Id: XMLDTDScannerImpl.java,v 1.8 2010-11-01 04:39:41 joehw Exp $ */ public class XMLDTDScannerImpl extends XMLScanner @@ -1545,7 +1547,7 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { // internal entity if (systemId == null) { - scanEntityValue(fLiteral, fLiteral2); + scanEntityValue(name, isPEDecl, fLiteral, fLiteral2); // since we need it's value anyway, let's snag it so it doesn't get corrupted // if a new load takes place before we store the entity values fStringBuffer.clear(); @@ -1610,7 +1612,7 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { * the use of scanCharReferenceValue), and fStringBuffer2, anything in them * at the time of calling is lost. */ - protected final void scanEntityValue(XMLString value, + protected final void scanEntityValue(String entityName, boolean isPEDecl, XMLString value, XMLString nonNormalizedValue) throws IOException, XNIException { int quote = fEntityScanner.scanChar(); @@ -1622,10 +1624,20 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { XMLString literal = fString; XMLString literal2 = fString; + int countChar = 0; + if (fLimitAnalyzer == null && fSecurityManager != null) { + fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); + fLimitAnalyzer.startEntity(entityName); + } + if (fEntityScanner.scanLiteral(quote, fString) != quote) { fStringBuffer.clear(); fStringBuffer2.clear(); do { + if (isPEDecl && fLimitAnalyzer != null) { + checkLimit("%" + entityName, fString.length + countChar); + } + countChar = 0; fStringBuffer.append(fString); fStringBuffer2.append(fString); if (fEntityScanner.skipChar('&')) { @@ -1685,6 +1697,7 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { } } else { + countChar++; int c = fEntityScanner.peekChar(); if (XMLChar.isHighSurrogate(c)) { scanSurrogates(fStringBuffer2); @@ -1708,9 +1721,17 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { fStringBuffer2.append(fString); literal = fStringBuffer; literal2 = fStringBuffer2; + } else { + if (isPEDecl) { + checkLimit("%" + entityName, literal); + } } value.setValues(literal); nonNormalizedValue.setValues(literal2); + if (fLimitAnalyzer != null) { + fLimitAnalyzer.endEntity(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT, entityName); + } + if (!fEntityScanner.skipChar(quote)) { reportFatalError("CloseQuoteMissingInDecl", null); } @@ -2126,6 +2147,43 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { //new SymbolTable()); } + /** + * Add the count of the content buffer and check if the accumulated + * value exceeds the limit + * @param entityName entity name + * @param buffer content buffer + */ + private void checkLimit(String entityName, XMLString buffer) { + checkLimit(entityName, buffer.length); + } + + /** + * Add the count and check limit + * @param entityName entity name + * @param len length of the buffer + */ + private void checkLimit(String entityName, int len) { + if (fLimitAnalyzer == null) { + fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); + } + fLimitAnalyzer.addValue(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT, entityName, len); + if (fSecurityManager.isOverLimit(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT)) { + fSecurityManager.debugPrint(); + reportFatalError("MaxEntitySizeLimit", new Object[]{entityName, + fLimitAnalyzer.getValue(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT), + fSecurityManager.getLimit(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT), + fSecurityManager.getStateLiteral(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT)}); + } + if (fSecurityManager.isOverLimit(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT)) { + fSecurityManager.debugPrint(); + reportFatalError("TotalEntitySizeLimit", + new Object[]{fLimitAnalyzer.getTotalValue(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT), + fSecurityManager.getLimit(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT), + fSecurityManager.getStateLiteral(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT)}); + } + + } + public DTDGrammar getGrammar(){ return nvGrammarInfo; } diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java index 050b852e84d..fe1f63f89ed 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java @@ -50,12 +50,14 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.NamespaceSupport; import com.sun.org.apache.xerces.internal.utils.SecuritySupport; +import com.sun.org.apache.xerces.internal.utils.XMLLimitAnalyzer; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager.Limit; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager.State; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.NamespaceContext; -import com.sun.xml.internal.stream.Entity; import javax.xml.XMLConstants; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.events.XMLEvent; @@ -213,11 +215,8 @@ public class XMLDocumentFragmentScannerImpl }; 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'}; - + private static final char [] endTag = {'<','/'}; // debugging /** Debug scanner state. */ @@ -316,6 +315,7 @@ public class XMLDocumentFragmentScannerImpl protected String fDeclaredEncoding = null; /** Xerces Feature: Disallow doctype declaration. */ protected boolean fDisallowDoctype = false; + /** * comma-delimited list of protocols that are allowed for the purpose * of accessing external dtd or entity references @@ -384,7 +384,6 @@ public class XMLDocumentFragmentScannerImpl protected boolean foundBuiltInRefs = false; - protected SecurityManager fSecurityManager = null; //skip element algorithm static final short MAX_DEPTH_LIMIT = 5 ; @@ -570,46 +569,24 @@ public class XMLDocumentFragmentScannerImpl // xerces features fReportCdataEvent = componentManager.getFeature(Constants.STAX_REPORT_CDATA_EVENT, true); - - fSecurityManager = (SecurityManager)componentManager.getProperty(Constants.SECURITY_MANAGER, null); - fElementAttributeLimit = (fSecurityManager != null)?fSecurityManager.getElementAttrLimit():0; - + fSecurityManager = (XMLSecurityManager)componentManager.getProperty(Constants.SECURITY_MANAGER, null); fNotifyBuiltInRefs = componentManager.getFeature(NOTIFY_BUILTIN_REFS, false); Object resolver = componentManager.getProperty(ENTITY_RESOLVER, null); fExternalSubsetResolver = (resolver instanceof ExternalSubsetResolver) ? (ExternalSubsetResolver) resolver : null; - // initialize vars - fMarkupDepth = 0; - fCurrentElement = null; - fElementStack.clear(); - fHasExternalDTD = false; - fStandaloneSet = false; - fStandalone = false; - fInScanContent = false; - //skipping algorithm - fShouldSkip = false; - fAdd = false; - fSkip = false; - //attribute fReadingAttributes = false; //xxx: external entities are supported in Xerces // it would be good to define feature for this case fSupportExternalEntities = true; - fSupportExternalEntities = true; - fSupportExternalEntities = true; - fSupportExternalEntities = true; fReplaceEntityReferences = true; fIsCoalesce = false; // setup Driver setScannerState(SCANNER_STATE_CONTENT); setDriver(fContentDriver); - fEntityStore = fEntityManager.getEntityStore(); - - dtdGrammarUtil = null; // JAXP 1.5 features and properties XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager) @@ -618,6 +595,7 @@ public class XMLDocumentFragmentScannerImpl fStrictURI = componentManager.getFeature(STANDARD_URI_CONFORMANT, false); + resetCommon(); //fEntityManager.test(); } // reset(XMLComponentManager) @@ -631,17 +609,7 @@ public class XMLDocumentFragmentScannerImpl fNamespaces = ((Boolean)propertyManager.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)).booleanValue(); fNotifyBuiltInRefs = false ; - // initialize vars - fMarkupDepth = 0; - fCurrentElement = null; - fShouldSkip = false; - fAdd = false; - fSkip = false; - fElementStack.clear(); //fElementStack2.clear(); - fHasExternalDTD = false; - fStandaloneSet = false; - fStandalone = false; //fReplaceEntityReferences = true; //fSupportExternalEntities = true; Boolean bo = (Boolean)propertyManager.getProperty(XMLInputFactoryImpl.IS_REPLACING_ENTITY_REFERENCES); @@ -662,17 +630,43 @@ public class XMLDocumentFragmentScannerImpl //we dont need to do this -- nb. //setScannerState(SCANNER_STATE_CONTENT); //setDriver(fContentDriver); - fEntityStore = fEntityManager.getEntityStore(); //fEntityManager.test(); - dtdGrammarUtil = null; - // JAXP 1.5 features and properties XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager) propertyManager.getProperty(XML_SECURITY_PROPERTY_MANAGER); fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD); + + fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(Constants.SECURITY_MANAGER); + resetCommon(); } // reset(XMLComponentManager) + void resetCommon() { + // initialize vars + fMarkupDepth = 0; + fCurrentElement = null; + fElementStack.clear(); + fHasExternalDTD = false; + fStandaloneSet = false; + fStandalone = false; + fInScanContent = false; + //skipping algorithm + fShouldSkip = false; + fAdd = false; + fSkip = false; + + fEntityStore = fEntityManager.getEntityStore(); + dtdGrammarUtil = null; + + if (fSecurityManager != null) { + fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); + fElementAttributeLimit = fSecurityManager.getLimit(XMLSecurityManager.Limit.ELEMENT_ATTRIBUTE_LIMIT); + } else { + fLimitAnalyzer = null; + fElementAttributeLimit = 0; + } + } + /** * Returns a list of feature identifiers that are recognized by * this component. This method may return null if no features @@ -1322,10 +1316,11 @@ public class XMLDocumentFragmentScannerImpl fAddDefaultAttr = true; do { scanAttribute(fAttributes); - if (fSecurityManager != null && fAttributes.getLength() > fElementAttributeLimit){ + if (fSecurityManager != null && !fSecurityManager.isNoLimit(fElementAttributeLimit) && + fAttributes.getLength() > fElementAttributeLimit){ fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, "ElementAttributeLimit", - new Object[]{rawname, new Integer(fAttributes.getLength()) }, + new Object[]{rawname, fElementAttributeLimit }, XMLErrorReporter.SEVERITY_FATAL_ERROR ); } @@ -2036,6 +2031,13 @@ public class XMLDocumentFragmentScannerImpl } // getDriverName():String + /** + * Check the protocol used in the systemId against allowed protocols + * + * @param systemId the Id of the URI + * @param allowedProtocols a list of allowed protocols separated by comma + * @return the name of the protocol if rejected, null otherwise + */ String checkAccess(String systemId, String allowedProtocols) throws IOException { String baseSystemId = fEntityScanner.getBaseSystemId(); String expandedSystemId = fEntityManager.expandSystemId(systemId, baseSystemId,fStrictURI); @@ -2833,6 +2835,8 @@ public class XMLDocumentFragmentScannerImpl if(DEBUG){ System.out.println("NOT USING THE BUFFER, STRING = " + fTempString.toString()); } + //check limit before returning event + checkLimit(fContentBuffer); if(dtdGrammarUtil!= null && dtdGrammarUtil.isIgnorableWhiteSpace(fContentBuffer)){ if(DEBUG)System.out.println("Return SPACE EVENT"); return XMLEvent.SPACE; @@ -2931,6 +2935,8 @@ public class XMLDocumentFragmentScannerImpl fLastSectionWasCharacterData = true ; continue; }else{ + //check limit before returning event + checkLimit(fContentBuffer); if(dtdGrammarUtil!= null && dtdGrammarUtil.isIgnorableWhiteSpace(fContentBuffer)){ if(DEBUG)System.out.println("Return SPACE EVENT"); return XMLEvent.SPACE; @@ -3141,6 +3147,30 @@ public class XMLDocumentFragmentScannerImpl } //while loop }//next + /** + * Add the count of the content buffer and check if the accumulated + * value exceeds the limit + * @param buffer content buffer + */ + protected void checkLimit(XMLStringBuffer buffer) { + if (fLimitAnalyzer.isTracking(fCurrentEntityName)) { + fLimitAnalyzer.addValue(Limit.GENEAL_ENTITY_SIZE_LIMIT, fCurrentEntityName, buffer.length); + if (fSecurityManager.isOverLimit(Limit.GENEAL_ENTITY_SIZE_LIMIT)) { + fSecurityManager.debugPrint(); + reportFatalError("MaxEntitySizeLimit", new Object[]{fCurrentEntityName, + fLimitAnalyzer.getValue(Limit.GENEAL_ENTITY_SIZE_LIMIT), + fSecurityManager.getLimit(Limit.GENEAL_ENTITY_SIZE_LIMIT), + fSecurityManager.getStateLiteral(Limit.GENEAL_ENTITY_SIZE_LIMIT)}); + } + if (fSecurityManager.isOverLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT)) { + fSecurityManager.debugPrint(); + reportFatalError("TotalEntitySizeLimit", + new Object[]{fLimitAnalyzer.getTotalValue(Limit.TOTAL_ENTITY_SIZE_LIMIT), + fSecurityManager.getLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT), + fSecurityManager.getStateLiteral(Limit.TOTAL_ENTITY_SIZE_LIMIT)}); + } + } + } // // Protected methods diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java index da902908dce..59f3aa00e2d 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java @@ -28,9 +28,10 @@ import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler; import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager; import com.sun.org.apache.xerces.internal.util.*; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.URI; import com.sun.org.apache.xerces.internal.utils.SecuritySupport; +import com.sun.org.apache.xerces.internal.utils.XMLLimitAnalyzer; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; @@ -174,7 +175,6 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { /** access external dtd: file protocol */ static final String EXTERNAL_ACCESS_DEFAULT = Constants.EXTERNAL_ACCESS_DEFAULT; - // recognized features and properties /** Recognized features. */ @@ -307,6 +307,7 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { /** used to restrict external access */ protected String fAccessExternalDTD = EXTERNAL_ACCESS_DEFAULT; + // settings /** @@ -324,9 +325,12 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { */ protected int fBufferSize = DEFAULT_BUFFER_SIZE; - // stores defaults for entity expansion limit if it has - // been set on the configuration. - protected SecurityManager fSecurityManager = null; + /** Security Manager */ + protected XMLSecurityManager fSecurityManager = null; + + protected XMLLimitAnalyzer fLimitAnalyzer = null; + + protected int entityExpansionIndex; /** * True if the document entity is standalone. This should really @@ -352,10 +356,6 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { /** XML 1.1 entity scanner. */ protected XMLEntityScanner fXML11EntityScanner; - /** entity expansion limit (contains useful data if and only if - fSecurityManager is non-null) */ - protected int fEntityExpansionLimit = 0; - /** count of entities expanded: */ protected int fEntityExpansionCount = 0; @@ -833,6 +833,9 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { fCurrentEntity.setEncodingExternallySpecified(encodingExternallySpecified); fEntityScanner.setCurrentEntity(fCurrentEntity); fResourceIdentifier.setValues(publicId, literalSystemId, baseSystemId, expandedSystemId); + if (fLimitAnalyzer != null) { + fLimitAnalyzer.startEntity(name); + } return encoding; } //setupCurrentEntity(String, XMLInputSource, boolean, boolean): String @@ -1294,10 +1297,13 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { //expansions exceeds the entity expansion limit, parser will throw fatal error. // Note that this represents the nesting level of open entities. fEntityExpansionCount++; - if( fSecurityManager != null && fEntityExpansionCount > fEntityExpansionLimit ){ - fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, - "EntityExpansionLimitExceeded", - new Object[]{new Integer(fEntityExpansionLimit) }, + if(fLimitAnalyzer != null) { + fLimitAnalyzer.addValue(entityExpansionIndex, name, 1); + } + if( fSecurityManager != null && fSecurityManager.isOverLimit(entityExpansionIndex)){ + fSecurityManager.debugPrint(); + fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,"EntityExpansionLimitExceeded", + new Object[]{fSecurityManager.getLimitValueByIndex(entityExpansionIndex)}, XMLErrorReporter.SEVERITY_FATAL_ERROR ); // is there anything better to do than reset the counter? // at least one can envision debugging applications where this might @@ -1361,6 +1367,12 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { if(fCurrentEntity != null){ //close the reader try{ + if (fLimitAnalyzer != null) { + fLimitAnalyzer.endEntity(XMLSecurityManager.Limit.GENEAL_ENTITY_SIZE_LIMIT, fCurrentEntity.name); + if (fCurrentEntity.name.equals("[xml]")) { + fSecurityManager.debugPrint(); + } + } fCurrentEntity.close(); }catch(IOException ex){ throw new XNIException(ex); @@ -1426,6 +1438,9 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager) propertyManager.getProperty(XML_SECURITY_PROPERTY_MANAGER); fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD); + fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(SECURITY_MANAGER); + fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); + // initialize state //fStandalone = false; fEntities.clear(); @@ -1485,7 +1500,9 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { fEntityResolver = (XMLEntityResolver)componentManager.getProperty(ENTITY_RESOLVER, null); fStaxEntityResolver = (StaxEntityResolverWrapper)componentManager.getProperty(STAX_ENTITY_RESOLVER, null); fValidationManager = (ValidationManager)componentManager.getProperty(VALIDATION_MANAGER, null); - fSecurityManager = (SecurityManager)componentManager.getProperty(SECURITY_MANAGER, null); + fSecurityManager = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER, null); + fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); + entityExpansionIndex = fSecurityManager.getIndex(Constants.JDK_ENTITY_EXPANSION_LIMIT); // JAXP 1.5 feature XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager) componentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER, null); @@ -1506,7 +1523,6 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { // a class acting as a component manager but not // implementing that interface for whatever reason. public void reset() { - fEntityExpansionLimit = (fSecurityManager != null)?fSecurityManager.getEntityExpansionLimit():0; // initialize state fStandalone = false; @@ -1642,8 +1658,8 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { } if (suffixLength == Constants.SECURITY_MANAGER_PROPERTY.length() && propertyId.endsWith(Constants.SECURITY_MANAGER_PROPERTY)) { - fSecurityManager = (SecurityManager)value; - fEntityExpansionLimit = (fSecurityManager != null)?fSecurityManager.getEntityExpansionLimit():0; + fSecurityManager = (XMLSecurityManager)value; + fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); } } @@ -1652,9 +1668,8 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { { XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)value; fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD); + } } - } - /** * Returns a list of property identifiers that are recognized by * this component. This method may return null if no properties diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java index b0461eb9138..f658d09e175 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java @@ -58,6 +58,7 @@ import javax.xml.stream.events.XMLEvent; * @author Neeraj Bajaj, Sun Microsystems * @author Venugopal Rao K, Sun Microsystems * @author Elena Litani, IBM + * @version $Id: XMLNSDocumentScannerImpl.java,v 1.11 2010-11-01 04:39:41 joehw Exp $ */ public class XMLNSDocumentScannerImpl extends XMLDocumentScannerImpl { @@ -251,10 +252,11 @@ public class XMLNSDocumentScannerImpl do { scanAttribute(fAttributes); - if (fSecurityManager != null && fAttributes.getLength() > fElementAttributeLimit){ + if (fSecurityManager != null && (!fSecurityManager.isNoLimit(fElementAttributeLimit)) && + fAttributes.getLength() > fElementAttributeLimit){ fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, "ElementAttributeLimit", - new Object[]{rawname, new Integer(fAttributes.getLength()) }, + new Object[]{rawname, fElementAttributeLimit }, XMLErrorReporter.SEVERITY_FATAL_ERROR ); } diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java index 0c66aa236fa..70de7869e78 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java @@ -32,6 +32,8 @@ import com.sun.org.apache.xerces.internal.util.SymbolTable; import com.sun.org.apache.xerces.internal.util.XMLChar; import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl; import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; +import com.sun.org.apache.xerces.internal.utils.XMLLimitAnalyzer; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.XMLAttributes; import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; @@ -106,6 +108,9 @@ public abstract class XMLScanner protected static final String ENTITY_MANAGER = Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY; + /** Property identifier: Security manager. */ + private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER; + // debugging /** Debug attribute normalization. */ @@ -159,6 +164,12 @@ public abstract class XMLScanner /** xxx this should be available from EntityManager Entity storage */ protected XMLEntityStorage fEntityStore = null ; + /** Security manager. */ + protected XMLSecurityManager fSecurityManager = null; + + /** Limit analyzer. */ + protected XMLLimitAnalyzer fLimitAnalyzer = null; + // protected data /** event type */ @@ -256,6 +267,7 @@ public abstract class XMLScanner fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE); fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER); fEntityManager = (XMLEntityManager)componentManager.getProperty(ENTITY_MANAGER); + fSecurityManager = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER); //this step is extra because we have separated the storage of entity fEntityStore = fEntityManager.getEntityStore() ; @@ -293,6 +305,10 @@ public abstract class XMLScanner fEntityManager = (XMLEntityManager)value; } } + + if (propertyId.equals(SECURITY_MANAGER)) { + fSecurityManager = (XMLSecurityManager)value; + } /*else if(propertyId.equals(Constants.STAX_PROPERTIES)){ fStaxProperties = (HashMap)value; //TODO::discuss with neeraj what are his thoughts on passing properties. @@ -352,6 +368,8 @@ public abstract class XMLScanner fEntityManager = (XMLEntityManager)propertyManager.getProperty(ENTITY_MANAGER); fEntityStore = fEntityManager.getEntityStore() ; fEntityScanner = (XMLEntityScanner)fEntityManager.getEntityScanner() ; + fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(SECURITY_MANAGER); + //fEntityManager.reset(); // DTD preparsing defaults: fValidation = false; @@ -499,7 +517,7 @@ public abstract class XMLScanner reportFatalError("SDDeclInvalid", new Object[] {standalone}); } } else { - reportFatalError("EncodingDeclRequired", null); + reportFatalError("SDDeclNameInvalid", null); } break; } @@ -510,8 +528,9 @@ public abstract class XMLScanner sawSpace = fEntityScanner.skipSpaces(); } // restore original literal value - if(currLiteral) + if(currLiteral) { currEnt.literal = true; + } // REVISIT: should we remove this error reporting? if (scanningTextDecl && state != STATE_DONE) { reportFatalError("MorePseudoAttributes", null); @@ -564,7 +583,7 @@ public abstract class XMLScanner XMLString value) throws IOException, XNIException { - String name = fEntityScanner.scanName(); + String name = scanPseudoAttributeName(); // XMLEntityManager.print(fEntityManager.getCurrentEntity()); if (name == null) { @@ -616,6 +635,35 @@ public abstract class XMLScanner } // scanPseudoAttribute(XMLString):String + /** + * Scans the name of a pseudo attribute. The only legal names + * in XML 1.0/1.1 documents are 'version', 'encoding' and 'standalone'. + * + * @return the name of the pseudo attribute or null + * if a legal pseudo attribute name could not be scanned. + */ + private String scanPseudoAttributeName() throws IOException, XNIException { + final int ch = fEntityScanner.peekChar(); + switch (ch) { + case 'v': + if (fEntityScanner.skipString(fVersionSymbol)) { + return fVersionSymbol; + } + break; + case 'e': + if (fEntityScanner.skipString(fEncodingSymbol)) { + return fEncodingSymbol; + } + break; + case 's': + if (fEntityScanner.skipString(fStandaloneSymbol)) { + return fStandaloneSymbol; + } + break; + } + return null; + } // scanPseudoAttributeName() + /** * Scans a processing instruction. *

    diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties index 86a927e085c..53c2ae00f51 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties @@ -27,7 +27,7 @@ # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: JAXPValidationMessages_it.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 08:14:02 gmolloy Exp $ +# @version $Id: JAXPValidationMessages_it.properties /st_wptg_1.8.0.0.0jdk/3 2013/09/16 07:02:00 gmolloy Exp $ # Messages for message reporting BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio. @@ -42,7 +42,7 @@ SchemaFactorySourceUnrecognized = Il parametro di origine di tipo ''{0}'' non \u # Validator error messages SourceParameterNull = Il parametro di origine non pu\u00F2 essere nullo. -SourceNotAccepted = Il parametro di origine di tipo ''{0}'' non \u00E8 accettato da questo convalidatore. +SourceNotAccepted = Il parametro di origine di tipo ''{0}'' non \u00E8 accettato da questo validator. SourceResultMismatch = Il parametro di origine di tipo ''{0}'' non \u00E8 compatibile con il parametro dei risultati di tipo ''{1}''. # TypeInfoProvider error messages diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties index 1a5d62af9bb..200b904b105 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties @@ -44,6 +44,7 @@ # 2.9 Standalone Document Declaration SDDeclInvalid = The standalone document declaration value must be \"yes\" or \"no\", not \"{0}\". + SDDeclNameInvalid = The standalone name in XML declaration may be misspelled. # 2.12 Language Identification XMLLangInvalid = The xml:lang attribute value \"{0}\" is an invalid language identifier. # 3. Logical Structures @@ -292,8 +293,10 @@ InvalidCharInLiteral=InvalidCharInLiteral -#Application can set the limit of number of entities that should be expanded by the parser. -EntityExpansionLimitExceeded=The parser has encountered more than \"{0}\" entity expansions in this document; this is the limit imposed by the application. +# Implementation limits + EntityExpansionLimitExceeded=JAXP00010001: The parser has encountered more than \"{0}\" entity expansions in this document; this is the limit imposed by the JDK. + ElementAttributeLimit=JAXP00010002: Element \"{0}\" has more than \"{1}\" attributes, \"{1}\" is the limit imposed by the JDK. + MaxEntitySizeLimit=JAXP00010003: The length of entity \"{0}\" is \"{1}\" that exceeds the \"{2}\" limit set by \"{3}\". + TotalEntitySizeLimit=JAXP00010004: The accumulated size \"{0}\" of entities exceeded the \"{1}\" limit set by \"{2}\". + MaxXMLNameLimit=JAXP00010005: The name \"{0}\" exceeded the \"{1}\" limit set by \"{2}\". -# Application can set the limit of number of attributes of entity that should be expanded by the parser. -ElementAttributeLimit= Element \"{0}\" has more than \"{1}\" attributes, \"{1}\" is the limit imposed by the application. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties index f22a2afa345..2a44dc055c8 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties @@ -286,8 +286,8 @@ # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags ReferenceToExternalEntity = Externe Entit\u00E4tsreferenz "&{0};" ist in einem Attributwert nicht zul\u00E4ssig. - AccessExternalDTD = Externe DTD: Lesen von externer DTD "{0}" nicht erfolgreich, da "{1}"-Zugriff nicht zul\u00E4ssig ist. - AccessExternalEntity = Externe Entity: Lesen von externem Dokument "{0}" nicht erfolgreich, da "{1}"-Zugriff nicht zul\u00E4ssig ist. + AccessExternalDTD = Externe DTD: Lesen von externer DTD "{0}" nicht erfolgreich, da "{1}"-Zugriff wegen der von der Eigenschaft "accessExternalDTD" festgelegten Einschr\u00E4nkung nicht zul\u00E4ssig ist. + AccessExternalEntity = Externe Entit\u00E4t: Lesen des externen Dokuments "{0}" nicht erfolgreich, da "{1}"-Zugriff wegen der von der Eigenschaft "accessExternalDTD" festgelegten Einschr\u00E4nkung nicht zul\u00E4ssig ist. # 4.1 Character and Entity References EntityNotDeclared = Entit\u00E4t "{0}" wurde referenziert aber nicht deklariert. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties index 7864be97e07..860f86218ee 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties @@ -286,8 +286,8 @@ # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags ReferenceToExternalEntity = La referencia de entidad externa "&{0};" no est\u00E1 permitida en un valor de atributo. - AccessExternalDTD = DTD externa: fallo al leer DTD externa ''{0}'' porque el acceso a ''{1}'' no est\u00E1 permitido. - AccessExternalEntity = Entidad externa: fallo al leer el documento externo ''{0}'' porque el acceso a ''{1}'' no est\u00E1 permitido. + AccessExternalDTD = DTD externa: fallo al leer DTD externa ''{0}'' porque el acceso a ''{1}'' no est\u00E1 permitido debido a una restricci\u00F3n que ha definido la propiedad accessExternalDTD. + AccessExternalEntity = Entidad externa: fallo al leer el documento externo ''{0}'' porque el acceso a ''{1}'' no est\u00E1 permitido debido a una restricci\u00F3n que ha definido la propiedad accessExternalDTD. # 4.1 Character and Entity References EntityNotDeclared = Se hizo referencia a la entidad "{0}", pero no se declar\u00F3. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties index 915a6e7b180..a7a2c4cffa8 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties @@ -286,8 +286,8 @@ # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags ReferenceToExternalEntity = La r\u00E9f\u00E9rence d''entit\u00E9 externe "&{0};" n''est pas autoris\u00E9e dans une valeur d''attribut. - AccessExternalDTD = DTD externe : \u00E9chec de la lecture de la DTD externe ''{0}'', car l''acc\u00E8s ''{1}'' n''est pas autoris\u00E9. - AccessExternalEntity = Entit\u00E9 externe : \u00E9chec de la lecture du document externe ''{0}'', car l''acc\u00E8s ''{1}'' n''est pas autoris\u00E9. + AccessExternalDTD = DTD externe : \u00E9chec de la lecture de la DTD externe ''{0}'', car l''acc\u00E8s ''{1}'' n''est pas autoris\u00E9 en raison d''une restriction d\u00E9finie par la propri\u00E9t\u00E9 accessExternalDTD. + AccessExternalEntity = Entit\u00E9 externe : \u00E9chec de la lecture du document externe ''{0}'', car l''acc\u00E8s ''{1}'' n''est pas autoris\u00E9 en raison d''une restriction d\u00E9finie par la propri\u00E9t\u00E9 accessExternalDTD. # 4.1 Character and Entity References EntityNotDeclared = L''entit\u00E9 "{0}" \u00E9tait r\u00E9f\u00E9renc\u00E9e, mais pas d\u00E9clar\u00E9e. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties index 5222b2e51f3..8bf8837ee35 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties @@ -286,8 +286,8 @@ # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags ReferenceToExternalEntity = Il riferimento di entit\u00E0 esterna "&{0};" non \u00E8 consentito in un valore di attributo. - AccessExternalDTD = DTD esterna: lettura della DTD esterna ''{0}'' non riuscita. Accesso ''{1}'' non consentito. - AccessExternalEntity = Entit\u00E0 esterna: lettura del documento esterno ''{0}'' non riuscita. Accesso ''{1}'' non consentito. + AccessExternalDTD = DTD esterna: lettura della DTD esterna ''{0}'' non riuscita. Accesso ''{1}'' non consentito a causa della limitazione definita dalla propriet\u00E0 accessExternalDTD. + AccessExternalEntity = Entit\u00E0 esterna: lettura del documento esterno ''{0}'' non riuscita. Accesso ''{1}'' non consentito a causa della limitazione definita dalla propriet\u00E0 accessExternalDTD. # 4.1 Character and Entity References EntityNotDeclared = L''entit\u00E0 "{0}" \u00E8 indicata da un riferimento, ma non \u00E8 dichiarata. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties index 66ed730953c..567376a2337 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties @@ -286,8 +286,8 @@ # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags ReferenceToExternalEntity = \u5916\u90E8\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167"&{0};"\u306F\u3001\u5C5E\u6027\u5024\u3067\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 - AccessExternalDTD = \u5916\u90E8DTD: ''{1}''\u30A2\u30AF\u30BB\u30B9\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u5916\u90E8DTD ''{0}''\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 - AccessExternalEntity = \u5916\u90E8\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3: ''{1}''\u30A2\u30AF\u30BB\u30B9\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u5916\u90E8\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 + AccessExternalDTD = \u5916\u90E8DTD: accessExternalDTD\u30D7\u30ED\u30D1\u30C6\u30A3\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650\u306B\u3088\u308A''{1}''\u30A2\u30AF\u30BB\u30B9\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u5916\u90E8DTD ''{0}''\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 + AccessExternalEntity = \u5916\u90E8\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3: accessExternalDTD\u30D7\u30ED\u30D1\u30C6\u30A3\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650\u306B\u3088\u308A''{1}''\u30A2\u30AF\u30BB\u30B9\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u5916\u90E8\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 # 4.1 Character and Entity References EntityNotDeclared = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u304C\u53C2\u7167\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties index 0613c417993..b7f18724328 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties @@ -286,8 +286,8 @@ # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags ReferenceToExternalEntity = \uC18D\uC131\uAC12\uC5D0\uC11C\uB294 \uC678\uBD80 \uC5D4\uD2F0\uD2F0 \uCC38\uC870 "&{0};"\uC774 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. - AccessExternalDTD = \uC678\uBD80 DTD: ''{1}'' \uC561\uC138\uC2A4\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC544 \uC678\uBD80 DTD ''{0}'' \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. - AccessExternalEntity = \uC678\uBD80 \uC5D4\uD2F0\uD2F0: ''{1}'' \uC561\uC138\uC2A4\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC544 \uC678\uBD80 \uBB38\uC11C ''{0}'' \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. + AccessExternalDTD = \uC678\uBD80 DTD: accessExternalDTD \uC18D\uC131\uC73C\uB85C \uC124\uC815\uB41C \uC81C\uD55C\uC73C\uB85C \uC778\uD574 ''{1}'' \uC561\uC138\uC2A4\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC73C\uBBC0\uB85C \uC678\uBD80 DTD ''{0}'' \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. + AccessExternalEntity = \uC678\uBD80 \uC5D4\uD2F0\uD2F0: accessExternalDTD \uC18D\uC131\uC73C\uB85C \uC124\uC815\uB41C \uC81C\uD55C\uC73C\uB85C \uC778\uD574 ''{1}'' \uC561\uC138\uC2A4\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC73C\uBBC0\uB85C \uC678\uBD80 \uBB38\uC11C ''{0}'' \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. # 4.1 Character and Entity References EntityNotDeclared = "{0}" \uC5D4\uD2F0\uD2F0\uAC00 \uCC38\uC870\uB418\uC5C8\uC9C0\uB9CC \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties index 6bf2f30654e..f76f8636ecd 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties @@ -286,8 +286,8 @@ # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags ReferenceToExternalEntity = A refer\u00EAncia da entidade externa "&{0};" n\u00E3o \u00E9 permitida em um valor do atributo. - AccessExternalDTD = DTD Externo: falha ao ler o DTD ''{0}'' externo porque o acesso a ''{1}'' n\u00E3o \u00E9 permitido. - AccessExternalEntity = Entidade Externa: falha ao ler o documento ''{0}'' externo porque o acesso a ''{1}'' n\u00E3o \u00E9 permitido. + AccessExternalDTD = DTD Externo: falha ao ler o DTD ''{0}'' externo porque o acesso a ''{1}'' n\u00E3o \u00E9 permitido em decorr\u00EAncia de uma restri\u00E7\u00E3o definida pela propriedade accessExternalDTD. + AccessExternalEntity = Entidade Externa: falha ao ler o documento ''{0}'' externo porque o acesso a ''{1}'' n\u00E3o \u00E9 permitido em decorr\u00EAncia de uma restri\u00E7\u00E3o definida pela propriedade accessExternalDTD. # 4.1 Character and Entity References EntityNotDeclared = A entidade "{0}" foi referenciada, mas n\u00E3o declarada. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties index 4502150a6e4..2aa0899ff79 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties @@ -286,8 +286,8 @@ # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags ReferenceToExternalEntity = Den externa enhetsreferensen "&{0};" till\u00E5ts inte i ett attributv\u00E4rde. - AccessExternalDTD = Extern DTD: Kunde inte l\u00E4sa extern DTD ''{0}'', eftersom ''{1}'' \u00E5tkomst inte till\u00E5ts. - AccessExternalEntity = Extern enhet: Kunde inte l\u00E4sa externt dokument ''{0}'', eftersom ''{1}'' \u00E5tkomst inte till\u00E5ts. + AccessExternalDTD = Extern DTD: Kunde inte l\u00E4sa extern DTD ''{0}'', eftersom ''{1}'' \u00E5tkomst inte till\u00E5ts p\u00E5 grund av begr\u00E4nsning som anges av accessExternalDTD-egenskapen. + AccessExternalEntity = Extern enhet: Kunde inte l\u00E4sa externt dokument ''{0}'', eftersom ''{1}'' \u00E5tkomst inte till\u00E5ts p\u00E5 grund av begr\u00E4nsning som anges av accessExternalDTD-egenskapen. # 4.1 Character and Entity References EntityNotDeclared = Enheten "{0}" har refererats, men \u00E4r inte deklarerad. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties index d327fe3f3eb..3bbcd1c084e 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties @@ -286,8 +286,8 @@ # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags ReferenceToExternalEntity = \u5C5E\u6027\u503C\u4E2D\u4E0D\u5141\u8BB8\u91C7\u7528\u5916\u90E8\u5B9E\u4F53\u5F15\u7528 "&{0};"\u3002 - AccessExternalDTD = \u5916\u90E8 DTD: \u65E0\u6CD5\u8BFB\u53D6\u5916\u90E8 DTD ''{0}'', \u56E0\u4E3A\u4E0D\u5141\u8BB8 ''{1}'' \u8BBF\u95EE\u3002 - AccessExternalEntity = \u5916\u90E8\u5B9E\u4F53: \u65E0\u6CD5\u8BFB\u53D6\u5916\u90E8\u6587\u6863 ''{0}'', \u56E0\u4E3A\u4E0D\u5141\u8BB8 ''{1}'' \u8BBF\u95EE\u3002 + AccessExternalDTD = \u5916\u90E8 DTD: \u65E0\u6CD5\u8BFB\u53D6\u5916\u90E8 DTD ''{0}'', \u56E0\u4E3A accessExternalDTD \u5C5E\u6027\u8BBE\u7F6E\u7684\u9650\u5236\u5BFC\u81F4\u4E0D\u5141\u8BB8 ''{1}'' \u8BBF\u95EE\u3002 + AccessExternalEntity = \u5916\u90E8\u5B9E\u4F53: \u65E0\u6CD5\u8BFB\u53D6\u5916\u90E8\u6587\u6863 ''{0}'', \u56E0\u4E3A accessExternalDTD \u5C5E\u6027\u8BBE\u7F6E\u7684\u9650\u5236\u5BFC\u81F4\u4E0D\u5141\u8BB8 ''{1}'' \u8BBF\u95EE\u3002 # 4.1 Character and Entity References EntityNotDeclared = \u5F15\u7528\u4E86\u5B9E\u4F53 "{0}", \u4F46\u672A\u58F0\u660E\u5B83\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties index 0b2be0cda71..3ddcf4dcf3f 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties @@ -286,8 +286,8 @@ # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags ReferenceToExternalEntity = \u5C6C\u6027\u503C\u4E0D\u5141\u8A31\u53C3\u7167\u5916\u90E8\u5BE6\u9AD4 "&{0};"\u3002 - AccessExternalDTD = \u5916\u90E8 DTD: \u7121\u6CD5\u8B80\u53D6\u5916\u90E8 DTD ''{0}''\uFF0C\u56E0\u70BA\u4E0D\u5141\u8A31 ''{1}'' \u5B58\u53D6\u3002 - AccessExternalEntity = \u5916\u90E8\u5BE6\u9AD4: \u7121\u6CD5\u8B80\u53D6\u5916\u90E8\u6587\u4EF6 ''{0}''\uFF0C\u56E0\u70BA\u4E0D\u5141\u8A31 ''{1}'' \u5B58\u53D6\u3002 + AccessExternalDTD = \u5916\u90E8 DTD: \u7121\u6CD5\u8B80\u53D6\u5916\u90E8 DTD ''{0}''\uFF0C\u56E0\u70BA accessExternalDTD \u5C6C\u6027\u8A2D\u5B9A\u7684\u9650\u5236\uFF0C\u6240\u4EE5\u4E0D\u5141\u8A31 ''{1}'' \u5B58\u53D6\u3002 + AccessExternalEntity = \u5916\u90E8\u5BE6\u9AD4: \u7121\u6CD5\u8B80\u53D6\u5916\u90E8\u6587\u4EF6 ''{0}''\uFF0C\u56E0\u70BA accessExternalDTD \u5C6C\u6027\u8A2D\u5B9A\u7684\u9650\u5236\uFF0C\u6240\u4EE5\u4E0D\u5141\u8A31 ''{1}'' \u5B58\u53D6\u3002 # 4.1 Character and Entity References EntityNotDeclared = \u53C3\u7167\u4E86\u5BE6\u9AD4 "{0}"\uFF0C\u4F46\u662F\u672A\u5BA3\u544A\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties index b591da69fdf..5f55b5563b8 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties @@ -26,7 +26,7 @@ # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_de.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:16:51 gmolloy Exp $ +# @version $Id: XMLSchemaMessages_de.properties /st_wptg_1.8.0.0.0jdk/3 2013/09/16 04:56:10 gmolloy Exp $ BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden. FormatFailed = Beim Formatieren der folgenden Meldung ist ein interner Fehler aufgetreten:\n @@ -111,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: Lesen von Schema-Dokument "{0}" nicht erfolgreich, da "{1}"-Zugriff nicht zul\u00E4ssig ist. + schema_reference.access = schema_reference: Schemadokument "{0}" konnte nicht gelesen werden, weil der "{1}"-Zugriff wegen der von der Eigenschaft accessExternalSchema festgelegten Einschr\u00E4nkung nicht zul\u00E4ssig ist. schema_reference.4 = schema_reference.4: Schemadokument "{0}" konnte nicht gelesen werden, da 1) das Dokument nicht gefunden werden konnte; 2) das Dokument nicht gelesen werden konnte; 3) das Root-Element des Dokuments nicht ist. src-annotation = src-annotation: -Elemente k\u00F6nnen nur - und -Elemente enthalten, aber es wurde "{0}" gefunden. src-attribute.1 = src-attribute.1: Die Eigenschaften "default" und "fixed" k\u00F6nnen nicht beide in der Attributdeklaration "{0}" vorhanden sein. Verwenden Sie nur eine dieser Eigenschaften. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties index dc6d6a24f21..302bdb6a0d3 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties @@ -26,7 +26,7 @@ # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_es.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 05:10:53 gmolloy Exp $ +# @version $Id: XMLSchemaMessages_es.properties /st_wptg_1.8.0.0.0jdk/3 2013/09/16 09:06:34 gmolloy Exp $ BadMessageKey = No se ha encontrado el mensaje de error correspondiente a la clave de mensaje. FormatFailed = Se ha producido un error interno al formatear el siguiente mensaje:\n @@ -111,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: fallo al leer el documento de esquema ''{0}'' porque el acceso a ''{1}'' no est\u00E1 permitido. + schema_reference.access = schema_reference: fallo al leer el documento de esquema ''{0}'' porque no se permite el acceso ''{1}'' debido a una restricci\u00F3n definida por la propiedad accessExternalSchema. schema_reference.4 = schema_reference.4: Fallo al leer el documento de esquema ''{0}'', porque 1) no se ha encontrado el documento; 2) no se ha podido leer el documento; 3) el elemento ra\u00EDz del documento no es . src-annotation = src-annotation: Los elementos de s\u00F3lo pueden contener elementos de y , pero se ha encontrado ''{0}''. src-attribute.1 = src-attribute.1: Las propiedades ''default'' y ''fixed'' no pueden estar presentes de forma simult\u00E1nea en la declaraci\u00F3n de atributo ''{0}''. Utilice s\u00F3lo una de ellas. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties index 46f840f4746..33d3a7635f3 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties @@ -26,7 +26,7 @@ # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_fr.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 02:16:52 gmolloy Exp $ +# @version $Id: XMLSchemaMessages_fr.properties /st_wptg_1.8.0.0.0jdk/3 2013/09/16 07:05:15 gmolloy Exp $ BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable. FormatFailed = Une erreur interne est survenue lors du formatage du message suivant :\n @@ -88,8 +88,8 @@ cvc-elt.4.3 = cvc-elt.4.3 : La d\u00E9rivation du type ''{1}'' \u00E0 partir de la d\u00E9finition de type ''{2}'' de l''\u00E9l\u00E9ment "{0}" n''est pas valide. cvc-elt.5.1.1 = cvc-elt.5.1.1 : L''attribut ''{''value constraint''}'' ''{2}'' de l''\u00E9l\u00E9ment ''{0}'' n''est pas une valeur par d\u00E9faut valide pour le type ''{1}''. cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1 : L''\u00E9l\u00E9ment ''{0}'' ne doit comporter aucun enfant ([children]) de type \u00E9l\u00E9ment d''information. - cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1 : La valeur ''{1}'' de l''\u00E9l\u00E9ment ''{0}'' ne concorde pas avec la valeur ''{2}'' de l''attribut ''{''value constraint''}'' fixe. - cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2 : La valeur ''{1}'' de l''\u00E9l\u00E9ment ''{0}'' ne concorde pas avec la valeur ''{2}'' de l''attribut ''{''value constraint''}''. + cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1 : La valeur ''{1}'' de l''\u00E9l\u00E9ment ''{0}'' ne concorde pas avec la valeur de l''attribut ''{''value constraint''}'' fixe ''{2}''. + cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2 : La valeur ''{1}'' de l''\u00E9l\u00E9ment ''{0}'' ne concorde pas avec la valeur de l''attribut ''{''value constraint''}'' ''{2}''. cvc-enumeration-valid = cvc-enumeration-valid : La valeur ''{0}'' n''est pas un facet valide par rapport \u00E0 l''\u00E9num\u00E9ration ''{1}''. Il doit s''agir d''une valeur provenant de l''\u00E9num\u00E9ration. cvc-fractionDigits-valid = cvc-fractionDigits-valid : La valeur ''{0}'' poss\u00E8de {1} chiffres apr\u00E8s la virgule, mais le nombre de chiffres apr\u00E8s la virgule ne doit pas d\u00E9passer {2}. cvc-id.1 = cvc-id.1 : Aucune liaison ID/IDREF pour l''IDREF ''{0}''. @@ -111,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference : \u00E9chec de la lecture du document de sch\u00E9ma ''{0}'', car l''acc\u00E8s ''{1}'' n''est pas autoris\u00E9. + schema_reference.access = schema_reference : \u00E9chec de la lecture du document de sch\u00E9ma ''{0}'', car l''acc\u00E8s ''{1}'' n''est pas autoris\u00E9 en raison d''une restriction d\u00E9finie par la propri\u00E9t\u00E9 accessExternalSchema. schema_reference.4 = schema_reference.4 : Echec de la lecture du document de sch\u00E9ma ''{0}'' pour les raisons suivantes : 1) Le document est introuvable ; 2) Le document n''a pas pu \u00EAtre lu ; 3) L''\u00E9l\u00E9ment racine du document n''est pas . src-annotation = src-annotation : Les \u00E9l\u00E9ments ne peuvent contenir que des \u00E9l\u00E9ments et , mais ''{0}'' a \u00E9t\u00E9 trouv\u00E9. src-attribute.1 = src-attribute.1 : Les propri\u00E9t\u00E9s ''default'' et ''fixed'' ne peuvent pas figurer simultan\u00E9ment dans la d\u00E9claration d''attribut ''{0}''. Utilisez uniquement l''une d''entre elles. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties index 7f4caa83e71..10743380fac 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties @@ -26,7 +26,7 @@ # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_it.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 08:14:02 gmolloy Exp $ +# @version $Id: XMLSchemaMessages_it.properties /st_wptg_1.8.0.0.0jdk/3 2013/09/16 07:02:00 gmolloy Exp $ BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio. FormatFailed = Si \u00E8 verificato un errore interno durante la formattazione del seguente messaggio:\n @@ -111,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: lettura del documento di schema ''{0}'' non riuscita. Accesso ''{1}'' non consentito. + schema_reference.access = schema_reference: lettura del documento di schema ''{0}'' non riuscita. Accesso ''{1}'' non consentito a causa della limitazione definita dalla propriet\u00E0 accessExternalSchema. schema_reference.4 = schema_reference.4: lettura del documento di schema "{0}" non riuscita perch\u00E9 1) non \u00E8 stato possibile trovare il documento; 2) non \u00E8 stato possibile leggere il documento; 3) l''elemento radice del documento non \u00E8 . src-annotation = src-annotation: possono essere contenuti soltanto elementi e , ma \u00E8 stato trovato ''{0}''. src-attribute.1 = src-attribute.1: le propriet\u00E0 ''default'' e ''fixed'' non possono essere entrambi presenti nella dichiarazione di attributo ''{0}''. Utilizzarne solo una. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties index 063f82c7597..d8567e3d949 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties @@ -26,7 +26,7 @@ # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_ja.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 01:05:12 gmolloy Exp $ +# @version $Id: XMLSchemaMessages_ja.properties /st_wptg_1.8.0.0.0jdk/3 2013/09/12 17:39:58 gmolloy Exp $ BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 FormatFailed = \u6B21\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u66F8\u5F0F\u8A2D\u5B9A\u4E2D\u306B\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:\n @@ -111,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: ''{1}''\u30A2\u30AF\u30BB\u30B9\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u30B9\u30AD\u30FC\u30DE\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 + schema_reference.access = schema_reference: accessExternalSchema\u30D7\u30ED\u30D1\u30C6\u30A3\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u5236\u9650\u306B\u3088\u308A''{1}''\u30A2\u30AF\u30BB\u30B9\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u30B9\u30AD\u30FC\u30DE\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 schema_reference.4 = schema_reference.4: 1)\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u304C\u898B\u3064\u304B\u3089\u306A\u304B\u3063\u305F\u30012)\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u8AAD\u307F\u53D6\u308C\u306A\u304B\u3063\u305F\u30013)\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30EB\u30FC\u30C8\u8981\u7D20\u304C\u3067\u306F\u306A\u304B\u3063\u305F\u305F\u3081\u3001\u30B9\u30AD\u30FC\u30DE\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 src-annotation = src-annotation: \u8981\u7D20\u306B\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u306E\u306F\u8981\u7D20\u304A\u3088\u3073\u8981\u7D20\u306E\u307F\u3067\u3059\u304C\u3001''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002 src-attribute.1 = src-attribute.1: ''default''\u3068''fixed''\u306E\u4E21\u65B9\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u5C5E\u6027\u5BA3\u8A00''{0}''\u306B\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002\u3044\u305A\u308C\u304B\u4E00\u65B9\u306E\u307F\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties index 2a21d78161f..77a2806e3f4 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties @@ -26,7 +26,7 @@ # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_ko.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 02:40:33 gmolloy Exp $ +# @version $Id: XMLSchemaMessages_ko.properties /st_wptg_1.8.0.0.0jdk/3 2013/09/16 02:31:34 gmolloy Exp $ BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. FormatFailed = \uB2E4\uC74C \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB294 \uC911 \uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\n @@ -111,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: ''{1}'' \uC561\uC138\uC2A4\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC544 \uC2A4\uD0A4\uB9C8 \uBB38\uC11C ''{0}'' \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. + schema_reference.access = schema_reference: accessExternalSchema \uC18D\uC131\uC73C\uB85C \uC124\uC815\uB41C \uC81C\uD55C\uC73C\uB85C \uC778\uD574 ''{1}'' \uC561\uC138\uC2A4\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC73C\uBBC0\uB85C \uC2A4\uD0A4\uB9C8 \uBB38\uC11C ''{0}'' \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. schema_reference.4 = schema_reference.4: \uC2A4\uD0A4\uB9C8 \uBB38\uC11C ''{0}'' \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC6D0\uC778: 1) \uBB38\uC11C\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. 2) \uBB38\uC11C\uB97C \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. 3) \uBB38\uC11C\uC758 \uB8E8\uD2B8 \uC694\uC18C\uAC00 \uAC00 \uC544\uB2D9\uB2C8\uB2E4. src-annotation = src-annotation: \uC694\uC18C\uC5D0\uB294 \uBC0F \uC694\uC18C\uB9CC \uD3EC\uD568\uB420 \uC218 \uC788\uC9C0\uB9CC ''{0}''\uC774(\uAC00) \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. src-attribute.1 = src-attribute.1: ''default'' \uBC0F ''fixed'' \uC18D\uC131\uC740 \uC18D\uC131 \uC120\uC5B8 ''{0}''\uC5D0 \uD568\uAED8 \uC874\uC7AC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uD558\uB098\uB9CC \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties index 8e0eec53908..5e3e2880b14 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties @@ -26,7 +26,7 @@ # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_pt_BR.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 07:33:06 gmolloy Exp $ +# @version $Id: XMLSchemaMessages_pt_BR.properties /st_wptg_1.8.0.0.0jdk/3 2013/09/11 12:46:54 gmolloy Exp $ BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem. FormatFailed = Ocorreu um erro interno ao formatar a mensagem a seguir:\n @@ -111,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: falha ao ler o documento ''{0}'' do esquema porque o acesso a ''{1}'' n\u00E3o \u00E9 permitido. + schema_reference.access = schema_reference: falha ao ler o documento de esquema ''{0}'' porque o acesso a ''{1}'' n\u00E3o \u00E9 permitido em decorr\u00EAncia de uma restri\u00E7\u00E3o definida pela propriedade accessExternalSchema. schema_reference.4 = schema_reference.4: Falha ao ler o documento do esquema ''{0}'' porque 1) n\u00E3o foi poss\u00EDvel encontrar o documento; 2) n\u00E3o foi poss\u00EDvel ler o documento; 3) o elemento-raiz do documento n\u00E3o \u00E9 . src-annotation = src-annotation: os elementos de podem conter somente os elementos e , mas foi encontrado ''{0}''. src-attribute.1 = src-attribute.1: As propriedades ''default'' e ''fixed'' n\u00E3o podem estar presentes na declara\u00E7\u00E3o do atributo ''{0}''. Use somente uma delas. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties index f29bfa177be..f14d85b8a2a 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties @@ -26,7 +26,7 @@ # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_sv.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 00:46:23 gmolloy Exp $ +# @version $Id: XMLSchemaMessages_sv.properties /st_wptg_1.8.0.0.0jdk/3 2013/09/16 06:50:58 gmolloy Exp $ BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln. FormatFailed = Ett internt fel intr\u00E4ffade vid formatering av f\u00F6ljande meddelande:\n @@ -111,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: Kunde inte l\u00E4sa schemadokument ''{0}'', eftersom ''{1}'' \u00E5tkomst inte till\u00E5ts. + schema_reference.access = schema_reference: Kunde inte l\u00E4sa schemadokumentet ''{0}'' eftersom ''{1}''-\u00E5tkomst inte till\u00E5ts p\u00E5 grund av begr\u00E4nsning som anges av egenskapen accessExternalSchema. schema_reference.4 = schema_reference.4: L\u00E4sning av schemadokument ''{0}'' utf\u00F6rdes inte p\u00E5 grund av 1) det g\u00E5r inte att hitta dokumentet; 2) det g\u00E5r inte att l\u00E4sa dokumentet; 3) dokumentets rotelement \u00E4r inte . src-annotation = src-annotation: element f\u00F6r f\u00E5r endast inneh\u00E5lla element f\u00F6r och , men ''{0}'' hittades. src-attribute.1 = src-attribute.1: B\u00E5da egenskaperna ''default'' och ''fixed'' kan inte samtidigt ing\u00E5 i attributdeklarationen ''{0}''. Anv\u00E4nd en av dem. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties index 2fdc0884edc..0f423232ec7 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties @@ -26,7 +26,7 @@ # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_zh_CN.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:19:32 gmolloy Exp $ +# @version $Id: XMLSchemaMessages_zh_CN.properties /st_wptg_1.8.0.0.0jdk/3 2013/09/16 04:44:25 gmolloy Exp $ BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002 FormatFailed = \u8BBE\u7F6E\u4EE5\u4E0B\u6D88\u606F\u7684\u683C\u5F0F\u65F6\u51FA\u73B0\u5185\u90E8\u9519\u8BEF:\n @@ -111,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: \u65E0\u6CD5\u8BFB\u53D6\u65B9\u6848\u6587\u6863 ''{0}'', \u56E0\u4E3A\u4E0D\u5141\u8BB8 ''{1}'' \u8BBF\u95EE\u3002 + schema_reference.access = schema_reference: \u7531\u4E8E accessExternalSchema \u5C5E\u6027\u8BBE\u7F6E\u7684\u9650\u5236\u800C\u4E0D\u5141\u8BB8 ''{1}'' \u8BBF\u95EE, \u56E0\u6B64\u65E0\u6CD5\u8BFB\u53D6\u65B9\u6848\u6587\u6863 ''{0}''\u3002 schema_reference.4 = schema_reference.4: \u65E0\u6CD5\u8BFB\u53D6\u65B9\u6848\u6587\u6863 ''{0}'', \u539F\u56E0\u4E3A 1) \u65E0\u6CD5\u627E\u5230\u6587\u6863; 2) \u65E0\u6CD5\u8BFB\u53D6\u6587\u6863; 3) \u6587\u6863\u7684\u6839\u5143\u7D20\u4E0D\u662F \u3002 src-annotation = src-annotation: \u5143\u7D20\u53EA\u80FD\u5305\u542B \u548C \u5143\u7D20, \u4F46\u53D1\u73B0\u4E86 ''{0}''\u3002 src-attribute.1 = src-attribute.1: \u5C5E\u6027\u58F0\u660E ''{0}'' \u4E2D\u4E0D\u80FD\u540C\u65F6\u5B58\u5728\u7279\u6027 ''default'' \u548C ''fixed''\u3002\u5E94\u53EA\u4F7F\u7528\u5176\u4E2D\u4E00\u4E2A\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties index 8600e688583..0efb3c491f7 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties @@ -26,7 +26,7 @@ # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_zh_TW.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 00:30:48 gmolloy Exp $ +# @version $Id: XMLSchemaMessages_zh_TW.properties /st_wptg_1.8.0.0.0jdk/3 2013/09/14 02:16:34 gmolloy Exp $ BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002 FormatFailed = \u683C\u5F0F\u5316\u4E0B\u5217\u8A0A\u606F\u6642\u767C\u751F\u5167\u90E8\u932F\u8AA4:\n @@ -111,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: \u7121\u6CD5\u8B80\u53D6\u7DB1\u8981\u6587\u4EF6 ''{0}''\uFF0C\u56E0\u70BA\u4E0D\u5141\u8A31 ''{1}'' \u5B58\u53D6\u3002 + schema_reference.access = schema_reference: \u7121\u6CD5\u8B80\u53D6\u7DB1\u8981\u6587\u4EF6 ''{0}''\uFF0C\u56E0\u70BA accessExternalSchema \u5C6C\u6027\u8A2D\u5B9A\u7684\u9650\u5236\uFF0C\u6240\u4EE5\u4E0D\u5141\u8A31 ''{1}'' \u5B58\u53D6\u3002 schema_reference.4 = schema_reference.4: \u7121\u6CD5\u8B80\u53D6\u7DB1\u8981\u6587\u4EF6 ''{0}''\uFF0C\u56E0\u70BA 1) \u627E\u4E0D\u5230\u6587\u4EF6; 2) \u7121\u6CD5\u8B80\u53D6\u6587\u4EF6; 3) \u6587\u4EF6\u7684\u6839\u5143\u7D20\u4E0D\u662F \u3002 src-annotation = src-annotation: \u5143\u7D20\u50C5\u80FD\u5305\u542B \u8207 \u5143\u7D20\uFF0C\u4F46\u627E\u5230 ''{0}''\u3002 src-attribute.1 = src-attribute.1: \u5C6C\u6027 ''default'' \u8207 ''fixed'' \u4E0D\u53EF\u540C\u6642\u51FA\u73FE\u5728\u5C6C\u6027\u5BA3\u544A ''{0}'' \u4E2D\u3002\u8ACB\u53EA\u4F7F\u7528\u5176\u4E2D\u4E00\u500B\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java index 90d6491d568..eb652a89441 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java @@ -1422,7 +1422,7 @@ public class XPath { } ch = data.charAt(currentOffset); } while (ch == ' ' || ch == 0x0A || ch == 0x09 || ch == 0x0D); - if (currentOffset == endOffset || ch == '|') { + if (currentOffset == endOffset || ch == '|' || ch == '/') { addToken(tokens, XPath.Tokens.EXPRTOKEN_PERIOD); starIsMultiplyOperator = true; break; diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java index d1831661f88..6aa06b8828d 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java @@ -21,13 +21,13 @@ package com.sun.org.apache.xerces.internal.impl.xs.models; -import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter; -import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager; -import com.sun.org.apache.xerces.internal.util.SecurityManager ; -import com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode; -import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; -import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter; import com.sun.org.apache.xerces.internal.impl.Constants; +import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter; +import com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode; +import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; +import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager; +import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; /** * @@ -68,7 +68,7 @@ public class CMNodeFactory { // stores defaults for different security holes (maxOccurLimit in current context) if it has // been set on the configuration. - private SecurityManager fSecurityManager = null; + private XMLSecurityManager fSecurityManager = null; /** default constructor */ public CMNodeFactory() { @@ -77,10 +77,10 @@ public class CMNodeFactory { public void reset(XMLComponentManager componentManager){ fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER); try { - fSecurityManager = (SecurityManager)componentManager.getProperty(SECURITY_MANAGER); + fSecurityManager = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER); //we are setting the limit of number of nodes to 3times the maxOccur value.. if(fSecurityManager != null){ - maxNodeLimit = fSecurityManager.getMaxOccurNodeLimit() * MULTIPLICITY ; + maxNodeLimit = fSecurityManager.getLimit(XMLSecurityManager.Limit.MAX_OCCUR_NODE_LIMIT) * MULTIPLICITY ; } } catch (XMLConfigurationException e) { @@ -109,7 +109,8 @@ public class CMNodeFactory { } public void nodeCountCheck(){ - if( fSecurityManager != null && nodeCount++ > maxNodeLimit){ + if( fSecurityManager != null && !fSecurityManager.isNoLimit(maxNodeLimit) && + nodeCount++ > maxNodeLimit){ if(DEBUG){ System.out.println("nodeCount = " + nodeCount ) ; System.out.println("nodeLimit = " + maxNodeLimit ) ; @@ -150,8 +151,9 @@ public class CMNodeFactory { if (suffixLength == Constants.SECURITY_MANAGER_PROPERTY.length() && propertyId.endsWith(Constants.SECURITY_MANAGER_PROPERTY)) { - fSecurityManager = (SecurityManager)value; - maxNodeLimit = (fSecurityManager != null) ? fSecurityManager.getMaxOccurNodeLimit() * MULTIPLICITY : 0 ; + fSecurityManager = (XMLSecurityManager)value; + maxNodeLimit = (fSecurityManager != null) ? + fSecurityManager.getLimit(XMLSecurityManager.Limit.MAX_OCCUR_NODE_LIMIT) * MULTIPLICITY : 0 ; return; } if (suffixLength == Constants.ERROR_REPORTER_PROPERTY.length() && diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java index 3744692c33d..f9eea6a4dc4 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java @@ -40,6 +40,7 @@ import com.sun.org.apache.xerces.internal.util.DOMUtil; import com.sun.org.apache.xerces.internal.util.SymbolTable; import com.sun.org.apache.xerces.internal.util.XMLChar; import com.sun.org.apache.xerces.internal.util.XMLSymbols; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.QName; import com.sun.org.apache.xerces.internal.xs.XSConstants; import java.util.HashMap; @@ -1194,8 +1195,8 @@ public class XSAttributeChecker { if (!optimize) { //Revisit :: IMO this is not right place to check // maxOccurNodeLimit. - int maxOccurNodeLimit = fSchemaHandler.fSecureProcessing.getMaxOccurNodeLimit(); - if (max > maxOccurNodeLimit) { + int maxOccurNodeLimit = fSchemaHandler.fSecureProcessing.getLimit(XMLSecurityManager.Limit.MAX_OCCUR_NODE_LIMIT); + if (max > maxOccurNodeLimit && !fSchemaHandler.fSecureProcessing.isNoLimit(maxOccurNodeLimit)) { reportSchemaFatalError("maxOccurLimit", new Object[] {new Integer(maxOccurNodeLimit)}, element); // reset max values in case processing continues on error diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java index d947cf8815d..d6a6e948f65 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java @@ -70,7 +70,6 @@ import com.sun.org.apache.xerces.internal.util.DOMUtil; import com.sun.org.apache.xerces.internal.util.DefaultErrorHandler; import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper; import com.sun.org.apache.xerces.internal.util.SAXInputSource; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.StAXInputSource; import com.sun.org.apache.xerces.internal.util.StAXLocationWrapper; import com.sun.org.apache.xerces.internal.util.SymbolHash; @@ -79,6 +78,7 @@ import com.sun.org.apache.xerces.internal.util.XMLSymbols; import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException; import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.QName; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.grammars.Grammar; @@ -257,7 +257,7 @@ public class XSDHandler { * *

    Protected to allow access by any traverser.

    */ - protected SecurityManager fSecureProcessing = null; + protected XMLSecurityManager fSecureProcessing = null; private String fAccessExternalSchema; private String fAccessExternalDTD; @@ -3509,7 +3509,7 @@ public class XSDHandler { fSecureProcessing = null; if( componentManager!=null ) { - fSecureProcessing = (SecurityManager) componentManager.getProperty(SECURE_PROCESSING, null); + fSecureProcessing = (XMLSecurityManager) componentManager.getProperty(SECURE_PROCESSING, null); } //set entity resolver diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java index 00bc0bbfab0..0c8d0a84db2 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java @@ -20,6 +20,8 @@ package com.sun.org.apache.xerces.internal.jaxp; +import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; +import java.util.Locale; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.helpers.DefaultHandler; @@ -30,6 +32,11 @@ import org.xml.sax.helpers.DefaultHandler; class DefaultValidationErrorHandler extends DefaultHandler { static private int ERROR_COUNT_LIMIT = 10; private int errorCount = 0; + private Locale locale = Locale.getDefault(); + + public DefaultValidationErrorHandler(Locale locale) { + this.locale = locale; + } // XXX Fix message i18n public void error(SAXParseException e) throws SAXException { @@ -38,11 +45,8 @@ class DefaultValidationErrorHandler extends DefaultHandler { return; } else if (errorCount == 0) { // Print a warning before the first error - System.err.println("Warning: validation was turned on but an org.xml.sax.ErrorHandler was not"); - System.err.println("set, which is probably not what is desired. Parser will use a default"); - System.err.println("ErrorHandler to print the first " + - ERROR_COUNT_LIMIT + " errors. Please call"); - System.err.println("the 'setErrorHandler' method to fix this."); + System.err.println(SAXMessageFormatter.formatMessage(locale, + "errorHandlerNotSet", new Object [] {errorCount})); } String systemId = e.getSystemId(); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java index 0c90afec1f8..51f22d713b1 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java @@ -36,7 +36,7 @@ import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager; import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator; import com.sun.org.apache.xerces.internal.jaxp.validation.XSGrammarPoolContainer; import com.sun.org.apache.xerces.internal.parsers.DOMParser; -import com.sun.org.apache.xerces.internal.util.SecurityManager; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager.Property; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager.State; @@ -46,7 +46,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager; import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource; import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; -import javax.xml.XMLConstants; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; import org.xml.sax.EntityResolver; @@ -125,6 +124,7 @@ public class DocumentBuilderImpl extends DocumentBuilder /** Initial EntityResolver */ private final EntityResolver fInitEntityResolver; + private XMLSecurityManager fSecurityManager; private XMLSecurityPropertyManager fSecurityPropertyMgr; DocumentBuilderImpl(DocumentBuilderFactoryImpl dbf, Hashtable dbfAttrs, Hashtable features) @@ -141,7 +141,7 @@ public class DocumentBuilderImpl extends DocumentBuilder // validation errors with a warning telling the user to set an // ErrorHandler if (dbf.isValidating()) { - fInitErrorHandler = new DefaultValidationErrorHandler(); + fInitErrorHandler = new DefaultValidationErrorHandler(domParser.getXMLParserConfiguration().getLocale()); setErrorHandler(fInitErrorHandler); } else { @@ -173,10 +173,10 @@ public class DocumentBuilderImpl extends DocumentBuilder fSecurityPropertyMgr = new XMLSecurityPropertyManager(); domParser.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); - // If the secure processing feature is on set a security manager. - if (secureProcessing) { - domParser.setProperty(SECURITY_MANAGER, new SecurityManager()); + fSecurityManager = new XMLSecurityManager(secureProcessing); + domParser.setProperty(SECURITY_MANAGER, fSecurityManager); + if (secureProcessing) { /** * If secure processing is explicitly set on the factory, the * access properties will be set unless the corresponding @@ -250,9 +250,9 @@ public class DocumentBuilderImpl extends DocumentBuilder String feature = (String) entry.getKey(); boolean value = ((Boolean) entry.getValue()).booleanValue(); domParser.setFeature(feature, value); - } } } + } /** * Set any DocumentBuilderFactory attributes of our underlying DOMParser @@ -303,14 +303,17 @@ public class DocumentBuilderImpl extends DocumentBuilder } } } else { - int index = fSecurityPropertyMgr.getIndex(name); - if (index > -1) { - fSecurityPropertyMgr.setValue(index, - XMLSecurityPropertyManager.State.APIPROPERTY, (String)val); - } else { - // Let Xerces code handle the property - domParser.setProperty(name, val); - } + //check if the property is managed by security manager + if (fSecurityManager == null || + !fSecurityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, val)) { + //check if the property is managed by security property manager + if (fSecurityPropertyMgr == null || + !fSecurityPropertyMgr.setValue(name, XMLSecurityPropertyManager.State.APIPROPERTY, val)) { + //fall back to the existing property manager + domParser.setProperty(name, val); + } + } + } } } diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java index 3a6d38f551b..6cc3e9a4678 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java @@ -20,22 +20,13 @@ package com.sun.org.apache.xerces.internal.jaxp; -import java.io.IOException; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Map; - -import javax.xml.XMLConstants; -import javax.xml.validation.Schema; - import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager; import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator; import com.sun.org.apache.xerces.internal.jaxp.validation.XSGrammarPoolContainer; import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.Status; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler; import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent; @@ -46,6 +37,14 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; import com.sun.org.apache.xerces.internal.xs.AttributePSVI; import com.sun.org.apache.xerces.internal.xs.ElementPSVI; import com.sun.org.apache.xerces.internal.xs.PSVIProvider; +import java.io.IOException; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.Locale; +import java.util.Map; +import javax.xml.XMLConstants; +import javax.xml.validation.Schema; import org.xml.sax.EntityResolver; import org.xml.sax.ErrorHandler; import org.xml.sax.HandlerBase; @@ -112,6 +111,7 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser /** Initial EntityResolver */ private final EntityResolver fInitEntityResolver; + private final XMLSecurityManager fSecurityManager; private final XMLSecurityPropertyManager fSecurityPropertyMgr; /** @@ -130,10 +130,10 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser SAXParserImpl(SAXParserFactoryImpl spf, Hashtable features, boolean secureProcessing) throws SAXException { + fSecurityManager = new XMLSecurityManager(secureProcessing); fSecurityPropertyMgr = new XMLSecurityPropertyManager(); - // Instantiate a SAXParser directly and not through SAX so that we use the right ClassLoader - xmlReader = new JAXPSAXParser(this, fSecurityPropertyMgr); + xmlReader = new JAXPSAXParser(this, fSecurityPropertyMgr, fSecurityManager); // JAXP "namespaceAware" == SAX Namespaces feature // Note: there is a compatibility problem here with default values: @@ -154,9 +154,9 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser xmlReader.setProperty0(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); - // If the secure processing feature is on set a security manager. + xmlReader.setProperty0(SECURITY_MANAGER, fSecurityManager); + if (secureProcessing) { - xmlReader.setProperty0(SECURITY_MANAGER, new SecurityManager()); /** * By default, secure processing is set, no external access is allowed. * However, we need to check if it is actively set on the factory since we @@ -164,6 +164,7 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser * the default value */ if (features != null) { + Object temp = features.get(XMLConstants.FEATURE_SECURE_PROCESSING); if (temp != null) { boolean value = ((Boolean) temp).booleanValue(); @@ -185,7 +186,7 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser // validation errors with a warning telling the user to set an // ErrorHandler. if (spf.isValidating()) { - fInitErrorHandler = new DefaultValidationErrorHandler(); + fInitErrorHandler = new DefaultValidationErrorHandler(xmlReader.getLocale()); xmlReader.setErrorHandler(fInitErrorHandler); } else { @@ -398,28 +399,42 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser private final HashMap fInitFeatures = new HashMap(); private final HashMap fInitProperties = new HashMap(); private final SAXParserImpl fSAXParser; + private XMLSecurityManager fSecurityManager; private XMLSecurityPropertyManager fSecurityPropertyMgr; public JAXPSAXParser() { - this(null, null); + this(null, null, null); } - JAXPSAXParser(SAXParserImpl saxParser, XMLSecurityPropertyManager spm) { + JAXPSAXParser(SAXParserImpl saxParser, XMLSecurityPropertyManager securityPropertyMgr, + XMLSecurityManager securityManager) { super(); fSAXParser = saxParser; - fSecurityPropertyMgr = spm; - + fSecurityManager = securityManager; + fSecurityPropertyMgr = securityPropertyMgr; /** * This class may be used directly. So initialize the security manager if * it is null. */ + if (fSecurityManager == null) { + fSecurityManager = new XMLSecurityManager(true); + try { + super.setProperty(SECURITY_MANAGER, fSecurityManager); + } catch (SAXException e) { + throw new UnsupportedOperationException( + SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), + "property-not-recognized", new Object [] {SECURITY_MANAGER}), e); + } + } if (fSecurityPropertyMgr == null) { fSecurityPropertyMgr = new XMLSecurityPropertyManager(); try { super.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); - } catch (Exception ex) { - //shall not happen + } catch (SAXException e) { + throw new UnsupportedOperationException( + SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), + "property-not-recognized", new Object [] {SECURITY_MANAGER}), e); } } } @@ -437,7 +452,8 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser } if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { try { - setProperty(SECURITY_MANAGER, value ? new SecurityManager() : null); + fSecurityManager.setSecureProcessing(value); + setProperty(SECURITY_MANAGER, fSecurityManager); } catch (SAXNotRecognizedException exc) { // If the property is not supported @@ -473,13 +489,7 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser throw new NullPointerException(); } if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { - try { - return (super.getProperty(SECURITY_MANAGER) != null); - } - // If the property is not supported the value must be false. - catch (SAXException exc) { - return false; - } + return fSecurityManager.isSecureProcessing(); } return super.getFeature(name); } @@ -558,17 +568,21 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser if (fSAXParser != null && fSAXParser.fSchemaValidator != null) { setSchemaValidatorProperty(name, value); } - /** Check to see if the property is managed by the property manager **/ - int index = (fSecurityPropertyMgr != null) ? fSecurityPropertyMgr.getIndex(name) : -1; - if (index > -1) { - fSecurityPropertyMgr.setValue(index, - XMLSecurityPropertyManager.State.APIPROPERTY, (String)value); - } else { - if (!fInitProperties.containsKey(name)) { - fInitProperties.put(name, super.getProperty(name)); + + //check if the property is managed by security manager + if (fSecurityManager == null || + !fSecurityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, value)) { + //check if the property is managed by security property manager + if (fSecurityPropertyMgr == null || + !fSecurityPropertyMgr.setValue(name, XMLSecurityPropertyManager.State.APIPROPERTY, value)) { + //fall back to the existing property manager + if (!fInitProperties.containsKey(name)) { + fInitProperties.put(name, super.getProperty(name)); + } + super.setProperty(name, value); } - super.setProperty(name, value); } + } public synchronized Object getProperty(String name) @@ -581,9 +595,18 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser // JAXP 1.2 support return fSAXParser.schemaLanguage; } - int index = (fSecurityPropertyMgr != null) ? fSecurityPropertyMgr.getIndex(name) : -1; - if (index > -1) { - return fSecurityPropertyMgr.getValueByIndex(index); + + /** Check to see if the property is managed by the security manager **/ + String propertyValue = (fSecurityManager != null) ? + fSecurityManager.getLimitAsString(name) : null; + if (propertyValue != null) { + return propertyValue; + } else { + propertyValue = (fSecurityPropertyMgr != null) ? + fSecurityPropertyMgr.getValue(name) : null; + if (propertyValue != null) { + return propertyValue; + } } return super.getProperty(name); @@ -662,6 +685,10 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser return super.getProperty(name); } + Locale getLocale() { + return fConfiguration.getLocale(); + } + private void setSchemaValidatorFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { try { diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StAXValidatorHelper.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StAXValidatorHelper.java index f398e037d18..5af27e26fc1 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StAXValidatorHelper.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StAXValidatorHelper.java @@ -26,6 +26,7 @@ package com.sun.org.apache.xerces.internal.jaxp.validation; import com.sun.org.apache.xerces.internal.impl.Constants; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import java.io.IOException; import javax.xml.transform.Result; @@ -73,6 +74,19 @@ public final class StAXValidatorHelper implements ValidatorHelper { SAXTransformerFactory tf = fComponentManager.getFeature(Constants.ORACLE_FEATURE_SERVICE_MECHANISM) ? (SAXTransformerFactory)SAXTransformerFactory.newInstance() : (SAXTransformerFactory) TransformerFactory.newInstance(DEFAULT_TRANSFORMER_IMPL, StAXValidatorHelper.class.getClassLoader()); + XMLSecurityManager securityManager = (XMLSecurityManager)fComponentManager.getProperty(Constants.SECURITY_MANAGER); + if (securityManager != null) { + for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) { + if (securityManager.isSet(limit.ordinal())){ + tf.setAttribute(limit.apiProperty(), + securityManager.getLimitValueAsString(limit)); + } + } + if (securityManager.printEntityCountInfo()) { + tf.setAttribute(Constants.JDK_ENTITY_COUNT_INFO, "yes"); + } + } + identityTransformer1 = tf.newTransformer(); identityTransformer2 = tf.newTransformerHandler(); } catch (TransformerConfigurationException e) { diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java index c3f1b674134..d6c04fd984a 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java @@ -20,28 +20,27 @@ package com.sun.org.apache.xerces.internal.jaxp.validation; -import java.lang.ref.SoftReference; -import java.io.IOException; - -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.sax.SAXTransformerFactory; -import javax.xml.transform.sax.TransformerHandler; -import javax.xml.transform.stream.StreamSource; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.TransformerFactoryConfigurationError; -import javax.xml.XMLConstants; - import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter; import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; import com.sun.org.apache.xerces.internal.parsers.XML11Configuration; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException; import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; +import java.io.IOException; +import java.lang.ref.SoftReference; +import javax.xml.XMLConstants; +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.TransformerFactoryConfigurationError; +import javax.xml.transform.sax.SAXTransformerFactory; +import javax.xml.transform.sax.TransformerHandler; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; import org.xml.sax.SAXException; /** @@ -86,6 +85,11 @@ final class StreamValidatorHelper implements ValidatorHelper { Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY; private static final String DEFAULT_TRANSFORMER_IMPL = "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl"; + + /** Property id: security manager. */ + private static final String SECURITY_MANAGER = + Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY; + // // Data // @@ -165,6 +169,9 @@ final class StreamValidatorHelper implements ValidatorHelper { private XMLParserConfiguration initialize() { XML11Configuration config = new XML11Configuration(); + if (fComponentManager.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) { + config.setProperty(SECURITY_MANAGER, new XMLSecurityManager()); + } config.setProperty(ENTITY_RESOLVER, fComponentManager.getProperty(ENTITY_RESOLVER)); config.setProperty(ERROR_HANDLER, fComponentManager.getProperty(ERROR_HANDLER)); XMLErrorReporter errorReporter = (XMLErrorReporter) fComponentManager.getProperty(ERROR_REPORTER); @@ -182,6 +189,8 @@ final class StreamValidatorHelper implements ValidatorHelper { config.setDTDContentModelHandler(null); config.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, fComponentManager.getProperty(Constants.XML_SECURITY_PROPERTY_MANAGER)); + config.setProperty(Constants.SECURITY_MANAGER, + fComponentManager.getProperty(Constants.SECURITY_MANAGER)); fConfiguration = new SoftReference(config); return config; } diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java index 8add5d26441..fc652af221a 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java @@ -49,11 +49,11 @@ import com.sun.org.apache.xerces.internal.util.SAXLocatorWrapper; import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; import com.sun.org.apache.xerces.internal.util.Status; import com.sun.org.apache.xerces.internal.util.SymbolTable; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.URI; import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl; import com.sun.org.apache.xerces.internal.util.XMLSymbols; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.NamespaceContext; import com.sun.org.apache.xerces.internal.xni.QName; @@ -679,10 +679,12 @@ final class ValidatorHandlerImpl extends ValidatorHandler implements SAXParserFactory.newInstance() : new SAXParserFactoryImpl(); spf.setNamespaceAware(true); try { + spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, + fComponentManager.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)); reader = spf.newSAXParser().getXMLReader(); // If this is a Xerces SAX parser, set the security manager if there is one if (reader instanceof com.sun.org.apache.xerces.internal.parsers.SAXParser) { - SecurityManager securityManager = (SecurityManager) fComponentManager.getProperty(SECURITY_MANAGER); + XMLSecurityManager securityManager = (XMLSecurityManager) fComponentManager.getProperty(SECURITY_MANAGER); if (securityManager != null) { try { reader.setProperty(SECURITY_MANAGER, securityManager); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java index a19088d9a67..f2dadd0fc4a 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java @@ -41,10 +41,10 @@ import com.sun.org.apache.xerces.internal.util.DOMInputSource; import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper; import com.sun.org.apache.xerces.internal.util.SAXInputSource; import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.StAXInputSource; import com.sun.org.apache.xerces.internal.util.Status; import com.sun.org.apache.xerces.internal.util.XMLGrammarPoolImpl; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.grammars.Grammar; @@ -79,7 +79,7 @@ public final class XMLSchemaFactory extends SchemaFactory { private static final String XMLGRAMMAR_POOL = Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY; - /** Property identifier: SecurityManager. */ + /** Property identifier: XMLSecurityManager. */ private static final String SECURITY_MANAGER = Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY; @@ -108,7 +108,7 @@ public final class XMLSchemaFactory extends SchemaFactory { private ErrorHandlerWrapper fErrorHandlerWrapper; /** The SecurityManager. */ - private SecurityManager fSecurityManager; + private XMLSecurityManager fSecurityManager; /** The Security property manager. */ private XMLSecurityPropertyManager fSecurityPropertyMgr; @@ -141,7 +141,7 @@ public final class XMLSchemaFactory extends SchemaFactory { fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper); // Enable secure processing feature by default - fSecurityManager = new SecurityManager(); + fSecurityManager = new XMLSecurityManager(true); fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager); fSecurityPropertyMgr = new XMLSecurityPropertyManager(); @@ -301,7 +301,7 @@ public final class XMLSchemaFactory extends SchemaFactory { "FeatureNameNull", null)); } if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { - return (fSecurityManager != null); + return (fSecurityManager != null && fSecurityManager.isSecureProcessing()); } try { return fXMLSchemaLoader.getFeature(name); @@ -365,17 +365,15 @@ public final class XMLSchemaFactory extends SchemaFactory { SAXMessageFormatter.formatMessage(null, "jaxp-secureprocessing-feature", null)); } - if (value) { - fSecurityManager = new SecurityManager(); + fSecurityManager.setSecureProcessing(value); + if (value) { if (Constants.IS_JDK8_OR_ABOVE) { fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD, XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP); fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA, XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP); } - } else { - fSecurityManager = null; } fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager); @@ -410,9 +408,17 @@ public final class XMLSchemaFactory extends SchemaFactory { "ProperyNameNull", null)); } if (name.equals(SECURITY_MANAGER)) { - fSecurityManager = (SecurityManager) object; + fSecurityManager = XMLSecurityManager.convert(object, fSecurityManager); fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager); return; + } else if (name.equals(Constants.XML_SECURITY_PROPERTY_MANAGER)) { + if (object == null) { + fSecurityPropertyMgr = new XMLSecurityPropertyManager(); + } else { + fSecurityPropertyMgr = (XMLSecurityPropertyManager)object; + } + fXMLSchemaLoader.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); + return; } else if (name.equals(XMLGRAMMAR_POOL)) { throw new SAXNotSupportedException( @@ -420,12 +426,15 @@ public final class XMLSchemaFactory extends SchemaFactory { "property-not-supported", new Object [] {name})); } try { - int index = fSecurityPropertyMgr.getIndex(name); - if (index > -1) { - fSecurityPropertyMgr.setValue(index, - XMLSecurityPropertyManager.State.APIPROPERTY, (String)object); - } else { - fXMLSchemaLoader.setProperty(name, object); + //check if the property is managed by security manager + if (fSecurityManager == null || + !fSecurityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, object)) { + //check if the property is managed by security property manager + if (fSecurityPropertyMgr == null || + !fSecurityPropertyMgr.setValue(name, XMLSecurityPropertyManager.State.APIPROPERTY, object)) { + //fall back to the existing property manager + fXMLSchemaLoader.setProperty(name, object); + } } } catch (XMLConfigurationException e) { diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java index 74e30daec1d..dcbbabd4d4a 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java @@ -39,10 +39,10 @@ import com.sun.org.apache.xerces.internal.util.FeatureState; import com.sun.org.apache.xerces.internal.util.NamespaceSupport; import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings; import com.sun.org.apache.xerces.internal.util.PropertyState; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.Status; import com.sun.org.apache.xerces.internal.util.SymbolTable; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.NamespaceContext; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent; @@ -181,7 +181,7 @@ final class XMLSchemaValidatorComponentManager extends ParserConfigurationSettin private final HashMap fInitProperties = new HashMap(); /** Stores the initial security manager. */ - private final SecurityManager fInitSecurityManager; + private XMLSecurityManager fInitSecurityManager; /** Stores the initial security property manager. */ private final XMLSecurityPropertyManager fSecurityPropertyMgr; @@ -221,12 +221,6 @@ final class XMLSchemaValidatorComponentManager extends ParserConfigurationSettin fComponents.put(ENTITY_RESOLVER, null); fComponents.put(ERROR_HANDLER, null); - if (System.getSecurityManager() != null) { - _isSecureMode = true; - setProperty(SECURITY_MANAGER, new SecurityManager()); - } else { - fComponents.put(SECURITY_MANAGER, null); - } fComponents.put(SYMBOL_TABLE, new SymbolTable()); // setup grammar pool @@ -241,15 +235,21 @@ final class XMLSchemaValidatorComponentManager extends ParserConfigurationSettin addRecognizedParamsAndSetDefaults(fErrorReporter, grammarContainer); addRecognizedParamsAndSetDefaults(fSchemaValidator, grammarContainer); - // if the secure processing feature is set to true, add a security manager to the configuration - Boolean secureProcessing = grammarContainer.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING); - if (Boolean.TRUE.equals(secureProcessing)) { - fInitSecurityManager = new SecurityManager(); + boolean secureProcessing = grammarContainer.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING); + if (System.getSecurityManager() != null) { + _isSecureMode = true; + secureProcessing = true; } - else { - fInitSecurityManager = null; + + fInitSecurityManager = (XMLSecurityManager) + grammarContainer.getProperty(SECURITY_MANAGER); + if (fInitSecurityManager != null ) { + fInitSecurityManager.setSecureProcessing(secureProcessing); + } else { + fInitSecurityManager = new XMLSecurityManager(secureProcessing); } - fComponents.put(SECURITY_MANAGER, fInitSecurityManager); + + setProperty(SECURITY_MANAGER, fInitSecurityManager); //pass on properties set on SchemaFactory fSecurityPropertyMgr = (XMLSecurityPropertyManager) @@ -281,7 +281,7 @@ final class XMLSchemaValidatorComponentManager extends ParserConfigurationSettin return FeatureState.is(fUseGrammarPoolOnly); } else if (XMLConstants.FEATURE_SECURE_PROCESSING.equals(featureId)) { - return FeatureState.is(getProperty(SECURITY_MANAGER) != null); + return FeatureState.is(fInitSecurityManager.isSecureProcessing()); } else if (SCHEMA_ELEMENT_DEFAULT.equals(featureId)) { return FeatureState.is(true); //pre-condition: VALIDATION and SCHEMA_VALIDATION are always true @@ -311,7 +311,9 @@ final class XMLSchemaValidatorComponentManager extends ParserConfigurationSettin if (_isSecureMode && !value) { throw new XMLConfigurationException(Status.NOT_ALLOWED, XMLConstants.FEATURE_SECURE_PROCESSING); } - setProperty(SECURITY_MANAGER, value ? new SecurityManager() : null); + + fInitSecurityManager.setSecureProcessing(value); + setProperty(SECURITY_MANAGER, fInitSecurityManager); if (value && Constants.IS_JDK8_OR_ABOVE) { fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD, @@ -390,10 +392,19 @@ final class XMLSchemaValidatorComponentManager extends ParserConfigurationSettin fComponents.put(propertyId, value); return; } - if (!fInitProperties.containsKey(propertyId)) { - fInitProperties.put(propertyId, super.getProperty(propertyId)); + //check if the property is managed by security manager + if (fInitSecurityManager == null || + !fInitSecurityManager.setLimit(propertyId, XMLSecurityManager.State.APIPROPERTY, value)) { + //check if the property is managed by security property manager + if (fSecurityPropertyMgr == null || + !fSecurityPropertyMgr.setValue(propertyId, XMLSecurityPropertyManager.State.APIPROPERTY, value)) { + //fall back to the existing property manager + if (!fInitProperties.containsKey(propertyId)) { + fInitProperties.put(propertyId, super.getProperty(propertyId)); + } + super.setProperty(propertyId, value); + } } - super.setProperty(propertyId, value); } /** diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java index 726f31e76b5..eea7057417b 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java @@ -20,18 +20,15 @@ package com.sun.org.apache.xerces.internal.parsers; -import java.io.IOException; -import java.util.Locale; - import com.sun.org.apache.xerces.internal.impl.Constants; -import com.sun.org.apache.xerces.internal.util.Status; -import com.sun.org.apache.xerces.internal.xs.PSVIProvider; -import com.sun.org.apache.xerces.internal.util.EntityResolverWrapper; import com.sun.org.apache.xerces.internal.util.EntityResolver2Wrapper; +import com.sun.org.apache.xerces.internal.util.EntityResolverWrapper; import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper; import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; +import com.sun.org.apache.xerces.internal.util.Status; import com.sun.org.apache.xerces.internal.util.SymbolHash; import com.sun.org.apache.xerces.internal.util.XMLSymbols; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.NamespaceContext; import com.sun.org.apache.xerces.internal.xni.QName; @@ -48,15 +45,17 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException; import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; import com.sun.org.apache.xerces.internal.xs.AttributePSVI; import com.sun.org.apache.xerces.internal.xs.ElementPSVI; +import com.sun.org.apache.xerces.internal.xs.PSVIProvider; +import java.io.IOException; +import java.util.Locale; +import javax.xml.XMLConstants; import org.xml.sax.AttributeList; -import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; import org.xml.sax.DTDHandler; import org.xml.sax.DocumentHandler; import org.xml.sax.EntityResolver; import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; -import org.xml.sax.Locator; import org.xml.sax.Parser; import org.xml.sax.SAXException; import org.xml.sax.SAXNotRecognizedException; @@ -131,6 +130,10 @@ public abstract class AbstractSAXParser protected static final String DOM_NODE = Constants.SAX_PROPERTY_PREFIX + Constants.DOM_NODE_PROPERTY; + /** Property id: security manager. */ + private static final String SECURITY_MANAGER = + Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY; + /** Recognized properties. */ private static final String[] RECOGNIZED_PROPERTIES = { LEXICAL_HANDLER, @@ -1645,19 +1648,13 @@ public abstract class AbstractSAXParser // Drop through and perform default processing // } - - // - // Xerces Features - // - - /* - else if (featureId.startsWith(XERCES_FEATURES_PREFIX)) { - String feature = featureId.substring(XERCES_FEATURES_PREFIX.length()); - // - // Drop through and perform default processing - // + else if (featureId.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { + if (state) { + if (fConfiguration.getProperty(SECURITY_MANAGER )==null) { + fConfiguration.setProperty(SECURITY_MANAGER, new XMLSecurityManager()); + } + } } - */ // // Default handling diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java index f681fadbd33..f2020efda4b 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java @@ -29,6 +29,7 @@ import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper; import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; import com.sun.org.apache.xerces.internal.util.Status; import com.sun.org.apache.xerces.internal.util.SymbolTable; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; @@ -531,7 +532,54 @@ public class DOMParser */ public void setProperty(String propertyId, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { + /** + * It's possible for users to set a security manager through the interface. + * If it's the old SecurityManager, convert it to the new XMLSecurityManager + */ + if (propertyId.equals(Constants.SECURITY_MANAGER)) { + securityManager = XMLSecurityManager.convert(value, securityManager); + setProperty0(Constants.SECURITY_MANAGER, securityManager); + return; + } + if (propertyId.equals(Constants.XML_SECURITY_PROPERTY_MANAGER)) { + if (value == null) { + securityPropertyManager = new XMLSecurityPropertyManager(); + } else { + securityPropertyManager = (XMLSecurityPropertyManager)value; + } + setProperty0(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); + return; + } + if (securityManager == null) { + securityManager = new XMLSecurityManager(true); + setProperty0(Constants.SECURITY_MANAGER, securityManager); + } + + if (securityPropertyManager == null) { + securityPropertyManager = new XMLSecurityPropertyManager(); + setProperty0(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); + } + int index = securityPropertyManager.getIndex(propertyId); + + if (index > -1) { + /** + * this is a direct call to this parser, not a subclass since + * internally the support of this property is done through + * XMLSecurityPropertyManager + */ + securityPropertyManager.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value); + } else { + //check if the property is managed by security manager + if (!securityManager.setLimit(propertyId, XMLSecurityManager.State.APIPROPERTY, value)) { + //fall back to the default configuration to handle the property + setProperty0(propertyId, value); + } + } + } + + public void setProperty0(String propertyId, Object value) + throws SAXNotRecognizedException, SAXNotSupportedException { try { fConfiguration.setProperty(propertyId, value); } diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java index c63ae43923e..0f37f7c375e 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java @@ -185,9 +185,12 @@ public class DTDConfiguration protected static final String LOCALE = Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY; - /** Property identifier: Security property manager. */ - protected static final String XML_SECURITY_PROPERTY_MANAGER = - Constants.XML_SECURITY_PROPERTY_MANAGER; + /** Property identifier: Security property manager. */ + protected static final String XML_SECURITY_PROPERTY_MANAGER = + Constants.XML_SECURITY_PROPERTY_MANAGER; + + /** Property identifier: Security manager. */ + private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER; // debugging @@ -334,6 +337,7 @@ public class DTDConfiguration JAXP_SCHEMA_SOURCE, JAXP_SCHEMA_LANGUAGE, LOCALE, + SECURITY_MANAGER, XML_SECURITY_PROPERTY_MANAGER }; addRecognizedProperties(recognizedProperties); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java index 481eda6f21e..469780136cd 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java @@ -158,9 +158,12 @@ public class NonValidatingConfiguration protected static final String LOCALE = Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY; - /** Property identifier: Security property manager. */ - protected static final String XML_SECURITY_PROPERTY_MANAGER = - Constants.XML_SECURITY_PROPERTY_MANAGER; + /** Property identifier: Security property manager. */ + protected static final String XML_SECURITY_PROPERTY_MANAGER = + Constants.XML_SECURITY_PROPERTY_MANAGER; + + /** Property identifier: Security manager. */ + private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER; // debugging @@ -316,6 +319,7 @@ public class NonValidatingConfiguration DATATYPE_VALIDATOR_FACTORY, VALIDATION_MANAGER, LOCALE, + SECURITY_MANAGER, XML_SECURITY_PROPERTY_MANAGER }; addRecognizedProperties(recognizedProperties); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java index 1ba84aff710..48b8a1ed538 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java @@ -22,6 +22,7 @@ package com.sun.org.apache.xerces.internal.parsers; import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.util.SymbolTable; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; @@ -76,7 +77,7 @@ public class SAXParser XMLGRAMMAR_POOL, }; - XMLSecurityPropertyManager securityPropertyManager; + // // Constructors // @@ -130,11 +131,36 @@ public class SAXParser */ public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { + /** + * It's possible for users to set a security manager through the interface. + * If it's the old SecurityManager, convert it to the new XMLSecurityManager + */ + if (name.equals(Constants.SECURITY_MANAGER)) { + securityManager = XMLSecurityManager.convert(value, securityManager); + super.setProperty(Constants.SECURITY_MANAGER, securityManager); + return; + } + if (name.equals(Constants.XML_SECURITY_PROPERTY_MANAGER)) { + if (value == null) { + securityPropertyManager = new XMLSecurityPropertyManager(); + } else { + securityPropertyManager = (XMLSecurityPropertyManager)value; + } + super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); + return; + } + + if (securityManager == null) { + securityManager = new XMLSecurityManager(true); + super.setProperty(Constants.SECURITY_MANAGER, securityManager); + } + if (securityPropertyManager == null) { securityPropertyManager = new XMLSecurityPropertyManager(); + super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); } - int index = securityPropertyManager.getIndex(name); + int index = securityPropertyManager.getIndex(name); if (index > -1) { /** * this is a direct call to this parser, not a subclass since @@ -142,9 +168,12 @@ public class SAXParser * XMLSecurityPropertyManager */ securityPropertyManager.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value); - super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); } else { - super.setProperty(name, value); + //check if the property is managed by security manager + if (!securityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, value)) { + //fall back to the default configuration to handle the property + super.setProperty(name, value); + } } } } // class SAXParser diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java index df32bfa41d9..65c85d164ca 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java @@ -23,8 +23,8 @@ package com.sun.org.apache.xerces.internal.parsers; import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.SymbolTable; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; /** * This configuration allows Xerces to behave in a security-conscious manner; that is, @@ -44,6 +44,7 @@ import com.sun.org.apache.xerces.internal.util.SymbolTable; * * @author Neil Graham, IBM * + * @version $Id: SecurityConfiguration.java,v 1.6 2010-11-01 04:40:09 joehw Exp $ */ public class SecurityConfiguration extends XIncludeAwareParserConfiguration { @@ -107,7 +108,7 @@ public class SecurityConfiguration extends XIncludeAwareParserConfiguration super(symbolTable, grammarPool, parentSettings); // create the SecurityManager property: - setProperty(SECURITY_MANAGER_PROPERTY, new SecurityManager()); + setProperty(SECURITY_MANAGER_PROPERTY, new XMLSecurityManager(true)); } // (SymbolTable,XMLGrammarPool) } // class SecurityConfiguration diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java index 993ef6132bd..bbcbceed10e 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java @@ -52,6 +52,7 @@ import com.sun.org.apache.xerces.internal.util.FeatureState; import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings; import com.sun.org.apache.xerces.internal.util.PropertyState; import com.sun.org.apache.xerces.internal.util.SymbolTable; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler; import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler; @@ -279,6 +280,8 @@ public class XML11Configuration extends ParserConfigurationSettings private static final String XML_SECURITY_PROPERTY_MANAGER = Constants.XML_SECURITY_PROPERTY_MANAGER; + /** Property identifier: Security manager. */ + private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER; // debugging @@ -449,26 +452,26 @@ public class XML11Configuration extends ParserConfigurationSettings XMLGrammarPool grammarPool, XMLComponentManager parentSettings) { - super(parentSettings); + super(parentSettings); - // create a vector to hold all the components in use - // XML 1.0 specialized components - fComponents = new ArrayList(); - // XML 1.1 specialized components - fXML11Components = new ArrayList(); - // Common components for XML 1.1. and XML 1.0 - fCommonComponents = new ArrayList(); + // create a vector to hold all the components in use + // XML 1.0 specialized components + fComponents = new ArrayList(); + // XML 1.1 specialized components + fXML11Components = new ArrayList(); + // Common components for XML 1.1. and XML 1.0 + fCommonComponents = new ArrayList(); - // create table for features and properties - fFeatures = new HashMap(); - fProperties = new HashMap(); + // create table for features and properties + fFeatures = new HashMap(); + fProperties = new HashMap(); // add default recognized features final String[] recognizedFeatures = { CONTINUE_AFTER_FATAL_ERROR, LOAD_EXTERNAL_DTD, // from XMLDTDScannerImpl - VALIDATION, - NAMESPACES, + VALIDATION, + NAMESPACES, NORMALIZE_DATA, SCHEMA_ELEMENT_DEFAULT, SCHEMA_AUGMENT_PSVI, GENERATE_SYNTHETIC_ANNOTATIONS, VALIDATE_ANNOTATIONS, HONOUR_ALL_SCHEMALOCATIONS, NAMESPACE_GROWTH, @@ -479,47 +482,47 @@ public class XML11Configuration extends ParserConfigurationSettings // features might not have been set and it would cause a // not-recognized exception to be thrown. -Ac XMLSCHEMA_VALIDATION, XMLSCHEMA_FULL_CHECKING, - EXTERNAL_GENERAL_ENTITIES, - EXTERNAL_PARAMETER_ENTITIES, - PARSER_SETTINGS, - XMLConstants.FEATURE_SECURE_PROCESSING + EXTERNAL_GENERAL_ENTITIES, + EXTERNAL_PARAMETER_ENTITIES, + PARSER_SETTINGS, + XMLConstants.FEATURE_SECURE_PROCESSING }; addRecognizedFeatures(recognizedFeatures); - // set state for default features - fFeatures.put(VALIDATION, Boolean.FALSE); - fFeatures.put(NAMESPACES, Boolean.TRUE); - fFeatures.put(EXTERNAL_GENERAL_ENTITIES, Boolean.TRUE); - fFeatures.put(EXTERNAL_PARAMETER_ENTITIES, Boolean.TRUE); - fFeatures.put(CONTINUE_AFTER_FATAL_ERROR, Boolean.FALSE); - fFeatures.put(LOAD_EXTERNAL_DTD, Boolean.TRUE); - fFeatures.put(SCHEMA_ELEMENT_DEFAULT, Boolean.TRUE); - fFeatures.put(NORMALIZE_DATA, Boolean.TRUE); - fFeatures.put(SCHEMA_AUGMENT_PSVI, Boolean.TRUE); - fFeatures.put(GENERATE_SYNTHETIC_ANNOTATIONS, Boolean.FALSE); - fFeatures.put(VALIDATE_ANNOTATIONS, Boolean.FALSE); - fFeatures.put(HONOUR_ALL_SCHEMALOCATIONS, Boolean.FALSE); - fFeatures.put(NAMESPACE_GROWTH, Boolean.FALSE); - fFeatures.put(TOLERATE_DUPLICATES, Boolean.FALSE); - fFeatures.put(USE_GRAMMAR_POOL_ONLY, Boolean.FALSE); - fFeatures.put(PARSER_SETTINGS, Boolean.TRUE); - fFeatures.put(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); + // set state for default features + fFeatures.put(VALIDATION, Boolean.FALSE); + fFeatures.put(NAMESPACES, Boolean.TRUE); + fFeatures.put(EXTERNAL_GENERAL_ENTITIES, Boolean.TRUE); + fFeatures.put(EXTERNAL_PARAMETER_ENTITIES, Boolean.TRUE); + fFeatures.put(CONTINUE_AFTER_FATAL_ERROR, Boolean.FALSE); + fFeatures.put(LOAD_EXTERNAL_DTD, Boolean.TRUE); + fFeatures.put(SCHEMA_ELEMENT_DEFAULT, Boolean.TRUE); + fFeatures.put(NORMALIZE_DATA, Boolean.TRUE); + fFeatures.put(SCHEMA_AUGMENT_PSVI, Boolean.TRUE); + fFeatures.put(GENERATE_SYNTHETIC_ANNOTATIONS, Boolean.FALSE); + fFeatures.put(VALIDATE_ANNOTATIONS, Boolean.FALSE); + fFeatures.put(HONOUR_ALL_SCHEMALOCATIONS, Boolean.FALSE); + fFeatures.put(NAMESPACE_GROWTH, Boolean.FALSE); + fFeatures.put(TOLERATE_DUPLICATES, Boolean.FALSE); + fFeatures.put(USE_GRAMMAR_POOL_ONLY, Boolean.FALSE); + fFeatures.put(PARSER_SETTINGS, Boolean.TRUE); + fFeatures.put(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); // add default recognized properties final String[] recognizedProperties = { - SYMBOL_TABLE, - ERROR_HANDLER, - ENTITY_RESOLVER, + SYMBOL_TABLE, + ERROR_HANDLER, + ENTITY_RESOLVER, ERROR_REPORTER, ENTITY_MANAGER, DOCUMENT_SCANNER, DTD_SCANNER, DTD_PROCESSOR, DTD_VALIDATOR, - DATATYPE_VALIDATOR_FACTORY, - VALIDATION_MANAGER, - SCHEMA_VALIDATOR, - XML_STRING, + DATATYPE_VALIDATOR_FACTORY, + VALIDATION_MANAGER, + SCHEMA_VALIDATOR, + XML_STRING, XMLGRAMMAR_POOL, JAXP_SCHEMA_SOURCE, JAXP_SCHEMA_LANGUAGE, @@ -531,19 +534,20 @@ public class XML11Configuration extends ParserConfigurationSettings SCHEMA_NONS_LOCATION, LOCALE, SCHEMA_DV_FACTORY, + SECURITY_MANAGER, XML_SECURITY_PROPERTY_MANAGER }; addRecognizedProperties(recognizedProperties); - if (symbolTable == null) { - symbolTable = new SymbolTable(); - } - fSymbolTable = symbolTable; - fProperties.put(SYMBOL_TABLE, fSymbolTable); + if (symbolTable == null) { + symbolTable = new SymbolTable(); + } + fSymbolTable = symbolTable; + fProperties.put(SYMBOL_TABLE, fSymbolTable); fGrammarPool = grammarPool; if (fGrammarPool != null) { - fProperties.put(XMLGRAMMAR_POOL, fGrammarPool); + fProperties.put(XMLGRAMMAR_POOL, fGrammarPool); } fEntityManager = new XMLEntityManager(); @@ -579,8 +583,6 @@ public class XML11Configuration extends ParserConfigurationSettings fVersionDetector = new XMLVersionDetector(); - fProperties.put(XML_SECURITY_PROPERTY_MANAGER, new XMLSecurityPropertyManager()); - // add message formatters if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) { XMLMessageFormatter xmft = new XMLMessageFormatter(); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java index 210b7ce9cc6..970cc51cd26 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java @@ -23,6 +23,8 @@ package com.sun.org.apache.xerces.internal.parsers; import java.io.IOException; import com.sun.org.apache.xerces.internal.impl.Constants; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; @@ -78,6 +80,13 @@ public abstract class XMLParser { /** The parser configuration. */ protected XMLParserConfiguration fConfiguration; + /** The XML Security Manager. */ + XMLSecurityManager securityManager; + + /** The XML Security Property Manager. */ + XMLSecurityPropertyManager securityPropertyManager; + + // // Constructors // @@ -118,6 +127,15 @@ public abstract class XMLParser { */ public void parse(XMLInputSource inputSource) throws XNIException, IOException { + // null indicates that the parser is called directly, initialize them + if (securityManager == null) { + securityManager = new XMLSecurityManager(true); + fConfiguration.setProperty(Constants.SECURITY_MANAGER, securityManager); + } + if (securityPropertyManager == null) { + securityPropertyManager = new XMLSecurityPropertyManager(); + fConfiguration.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); + } reset(); fConfiguration.parse(inputSource); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java index dd510b622bc..d916f5bc516 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java @@ -61,8 +61,6 @@ package com.sun.org.apache.xerces.internal.util; import com.sun.org.apache.xerces.internal.impl.Constants; -import java.security.AccessController; -import java.security.PrivilegedAction; /** * This class is a container for parser settings that relate to * security, or more specifically, it is intended to be used to prevent denial-of-service @@ -79,7 +77,6 @@ import java.security.PrivilegedAction; * * @author Neil Graham, IBM * - * @version $Id: SecurityManager.java,v 1.5 2010-11-01 04:40:14 joehw Exp $ */ public final class SecurityManager { @@ -179,48 +176,40 @@ public final class SecurityManager { private void readSystemProperties(){ - //TODO: also read SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT - try { - String value = getSystemProperty(Constants.ENTITY_EXPANSION_LIMIT); - if(value != null && !value.equals("")){ - entityExpansionLimit = Integer.parseInt(value); - if (entityExpansionLimit < 0) - entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT; - } - else - entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT; - }catch(Exception ex){} + try { + String value = System.getProperty(Constants.ENTITY_EXPANSION_LIMIT); + if(value != null && !value.equals("")){ + entityExpansionLimit = Integer.parseInt(value); + if (entityExpansionLimit < 0) + entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT; + } + else + entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT; + }catch(Exception ex){} - try { - String value = getSystemProperty(Constants.MAX_OCCUR_LIMIT); - if(value != null && !value.equals("")){ - maxOccurLimit = Integer.parseInt(value); - if (maxOccurLimit < 0) - maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT; - } - else - maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT; - }catch(Exception ex){} + try { + String value = System.getProperty(Constants.MAX_OCCUR_LIMIT); + if(value != null && !value.equals("")){ + maxOccurLimit = Integer.parseInt(value); + if (maxOccurLimit < 0) + maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT; + } + else + maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT; + }catch(Exception ex){} - try { - String value = getSystemProperty(Constants.SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT); - if(value != null && !value.equals("")){ - fElementAttributeLimit = Integer.parseInt(value); - if ( fElementAttributeLimit < 0) - fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT; - } - else - fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT; + try { + String value = System.getProperty(Constants.ELEMENT_ATTRIBUTE_LIMIT); + if(value != null && !value.equals("")){ + fElementAttributeLimit = Integer.parseInt(value); + if ( fElementAttributeLimit < 0) + fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT; + } + else + fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT; }catch(Exception ex){} } - private String getSystemProperty(final String propName) { - return AccessController.doPrivileged(new PrivilegedAction() { - public String run() { - return System.getProperty(propName); - } - }); - } } // class SecurityManager diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java index b3d9ed7f925..8e62c1f1d75 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java @@ -173,7 +173,7 @@ public class SymbolTable { for (int i = 0; i < length; i++) { code = code * 37 + symbol.charAt(i); } - return code & 0x7FFFFFF; + return code & 0x7FFFFFFF; } // hash(String):int @@ -194,7 +194,7 @@ public class SymbolTable { for (int i = 0; i < length; i++) { code = code * 37 + buffer[offset + i]; } - return code & 0x7FFFFFF; + return code & 0x7FFFFFFF; } // hash(char[],int,int):int diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/URI.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/URI.java index e420f2616b6..a92cd20e399 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/util/URI.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/URI.java @@ -689,9 +689,13 @@ import java.util.Objects; if (!initializeAuthority(uriSpec.substring(startPos, index))) { index = startPos - 2; } - } - else { + } else if (index < uriSpecLen) { + //Same as java.net.URI: + // DEVIATION: Allow empty authority prior to non-empty + // path, query component or fragment identifier m_host = ""; + } else { + throw new MalformedURIException("Expected authority."); } } diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java b/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java index 995105902f1..613d651594f 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java @@ -211,7 +211,7 @@ public final class SecuritySupport { if (i > 0) { return uri.substring(i+1, uri.length()); } - return ""; + return uri; } /** diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java b/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java new file mode 100644 index 00000000000..82667edeed0 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java @@ -0,0 +1,239 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package com.sun.org.apache.xerces.internal.utils; + +import com.sun.org.apache.xerces.internal.impl.Constants; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager.Limit; +import java.util.Formatter; +import java.util.HashMap; +import java.util.Map; + +/** + * A helper for analyzing entity expansion limits + * + * @author Joe Wang Oracle Corp. + * + */ +public final class XMLLimitAnalyzer { + + /** + * Map old property names with the new ones + */ + public static enum NameMap { + ENTITY_EXPANSION_LIMIT(Constants.SP_ENTITY_EXPANSION_LIMIT, Constants.ENTITY_EXPANSION_LIMIT), + MAX_OCCUR_NODE_LIMIT(Constants.SP_MAX_OCCUR_LIMIT, Constants.MAX_OCCUR_LIMIT), + ELEMENT_ATTRIBUTE_LIMIT(Constants.SP_ELEMENT_ATTRIBUTE_LIMIT, Constants.ELEMENT_ATTRIBUTE_LIMIT); + + final String newName; + final String oldName; + + NameMap(String newName, String oldName) { + this.newName = newName; + this.oldName = oldName; + } + + String getOldName(String newName) { + if (newName.equals(this.newName)) { + return oldName; + } + return null; + } + } + + private XMLSecurityManager securityManager; + /** + * Max value accumulated for each property + */ + private final int[] values; + /** + * Names of the entities corresponding to their max values + */ + private final String[] names; + /** + * Total value of accumulated entities + */ + private final int[] totalValue; + + /** + * Maintain values of the top 10 elements in the process of parsing + */ + private final Map[] caches; + + private String entityStart, entityEnd; + /** + * Default constructor. Establishes default values for known security + * vulnerabilities. + */ + public XMLLimitAnalyzer(XMLSecurityManager securityManager) { + this.securityManager = securityManager; + values = new int[Limit.values().length]; + totalValue = new int[Limit.values().length]; + names = new String[Limit.values().length]; + caches = new Map[Limit.values().length]; + } + + /** + * Add the value to the current max count for the specified property + * To find the max value of all entities, set no limit + * + * @param limit the type of the property + * @param entityName the name of the entity + * @param value the value of the entity + */ + public void addValue(Limit limit, String entityName, int value) { + addValue(limit.ordinal(), entityName, value); + } + + /** + * Add the value to the current count by the index of the property + * @param index the index of the property + * @param entityName the name of the entity + * @param value the value of the entity + */ + public void addValue(int index, String entityName, int value) { + if (index == Limit.ENTITY_EXPANSION_LIMIT.ordinal() || + index == Limit.MAX_OCCUR_NODE_LIMIT.ordinal() || + index == Limit.ELEMENT_ATTRIBUTE_LIMIT.ordinal()) { + totalValue[index] += value; + return; + } + + Map cache; + if (caches[index] == null) { + cache = new HashMap(10); + caches[index] = cache; + } else { + cache = caches[index]; + } + + int accumulatedValue = value; + if (cache.containsKey(entityName)) { + accumulatedValue += cache.get(entityName).intValue(); + cache.put(entityName, Integer.valueOf(accumulatedValue)); + } else { + cache.put(entityName, Integer.valueOf(value)); + } + + if (accumulatedValue > values[index]) { + values[index] = accumulatedValue; + names[index] = entityName; + } + + + if (index == Limit.GENEAL_ENTITY_SIZE_LIMIT.ordinal() || + index == Limit.PARAMETER_ENTITY_SIZE_LIMIT.ordinal()) { + totalValue[Limit.TOTAL_ENTITY_SIZE_LIMIT.ordinal()] += value; + } + } + + /** + * Return the value of the current max count for the specified property + * + * @param limit the property + * @return the value of the property + */ + public int getValue(Limit limit) { + return values[limit.ordinal()]; + } + + public int getValue(int index) { + return values[index]; + } + /** + * Return the total value accumulated so far + * + * @param limit the property + * @return the accumulated value of the property + */ + public int getTotalValue(Limit limit) { + return totalValue[limit.ordinal()]; + } + + public int getTotalValue(int index) { + return totalValue[index]; + } + /** + * Return the current max value (count or length) by the index of a property + * @param index the index of a property + * @return count of a property + */ + public int getValueByIndex(int index) { + return values[index]; + } + + public void startEntity(String name) { + entityStart = name; + } + + public boolean isTracking(String name) { + if (entityStart == null) { + return false; + } + return entityStart.equals(name); + } + /** + * Stop tracking the entity + * @param limit the limit property + * @param name the name of an entity + */ + public void endEntity(Limit limit, String name) { + entityStart = ""; + Map cache = caches[limit.ordinal()]; + if (cache != null) { + cache.remove(name); + } + } + + public void debugPrint() { + Formatter formatter = new Formatter(); + System.out.println(formatter.format("%30s %15s %15s %15s %30s", + "Property","Limit","Total size","Size","Entity Name")); + + for (Limit limit : Limit.values()) { + formatter = new Formatter(); + System.out.println(formatter.format("%30s %15d %15d %15d %30s", + limit.name(), + securityManager.getLimit(limit), + totalValue[limit.ordinal()], + values[limit.ordinal()], + names[limit.ordinal()])); + } + } +} diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java new file mode 100644 index 00000000000..a28e80dc81a --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java @@ -0,0 +1,555 @@ +/* + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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.org.apache.xerces.internal.utils; + +import com.sun.org.apache.xerces.internal.impl.Constants; +import com.sun.org.apache.xerces.internal.util.SecurityManager; + +/** + * This class manages standard and implementation-specific limitations. + * + */ +public final class XMLSecurityManager { + + /** + * States of the settings of a property, in the order: default value, value + * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system + * properties, and jaxp api properties + */ + public static enum State { + //this order reflects the overriding order + + DEFAULT("default"), FSP("FEATURE_SECURE_PROCESSING"), + JAXPDOTPROPERTIES("jaxp.properties"), SYSTEMPROPERTY("system property"), + APIPROPERTY("property"); + + final String literal; + State(String literal) { + this.literal = literal; + } + + String literal() { + return literal; + } + } + + /** + * Limits managed by the security manager + */ + public static enum Limit { + + ENTITY_EXPANSION_LIMIT(Constants.JDK_ENTITY_EXPANSION_LIMIT, Constants.SP_ENTITY_EXPANSION_LIMIT, 0, 64000), + MAX_OCCUR_NODE_LIMIT(Constants.JDK_MAX_OCCUR_LIMIT, Constants.SP_MAX_OCCUR_LIMIT, 0, 5000), + ELEMENT_ATTRIBUTE_LIMIT(Constants.JDK_ELEMENT_ATTRIBUTE_LIMIT, Constants.SP_ELEMENT_ATTRIBUTE_LIMIT, 0, 10000), + TOTAL_ENTITY_SIZE_LIMIT(Constants.JDK_TOTAL_ENTITY_SIZE_LIMIT, Constants.SP_TOTAL_ENTITY_SIZE_LIMIT, 0, 50000000), + GENEAL_ENTITY_SIZE_LIMIT(Constants.JDK_GENEAL_ENTITY_SIZE_LIMIT, Constants.SP_GENEAL_ENTITY_SIZE_LIMIT, 0, 0), + PARAMETER_ENTITY_SIZE_LIMIT(Constants.JDK_PARAMETER_ENTITY_SIZE_LIMIT, Constants.SP_PARAMETER_ENTITY_SIZE_LIMIT, 0, 1000000); + + final String apiProperty; + final String systemProperty; + final int defaultValue; + final int secureValue; + + Limit(String apiProperty, String systemProperty, int value, int secureValue) { + this.apiProperty = apiProperty; + this.systemProperty = systemProperty; + this.defaultValue = value; + this.secureValue = secureValue; + } + + public boolean equalsAPIPropertyName(String propertyName) { + return (propertyName == null) ? false : apiProperty.equals(propertyName); + } + + public boolean equalsSystemPropertyName(String propertyName) { + return (propertyName == null) ? false : systemProperty.equals(propertyName); + } + + public String apiProperty() { + return apiProperty; + } + + String systemProperty() { + return systemProperty; + } + + int defaultValue() { + return defaultValue; + } + + int secureValue() { + return secureValue; + } + } + + /** + * Map old property names with the new ones + */ + public static enum NameMap { + + ENTITY_EXPANSION_LIMIT(Constants.SP_ENTITY_EXPANSION_LIMIT, Constants.ENTITY_EXPANSION_LIMIT), + MAX_OCCUR_NODE_LIMIT(Constants.SP_MAX_OCCUR_LIMIT, Constants.MAX_OCCUR_LIMIT), + ELEMENT_ATTRIBUTE_LIMIT(Constants.SP_ELEMENT_ATTRIBUTE_LIMIT, Constants.ELEMENT_ATTRIBUTE_LIMIT); + final String newName; + final String oldName; + + NameMap(String newName, String oldName) { + this.newName = newName; + this.oldName = oldName; + } + + String getOldName(String newName) { + if (newName.equals(this.newName)) { + return oldName; + } + return null; + } + } + private static final int NO_LIMIT = 0; + /** + * Values of the properties + */ + private final int[] values; + /** + * States of the settings for each property + */ + private State[] states; + /** + * Flag indicating if secure processing is set + */ + boolean secureProcessing; + + /** + * States that determine if properties are set explicitly + */ + private boolean[] isSet; + + + private XMLLimitAnalyzer limitAnalyzer; + /** + * Index of the special entityCountInfo property + */ + private int indexEntityCountInfo = 10000; + private String printEntityCountInfo = ""; + + /** + * Default constructor. Establishes default values for known security + * vulnerabilities. + */ + public XMLSecurityManager() { + this(false); + } + + /** + * Instantiate Security Manager in accordance with the status of + * secure processing + * @param secureProcessing + */ + public XMLSecurityManager(boolean secureProcessing) { + limitAnalyzer = new XMLLimitAnalyzer(this); + values = new int[Limit.values().length]; + states = new State[Limit.values().length]; + isSet = new boolean[Limit.values().length]; + this.secureProcessing = secureProcessing; + for (Limit limit : Limit.values()) { + if (secureProcessing) { + values[limit.ordinal()] = limit.secureValue; + states[limit.ordinal()] = State.FSP; + } else { + values[limit.ordinal()] = limit.defaultValue(); + states[limit.ordinal()] = State.DEFAULT; + } + } + //read system properties or jaxp.properties + readSystemProperties(); + } + + /** + * Setting FEATURE_SECURE_PROCESSING explicitly + */ + public void setSecureProcessing(boolean secure) { + secureProcessing = secure; + for (Limit limit : Limit.values()) { + if (secure) { + setLimit(limit.ordinal(), State.FSP, limit.secureValue()); + } else { + setLimit(limit.ordinal(), State.FSP, limit.defaultValue()); + } + } + } + + /** + * Return the state of secure processing + * @return the state of secure processing + */ + public boolean isSecureProcessing() { + return secureProcessing; + } + + + /** + * Set limit by property name and state + * @param propertyName property name + * @param state the state of the property + * @param value the value of the property + * @return true if the property is managed by the security manager; false + * if otherwise. + */ + public boolean setLimit(String propertyName, State state, Object value) { + int index = getIndex(propertyName); + if (index > -1) { + setLimit(index, state, value); + return true; + } + return false; + } + + /** + * Set the value for a specific limit. + * + * @param limit the limit + * @param state the state of the property + * @param value the value of the property + */ + public void setLimit(Limit limit, State state, int value) { + setLimit(limit.ordinal(), state, value); + } + + /** + * Set the value of a property by its index + * + * @param index the index of the property + * @param state the state of the property + * @param value the value of the property + */ + public void setLimit(int index, State state, Object value) { + if (index == indexEntityCountInfo) { + printEntityCountInfo = (String)value; + } else { + int temp = 0; + try { + temp = Integer.parseInt((String) value); + if (temp < 0) { + temp = 0; + } + } catch (NumberFormatException e) {} + setLimit(index, state, temp); + } + } + + /** + * Set the value of a property by its index + * + * @param index the index of the property + * @param state the state of the property + * @param value the value of the property + */ + public void setLimit(int index, State state, int value) { + if (index == indexEntityCountInfo) { + //if it's explicitly set, it's treated as yes no matter the value + printEntityCountInfo = Constants.JDK_YES; + } else { + //only update if it shall override + if (state.compareTo(states[index]) >= 0) { + values[index] = value; + states[index] = state; + isSet[index] = true; + } + } + } + + /** + * Return the value of the specified property + * + * @param propertyName the property name + * @return the value of the property as a string. If a property is managed + * by this manager, its value shall not be null. + */ + public String getLimitAsString(String propertyName) { + int index = getIndex(propertyName); + if (index > -1) { + return getLimitValueByIndex(index); + } + + return null; + } + /** + * Return the value of the specified property + * + * @param limit the property + * @return the value of the property + */ + public int getLimit(Limit limit) { + return values[limit.ordinal()]; + } + + /** + * Return the value of a property by its ordinal + * + * @param limit the property + * @return value of a property + */ + public String getLimitValueAsString(Limit limit) { + return Integer.toString(values[limit.ordinal()]); + } + + /** + * Return the value of a property by its ordinal + * + * @param index the index of a property + * @return limit of a property as a string + */ + public String getLimitValueByIndex(int index) { + if (index == indexEntityCountInfo) { + return printEntityCountInfo; + } + + return Integer.toString(values[index]); + } + + /** + * Return the state of the limit property + * + * @param limit the limit + * @return the state of the limit property + */ + public State getState(Limit limit) { + return states[limit.ordinal()]; + } + + /** + * Return the state of the limit property + * + * @param limit the limit + * @return the state of the limit property + */ + public String getStateLiteral(Limit limit) { + return states[limit.ordinal()].literal(); + } + + /** + * Get the index by property name + * + * @param propertyName property name + * @return the index of the property if found; return -1 if not + */ + public int getIndex(String propertyName) { + for (Limit limit : Limit.values()) { + if (limit.equalsAPIPropertyName(propertyName)) { + //internally, ordinal is used as index + return limit.ordinal(); + } + } + //special property to return entity count info + if (propertyName.equals(Constants.JDK_ENTITY_COUNT_INFO)) { + return indexEntityCountInfo; + } + return -1; + } + + /** + * Check if there's no limit defined by the Security Manager + * @param limit + * @return + */ + public boolean isNoLimit(int limit) { + return limit==NO_LIMIT; + } + /** + * Check if the size (length or count) of the specified limit property is + * over the limit + * + * @param limit the type of the limit property + * @param entityName the name of the entity + * @param size the size (count or length) of the entity + * @return true if the size is over the limit, false otherwise + */ + public boolean isOverLimit(Limit limit, String entityName, int size) { + return isOverLimit(limit.ordinal(), entityName, size); + } + + /** + * Check if the value (length or count) of the specified limit property is + * over the limit + * + * @param index the index of the limit property + * @param entityName the name of the entity + * @param size the size (count or length) of the entity + * @return true if the size is over the limit, false otherwise + */ + public boolean isOverLimit(int index, String entityName, int size) { + if (values[index] == NO_LIMIT) { + return false; + } + if (size > values[index]) { + limitAnalyzer.addValue(index, entityName, size); + return true; + } + return false; + } + + /** + * Check against cumulated value + * + * @param limit the type of the limit property + * @param size the size (count or length) of the entity + * @return true if the size is over the limit, false otherwise + */ + public boolean isOverLimit(Limit limit) { + return isOverLimit(limit.ordinal()); + } + + public boolean isOverLimit(int index) { + if (values[index] == NO_LIMIT) { + return false; + } + + if (index==Limit.ELEMENT_ATTRIBUTE_LIMIT.ordinal() || + index==Limit.ENTITY_EXPANSION_LIMIT.ordinal() || + index==Limit.TOTAL_ENTITY_SIZE_LIMIT.ordinal()) { + return (limitAnalyzer.getTotalValue(index) > values[index]); + } else { + return (limitAnalyzer.getValue(index) > values[index]); + } + } + + public void debugPrint() { + if (printEntityCountInfo.equals(Constants.JDK_YES)) { + limitAnalyzer.debugPrint(); + } + } + + /** + * Return the limit analyzer + * + * @return the limit analyzer + */ + public XMLLimitAnalyzer getLimitAnalyzer() { + return limitAnalyzer; + } + + /** + * Set limit analyzer + * + * @param analyzer a limit analyzer + */ + public void setLimitAnalyzer(XMLLimitAnalyzer analyzer) { + limitAnalyzer = analyzer; + } + + /** + * Indicate if a property is set explicitly + * @param index + * @return + */ + public boolean isSet(int index) { + return isSet[index]; + } + + public boolean printEntityCountInfo() { + return printEntityCountInfo.equals(Constants.JDK_YES); + } + + /** + * Read from system properties, or those in jaxp.properties + */ + private void readSystemProperties() { + + for (Limit limit : Limit.values()) { + if (!getSystemProperty(limit, limit.systemProperty())) { + //if system property is not found, try the older form if any + for (NameMap nameMap : NameMap.values()) { + String oldName = nameMap.getOldName(limit.systemProperty()); + if (oldName != null) { + getSystemProperty(limit, oldName); + } + } + } + } + + } + + /** + * Read from system properties, or those in jaxp.properties + * + * @param property the type of the property + * @param sysPropertyName the name of system property + */ + private boolean getSystemProperty(Limit limit, String sysPropertyName) { + try { + String value = SecuritySupport.getSystemProperty(sysPropertyName); + if (value != null && !value.equals("")) { + values[limit.ordinal()] = Integer.parseInt(value); + states[limit.ordinal()] = State.SYSTEMPROPERTY; + return true; + } + + value = SecuritySupport.readJAXPProperty(sysPropertyName); + if (value != null && !value.equals("")) { + values[limit.ordinal()] = Integer.parseInt(value); + states[limit.ordinal()] = State.JAXPDOTPROPERTIES; + return true; + } + } catch (NumberFormatException e) { + //invalid setting + throw new NumberFormatException("Invalid setting for system property: " + limit.systemProperty()); + } + return false; + } + + + /** + * Convert a value set through setProperty to XMLSecurityManager. + * If the value is an instance of XMLSecurityManager, use it to override the default; + * If the value is an old SecurityManager, convert to the new XMLSecurityManager. + * + * @param value user specified security manager + * @param securityManager an instance of XMLSecurityManager + * @return an instance of the new security manager XMLSecurityManager + */ + static public XMLSecurityManager convert(Object value, XMLSecurityManager securityManager) { + if (value == null) { + if (securityManager == null) { + securityManager = new XMLSecurityManager(true); + } + return securityManager; + } + if (XMLSecurityManager.class.isAssignableFrom(value.getClass())) { + return (XMLSecurityManager)value; + } else { + if (securityManager == null) { + securityManager = new XMLSecurityManager(true); + } + if (SecurityManager.class.isAssignableFrom(value.getClass())) { + SecurityManager origSM = (SecurityManager)value; + securityManager.setLimit(Limit.MAX_OCCUR_NODE_LIMIT, State.APIPROPERTY, origSM.getMaxOccurNodeLimit()); + securityManager.setLimit(Limit.ENTITY_EXPANSION_LIMIT, State.APIPROPERTY, origSM.getEntityExpansionLimit()); + securityManager.setLimit(Limit.ELEMENT_ATTRIBUTE_LIMIT, State.APIPROPERTY, origSM.getElementAttrLimit()); + } + return securityManager; + } + } +} diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java index c6bb0310702..4286f043e50 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java @@ -91,6 +91,24 @@ public final class XMLSecurityPropertyManager { readSystemProperties(); } + + /** + * Set limit by property name and state + * @param propertyName property name + * @param state the state of the property + * @param value the value of the property + * @return true if the property is managed by the security property manager; + * false if otherwise. + */ + public boolean setValue(String propertyName, State state, Object value) { + int index = getIndex(propertyName); + if (index > -1) { + setValue(index, state, (String)value); + return true; + } + return false; + } + /** * Set the value for a specific property. * @@ -119,6 +137,23 @@ public final class XMLSecurityPropertyManager { states[index] = state; } } + + + /** + * Return the value of the specified property + * + * @param propertyName the property name + * @return the value of the property as a string + */ + public String getValue(String propertyName) { + int index = getIndex(propertyName); + if (index > -1) { + return getValueByIndex(index); + } + + return null; + } + /** * Return the value of the specified property * diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java index 0c01d601c06..a060f99e091 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java @@ -37,7 +37,6 @@ import com.sun.org.apache.xerces.internal.util.AugmentationsImpl; import com.sun.org.apache.xerces.internal.util.HTTPInputSource; import com.sun.org.apache.xerces.internal.util.IntStack; import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.SymbolTable; import com.sun.org.apache.xerces.internal.util.URI; import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl; @@ -45,6 +44,7 @@ import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl; import com.sun.org.apache.xerces.internal.util.XMLChar; import com.sun.org.apache.xerces.internal.util.XMLSymbols; import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.NamespaceContext; import com.sun.org.apache.xerces.internal.xni.QName; @@ -289,7 +289,7 @@ public class XIncludeHandler protected SymbolTable fSymbolTable; protected XMLErrorReporter fErrorReporter; protected XMLEntityResolver fEntityResolver; - protected SecurityManager fSecurityManager; + protected XMLSecurityManager fSecurityManager; protected XMLSecurityPropertyManager fSecurityPropertyMgr; // these are needed for text include processing @@ -517,8 +517,8 @@ public class XIncludeHandler // Get security manager. try { - SecurityManager value = - (SecurityManager)componentManager.getProperty( + XMLSecurityManager value = + (XMLSecurityManager)componentManager.getProperty( SECURITY_MANAGER); if (value != null) { @@ -674,7 +674,7 @@ public class XIncludeHandler return; } if (propertyId.equals(SECURITY_MANAGER)) { - fSecurityManager = (SecurityManager)value; + fSecurityManager = (XMLSecurityManager)value; if (fChildConfig != null) { fChildConfig.setProperty(propertyId, value); } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java index fa1da4fd079..1993bd6b9c6 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java @@ -105,15 +105,15 @@ public class DTMAxisIterNodeList extends DTMNodeListBase { */ public Node item(int index) { if (m_iter != null) { - int node; + int node = 0; int count = m_cachedNodes.size(); if (count > index) { node = m_cachedNodes.elementAt(index); return m_dtm.getNode(node); } else if (m_last == -1) { - while (((node = m_iter.next()) != DTMAxisIterator.END) - && count <= index) { + while (count <= index + && ((node = m_iter.next()) != DTMAxisIterator.END)) { m_cachedNodes.addElement(node); count++; } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_de.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_de.java index ac19d0dbdd9..1d5d39a7794 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_de.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_de.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XMLErrorResources_de.java,v 1.2.4.1 2005/09/15 07:45:39 suresh_emailid Exp $ + * $Id: XMLErrorResources_de.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 04:56:10 gmolloy Exp $ */ package com.sun.org.apache.xml.internal.res; @@ -179,7 +179,7 @@ public class XMLErrorResources_de extends ListResourceBundle // Error messages... /** The lookup table for error messages. */ - private static final Object[][] _contents = { + private static final Object[][] contents = { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -447,7 +447,7 @@ public class XMLErrorResources_de extends ListResourceBundle */ protected Object[][] getContents() { - return _contents; + return contents; } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_es.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_es.java index f35db360989..a2ec7cf292c 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_es.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_es.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XMLErrorResources_es.java,v 1.2.4.1 2005/09/15 07:45:41 suresh_emailid Exp $ + * $Id: XMLErrorResources_es.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 09:06:34 gmolloy Exp $ */ package com.sun.org.apache.xml.internal.res; @@ -179,7 +179,7 @@ public class XMLErrorResources_es extends ListResourceBundle // Error messages... /** The lookup table for error messages. */ - private static final Object[][] _contents = { + private static final Object[][] contents = { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -447,7 +447,7 @@ public class XMLErrorResources_es extends ListResourceBundle */ protected Object[][] getContents() { - return _contents; + return contents; } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_fr.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_fr.java index b5891d6cb7e..95d0282b07b 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_fr.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_fr.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XMLErrorResources_fr.java,v 1.2.4.1 2005/09/15 07:45:41 suresh_emailid Exp $ + * $Id: XMLErrorResources_fr.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 07:05:15 gmolloy Exp $ */ package com.sun.org.apache.xml.internal.res; @@ -179,7 +179,7 @@ public class XMLErrorResources_fr extends ListResourceBundle // Error messages... /** The lookup table for error messages. */ - private static final Object[][] _contents = { + private static final Object[][] contents = { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -447,7 +447,7 @@ public class XMLErrorResources_fr extends ListResourceBundle */ protected Object[][] getContents() { - return _contents; + return contents; } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_it.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_it.java index c7d01ffc962..ff457b52618 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_it.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_it.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XMLErrorResources_it.java,v 1.2.4.1 2005/09/15 07:45:42 suresh_emailid Exp $ + * $Id: XMLErrorResources_it.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 07:02:00 gmolloy Exp $ */ package com.sun.org.apache.xml.internal.res; @@ -179,7 +179,7 @@ public class XMLErrorResources_it extends ListResourceBundle // Error messages... /** The lookup table for error messages. */ - private static final Object[][] _contents = { + private static final Object[][] contents = { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -447,7 +447,7 @@ public class XMLErrorResources_it extends ListResourceBundle */ protected Object[][] getContents() { - return _contents; + return contents; } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ja.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ja.java index b1a811fb9c9..2cb9734014a 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ja.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ja.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XMLErrorResources_ja.java,v 1.2.4.1 2005/09/15 07:45:42 suresh_emailid Exp $ + * $Id: XMLErrorResources_ja.java /st_wptg_1.8.0.0.0jdk/2 2013/09/12 17:39:58 gmolloy Exp $ */ package com.sun.org.apache.xml.internal.res; @@ -179,7 +179,7 @@ public class XMLErrorResources_ja extends ListResourceBundle // Error messages... /** The lookup table for error messages. */ - private static final Object[][] _contents = { + private static final Object[][] contents = { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -269,13 +269,13 @@ public class XMLErrorResources_ja extends ListResourceBundle "\u30B9\u30AD\u30FC\u30E0\u304CURI\u306B\u898B\u3064\u304B\u308A\u307E\u305B\u3093"}, { ER_PATH_INVALID_CHAR, - "\u30D1\u30B9\u306B\u7121\u52B9\u6587\u5B57{0}\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059"}, + "\u30D1\u30B9\u306B\u7121\u52B9\u306A\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059: {0}"}, { ER_SCHEME_FROM_NULL_STRING, "null\u6587\u5B57\u5217\u304B\u3089\u306F\u30B9\u30AD\u30FC\u30E0\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093"}, { ER_SCHEME_NOT_CONFORMANT, - "\u30B9\u30AD\u30FC\u30E0\u306F\u4E00\u81F4\u3057\u3066\u3044\u307E\u305B\u3093\u3002"}, + "\u30B9\u30AD\u30FC\u30E0\u304C\u6574\u5408\u3057\u3066\u3044\u307E\u305B\u3093\u3002"}, { ER_HOST_ADDRESS_NOT_WELLFORMED, "\u30DB\u30B9\u30C8\u306F\u6574\u5F62\u5F0F\u306E\u30A2\u30C9\u30EC\u30B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093"}, @@ -397,7 +397,7 @@ public class XMLErrorResources_ja extends ListResourceBundle "\u7121\u52B9\u306AUTF-16\u30B5\u30ED\u30B2\u30FC\u30C8\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F: {0}\u3002" }, {ER_OIERROR, - "\u5165\u51FA\u529B\u30A8\u30E9\u30FC" }, + "IO\u30A8\u30E9\u30FC" }, {ER_ILLEGAL_ATTRIBUTE_POSITION, "\u5B50\u30CE\u30FC\u30C9\u306E\u5F8C\u307E\u305F\u306F\u8981\u7D20\u304C\u751F\u6210\u3055\u308C\u308B\u524D\u306B\u5C5E\u6027{0}\u3092\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002\u5C5E\u6027\u306F\u7121\u8996\u3055\u308C\u307E\u3059\u3002"}, @@ -447,7 +447,7 @@ public class XMLErrorResources_ja extends ListResourceBundle */ protected Object[][] getContents() { - return _contents; + return contents; } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ko.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ko.java index 97215695644..75956ddd256 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ko.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_ko.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XMLErrorResources_ko.java,v 1.2.4.1 2005/09/15 07:45:42 suresh_emailid Exp $ + * $Id: XMLErrorResources_ko.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 02:31:34 gmolloy Exp $ */ package com.sun.org.apache.xml.internal.res; @@ -179,7 +179,7 @@ public class XMLErrorResources_ko extends ListResourceBundle // Error messages... /** The lookup table for error messages. */ - private static final Object[][] _contents = { + private static final Object[][] contents = { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -447,7 +447,7 @@ public class XMLErrorResources_ko extends ListResourceBundle */ protected Object[][] getContents() { - return _contents; + return contents; } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_pt_BR.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_pt_BR.java index 593f8b8ff3f..089dc43569d 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_pt_BR.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_pt_BR.java @@ -9,7 +9,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -17,9 +17,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - /* - * $Id: XMLErrorResources_pt_BR.java 3023 2011-03-01 00:53:34Z joehw $ + * $Id: XMLErrorResources_pt_BR.java /st_wptg_1.8.0.0.0jdk/2 2013/09/11 12:46:54 gmolloy Exp $ */ package com.sun.org.apache.xml.internal.res; @@ -180,7 +179,7 @@ public class XMLErrorResources_pt_BR extends ListResourceBundle // Error messages... /** The lookup table for error messages. */ - public static final Object[][] contents = { + private static final Object[][] contents = { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -216,7 +215,7 @@ public class XMLErrorResources_pt_BR extends ListResourceBundle "\nINESPERADO: Parser doTerminate responde {0}"}, { ER_NO_PARSE_CALL_WHILE_PARSING, - "o parse n\u00E3o pode ser chamado durante o parse"}, + "o parsing n\u00E3o pode ser chamado durante o parsing"}, { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED, "Erro: iterador digitado para o eixo {0} n\u00E3o implementado"}, @@ -246,7 +245,7 @@ public class XMLErrorResources_pt_BR extends ListResourceBundle "N\u00E3o foi poss\u00EDvel resolver o n\u00F3 para um handle"}, { ER_STARTPARSE_WHILE_PARSING, - "startParse n\u00E3o pode ser chamado durante o parse"}, + "startParse n\u00E3o pode ser chamado durante o parsing"}, { ER_STARTPARSE_NEEDS_SAXPARSER, "startParse requer um SAXParser n\u00E3o nulo"}, @@ -261,7 +260,7 @@ public class XMLErrorResources_pt_BR extends ListResourceBundle "O caminho cont\u00E9m uma sequ\u00EAncia inv\u00E1lida de caracteres de escape"}, { ER_SCHEME_REQUIRED, - "\u00C9 necess\u00E1rio um esquema!"}, + "O esquema \u00E9 obrigat\u00F3rio!"}, { ER_NO_SCHEME_IN_URI, "Nenhum esquema encontrado no URI: {0}"}, @@ -300,7 +299,7 @@ public class XMLErrorResources_pt_BR extends ListResourceBundle "O parser j\u00E1 est\u00E1 sendo usado"}, { ER_CANNOT_CHANGE_WHILE_PARSING, - "N\u00E3o \u00E9 poss\u00EDvel alterar {0} {1} durante o parse"}, + "N\u00E3o \u00E9 poss\u00EDvel alterar {0} {1} durante o parsing"}, { ER_SELF_CAUSATION_NOT_PERMITTED, "Autoaverigua\u00E7\u00E3o n\u00E3o permitida"}, @@ -440,16 +439,7 @@ public class XMLErrorResources_pt_BR extends ListResourceBundle }; - private static final Object[][] msgCopy = new Object[contents.length][2]; - // return a copy of contents; in theory we want a deep clone - // of contents, but since it only contains (immutable) Strings, - // this shallow copy is sufficient - static { - for (int i = 0; i < contents.length; i++) { - msgCopy[i][0] = contents[i][0]; - msgCopy[i][1] = contents[i][1]; - } - } + /** * Get the association list. * @@ -457,7 +447,7 @@ public class XMLErrorResources_pt_BR extends ListResourceBundle */ protected Object[][] getContents() { - return msgCopy; + return contents; } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sv.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sv.java index 4fa6a340057..f464bedb077 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sv.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_sv.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XMLErrorResources_sv.java,v 1.2.4.1 2005/09/15 07:45:46 suresh_emailid Exp $ + * $Id: XMLErrorResources_sv.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 06:50:58 gmolloy Exp $ */ package com.sun.org.apache.xml.internal.res; @@ -179,7 +179,7 @@ public class XMLErrorResources_sv extends ListResourceBundle // Error messages... /** The lookup table for error messages. */ - private static final Object[][] _contents = { + private static final Object[][] contents = { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -447,6 +447,7 @@ public class XMLErrorResources_sv extends ListResourceBundle */ protected Object[][] getContents() { - return _contents; + return contents; } + } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_CN.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_CN.java index aa861e25a97..e8467408ed6 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_CN.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_CN.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XMLErrorResources_zh_CN.java,v 1.2.4.1 2005/09/15 07:45:47 suresh_emailid Exp $ + * $Id: XMLErrorResources_zh_CN.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 04:44:25 gmolloy Exp $ */ package com.sun.org.apache.xml.internal.res; @@ -179,7 +179,7 @@ public class XMLErrorResources_zh_CN extends ListResourceBundle // Error messages... /** The lookup table for error messages. */ - private static final Object[][] _contents = { + private static final Object[][] contents = { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -447,7 +447,7 @@ public class XMLErrorResources_zh_CN extends ListResourceBundle */ protected Object[][] getContents() { - return _contents; + return contents; } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_TW.java b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_TW.java index 78df8fd081e..8c68bbabb9a 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_TW.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/res/XMLErrorResources_zh_TW.java @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XMLErrorResources_zh_TW.java,v 1.2.4.1 2005/09/15 07:45:48 suresh_emailid Exp $ + * $Id: XMLErrorResources_zh_TW.java /st_wptg_1.8.0.0.0jdk/2 2013/09/14 02:16:34 gmolloy Exp $ */ package com.sun.org.apache.xml.internal.res; @@ -179,7 +179,7 @@ public class XMLErrorResources_zh_TW extends ListResourceBundle // Error messages... /** The lookup table for error messages. */ - private static final Object[][] _contents = { + private static final Object[][] contents = { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -447,7 +447,7 @@ public class XMLErrorResources_zh_TW extends ListResourceBundle */ protected Object[][] getContents() { - return _contents; + return contents; } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java index 264a8c9271c..20e8a4de7b8 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,105 +18,191 @@ * limitations under the License. */ /* - * $Id: SerializerMessages_de.java,v 1.1.4.1 2005/09/08 11:03:12 suresh_emailid Exp $ + * $Id: SerializerMessages_de.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 04:56:10 gmolloy Exp $ */ - package com.sun.org.apache.xml.internal.serializer.utils; import java.util.ListResourceBundle; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +/** + * An instance of this class is a ListResourceBundle that + * has the required getContents() method that returns + * an array of message-key/message associations. + *

    + * The message keys are defined in {@link MsgKey}. The + * messages that those keys map to are defined here. + *

    + * The messages in the English version are intended to be + * translated. + * + * This class is not a public API, it is only public because it is + * used in com.sun.org.apache.xml.internal.serializer. + * + * @xsl.usage internal + */ public class SerializerMessages_de extends ListResourceBundle { - public Object[][] getContents() { - Object[][] contents = new Object[][] { - // BAD_MSGKEY needs translation - // BAD_MSGFORMAT needs translation - { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, - "Die Parallel-Seriell-Umsetzerklasse ''{0}'' implementiert org.xml.sax.ContentHandler nicht."}, - { MsgKey.ER_RESOURCE_COULD_NOT_FIND, - "Die Ressource [ {0} ] konnte nicht gefunden werden.\n {1}"}, + /* + * This file contains error and warning messages related to + * Serializer Error Handling. + * + * General notes to translators: - { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, - "Die Ressource [ {0} ] konnte nicht geladen werden: {1} \n {2} \n {3}"}, + * 1) A stylesheet is a description of how to transform an input XML document + * into a resultant XML document (or HTML document or text). The + * stylesheet itself is described in the form of an XML document. - { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, - "Puffergr\u00f6\u00dfe <=0"}, + * + * 2) An element is a mark-up tag in an XML document; an attribute is a + * modifier on the tag. For example, in + * "elem" is an element name, "attr" and "attr2" are attribute names with + * the values "val" and "val2", respectively. + * + * 3) A namespace declaration is a special attribute that is used to associate + * a prefix with a URI (the namespace). The meanings of element names and + * attribute names that use that prefix are defined with respect to that + * namespace. + * + * + */ - { MsgKey.ER_INVALID_UTF16_SURROGATE, - "Ung\u00fcltige UTF-16-Ersetzung festgestellt: {0} ?"}, + /** The lookup table for error messages. */ + public Object[][] getContents() { + Object[][] contents = new Object[][] { + { MsgKey.BAD_MSGKEY, + "Der Nachrichtenschl\u00FCssel \"{0}\" ist nicht in der Nachrichtenklasse \"{1}\" enthalten" }, - { MsgKey.ER_OIERROR, - "E/A-Fehler"}, + { MsgKey.BAD_MSGFORMAT, + "Das Format der Nachricht \"{0}\" in der Nachrichtenklasse \"{1}\" war nicht erfolgreich." }, - { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, - "Attribut {0} kann nicht nach Kindknoten oder vor dem Erstellen eines Elements hinzugef\u00fcgt werden. Das Attribut wird ignoriert."}, + { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, + "Serializer-Klasse \"{0}\" implementiert org.xml.sax.ContentHandler nicht." }, - { MsgKey.ER_NAMESPACE_PREFIX, - "Der Namensbereich f\u00fcr Pr\u00e4fix ''{0}'' wurde nicht deklariert."}, + { MsgKey.ER_RESOURCE_COULD_NOT_FIND, + "Ressource [ {0} ] konnte nicht gefunden werden.\n {1}" }, - // ER_STRAY_ATTRIBUTE needs translation - { MsgKey.ER_STRAY_NAMESPACE, - "Namensbereichsdeklaration ''{0}''=''{1}'' befindet sich nicht in einem Element."}, + { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, + "Ressource [ {0} ] konnte nicht geladen werden: {1} \n {2} \t {3}" }, - { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, - "''{0}'' konnte nicht geladen werden (CLASSPATH pr\u00fcfen); es werden die Standardwerte verwendet"}, + { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, + "Puffergr\u00F6\u00DFe <=0" }, - // ER_ILLEGAL_CHARACTER needs translation - { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, - "Merkmaldatei ''{0}'' konnte f\u00fcr Ausgabemethode ''{1}'' nicht geladen werden (CLASSPATH pr\u00fcfen)"}, + { MsgKey.ER_INVALID_UTF16_SURROGATE, + "Ung\u00FCltige UTF-16-Ersetzung festgestellt: {0}?" }, - { MsgKey.ER_INVALID_PORT, - "Ung\u00fcltige Portnummer"}, + { MsgKey.ER_OIERROR, + "I/O-Fehler" }, - { MsgKey.ER_PORT_WHEN_HOST_NULL, - "Der Port kann nicht festgelegt werden, wenn der Host gleich Null ist."}, + { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, + "Attribut {0} kann nicht nach untergeordneten Knoten oder vor dem Erstellen eines Elements hinzugef\u00FCgt werden. Attribut wird ignoriert." }, - { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, - "Der Host ist keine syntaktisch korrekte Adresse."}, + /* + * Note to translators: The stylesheet contained a reference to a + * namespace prefix that was undefined. The value of the substitution + * text is the name of the prefix. + */ + { MsgKey.ER_NAMESPACE_PREFIX, + "Namespace f\u00FCr Pr\u00E4fix \"{0}\" wurde nicht deklariert." }, - { MsgKey.ER_SCHEME_NOT_CONFORMANT, - "Das Schema ist nicht angepasst."}, + /* + * Note to translators: This message is reported if the stylesheet + * being processed attempted to construct an XML document with an + * attribute in a place other than on an element. The substitution text + * specifies the name of the attribute. + */ + { MsgKey.ER_STRAY_ATTRIBUTE, + "Attribut \"{0}\" au\u00DFerhalb des Elements." }, - { MsgKey.ER_SCHEME_FROM_NULL_STRING, - "Schema kann nicht von Nullzeichenfolge festgelegt werden."}, + /* + * Note to translators: As with the preceding message, a namespace + * declaration has the form of an attribute and is only permitted to + * appear on an element. The substitution text {0} is the namespace + * prefix and {1} is the URI that was being used in the erroneous + * namespace declaration. + */ + { MsgKey.ER_STRAY_NAMESPACE, + "Namespace-Deklaration {0}={1} au\u00DFerhalb des Elements." }, - { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, - "Der Pfad enth\u00e4lt eine ung\u00fcltige Escapezeichenfolge."}, + { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, + "\"{0}\" konnte nicht geladen werden (CLASSPATH pr\u00FCfen). Die Standardwerte werden verwendet" }, - { MsgKey.ER_PATH_INVALID_CHAR, - "Pfad enth\u00e4lt ung\u00fcltiges Zeichen: {0}."}, + { MsgKey.ER_ILLEGAL_CHARACTER, + "Versuch, Zeichen mit Integralwert {0} auszugeben, das nicht in der speziellen Ausgabecodierung von {1} dargestellt wird." }, - { MsgKey.ER_FRAG_INVALID_CHAR, - "Fragment enth\u00e4lt ein ung\u00fcltiges Zeichen."}, + { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, + "Property-Datei \"{0}\" konnte f\u00FCr Ausgabemethode \"{1}\" nicht geladen werden (CLASSPATH pr\u00FCfen)" }, - { MsgKey.ER_FRAG_WHEN_PATH_NULL, - "Fragment kann nicht festgelegt werden, wenn der Pfad gleich Null ist."}, + { MsgKey.ER_INVALID_PORT, + "Ung\u00FCltige Portnummer" }, - { MsgKey.ER_FRAG_FOR_GENERIC_URI, - "Fragment kann nur f\u00fcr eine generische URI (Uniform Resource Identifier) festgelegt werden."}, + { MsgKey.ER_PORT_WHEN_HOST_NULL, + "Port kann nicht festgelegt werden, wenn der Host null ist" }, - { MsgKey.ER_NO_SCHEME_IN_URI, - "Kein Schema gefunden in URI: {0}."}, + { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, + "Host ist keine wohlgeformte Adresse" }, - { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, - "URI (Uniform Resource Identifier) kann nicht mit leeren Parametern initialisiert werden."}, + { MsgKey.ER_SCHEME_NOT_CONFORMANT, + "Schema ist nicht konform." }, - { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, - "Fragment kann nicht im Pfad und im Fragment angegeben werden."}, + { MsgKey.ER_SCHEME_FROM_NULL_STRING, + "Schema kann nicht von Nullzeichenfolge festgelegt werden" }, - { MsgKey.ER_NO_QUERY_STRING_IN_PATH, - "Abfragezeichenfolge kann nicht im Pfad und in der Abfragezeichenfolge angegeben werden."}, + { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, + "Pfad enth\u00E4lt eine ung\u00FCltige Escapesequenz" }, - { MsgKey.ER_NO_PORT_IF_NO_HOST, - "Der Port kann nicht angegeben werden, wenn der Host nicht angegeben wurde."}, + { MsgKey.ER_PATH_INVALID_CHAR, + "Pfad enth\u00E4lt ung\u00FCltiges Zeichen: {0}" }, - { MsgKey.ER_NO_USERINFO_IF_NO_HOST, - "Benutzerinformationen k\u00f6nnen nicht angegeben werden, wenn der Host nicht angegeben wurde."}, + { MsgKey.ER_FRAG_INVALID_CHAR, + "Fragment enth\u00E4lt ein ung\u00FCltiges Zeichen" }, - { MsgKey.ER_SCHEME_REQUIRED, - "Schema ist erforderlich!"} + { MsgKey.ER_FRAG_WHEN_PATH_NULL, + "Fragment kann nicht festgelegt werden, wenn der Pfad null ist" }, - }; - return contents; - } + { MsgKey.ER_FRAG_FOR_GENERIC_URI, + "Fragment kann nur f\u00FCr einen generischen URI festgelegt werden" }, + + { MsgKey.ER_NO_SCHEME_IN_URI, + "Kein Schema gefunden in URI" }, + + { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, + "URI kann nicht mit leeren Parametern initialisiert werden" }, + + { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, + "Fragment kann nicht im Pfad und im Fragment angegeben werden" }, + + { MsgKey.ER_NO_QUERY_STRING_IN_PATH, + "Abfragezeichenfolge kann nicht im Pfad und in der Abfragezeichenfolge angegeben werden" }, + + { MsgKey.ER_NO_PORT_IF_NO_HOST, + "Port kann nicht angegeben werden, wenn der Host nicht angegeben wurde" }, + + { MsgKey.ER_NO_USERINFO_IF_NO_HOST, + "Benutzerinformationen k\u00F6nnen nicht angegeben werden, wenn der Host nicht angegeben wurde" }, + + { MsgKey.ER_XML_VERSION_NOT_SUPPORTED, + "Warnung: Die Version des Ausgabedokuments soll \"{0}\" sein. Diese Version von XML wird nicht unterst\u00FCtzt. Die Version des Ausgabedokuments wird \"1.0\" sein." }, + + { MsgKey.ER_SCHEME_REQUIRED, + "Schema ist erforderlich." }, + + /* + * Note to translators: The words 'Properties' and + * 'SerializerFactory' in this message are Java class names + * and should not be translated. + */ + { MsgKey.ER_FACTORY_PROPERTY_MISSING, + "Das an die SerializerFactory \u00FCbergebene Properties-Objekt verf\u00FCgt \u00FCber keine Eigenschaft \"{0}\"." }, + + { MsgKey.ER_ENCODING_NOT_SUPPORTED, + "Warnung: Die Codierung \"{0}\" wird nicht von der Java-Laufzeit unterst\u00FCtzt." }, + + + }; + + return contents; + } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java index 8cec0b3cf97..4628321c2a0 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,105 +18,191 @@ * limitations under the License. */ /* - * $Id: SerializerMessages_es.java,v 1.1.4.1 2005/09/08 11:03:13 suresh_emailid Exp $ + * $Id: SerializerMessages_es.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 09:06:34 gmolloy Exp $ */ - package com.sun.org.apache.xml.internal.serializer.utils; import java.util.ListResourceBundle; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +/** + * An instance of this class is a ListResourceBundle that + * has the required getContents() method that returns + * an array of message-key/message associations. + *

    + * The message keys are defined in {@link MsgKey}. The + * messages that those keys map to are defined here. + *

    + * The messages in the English version are intended to be + * translated. + * + * This class is not a public API, it is only public because it is + * used in com.sun.org.apache.xml.internal.serializer. + * + * @xsl.usage internal + */ public class SerializerMessages_es extends ListResourceBundle { - public Object[][] getContents() { - Object[][] contents = new Object[][] { - // BAD_MSGKEY needs translation - // BAD_MSGFORMAT needs translation - { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, - "La clase serializer ''{0}'' no implementa org.xml.sax.ContentHandler."}, - { MsgKey.ER_RESOURCE_COULD_NOT_FIND, - "No se ha podido cargar el recurso [ {0} ].\n{1}"}, + /* + * This file contains error and warning messages related to + * Serializer Error Handling. + * + * General notes to translators: - { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, - "No se ha podido cargar el recurso [ {0} ]: {1} \n {2} \n {3}"}, + * 1) A stylesheet is a description of how to transform an input XML document + * into a resultant XML document (or HTML document or text). The + * stylesheet itself is described in the form of an XML document. - { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, - "Tama\u00f1o de almacenamiento intermedio <=0"}, + * + * 2) An element is a mark-up tag in an XML document; an attribute is a + * modifier on the tag. For example, in + * "elem" is an element name, "attr" and "attr2" are attribute names with + * the values "val" and "val2", respectively. + * + * 3) A namespace declaration is a special attribute that is used to associate + * a prefix with a URI (the namespace). The meanings of element names and + * attribute names that use that prefix are defined with respect to that + * namespace. + * + * + */ - { MsgKey.ER_INVALID_UTF16_SURROGATE, - "\u00bfSe ha detectado un sustituto UTF-16 no v\u00e1lido: {0}?"}, + /** The lookup table for error messages. */ + public Object[][] getContents() { + Object[][] contents = new Object[][] { + { MsgKey.BAD_MSGKEY, + "La clave de mensaje ''{0}'' no est\u00E1 en la clase de mensaje ''{1}''" }, - { MsgKey.ER_OIERROR, - "Error de ES"}, + { MsgKey.BAD_MSGFORMAT, + "Fallo de formato del mensaje ''{0}'' en la clase de mensaje ''{1}''." }, - { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, - "No se puede a\u00f1adir el atributo {0} despu\u00e9s de nodos hijo o antes de que se produzca un elemento. Se ignorar\u00e1 el atributo."}, + { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, + "La clase de serializador ''{0}'' no implanta org.xml.sax.ContentHandler." }, - { MsgKey.ER_NAMESPACE_PREFIX, - "No se ha declarado el espacio de nombres para el prefijo ''{0}''."}, + { MsgKey.ER_RESOURCE_COULD_NOT_FIND, + "No se ha encontrado el recurso [ {0} ].\n {1}" }, - // ER_STRAY_ATTRIBUTE needs translation - { MsgKey.ER_STRAY_NAMESPACE, - "Declaraci\u00f3n del espacio de nombres ''{0}''=''{1}'' fuera del elemento."}, + { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, + "No se ha podido cargar el recurso [ {0} ]: {1} \n {2} \t {3}" }, - { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, - "No se ha podido cargar ''{0}'' (compruebe la CLASSPATH), ahora s\u00f3lo se est\u00e1n utilizando los valores por omisi\u00f3n"}, + { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, + "Tama\u00F1o de buffer menor o igual que 0" }, - // ER_ILLEGAL_CHARACTER needs translation - { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, - "No se ha podido cargar el archivo de propiedades ''{0}'' para el m\u00e9todo de salida ''{1}'' (compruebe la CLASSPATH)"}, + { MsgKey.ER_INVALID_UTF16_SURROGATE, + "\u00BFSe ha detectado un sustituto UTF-16 no v\u00E1lido: {0}?" }, - { MsgKey.ER_INVALID_PORT, - "N\u00famero de puerto no v\u00e1lido"}, + { MsgKey.ER_OIERROR, + "Error de E/S" }, - { MsgKey.ER_PORT_WHEN_HOST_NULL, - "No se puede establecer el puerto si el sistema principal es nulo"}, + { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, + "No se puede agregar el atributo {0} despu\u00E9s de nodos secundarios o antes de que se produzca un elemento. Se ignorar\u00E1 el atributo." }, - { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, - "El sistema principal no es una direcci\u00f3n bien formada"}, + /* + * Note to translators: The stylesheet contained a reference to a + * namespace prefix that was undefined. The value of the substitution + * text is the name of the prefix. + */ + { MsgKey.ER_NAMESPACE_PREFIX, + "No se ha declarado el espacio de nombres para el prefijo ''{0}''." }, - { MsgKey.ER_SCHEME_NOT_CONFORMANT, - "El esquema no es compatible."}, + /* + * Note to translators: This message is reported if the stylesheet + * being processed attempted to construct an XML document with an + * attribute in a place other than on an element. The substitution text + * specifies the name of the attribute. + */ + { MsgKey.ER_STRAY_ATTRIBUTE, + "El atributo ''{0}'' est\u00E1 fuera del elemento." }, - { MsgKey.ER_SCHEME_FROM_NULL_STRING, - "No se puede establecer un esquema de una serie nula"}, + /* + * Note to translators: As with the preceding message, a namespace + * declaration has the form of an attribute and is only permitted to + * appear on an element. The substitution text {0} is the namespace + * prefix and {1} is the URI that was being used in the erroneous + * namespace declaration. + */ + { MsgKey.ER_STRAY_NAMESPACE, + "Declaraci\u00F3n del espacio de nombres ''{0}''=''{1}'' fuera del elemento." }, - { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, - "La v\u00eda de acceso contiene una secuencia de escape no v\u00e1lida"}, + { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, + "No se ha podido cargar ''{0}'' (compruebe la CLASSPATH), ahora s\u00F3lo se est\u00E1n utilizando los valores por defecto" }, - { MsgKey.ER_PATH_INVALID_CHAR, - "La v\u00eda de acceso contiene un car\u00e1cter no v\u00e1lido: {0}"}, + { MsgKey.ER_ILLEGAL_CHARACTER, + "Intento de realizar la salida del car\u00E1cter del valor integral {0}, que no est\u00E1 representado en la codificaci\u00F3n de salida de {1}." }, - { MsgKey.ER_FRAG_INVALID_CHAR, - "El fragmento contiene un car\u00e1cter no v\u00e1lido"}, + { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, + "No se ha podido cargar el archivo de propiedades ''{0}'' para el m\u00E9todo de salida ''{1}'' (compruebe la CLASSPATH)" }, - { MsgKey.ER_FRAG_WHEN_PATH_NULL, - "No se puede establecer el fragmento si la v\u00eda de acceso es nula"}, + { MsgKey.ER_INVALID_PORT, + "N\u00FAmero de puerto no v\u00E1lido" }, - { MsgKey.ER_FRAG_FOR_GENERIC_URI, - "S\u00f3lo se puede establecer el fragmento para un URI gen\u00e9rico"}, + { MsgKey.ER_PORT_WHEN_HOST_NULL, + "No se puede definir el puerto si el host es nulo" }, - { MsgKey.ER_NO_SCHEME_IN_URI, - "No se ha encontrado un esquema en el URI: {0}"}, + { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, + "El formato de la direcci\u00F3n de host no es correcto" }, - { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, - "No se puede inicializar el URI con par\u00e1metros vac\u00edos"}, + { MsgKey.ER_SCHEME_NOT_CONFORMANT, + "El esquema no es v\u00E1lido." }, - { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, - "No se puede especificar el fragmento en la v\u00eda de acceso y en el fragmento"}, + { MsgKey.ER_SCHEME_FROM_NULL_STRING, + "No se puede definir un esquema a partir de una cadena nula" }, - { MsgKey.ER_NO_QUERY_STRING_IN_PATH, - "No se puede especificar la serie de consulta en la v\u00eda de acceso y en la serie de consulta"}, + { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, + "La ruta de acceso contiene una secuencia de escape no v\u00E1lida" }, - { MsgKey.ER_NO_PORT_IF_NO_HOST, - "No se puede especificar el puerto si no se ha especificado el sistema principal"}, + { MsgKey.ER_PATH_INVALID_CHAR, + "La ruta de acceso contiene un car\u00E1cter no v\u00E1lido: {0}" }, - { MsgKey.ER_NO_USERINFO_IF_NO_HOST, - "No se puede especificar la informaci\u00f3n de usuario si no se ha especificado el sistema principal"}, + { MsgKey.ER_FRAG_INVALID_CHAR, + "El fragmento contiene un car\u00E1cter no v\u00E1lido" }, - { MsgKey.ER_SCHEME_REQUIRED, - "\u00a1Se necesita un esquema!"} + { MsgKey.ER_FRAG_WHEN_PATH_NULL, + "No se puede definir el fragmento si la ruta de acceso es nula" }, - }; - return contents; - } + { MsgKey.ER_FRAG_FOR_GENERIC_URI, + "S\u00F3lo se puede definir el fragmento para un URI gen\u00E9rico" }, + + { MsgKey.ER_NO_SCHEME_IN_URI, + "No se ha encontrado un esquema en el URI" }, + + { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, + "No se puede inicializar el URI con par\u00E1metros vac\u00EDos" }, + + { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, + "No se puede especificar el fragmento en la ruta de acceso y en el fragmento" }, + + { MsgKey.ER_NO_QUERY_STRING_IN_PATH, + "No se puede especificar la cadena de consulta en la ruta de acceso y en la cadena de consulta" }, + + { MsgKey.ER_NO_PORT_IF_NO_HOST, + "No se puede especificar el puerto si no se ha especificado el host" }, + + { MsgKey.ER_NO_USERINFO_IF_NO_HOST, + "No se puede especificar la informaci\u00F3n de usuario si no se ha especificado el host" }, + + { MsgKey.ER_XML_VERSION_NOT_SUPPORTED, + "Advertencia: es necesario que la versi\u00F3n del documento de salida sea ''{0}''. Esta versi\u00F3n de XML no est\u00E1 soportada. La versi\u00F3n del documento de salida ser\u00E1 ''1.0''." }, + + { MsgKey.ER_SCHEME_REQUIRED, + "Se necesita un esquema." }, + + /* + * Note to translators: The words 'Properties' and + * 'SerializerFactory' in this message are Java class names + * and should not be translated. + */ + { MsgKey.ER_FACTORY_PROPERTY_MISSING, + "El objeto de propiedades transferido a SerializerFactory no tiene una propiedad ''{0}''." }, + + { MsgKey.ER_ENCODING_NOT_SUPPORTED, + "Advertencia: el tiempo de ejecuci\u00F3n de Java no soporta la codificaci\u00F3n ''{0}''." }, + + + }; + + return contents; + } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java index c46cd0fff81..97fb91fea96 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,105 +18,191 @@ * limitations under the License. */ /* - * $Id: SerializerMessages_fr.java,v 1.1.4.1 2005/09/08 11:03:13 suresh_emailid Exp $ + * $Id: SerializerMessages_fr.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 07:05:15 gmolloy Exp $ */ - package com.sun.org.apache.xml.internal.serializer.utils; import java.util.ListResourceBundle; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +/** + * An instance of this class is a ListResourceBundle that + * has the required getContents() method that returns + * an array of message-key/message associations. + *

    + * The message keys are defined in {@link MsgKey}. The + * messages that those keys map to are defined here. + *

    + * The messages in the English version are intended to be + * translated. + * + * This class is not a public API, it is only public because it is + * used in com.sun.org.apache.xml.internal.serializer. + * + * @xsl.usage internal + */ public class SerializerMessages_fr extends ListResourceBundle { - public Object[][] getContents() { - Object[][] contents = new Object[][] { - // BAD_MSGKEY needs translation - // BAD_MSGFORMAT needs translation - { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, - "La classe de la m\u00e9thode de s\u00e9rialisation ''{0}'' n''impl\u00e9mente pas org.xml.sax.ContentHandler."}, - { MsgKey.ER_RESOURCE_COULD_NOT_FIND, - "La ressource [ {0} ] est introuvable.\n {1}"}, + /* + * This file contains error and warning messages related to + * Serializer Error Handling. + * + * General notes to translators: - { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, - "La ressource [ {0} ] n''a pas pu charger : {1} \n {2} \n {3}"}, + * 1) A stylesheet is a description of how to transform an input XML document + * into a resultant XML document (or HTML document or text). The + * stylesheet itself is described in the form of an XML document. - { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, - "Taille du tampon <=0"}, + * + * 2) An element is a mark-up tag in an XML document; an attribute is a + * modifier on the tag. For example, in + * "elem" is an element name, "attr" and "attr2" are attribute names with + * the values "val" and "val2", respectively. + * + * 3) A namespace declaration is a special attribute that is used to associate + * a prefix with a URI (the namespace). The meanings of element names and + * attribute names that use that prefix are defined with respect to that + * namespace. + * + * + */ - { MsgKey.ER_INVALID_UTF16_SURROGATE, - "Substitut UTF-16 non valide d\u00e9tect\u00e9 : {0} ?"}, + /** The lookup table for error messages. */ + public Object[][] getContents() { + Object[][] contents = new Object[][] { + { MsgKey.BAD_MSGKEY, + "La cl\u00E9 de message ''{0}'' ne figure pas dans la classe de messages ''{1}''" }, - { MsgKey.ER_OIERROR, - "Erreur d''E-S"}, + { MsgKey.BAD_MSGFORMAT, + "Echec du format de message ''{0}'' dans la classe de messages ''{1}''." }, - { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, - "Ajout impossible de l''attribut {0} apr\u00e8s des noeuds enfants ou avant la production d''un \u00e9l\u00e9ment. L''attribut est ignor\u00e9."}, + { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, + "La classe de serializer ''{0}'' n''impl\u00E9mente pas org.xml.sax.ContentHandler." }, - { MsgKey.ER_NAMESPACE_PREFIX, - "L''espace de noms du pr\u00e9fixe ''{0}'' n''a pas \u00e9t\u00e9 d\u00e9clar\u00e9."}, + { MsgKey.ER_RESOURCE_COULD_NOT_FIND, + "La ressource [ {0} ] est introuvable.\n {1}" }, - // ER_STRAY_ATTRIBUTE needs translation - { MsgKey.ER_STRAY_NAMESPACE, - "La d\u00e9claration d''espace de noms ''{0}''=''{1}'' est \u00e0 l''ext\u00e9rieur de l''\u00e9l\u00e9ment."}, + { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, + "La ressource [ {0} ] n''a pas pu charger : {1} \n {2} \t {3}" }, - { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, - "Impossible de charger ''{0}'' (v\u00e9rifier CLASSPATH), les valeurs par d\u00e9faut sont donc employ\u00e9es "}, + { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, + "Taille du tampon <=0" }, - // ER_ILLEGAL_CHARACTER needs translation - { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, - "Impossible de charger le fichier de propri\u00e9t\u00e9s ''{0}'' pour la m\u00e9thode de sortie ''{1}'' (v\u00e9rifier CLASSPATH)"}, + { MsgKey.ER_INVALID_UTF16_SURROGATE, + "Substitut UTF-16 non valide d\u00E9tect\u00E9 : {0} ?" }, - { MsgKey.ER_INVALID_PORT, - "Num\u00e9ro de port non valide"}, + { MsgKey.ER_OIERROR, + "Erreur d'E/S" }, - { MsgKey.ER_PORT_WHEN_HOST_NULL, - "Le port ne peut \u00eatre d\u00e9fini quand l'h\u00f4te est vide"}, + { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, + "Impossible d''ajouter l''attribut {0} apr\u00E8s des noeuds enfant ou avant la production d''un \u00E9l\u00E9ment. L''attribut est ignor\u00E9." }, - { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, - "L'h\u00f4te n'est pas une adresse bien form\u00e9e"}, + /* + * Note to translators: The stylesheet contained a reference to a + * namespace prefix that was undefined. The value of the substitution + * text is the name of the prefix. + */ + { MsgKey.ER_NAMESPACE_PREFIX, + "L''espace de noms du pr\u00E9fixe ''{0}'' n''a pas \u00E9t\u00E9 d\u00E9clar\u00E9." }, - { MsgKey.ER_SCHEME_NOT_CONFORMANT, - "Le processus n'est pas conforme."}, + /* + * Note to translators: This message is reported if the stylesheet + * being processed attempted to construct an XML document with an + * attribute in a place other than on an element. The substitution text + * specifies the name of the attribute. + */ + { MsgKey.ER_STRAY_ATTRIBUTE, + "Attribut ''{0}'' en dehors de l''\u00E9l\u00E9ment." }, - { MsgKey.ER_SCHEME_FROM_NULL_STRING, - "Impossible de d\u00e9finir le processus \u00e0 partir de la cha\u00eene vide"}, + /* + * Note to translators: As with the preceding message, a namespace + * declaration has the form of an attribute and is only permitted to + * appear on an element. The substitution text {0} is the namespace + * prefix and {1} is the URI that was being used in the erroneous + * namespace declaration. + */ + { MsgKey.ER_STRAY_NAMESPACE, + "La d\u00E9claration d''espace de noms ''{0}''=''{1}'' est \u00E0 l''ext\u00E9rieur de l''\u00E9l\u00E9ment." }, - { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, - "Le chemin d'acc\u00e8s contient une s\u00e9quence d'\u00e9chappement non valide"}, + { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, + "Impossible de charger ''{0}'' (v\u00E9rifier CLASSPATH), les valeurs par d\u00E9faut sont donc employ\u00E9es" }, - { MsgKey.ER_PATH_INVALID_CHAR, - "Le chemin contient un caract\u00e8re non valide : {0}"}, + { MsgKey.ER_ILLEGAL_CHARACTER, + "Tentative de sortie d''un caract\u00E8re avec une valeur enti\u00E8re {0}, non repr\u00E9sent\u00E9 dans l''encodage de sortie sp\u00E9cifi\u00E9 pour {1}." }, - { MsgKey.ER_FRAG_INVALID_CHAR, - "Le fragment contient un caract\u00e8re non valide"}, + { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, + "Impossible de charger le fichier de propri\u00E9t\u00E9s ''{0}'' pour la m\u00E9thode de sortie ''{1}'' (v\u00E9rifier CLASSPATH)" }, - { MsgKey.ER_FRAG_WHEN_PATH_NULL, - "Le fragment ne peut \u00eatre d\u00e9fini quand le chemin d'acc\u00e8s est vide"}, + { MsgKey.ER_INVALID_PORT, + "Num\u00E9ro de port non valide" }, - { MsgKey.ER_FRAG_FOR_GENERIC_URI, - "Le fragment ne peut \u00eatre d\u00e9fini que pour un URI g\u00e9n\u00e9rique"}, + { MsgKey.ER_PORT_WHEN_HOST_NULL, + "Impossible de d\u00E9finir le port quand l'h\u00F4te est NULL" }, - { MsgKey.ER_NO_SCHEME_IN_URI, - "Processus introuvable dans l''URI : {0}"}, + { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, + "Le format de l'adresse de l'h\u00F4te n'est pas correct" }, - { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, - "Impossible d'initialiser l'URI avec des param\u00e8tres vides"}, + { MsgKey.ER_SCHEME_NOT_CONFORMANT, + "Le mod\u00E8le n'est pas conforme." }, - { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, - "Le fragment ne doit pas \u00eatre indiqu\u00e9 \u00e0 la fois dans le chemin et dans le fragment"}, + { MsgKey.ER_SCHEME_FROM_NULL_STRING, + "Impossible de d\u00E9finir le mod\u00E8le \u00E0 partir de la cha\u00EEne NULL" }, - { MsgKey.ER_NO_QUERY_STRING_IN_PATH, - "La cha\u00eene de requ\u00eate ne doit pas figurer dans un chemin et une cha\u00eene de requ\u00eate"}, + { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, + "Le chemin d'acc\u00E8s contient une s\u00E9quence d'\u00E9chappement non valide" }, - { MsgKey.ER_NO_PORT_IF_NO_HOST, - "Le port peut ne pas \u00eatre sp\u00e9cifi\u00e9 si l'h\u00f4te n'est pas sp\u00e9cifi\u00e9"}, + { MsgKey.ER_PATH_INVALID_CHAR, + "Le chemin contient un caract\u00E8re non valide : {0}" }, - { MsgKey.ER_NO_USERINFO_IF_NO_HOST, - "Userinfo ne peut \u00eatre sp\u00e9cifi\u00e9 si l'h\u00f4te ne l'est pas"}, + { MsgKey.ER_FRAG_INVALID_CHAR, + "Le fragment contient un caract\u00E8re non valide" }, - { MsgKey.ER_SCHEME_REQUIRED, - "Processus requis !"} + { MsgKey.ER_FRAG_WHEN_PATH_NULL, + "Impossible de d\u00E9finir le fragment quand le chemin d'acc\u00E8s est NULL" }, - }; - return contents; - } + { MsgKey.ER_FRAG_FOR_GENERIC_URI, + "Le fragment ne peut \u00EAtre d\u00E9fini que pour un URI g\u00E9n\u00E9rique" }, + + { MsgKey.ER_NO_SCHEME_IN_URI, + "Mod\u00E8le introuvable dans l'URI" }, + + { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, + "Impossible d'initialiser l'URI avec des param\u00E8tres vides" }, + + { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, + "Le fragment ne doit pas \u00EAtre indiqu\u00E9 \u00E0 la fois dans le chemin et dans le fragment" }, + + { MsgKey.ER_NO_QUERY_STRING_IN_PATH, + "La cha\u00EEne de requ\u00EAte ne doit pas figurer dans un chemin et une cha\u00EEne de requ\u00EAte" }, + + { MsgKey.ER_NO_PORT_IF_NO_HOST, + "Le port peut ne pas \u00EAtre sp\u00E9cifi\u00E9 si l'h\u00F4te ne l'est pas" }, + + { MsgKey.ER_NO_USERINFO_IF_NO_HOST, + "Userinfo peut ne pas \u00EAtre sp\u00E9cifi\u00E9 si l'h\u00F4te ne l'est pas" }, + + { MsgKey.ER_XML_VERSION_NOT_SUPPORTED, + "Avertissement : la version du document de sortie doit \u00EAtre ''{0}''. Cette version XML n''est pas prise en charge. La version du document de sortie sera ''1.0''." }, + + { MsgKey.ER_SCHEME_REQUIRED, + "Mod\u00E8le obligatoire." }, + + /* + * Note to translators: The words 'Properties' and + * 'SerializerFactory' in this message are Java class names + * and should not be translated. + */ + { MsgKey.ER_FACTORY_PROPERTY_MISSING, + "L''objet de propri\u00E9t\u00E9s transmis \u00E0 SerializerFactory ne comporte aucune propri\u00E9t\u00E9 ''{0}''." }, + + { MsgKey.ER_ENCODING_NOT_SUPPORTED, + "Avertissement : l''encodage ''{0}'' n''est pas pris en charge par l''ex\u00E9cution Java." }, + + + }; + + return contents; + } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java index 8788cf9b74d..6d3977af38c 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,105 +18,191 @@ * limitations under the License. */ /* - * $Id: SerializerMessages_it.java,v 1.1.4.1 2005/09/08 11:03:15 suresh_emailid Exp $ + * $Id: SerializerMessages_it.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 07:02:00 gmolloy Exp $ */ - package com.sun.org.apache.xml.internal.serializer.utils; import java.util.ListResourceBundle; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +/** + * An instance of this class is a ListResourceBundle that + * has the required getContents() method that returns + * an array of message-key/message associations. + *

    + * The message keys are defined in {@link MsgKey}. The + * messages that those keys map to are defined here. + *

    + * The messages in the English version are intended to be + * translated. + * + * This class is not a public API, it is only public because it is + * used in com.sun.org.apache.xml.internal.serializer. + * + * @xsl.usage internal + */ public class SerializerMessages_it extends ListResourceBundle { - public Object[][] getContents() { - Object[][] contents = new Object[][] { - // BAD_MSGKEY needs translation - // BAD_MSGFORMAT needs translation - { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, - "La classe serializer ''{0}'' non implementa org.xml.sax.ContentHandler."}, - { MsgKey.ER_RESOURCE_COULD_NOT_FIND, - "Risorsa [ {0} ] non trovata.\n {1}"}, + /* + * This file contains error and warning messages related to + * Serializer Error Handling. + * + * General notes to translators: - { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, - "Impossibile caricare la risorsa [ {0} ]: {1} \n {2} \n {3}"}, + * 1) A stylesheet is a description of how to transform an input XML document + * into a resultant XML document (or HTML document or text). The + * stylesheet itself is described in the form of an XML document. - { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, - "Dimensione buffer <=0"}, + * + * 2) An element is a mark-up tag in an XML document; an attribute is a + * modifier on the tag. For example, in + * "elem" is an element name, "attr" and "attr2" are attribute names with + * the values "val" and "val2", respectively. + * + * 3) A namespace declaration is a special attribute that is used to associate + * a prefix with a URI (the namespace). The meanings of element names and + * attribute names that use that prefix are defined with respect to that + * namespace. + * + * + */ - { MsgKey.ER_INVALID_UTF16_SURROGATE, - "Rilevato surrogato UTF-16 non valido: {0} ?"}, + /** The lookup table for error messages. */ + public Object[][] getContents() { + Object[][] contents = new Object[][] { + { MsgKey.BAD_MSGKEY, + "La chiave di messaggio ''{0}'' non si trova nella classe messaggio ''{1}''" }, - { MsgKey.ER_OIERROR, - "Errore IO"}, + { MsgKey.BAD_MSGFORMAT, + "Formato di messaggio ''{0}'' in classe messaggio ''{1}'' non riuscito." }, - { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, - "Impossibile aggiungere l''attributo {0} dopo i nodi secondari o prima che sia prodotto un elemento. L''attributo verr\u00e0 ignorato. "}, + { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, + "La classe serializzatore ''{0}'' non implementa org.xml.sax.ContentHandler." }, - { MsgKey.ER_NAMESPACE_PREFIX, - "Lo spazio nomi per il prefisso ''{0}'' non \u00e8 stato dichiarato. "}, + { MsgKey.ER_RESOURCE_COULD_NOT_FIND, + "Risorsa [ {0} ] non trovata.\n {1}" }, - // ER_STRAY_ATTRIBUTE needs translation - { MsgKey.ER_STRAY_NAMESPACE, - "Dichiarazione dello spazio nome ''{0}''=''{1}'' al di fuori dell''elemento. "}, + { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, + "Impossibile caricare la risorsa [ {0} ]: {1} \n {2} \t {3}" }, - { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, - "Impossibile caricare ''{0}'' (verificare CLASSPATH); verranno utilizzati i valori predefiniti "}, + { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, + "Dimensione buffer <=0" }, - // ER_ILLEGAL_CHARACTER needs translation - { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, - "Impossibile caricare il file delle propriet\u00e0 ''{0}'' per il metodo di emissione ''{1}'' (verificare CLASSPATH)"}, + { MsgKey.ER_INVALID_UTF16_SURROGATE, + "Rilevato surrogato UTF-16 non valido: {0}?" }, - { MsgKey.ER_INVALID_PORT, - "Numero di porta non valido"}, + { MsgKey.ER_OIERROR, + "Errore di I/O" }, - { MsgKey.ER_PORT_WHEN_HOST_NULL, - "La porta non pu\u00f2 essere impostata se l'host \u00e8 nullo"}, + { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, + "Impossibile aggiungere l''attributo {0} dopo i nodi figlio o prima che sia prodotto un elemento. L''attributo verr\u00E0 ignorato." }, - { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, - "Host non \u00e8 un'indirizzo corretto"}, + /* + * Note to translators: The stylesheet contained a reference to a + * namespace prefix that was undefined. The value of the substitution + * text is the name of the prefix. + */ + { MsgKey.ER_NAMESPACE_PREFIX, + "Lo spazio di nomi per il prefisso ''{0}'' non \u00E8 stato dichiarato." }, - { MsgKey.ER_SCHEME_NOT_CONFORMANT, - "Lo schema non \u00e8 conforme."}, + /* + * Note to translators: This message is reported if the stylesheet + * being processed attempted to construct an XML document with an + * attribute in a place other than on an element. The substitution text + * specifies the name of the attribute. + */ + { MsgKey.ER_STRAY_ATTRIBUTE, + "Attributo ''{0}'' al di fuori dell''elemento." }, - { MsgKey.ER_SCHEME_FROM_NULL_STRING, - "Impossibile impostare lo schema da una stringa nulla"}, + /* + * Note to translators: As with the preceding message, a namespace + * declaration has the form of an attribute and is only permitted to + * appear on an element. The substitution text {0} is the namespace + * prefix and {1} is the URI that was being used in the erroneous + * namespace declaration. + */ + { MsgKey.ER_STRAY_NAMESPACE, + "Dichiarazione dello spazio di nomi ''{0}''=''{1}'' al di fuori dell''elemento." }, - { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, - "Il percorso contiene sequenza di escape non valida"}, + { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, + "Impossibile caricare ''{0}'' (verificare CLASSPATH); verranno utilizzati i valori predefiniti" }, - { MsgKey.ER_PATH_INVALID_CHAR, - "Il percorso contiene un carattere non valido: {0}"}, + { MsgKey.ER_ILLEGAL_CHARACTER, + "Tentativo di eseguire l''output di un carattere di valore integrale {0} non rappresentato nella codifica di output {1} specificata." }, - { MsgKey.ER_FRAG_INVALID_CHAR, - "Il frammento contiene un carattere non valido"}, + { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, + "Impossibile caricare il file delle propriet\u00E0 ''{0}'' per il metodo di emissione ''{1}'' (verificare CLASSPATH)" }, - { MsgKey.ER_FRAG_WHEN_PATH_NULL, - "Il frammento non pu\u00f2 essere impostato se il percorso \u00e8 nullo"}, + { MsgKey.ER_INVALID_PORT, + "Numero di porta non valido" }, - { MsgKey.ER_FRAG_FOR_GENERIC_URI, - "Il frammento pu\u00f2 essere impostato solo per un URI generico"}, + { MsgKey.ER_PORT_WHEN_HOST_NULL, + "La porta non pu\u00F2 essere impostata se l'host \u00E8 nullo" }, - { MsgKey.ER_NO_SCHEME_IN_URI, - "Nessuno schema trovato nell''URI: {0}"}, + { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, + "Host non \u00E8 un indirizzo corretto" }, - { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, - "Impossibile inizializzare l'URI con i parametri vuoti"}, + { MsgKey.ER_SCHEME_NOT_CONFORMANT, + "Lo schema non \u00E8 conforme." }, - { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, - "Il frammento non pu\u00f2 essere specificato sia nel percorso che nel frammento"}, + { MsgKey.ER_SCHEME_FROM_NULL_STRING, + "Impossibile impostare lo schema da una stringa nulla" }, - { MsgKey.ER_NO_QUERY_STRING_IN_PATH, - "La stringa di interrogazione non pu\u00f2 essere specificata nella stringa di interrogazione e percorso."}, + { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, + "Il percorso contiene sequenza di escape non valida" }, - { MsgKey.ER_NO_PORT_IF_NO_HOST, - "La porta non pu\u00f2 essere specificata se l'host non \u00e8 specificato"}, + { MsgKey.ER_PATH_INVALID_CHAR, + "Il percorso contiene un carattere non valido: {0}" }, - { MsgKey.ER_NO_USERINFO_IF_NO_HOST, - "Userinfo non pu\u00f2 essere specificato se l'host non \u00e8 specificato"}, + { MsgKey.ER_FRAG_INVALID_CHAR, + "Il frammento contiene un carattere non valido" }, - { MsgKey.ER_SCHEME_REQUIRED, - "Lo schema \u00e8 obbligatorio."} + { MsgKey.ER_FRAG_WHEN_PATH_NULL, + "Il frammento non pu\u00F2 essere impostato se il percorso \u00E8 nullo" }, - }; - return contents; - } + { MsgKey.ER_FRAG_FOR_GENERIC_URI, + "Il frammento pu\u00F2 essere impostato solo per un URI generico" }, + + { MsgKey.ER_NO_SCHEME_IN_URI, + "Nessuno schema trovato nell'URI" }, + + { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, + "Impossibile inizializzare l'URI con i parametri vuoti" }, + + { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, + "Il frammento non pu\u00F2 essere specificato sia nel percorso che nel frammento" }, + + { MsgKey.ER_NO_QUERY_STRING_IN_PATH, + "La stringa di query non pu\u00F2 essere specificata nella stringa di percorso e query." }, + + { MsgKey.ER_NO_PORT_IF_NO_HOST, + "La porta non pu\u00F2 essere specificata se l'host non \u00E8 specificato" }, + + { MsgKey.ER_NO_USERINFO_IF_NO_HOST, + "Userinfo non pu\u00F2 essere specificato se l'host non \u00E8 specificato" }, + + { MsgKey.ER_XML_VERSION_NOT_SUPPORTED, + "Avvertenza: la versione del documento di output deve essere ''{0}''. Questa versione di XML non \u00E8 supportata. La versione del documento di output sar\u00E0 ''1.0''." }, + + { MsgKey.ER_SCHEME_REQUIRED, + "Lo schema \u00E8 obbligatorio." }, + + /* + * Note to translators: The words 'Properties' and + * 'SerializerFactory' in this message are Java class names + * and should not be translated. + */ + { MsgKey.ER_FACTORY_PROPERTY_MISSING, + "L''oggetto Properties passato a SerializerFactory non dispone di una propriet\u00E0 ''{0}''." }, + + { MsgKey.ER_ENCODING_NOT_SUPPORTED, + "Avvertenza: la codifica ''{0}'' non \u00E8 supportata da Java Runtime." }, + + + }; + + return contents; + } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java index 1fd524fbcef..069c9f8b2d7 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,105 +18,191 @@ * limitations under the License. */ /* - * $Id: SerializerMessages_ja.java,v 1.1.4.1 2005/09/08 11:03:16 suresh_emailid Exp $ + * $Id: SerializerMessages_ja.java /st_wptg_1.8.0.0.0jdk/2 2013/09/12 17:39:58 gmolloy Exp $ */ - package com.sun.org.apache.xml.internal.serializer.utils; import java.util.ListResourceBundle; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +/** + * An instance of this class is a ListResourceBundle that + * has the required getContents() method that returns + * an array of message-key/message associations. + *

    + * The message keys are defined in {@link MsgKey}. The + * messages that those keys map to are defined here. + *

    + * The messages in the English version are intended to be + * translated. + * + * This class is not a public API, it is only public because it is + * used in com.sun.org.apache.xml.internal.serializer. + * + * @xsl.usage internal + */ public class SerializerMessages_ja extends ListResourceBundle { - public Object[][] getContents() { - Object[][] contents = new Object[][] { - // BAD_MSGKEY needs translation - // BAD_MSGFORMAT needs translation - { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, - "\u30b7\u30ea\u30a2\u30e9\u30a4\u30b6\u30fc\u30fb\u30af\u30e9\u30b9 ''{0}'' \u306f org.xml.sax.ContentHandler \u3092\u30a4\u30f3\u30d7\u30ea\u30e1\u30f3\u30c8\u3057\u307e\u305b\u3093\u3002"}, - { MsgKey.ER_RESOURCE_COULD_NOT_FIND, - "\u30ea\u30bd\u30fc\u30b9 [ {0} ] \u306f\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002\n {1}"}, + /* + * This file contains error and warning messages related to + * Serializer Error Handling. + * + * General notes to translators: - { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, - "\u30ea\u30bd\u30fc\u30b9 [ {0} ] \u3092\u30ed\u30fc\u30c9\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f: {1} \n {2} \n {3}"}, + * 1) A stylesheet is a description of how to transform an input XML document + * into a resultant XML document (or HTML document or text). The + * stylesheet itself is described in the form of an XML document. - { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, - "\u30d0\u30c3\u30d5\u30a1\u30fc\u30fb\u30b5\u30a4\u30ba <=0"}, + * + * 2) An element is a mark-up tag in an XML document; an attribute is a + * modifier on the tag. For example, in + * "elem" is an element name, "attr" and "attr2" are attribute names with + * the values "val" and "val2", respectively. + * + * 3) A namespace declaration is a special attribute that is used to associate + * a prefix with a URI (the namespace). The meanings of element names and + * attribute names that use that prefix are defined with respect to that + * namespace. + * + * + */ - { MsgKey.ER_INVALID_UTF16_SURROGATE, - "\u7121\u52b9\u306a UTF-16 \u30b5\u30ed\u30b2\u30fc\u30c8\u304c\u691c\u51fa\u3055\u308c\u307e\u3057\u305f: {0} ?"}, + /** The lookup table for error messages. */ + public Object[][] getContents() { + Object[][] contents = new Object[][] { + { MsgKey.BAD_MSGKEY, + "\u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC''{0}''\u306F\u3001\u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AF\u30E9\u30B9''{1}''\u3067\u306F\u3042\u308A\u307E\u305B\u3093" }, - { MsgKey.ER_OIERROR, - "\u5165\u51fa\u529b\u30a8\u30e9\u30fc"}, + { MsgKey.BAD_MSGFORMAT, + "\u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AF\u30E9\u30B9''{1}''\u306E\u30E1\u30C3\u30BB\u30FC\u30B8''{0}''\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002" }, - { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, - "\u4e0b\u4f4d\u30ce\u30fc\u30c9\u306e\u5f8c\u307e\u305f\u306f\u30a8\u30ec\u30e1\u30f3\u30c8\u304c\u751f\u6210\u3055\u308c\u308b\u524d\u306b\u5c5e\u6027 {0} \u3092\u8ffd\u52a0\u3067\u304d\u307e\u305b\u3093\u3002\u5c5e\u6027\u306f\u7121\u8996\u3055\u308c\u307e\u3059\u3002"}, + { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, + "\u30B7\u30EA\u30A2\u30E9\u30A4\u30B6\u30FB\u30AF\u30E9\u30B9''{0}''\u306Forg.xml.sax.ContentHandler\u3092\u5B9F\u88C5\u3057\u307E\u305B\u3093\u3002" }, - { MsgKey.ER_NAMESPACE_PREFIX, - "\u63a5\u982d\u90e8 ''{0}'' \u306e\u30cd\u30fc\u30e0\u30fb\u30b9\u30da\u30fc\u30b9\u304c\u5ba3\u8a00\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, + { MsgKey.ER_RESOURCE_COULD_NOT_FIND, + "\u30EA\u30BD\u30FC\u30B9[ {0} ]\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\n {1}" }, - // ER_STRAY_ATTRIBUTE needs translation - { MsgKey.ER_STRAY_NAMESPACE, - "\u30cd\u30fc\u30e0\u30fb\u30b9\u30da\u30fc\u30b9\u5ba3\u8a00 ''{0}''=''{1}'' \u304c\u30a8\u30ec\u30e1\u30f3\u30c8\u306e\u5916\u5074\u3067\u3059\u3002"}, + { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, + "\u30EA\u30BD\u30FC\u30B9[ {0} ]\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: {1} \n {2} \t {3}" }, - { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, - "''{0}'' \u3092\u30ed\u30fc\u30c9\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f (CLASSPATH \u3092\u8abf\u3079\u3066\u304f\u3060\u3055\u3044)\u3002\u73fe\u5728\u306f\u5358\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002"}, + { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, + "\u30D0\u30C3\u30D5\u30A1\u30FB\u30B5\u30A4\u30BA<=0" }, - // ER_ILLEGAL_CHARACTER needs translation - { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, - "\u51fa\u529b\u30e1\u30bd\u30c3\u30c9 ''{1}'' \u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u30fc\u30fb\u30d5\u30a1\u30a4\u30eb ''{0}'' \u3092\u30ed\u30fc\u30c9\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f (CLASSPATH \u3092\u78ba\u8a8d)"}, + { MsgKey.ER_INVALID_UTF16_SURROGATE, + "\u7121\u52B9\u306AUTF-16\u30B5\u30ED\u30B2\u30FC\u30C8\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F: {0}\u3002" }, - { MsgKey.ER_INVALID_PORT, - "\u7121\u52b9\u306a\u30dd\u30fc\u30c8\u756a\u53f7"}, + { MsgKey.ER_OIERROR, + "IO\u30A8\u30E9\u30FC" }, - { MsgKey.ER_PORT_WHEN_HOST_NULL, - "\u30db\u30b9\u30c8\u304c\u30cc\u30eb\u3067\u3042\u308b\u3068\u30dd\u30fc\u30c8\u3092\u8a2d\u5b9a\u3067\u304d\u307e\u305b\u3093"}, + { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, + "\u5B50\u30CE\u30FC\u30C9\u306E\u5F8C\u307E\u305F\u306F\u8981\u7D20\u304C\u751F\u6210\u3055\u308C\u308B\u524D\u306B\u5C5E\u6027{0}\u3092\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002\u5C5E\u6027\u306F\u7121\u8996\u3055\u308C\u307E\u3059\u3002" }, - { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, - "\u30db\u30b9\u30c8\u306f\u3046\u307e\u304f\u69cb\u6210\u3055\u308c\u305f\u30a2\u30c9\u30ec\u30b9\u3067\u3042\u308a\u307e\u305b\u3093"}, + /* + * Note to translators: The stylesheet contained a reference to a + * namespace prefix that was undefined. The value of the substitution + * text is the name of the prefix. + */ + { MsgKey.ER_NAMESPACE_PREFIX, + "\u63A5\u982D\u8F9E''{0}''\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002" }, - { MsgKey.ER_SCHEME_NOT_CONFORMANT, - "\u30b9\u30ad\u30fc\u30e0\u306f\u4e00\u81f4\u3057\u3066\u3044\u307e\u305b\u3093\u3002"}, + /* + * Note to translators: This message is reported if the stylesheet + * being processed attempted to construct an XML document with an + * attribute in a place other than on an element. The substitution text + * specifies the name of the attribute. + */ + { MsgKey.ER_STRAY_ATTRIBUTE, + "\u5C5E\u6027''{0}''\u304C\u8981\u7D20\u306E\u5916\u5074\u306B\u3042\u308A\u307E\u3059\u3002" }, - { MsgKey.ER_SCHEME_FROM_NULL_STRING, - "\u30cc\u30eb\u30fb\u30b9\u30c8\u30ea\u30f3\u30b0\u304b\u3089\u306f\u30b9\u30ad\u30fc\u30e0\u3092\u8a2d\u5b9a\u3067\u304d\u307e\u305b\u3093"}, + /* + * Note to translators: As with the preceding message, a namespace + * declaration has the form of an attribute and is only permitted to + * appear on an element. The substitution text {0} is the namespace + * prefix and {1} is the URI that was being used in the erroneous + * namespace declaration. + */ + { MsgKey.ER_STRAY_NAMESPACE, + "\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u5BA3\u8A00''{0}''=''{1}''\u304C\u8981\u7D20\u306E\u5916\u5074\u306B\u3042\u308A\u307E\u3059\u3002" }, - { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, - "\u30d1\u30b9\u306b\u7121\u52b9\u306a\u30a8\u30b9\u30b1\u30fc\u30d7\u30fb\u30b7\u30fc\u30b1\u30f3\u30b9\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059"}, + { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, + "''{0}''\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F(CLASSPATH\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044)\u3002\u73FE\u5728\u306F\u5358\u306B\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059" }, - { MsgKey.ER_PATH_INVALID_CHAR, - "\u30d1\u30b9\u306b\u7121\u52b9\u6587\u5b57: {0} \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059"}, + { MsgKey.ER_ILLEGAL_CHARACTER, + "{1}\u306E\u6307\u5B9A\u3055\u308C\u305F\u51FA\u529B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3067\u793A\u3055\u308C\u306A\u3044\u6574\u6570\u5024{0}\u306E\u6587\u5B57\u3092\u51FA\u529B\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F\u3002" }, - { MsgKey.ER_FRAG_INVALID_CHAR, - "\u30d5\u30e9\u30b0\u30e1\u30f3\u30c8\u306b\u7121\u52b9\u6587\u5b57\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059"}, + { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, + "\u51FA\u529B\u30E1\u30BD\u30C3\u30C9''{1}''\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30D5\u30A1\u30A4\u30EB''{0}''\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F(CLASSPATH\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044)" }, - { MsgKey.ER_FRAG_WHEN_PATH_NULL, - "\u30d1\u30b9\u304c\u30cc\u30eb\u3067\u3042\u308b\u3068\u30d5\u30e9\u30b0\u30e1\u30f3\u30c8\u3092\u8a2d\u5b9a\u3067\u304d\u307e\u305b\u3093"}, + { MsgKey.ER_INVALID_PORT, + "\u7121\u52B9\u306A\u30DD\u30FC\u30C8\u756A\u53F7" }, - { MsgKey.ER_FRAG_FOR_GENERIC_URI, - "\u7dcf\u79f0 URI \u306e\u30d5\u30e9\u30b0\u30e1\u30f3\u30c8\u3057\u304b\u8a2d\u5b9a\u3067\u304d\u307e\u305b\u3093"}, + { MsgKey.ER_PORT_WHEN_HOST_NULL, + "\u30DB\u30B9\u30C8\u304Cnull\u306E\u5834\u5408\u306F\u30DD\u30FC\u30C8\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093" }, - { MsgKey.ER_NO_SCHEME_IN_URI, - "\u30b9\u30ad\u30fc\u30e0\u306f URI {0} \u3067\u898b\u3064\u304b\u308a\u307e\u305b\u3093"}, + { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, + "\u30DB\u30B9\u30C8\u306F\u6574\u5F62\u5F0F\u306E\u30A2\u30C9\u30EC\u30B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093" }, - { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, - "URI \u306f\u7a7a\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u4f7f\u7528\u3057\u3066\u521d\u671f\u5316\u3067\u304d\u307e\u305b\u3093"}, + { MsgKey.ER_SCHEME_NOT_CONFORMANT, + "\u30B9\u30AD\u30FC\u30E0\u304C\u6574\u5408\u3057\u3066\u3044\u307E\u305B\u3093\u3002" }, - { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, - "\u30d5\u30e9\u30b0\u30e1\u30f3\u30c8\u306f\u30d1\u30b9\u3068\u30d5\u30e9\u30b0\u30e1\u30f3\u30c8\u306e\u4e21\u65b9\u306b\u6307\u5b9a\u3067\u304d\u307e\u305b\u3093"}, + { MsgKey.ER_SCHEME_FROM_NULL_STRING, + "null\u6587\u5B57\u5217\u304B\u3089\u306F\u30B9\u30AD\u30FC\u30E0\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093" }, - { MsgKey.ER_NO_QUERY_STRING_IN_PATH, - "\u7167\u4f1a\u30b9\u30c8\u30ea\u30f3\u30b0\u306f\u30d1\u30b9\u304a\u3088\u3073\u7167\u4f1a\u30b9\u30c8\u30ea\u30f3\u30b0\u5185\u306b\u6307\u5b9a\u3067\u304d\u307e\u305b\u3093"}, + { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, + "\u30D1\u30B9\u306B\u7121\u52B9\u306A\u30A8\u30B9\u30B1\u30FC\u30D7\u30FB\u30B7\u30FC\u30B1\u30F3\u30B9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059" }, - { MsgKey.ER_NO_PORT_IF_NO_HOST, - "\u30db\u30b9\u30c8\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u30dd\u30fc\u30c8\u3092\u6307\u5b9a\u3057\u3066\u306f\u3044\u3051\u307e\u305b\u3093"}, + { MsgKey.ER_PATH_INVALID_CHAR, + "\u30D1\u30B9\u306B\u7121\u52B9\u306A\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059: {0}" }, - { MsgKey.ER_NO_USERINFO_IF_NO_HOST, - "\u30db\u30b9\u30c8\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f Userinfo \u3092\u6307\u5b9a\u3057\u3066\u306f\u3044\u3051\u307e\u305b\u3093"}, + { MsgKey.ER_FRAG_INVALID_CHAR, + "\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u306B\u7121\u52B9\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059" }, - { MsgKey.ER_SCHEME_REQUIRED, - "\u30b9\u30ad\u30fc\u30e0\u304c\u5fc5\u8981\u3067\u3059!"} + { MsgKey.ER_FRAG_WHEN_PATH_NULL, + "\u30D1\u30B9\u304Cnull\u306E\u5834\u5408\u306F\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093" }, - }; - return contents; - } + { MsgKey.ER_FRAG_FOR_GENERIC_URI, + "\u6C4E\u7528URI\u306E\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u306E\u307F\u8A2D\u5B9A\u3067\u304D\u307E\u3059" }, + + { MsgKey.ER_NO_SCHEME_IN_URI, + "\u30B9\u30AD\u30FC\u30E0\u304CURI\u306B\u898B\u3064\u304B\u308A\u307E\u305B\u3093" }, + + { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, + "URI\u306F\u7A7A\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3066\u521D\u671F\u5316\u3067\u304D\u307E\u305B\u3093" }, + + { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, + "\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u306F\u30D1\u30B9\u3068\u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u306E\u4E21\u65B9\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093" }, + + { MsgKey.ER_NO_QUERY_STRING_IN_PATH, + "\u554F\u5408\u305B\u6587\u5B57\u5217\u306F\u30D1\u30B9\u304A\u3088\u3073\u554F\u5408\u305B\u6587\u5B57\u5217\u5185\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093" }, + + { MsgKey.ER_NO_PORT_IF_NO_HOST, + "\u30DB\u30B9\u30C8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306F\u30DD\u30FC\u30C8\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093" }, + + { MsgKey.ER_NO_USERINFO_IF_NO_HOST, + "\u30DB\u30B9\u30C8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306FUserinfo\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093" }, + + { MsgKey.ER_XML_VERSION_NOT_SUPPORTED, + "\u8B66\u544A: \u51FA\u529B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u3001''{0}''\u3067\u3042\u308B\u3053\u3068\u304C\u30EA\u30AF\u30A8\u30B9\u30C8\u3055\u308C\u3066\u3044\u307E\u3059\u3002XML\u306E\u3053\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u51FA\u529B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u306F\u3001''1.0''\u306B\u306A\u308A\u307E\u3059\u3002" }, + + { MsgKey.ER_SCHEME_REQUIRED, + "\u30B9\u30AD\u30FC\u30E0\u304C\u5FC5\u8981\u3067\u3059\u3002" }, + + /* + * Note to translators: The words 'Properties' and + * 'SerializerFactory' in this message are Java class names + * and should not be translated. + */ + { MsgKey.ER_FACTORY_PROPERTY_MISSING, + "SerializerFactory\u306B\u6E21\u3055\u308C\u308B\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306B\u3001''{0}''\u30D7\u30ED\u30D1\u30C6\u30A3\u304C\u3042\u308A\u307E\u305B\u3093\u3002" }, + + { MsgKey.ER_ENCODING_NOT_SUPPORTED, + "\u8B66\u544A: \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0''{0}''\u306F\u3001Java\u30E9\u30F3\u30BF\u30A4\u30E0\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002" }, + + + }; + + return contents; + } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java index 986954ad09e..90750d5245e 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,105 +18,191 @@ * limitations under the License. */ /* - * $Id: SerializerMessages_ko.java,v 1.1.4.1 2005/09/08 11:03:16 suresh_emailid Exp $ + * $Id: SerializerMessages_ko.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 02:31:34 gmolloy Exp $ */ - package com.sun.org.apache.xml.internal.serializer.utils; import java.util.ListResourceBundle; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +/** + * An instance of this class is a ListResourceBundle that + * has the required getContents() method that returns + * an array of message-key/message associations. + *

    + * The message keys are defined in {@link MsgKey}. The + * messages that those keys map to are defined here. + *

    + * The messages in the English version are intended to be + * translated. + * + * This class is not a public API, it is only public because it is + * used in com.sun.org.apache.xml.internal.serializer. + * + * @xsl.usage internal + */ public class SerializerMessages_ko extends ListResourceBundle { - public Object[][] getContents() { - Object[][] contents = new Object[][] { - // BAD_MSGKEY needs translation - // BAD_MSGFORMAT needs translation - { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, - "''{0}'' \uc9c1\ub82c\ud654 \ud504\ub85c\uadf8\ub7a8 \ud074\ub798\uc2a4\uac00 org.xml.sax.ContentHandler\ub97c \uad6c\ud604\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4."}, - { MsgKey.ER_RESOURCE_COULD_NOT_FIND, - "[ {0} ] \uc790\uc6d0\uc744 \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.\n {1}"}, + /* + * This file contains error and warning messages related to + * Serializer Error Handling. + * + * General notes to translators: - { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, - "[ {0} ] \uc790\uc6d0\uc774 {1} \n {2} \n {3}\uc744(\ub97c) \ub85c\ub4dc\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. "}, + * 1) A stylesheet is a description of how to transform an input XML document + * into a resultant XML document (or HTML document or text). The + * stylesheet itself is described in the form of an XML document. - { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, - "\ubc84\ud37c \ud06c\uae30 <=0"}, + * + * 2) An element is a mark-up tag in an XML document; an attribute is a + * modifier on the tag. For example, in + * "elem" is an element name, "attr" and "attr2" are attribute names with + * the values "val" and "val2", respectively. + * + * 3) A namespace declaration is a special attribute that is used to associate + * a prefix with a URI (the namespace). The meanings of element names and + * attribute names that use that prefix are defined with respect to that + * namespace. + * + * + */ - { MsgKey.ER_INVALID_UTF16_SURROGATE, - "\uc798\ubabb\ub41c UTF-16 \ub300\ub9ac\uc790(surrogate)\uac00 \ubc1c\uacac\ub418\uc5c8\uc2b5\ub2c8\ub2e4: {0} ?"}, + /** The lookup table for error messages. */ + public Object[][] getContents() { + Object[][] contents = new Object[][] { + { MsgKey.BAD_MSGKEY, + "\uBA54\uC2DC\uC9C0 \uD0A4 ''{0}''\uC774(\uAC00) \uBA54\uC2DC\uC9C0 \uD074\uB798\uC2A4 ''{1}''\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4." }, - { MsgKey.ER_OIERROR, - "IO \uc624\ub958"}, + { MsgKey.BAD_MSGFORMAT, + "\uBA54\uC2DC\uC9C0 \uD074\uB798\uC2A4 ''{1}''\uC5D0\uC11C ''{0}'' \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC774 \uC798\uBABB\uB418\uC5C8\uC2B5\uB2C8\uB2E4." }, - { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, - "\ud558\uc704 \ub178\ub4dc\uac00 \uc0dd\uc131\ub41c \uc774\ud6c4 \ub610\ub294 \uc694\uc18c\uac00 \uc791\uc131\ub418\uae30 \uc774\uc804\uc5d0 {0} \uc18d\uc131\uc744 \ucd94\uac00\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. \uc18d\uc131\uc774 \ubb34\uc2dc\ub429\ub2c8\ub2e4."}, + { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, + "Serializer \uD074\uB798\uC2A4 ''{0}''\uC774(\uAC00) org.xml.sax.ContentHandler\uB97C \uAD6C\uD604\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4." }, - { MsgKey.ER_NAMESPACE_PREFIX, - "''{0}'' \uc811\ub450\ubd80\uc5d0 \ub300\ud55c \uc774\ub984 \uacf5\uac04\uc774 \uc120\uc5b8\ub418\uc9c0 \uc54a\uc558\uc2b5\ub2c8\ub2e4."}, + { MsgKey.ER_RESOURCE_COULD_NOT_FIND, + "[{0}] \uB9AC\uC18C\uC2A4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.\n {1}" }, - // ER_STRAY_ATTRIBUTE needs translation - { MsgKey.ER_STRAY_NAMESPACE, - "''{0}''=''{1}'' \uc774\ub984 \uacf5\uac04 \uc120\uc5b8\uc774 \uc694\uc18c\uc758 \uc678\ubd80\uc5d0 \uc788\uc2b5\ub2c8\ub2e4."}, + { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, + "[{0}] \uB9AC\uC18C\uC2A4\uAC00 \uB2E4\uC74C\uC744 \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC74C: {1} \n {2} \t {3}" }, - { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, - "''{0}''(CLASSPATH \ud655\uc778)\uc744(\ub97c) \ub85c\ub4dc\ud560 \uc218 \uc5c6\uc73c\ubbc0\ub85c, \ud604\uc7ac \uae30\ubcf8\uac12\ub9cc\uc744 \uc0ac\uc6a9 \uc911\uc785\ub2c8\ub2e4."}, + { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, + "\uBC84\uD37C \uD06C\uAE30 <=0" }, - // ER_ILLEGAL_CHARACTER needs translation - { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, - "''{1}''\ucd9c\ub825 \uba54\uc18c\ub4dc(CLASSPATH \ud655\uc778)\uc5d0 \ub300\ud55c ''{0}'' \ud2b9\uc131 \ud30c\uc77c\uc744 \ub85c\ub4dc\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}, + { MsgKey.ER_INVALID_UTF16_SURROGATE, + "\uBD80\uC801\uD569\uD55C UTF-16 \uB300\uB9AC \uC694\uC18C\uAC00 \uAC10\uC9C0\uB428: {0}" }, - { MsgKey.ER_INVALID_PORT, - "\uc798\ubabb\ub41c \ud3ec\ud2b8 \ubc88\ud638"}, + { MsgKey.ER_OIERROR, + "IO \uC624\uB958" }, - { MsgKey.ER_PORT_WHEN_HOST_NULL, - "\ud638\uc2a4\ud2b8\uac00 \ub110(null)\uc774\uba74 \ud3ec\ud2b8\ub97c \uc124\uc815\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}, + { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, + "\uD558\uC704 \uB178\uB4DC\uAC00 \uC0DD\uC131\uB41C \uD6C4 \uB610\uB294 \uC694\uC18C\uAC00 \uC0DD\uC131\uB418\uAE30 \uC804\uC5D0 {0} \uC18D\uC131\uC744 \uCD94\uAC00\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC18D\uC131\uC774 \uBB34\uC2DC\uB429\uB2C8\uB2E4." }, - { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, - "\ud638\uc2a4\ud2b8\uac00 \uc644\uc804\ud55c \uc8fc\uc18c\uac00 \uc544\ub2d9\ub2c8\ub2e4."}, + /* + * Note to translators: The stylesheet contained a reference to a + * namespace prefix that was undefined. The value of the substitution + * text is the name of the prefix. + */ + { MsgKey.ER_NAMESPACE_PREFIX, + "''{0}'' \uC811\uB450\uC5B4\uC5D0 \uB300\uD55C \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4." }, - { MsgKey.ER_SCHEME_NOT_CONFORMANT, - "\uc124\uacc4\uac00 \uc77c\uce58\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4."}, + /* + * Note to translators: This message is reported if the stylesheet + * being processed attempted to construct an XML document with an + * attribute in a place other than on an element. The substitution text + * specifies the name of the attribute. + */ + { MsgKey.ER_STRAY_ATTRIBUTE, + "''{0}'' \uC18D\uC131\uC774 \uC694\uC18C\uC5D0 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." }, - { MsgKey.ER_SCHEME_FROM_NULL_STRING, - "\ub110(null) \ubb38\uc790\uc5f4\uc5d0\uc11c \uc124\uacc4\ub97c \uc124\uc815\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}, + /* + * Note to translators: As with the preceding message, a namespace + * declaration has the form of an attribute and is only permitted to + * appear on an element. The substitution text {0} is the namespace + * prefix and {1} is the URI that was being used in the erroneous + * namespace declaration. + */ + { MsgKey.ER_STRAY_NAMESPACE, + "\uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC120\uC5B8 ''{0}''=''{1}''\uC774(\uAC00) \uC694\uC18C\uC5D0 \uD3EC\uD568\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." }, - { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, - "\uacbd\ub85c\uc5d0 \uc798\ubabb\ub41c \uc774\uc2a4\ucf00\uc774\ud504 \uc21c\uc11c\uac00 \uc788\uc2b5\ub2c8\ub2e4."}, + { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, + "{0}\uC744(\uB97C) \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. CLASSPATH\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624. \uD604\uC7AC \uAE30\uBCF8\uAC12\uB9CC \uC0AC\uC6A9\uD558\uB294 \uC911\uC785\uB2C8\uB2E4." }, - { MsgKey.ER_PATH_INVALID_CHAR, - "\uacbd\ub85c\uc5d0 \uc798\ubabb\ub41c \ubb38\uc790\uac00 \uc788\uc2b5\ub2c8\ub2e4: {0}"}, + { MsgKey.ER_ILLEGAL_CHARACTER, + "{1}\uC758 \uC9C0\uC815\uB41C \uCD9C\uB825 \uC778\uCF54\uB529\uC5D0\uC11C \uD45C\uC2DC\uB418\uC9C0 \uC54A\uB294 \uC815\uC218 \uAC12 {0}\uC758 \uBB38\uC790\uB97C \uCD9C\uB825\uD558\uB824\uACE0 \uC2DC\uB3C4\uD588\uC2B5\uB2C8\uB2E4." }, - { MsgKey.ER_FRAG_INVALID_CHAR, - "\ub2e8\ud3b8\uc5d0 \uc798\ubabb\ub41c \ubb38\uc790\uac00 \uc788\uc2b5\ub2c8\ub2e4."}, + { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, + "\uCD9C\uB825 \uBA54\uC18C\uB4DC ''{1}''\uC5D0 \uB300\uD55C \uC18D\uC131 \uD30C\uC77C ''{0}''\uC744(\uB97C) \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. CLASSPATH\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624." }, - { MsgKey.ER_FRAG_WHEN_PATH_NULL, - "\uacbd\ub85c\uac00 \ub110(null)\uc774\uba74 \ub2e8\ud3b8\uc744 \uc124\uc815\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}, + { MsgKey.ER_INVALID_PORT, + "\uD3EC\uD2B8 \uBC88\uD638\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4." }, - { MsgKey.ER_FRAG_FOR_GENERIC_URI, - "\uc77c\ubc18 URI\uc5d0 \ub300\ud574\uc11c\ub9cc \ub2e8\ud3b8\uc744 \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4."}, + { MsgKey.ER_PORT_WHEN_HOST_NULL, + "\uD638\uC2A4\uD2B8\uAC00 \uB110\uC77C \uACBD\uC6B0 \uD3EC\uD2B8\uB97C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." }, - { MsgKey.ER_NO_SCHEME_IN_URI, - "URI\uc5d0 \uc124\uacc4\uac00 \uc5c6\uc2b5\ub2c8\ub2e4: {0}"}, + { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, + "\uD638\uC2A4\uD2B8\uAC00 \uC644\uC804\uD55C \uC8FC\uC18C\uAC00 \uC544\uB2D9\uB2C8\uB2E4." }, - { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, - "\ube48 \ub9e4\uac1c\ubcc0\uc218\ub85c URI\ub97c \ucd08\uae30\ud654\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}, + { MsgKey.ER_SCHEME_NOT_CONFORMANT, + "\uCCB4\uACC4\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." }, - { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, - "\uacbd\ub85c \ubc0f \ub2e8\ud3b8 \ub458 \ub2e4\uc5d0 \ub2e8\ud3b8\uc744 \uc9c0\uc815\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}, + { MsgKey.ER_SCHEME_FROM_NULL_STRING, + "\uB110 \uBB38\uC790\uC5F4\uC5D0\uC11C \uCCB4\uACC4\uB97C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." }, - { MsgKey.ER_NO_QUERY_STRING_IN_PATH, - "\uacbd\ub85c \ubc0f \uc870\ud68c \ubb38\uc790\uc5f4\uc5d0 \uc870\ud68c \ubb38\uc790\uc5f4\uc744 \uc9c0\uc815\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}, + { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, + "\uACBD\uB85C\uC5D0 \uBD80\uC801\uD569\uD55C \uC774\uC2A4\uCF00\uC774\uD504 \uC2DC\uD000\uC2A4\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4." }, - { MsgKey.ER_NO_PORT_IF_NO_HOST, - "\ud638\uc2a4\ud2b8\ub97c \uc9c0\uc815\ud558\uc9c0 \uc54a\uc740 \uacbd\uc6b0\uc5d0\ub294 \ud3ec\ud2b8\ub97c \uc9c0\uc815\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}, + { MsgKey.ER_PATH_INVALID_CHAR, + "\uACBD\uB85C\uC5D0 \uBD80\uC801\uD569\uD55C \uBB38\uC790\uAC00 \uD3EC\uD568\uB428: {0}" }, - { MsgKey.ER_NO_USERINFO_IF_NO_HOST, - "\ud638\uc2a4\ud2b8\ub97c \uc9c0\uc815\ud558\uc9c0 \uc54a\uc740 \uacbd\uc6b0\uc5d0\ub294 Userinfo\ub97c \uc9c0\uc815\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}, + { MsgKey.ER_FRAG_INVALID_CHAR, + "\uBD80\uBD84\uC5D0 \uBD80\uC801\uD569\uD55C \uBB38\uC790\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4." }, - { MsgKey.ER_SCHEME_REQUIRED, - "\uc124\uacc4\uac00 \ud544\uc694\ud569\ub2c8\ub2e4!"} + { MsgKey.ER_FRAG_WHEN_PATH_NULL, + "\uACBD\uB85C\uAC00 \uB110\uC77C \uACBD\uC6B0 \uBD80\uBD84\uC744 \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." }, - }; - return contents; - } + { MsgKey.ER_FRAG_FOR_GENERIC_URI, + "\uC77C\uBC18 URI\uC5D0 \uB300\uD574\uC11C\uB9CC \uBD80\uBD84\uC744 \uC124\uC815\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4." }, + + { MsgKey.ER_NO_SCHEME_IN_URI, + "URI\uC5D0\uC11C \uCCB4\uACC4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." }, + + { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, + "\uBE48 \uB9E4\uAC1C\uBCC0\uC218\uB85C URI\uB97C \uCD08\uAE30\uD654\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." }, + + { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, + "\uACBD\uB85C\uC640 \uBD80\uBD84\uC5D0 \uBAA8\uB450 \uBD80\uBD84\uC744 \uC9C0\uC815\uD560 \uC218\uB294 \uC5C6\uC2B5\uB2C8\uB2E4." }, + + { MsgKey.ER_NO_QUERY_STRING_IN_PATH, + "\uACBD\uB85C \uBC0F \uC9C8\uC758 \uBB38\uC790\uC5F4\uC5D0 \uC9C8\uC758 \uBB38\uC790\uC5F4\uC744 \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." }, + + { MsgKey.ER_NO_PORT_IF_NO_HOST, + "\uD638\uC2A4\uD2B8\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC740 \uACBD\uC6B0\uC5D0\uB294 \uD3EC\uD2B8\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." }, + + { MsgKey.ER_NO_USERINFO_IF_NO_HOST, + "\uD638\uC2A4\uD2B8\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC740 \uACBD\uC6B0\uC5D0\uB294 Userinfo\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." }, + + { MsgKey.ER_XML_VERSION_NOT_SUPPORTED, + "\uACBD\uACE0: \uCD9C\uB825 \uBB38\uC11C\uC758 \uBC84\uC804\uC774 ''{0}''\uC774(\uAC00) \uB418\uB3C4\uB85D \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4. \uC774 \uBC84\uC804\uC758 XML\uC740 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uCD9C\uB825 \uBB38\uC11C\uC758 \uBC84\uC804\uC740 ''1.0''\uC774 \uB429\uB2C8\uB2E4." }, + + { MsgKey.ER_SCHEME_REQUIRED, + "\uCCB4\uACC4\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4!" }, + + /* + * Note to translators: The words 'Properties' and + * 'SerializerFactory' in this message are Java class names + * and should not be translated. + */ + { MsgKey.ER_FACTORY_PROPERTY_MISSING, + "SerializerFactory\uC5D0 \uC804\uB2EC\uB41C Properties \uAC1D\uCCB4\uC5D0 ''{0}'' \uC18D\uC131\uC774 \uC5C6\uC2B5\uB2C8\uB2E4." }, + + { MsgKey.ER_ENCODING_NOT_SUPPORTED, + "\uACBD\uACE0: \uC778\uCF54\uB529 ''{0}''\uC740(\uB294) Java \uB7F0\uD0C0\uC784\uC5D0 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." }, + + + }; + + return contents; + } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java new file mode 100644 index 00000000000..41949ddbf55 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java @@ -0,0 +1,208 @@ +/* + * reserved comment block + * DO NOT REMOVE OR ALTER! + */ +/* + * Copyright 2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: SerializerMessages_pt_BR.java /st_wptg_1.8.0.0.0jdk/2 2013/09/11 12:46:54 gmolloy Exp $ + */ +package com.sun.org.apache.xml.internal.serializer.utils; + +import java.util.ListResourceBundle; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +/** + * An instance of this class is a ListResourceBundle that + * has the required getContents() method that returns + * an array of message-key/message associations. + *

    + * The message keys are defined in {@link MsgKey}. The + * messages that those keys map to are defined here. + *

    + * The messages in the English version are intended to be + * translated. + * + * This class is not a public API, it is only public because it is + * used in com.sun.org.apache.xml.internal.serializer. + * + * @xsl.usage internal + */ +public class SerializerMessages_pt_BR extends ListResourceBundle { + + /* + * This file contains error and warning messages related to + * Serializer Error Handling. + * + * General notes to translators: + + * 1) A stylesheet is a description of how to transform an input XML document + * into a resultant XML document (or HTML document or text). The + * stylesheet itself is described in the form of an XML document. + + * + * 2) An element is a mark-up tag in an XML document; an attribute is a + * modifier on the tag. For example, in + * "elem" is an element name, "attr" and "attr2" are attribute names with + * the values "val" and "val2", respectively. + * + * 3) A namespace declaration is a special attribute that is used to associate + * a prefix with a URI (the namespace). The meanings of element names and + * attribute names that use that prefix are defined with respect to that + * namespace. + * + * + */ + + /** The lookup table for error messages. */ + public Object[][] getContents() { + Object[][] contents = new Object[][] { + { MsgKey.BAD_MSGKEY, + "A chave de mensagem ''{0}'' n\u00E3o est\u00E1 na classe de mensagem ''{1}''" }, + + { MsgKey.BAD_MSGFORMAT, + "Houve falha no formato da mensagem ''{0}'' na classe de mensagem ''{1}''." }, + + { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, + "A classe ''{0}'' do serializador n\u00E3o implementa org.xml.sax.ContentHandler." }, + + { MsgKey.ER_RESOURCE_COULD_NOT_FIND, + "N\u00E3o foi poss\u00EDvel encontrar o recurso [ {0} ].\n {1}" }, + + { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, + "O recurso [ {0} ] n\u00E3o foi carregado: {1} \n {2} \t {3}" }, + + { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, + "Tamanho do buffer <=0" }, + + { MsgKey.ER_INVALID_UTF16_SURROGATE, + "Foi detectado um substituto de UTF-16 inv\u00E1lido: {0} ?" }, + + { MsgKey.ER_OIERROR, + "Erro de E/S" }, + + { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, + "N\u00E3o \u00E9 poss\u00EDvel adicionar o atributo {0} depois dos n\u00F3s filhos ou antes que um elemento seja produzido. O atributo ser\u00E1 ignorado." }, + + /* + * Note to translators: The stylesheet contained a reference to a + * namespace prefix that was undefined. The value of the substitution + * text is the name of the prefix. + */ + { MsgKey.ER_NAMESPACE_PREFIX, + "O namespace do prefixo ''{0}'' n\u00E3o foi declarado." }, + + /* + * Note to translators: This message is reported if the stylesheet + * being processed attempted to construct an XML document with an + * attribute in a place other than on an element. The substitution text + * specifies the name of the attribute. + */ + { MsgKey.ER_STRAY_ATTRIBUTE, + "Atributo ''{0}'' fora do elemento." }, + + /* + * Note to translators: As with the preceding message, a namespace + * declaration has the form of an attribute and is only permitted to + * appear on an element. The substitution text {0} is the namespace + * prefix and {1} is the URI that was being used in the erroneous + * namespace declaration. + */ + { MsgKey.ER_STRAY_NAMESPACE, + "Declara\u00E7\u00E3o de namespace ''{0}''=''{1}'' fora do elemento." }, + + { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, + "N\u00E3o foi poss\u00EDvel carregar ''{0}'' (verificar CLASSPATH); usando agora apenas os defaults" }, + + { MsgKey.ER_ILLEGAL_CHARACTER, + "Tentativa de exibir um caractere de valor integral {0} que n\u00E3o est\u00E1 representado na codifica\u00E7\u00E3o de sa\u00EDda especificada de {1}." }, + + { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, + "N\u00E3o foi poss\u00EDvel carregar o arquivo de propriedade ''{0}'' para o m\u00E9todo de sa\u00EDda ''{1}'' (verificar CLASSPATH)" }, + + { MsgKey.ER_INVALID_PORT, + "N\u00FAmero de porta inv\u00E1lido" }, + + { MsgKey.ER_PORT_WHEN_HOST_NULL, + "A porta n\u00E3o pode ser definida quando o host \u00E9 nulo" }, + + { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, + "O host n\u00E3o \u00E9 um endere\u00E7o correto" }, + + { MsgKey.ER_SCHEME_NOT_CONFORMANT, + "O esquema n\u00E3o \u00E9 compat\u00EDvel." }, + + { MsgKey.ER_SCHEME_FROM_NULL_STRING, + "N\u00E3o \u00E9 poss\u00EDvel definir o esquema de uma string nula" }, + + { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, + "O caminho cont\u00E9m uma sequ\u00EAncia inv\u00E1lida de caracteres de escape" }, + + { MsgKey.ER_PATH_INVALID_CHAR, + "O caminho cont\u00E9m um caractere inv\u00E1lido: {0}" }, + + { MsgKey.ER_FRAG_INVALID_CHAR, + "O fragmento cont\u00E9m um caractere inv\u00E1lido" }, + + { MsgKey.ER_FRAG_WHEN_PATH_NULL, + "O fragmento n\u00E3o pode ser definido quando o caminho \u00E9 nulo" }, + + { MsgKey.ER_FRAG_FOR_GENERIC_URI, + "O fragmento s\u00F3 pode ser definido para um URI gen\u00E9rico" }, + + { MsgKey.ER_NO_SCHEME_IN_URI, + "Nenhum esquema encontrado no URI" }, + + { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, + "N\u00E3o \u00E9 poss\u00EDvel inicializar o URI com par\u00E2metros vazios" }, + + { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, + "O fragmento n\u00E3o pode ser especificado no caminho nem no fragmento" }, + + { MsgKey.ER_NO_QUERY_STRING_IN_PATH, + "A string de consulta n\u00E3o pode ser especificada no caminho nem na string de consulta" }, + + { MsgKey.ER_NO_PORT_IF_NO_HOST, + "A porta n\u00E3o pode ser especificada se o host n\u00E3o tiver sido especificado" }, + + { MsgKey.ER_NO_USERINFO_IF_NO_HOST, + "As informa\u00E7\u00F5es do usu\u00E1rio n\u00E3o podem ser especificadas se o host n\u00E3o tiver sido especificado" }, + + { MsgKey.ER_XML_VERSION_NOT_SUPPORTED, + "Advert\u00EAncia: a vers\u00E3o do documento de sa\u00EDda deve ser obrigatoriamente ''{0}''. Esta vers\u00E3o do XML n\u00E3o \u00E9 suportada. A vers\u00E3o do documento de sa\u00EDda ser\u00E1 ''1.0''." }, + + { MsgKey.ER_SCHEME_REQUIRED, + "O esquema \u00E9 obrigat\u00F3rio!" }, + + /* + * Note to translators: The words 'Properties' and + * 'SerializerFactory' in this message are Java class names + * and should not be translated. + */ + { MsgKey.ER_FACTORY_PROPERTY_MISSING, + "O objeto Properties especificado para a SerializerFactory n\u00E3o tem uma propriedade ''{0}''." }, + + { MsgKey.ER_ENCODING_NOT_SUPPORTED, + "Advert\u00EAncia: a codifica\u00E7\u00E3o ''{0}'' n\u00E3o \u00E9 suportada pelo Java runtime." }, + + + }; + + return contents; + } +} diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_sv.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_sv.java index 4690a4bb870..e9104b71cc8 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_sv.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_sv.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,83 +18,191 @@ * limitations under the License. */ /* - * $Id: SerializerMessages_sv.java,v 1.1.4.1 2005/09/08 11:03:17 suresh_emailid Exp $ + * $Id: SerializerMessages_sv.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 06:50:58 gmolloy Exp $ */ - package com.sun.org.apache.xml.internal.serializer.utils; import java.util.ListResourceBundle; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +/** + * An instance of this class is a ListResourceBundle that + * has the required getContents() method that returns + * an array of message-key/message associations. + *

    + * The message keys are defined in {@link MsgKey}. The + * messages that those keys map to are defined here. + *

    + * The messages in the English version are intended to be + * translated. + * + * This class is not a public API, it is only public because it is + * used in com.sun.org.apache.xml.internal.serializer. + * + * @xsl.usage internal + */ public class SerializerMessages_sv extends ListResourceBundle { - public Object[][] getContents() { - Object[][] contents = new Object[][] { - // BAD_MSGKEY needs translation - // BAD_MSGFORMAT needs translation - // ER_SERIALIZER_NOT_CONTENTHANDLER needs translation - // ER_RESOURCE_COULD_NOT_FIND needs translation - // ER_RESOURCE_COULD_NOT_LOAD needs translation - // ER_BUFFER_SIZE_LESSTHAN_ZERO needs translation - // ER_INVALID_UTF16_SURROGATE needs translation - // ER_OIERROR needs translation - // ER_ILLEGAL_ATTRIBUTE_POSITION needs translation - // ER_NAMESPACE_PREFIX needs translation - // ER_STRAY_ATTRIBUTE needs translation - // ER_STRAY_NAMESPACE needs translation - // ER_COULD_NOT_LOAD_RESOURCE needs translation - // ER_ILLEGAL_CHARACTER needs translation - // ER_COULD_NOT_LOAD_METHOD_PROPERTY needs translation - { MsgKey.ER_INVALID_PORT, - "Ogiltigt portnummer"}, - { MsgKey.ER_PORT_WHEN_HOST_NULL, - "Port kan inte s\u00e4ttas n\u00e4r v\u00e4rd \u00e4r null"}, + /* + * This file contains error and warning messages related to + * Serializer Error Handling. + * + * General notes to translators: - { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, - "V\u00e4rd \u00e4r inte en v\u00e4lformulerad adress"}, + * 1) A stylesheet is a description of how to transform an input XML document + * into a resultant XML document (or HTML document or text). The + * stylesheet itself is described in the form of an XML document. - { MsgKey.ER_SCHEME_NOT_CONFORMANT, - "Schemat \u00e4r inte likformigt."}, + * + * 2) An element is a mark-up tag in an XML document; an attribute is a + * modifier on the tag. For example, in + * "elem" is an element name, "attr" and "attr2" are attribute names with + * the values "val" and "val2", respectively. + * + * 3) A namespace declaration is a special attribute that is used to associate + * a prefix with a URI (the namespace). The meanings of element names and + * attribute names that use that prefix are defined with respect to that + * namespace. + * + * + */ - { MsgKey.ER_SCHEME_FROM_NULL_STRING, - "Kan inte s\u00e4tta schema fr\u00e5n null-str\u00e4ng"}, + /** The lookup table for error messages. */ + public Object[][] getContents() { + Object[][] contents = new Object[][] { + { MsgKey.BAD_MSGKEY, + "Meddelandenyckeln ''{0}'' \u00E4r inte i meddelandeklassen ''{1}''" }, - { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, - "V\u00e4g inneh\u00e5ller ogiltig flyktsekvens"}, + { MsgKey.BAD_MSGFORMAT, + "Formatet p\u00E5 meddelandet ''{0}'' i meddelandeklassen ''{1}'' underk\u00E4ndes." }, - { MsgKey.ER_PATH_INVALID_CHAR, - "V\u00e4g inneh\u00e5ller ogiltigt tecken: {0}"}, + { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, + "Serializerklassen ''{0}'' implementerar inte org.xml.sax.ContentHandler." }, - { MsgKey.ER_FRAG_INVALID_CHAR, - "Fragment inneh\u00e5ller ogiltigt tecken"}, + { MsgKey.ER_RESOURCE_COULD_NOT_FIND, + "Resursen [ {0} ] kunde inte h\u00E4mtas.\n {1}" }, - { MsgKey.ER_FRAG_WHEN_PATH_NULL, - "Fragment kan inte s\u00e4ttas n\u00e4r v\u00e4g \u00e4r null"}, + { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, + "Resursen [ {0} ] kunde inte laddas: {1} \n {2} \t {3}" }, - { MsgKey.ER_FRAG_FOR_GENERIC_URI, - "Fragment kan bara s\u00e4ttas f\u00f6r en allm\u00e4n URI"}, + { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, + "Buffertstorlek <=0" }, - { MsgKey.ER_NO_SCHEME_IN_URI, - "Schema saknas i URI: {0}"}, + { MsgKey.ER_INVALID_UTF16_SURROGATE, + "Ogiltigt UTF-16-surrogat uppt\u00E4ckt: {0} ?" }, - { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, - "Kan inte initialisera URI med tomma parametrar"}, + { MsgKey.ER_OIERROR, + "IO-fel" }, - { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, - "Fragment kan inte anges i b\u00e5de v\u00e4gen och fragmentet"}, + { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, + "Kan inte l\u00E4gga till attributet {0} efter underordnade noder eller innan ett element har skapats. Attributet ignoreras." }, - { MsgKey.ER_NO_QUERY_STRING_IN_PATH, - "F\u00f6rfr\u00e5gan-str\u00e4ng kan inte anges i v\u00e4g och f\u00f6rfr\u00e5gan-str\u00e4ng"}, + /* + * Note to translators: The stylesheet contained a reference to a + * namespace prefix that was undefined. The value of the substitution + * text is the name of the prefix. + */ + { MsgKey.ER_NAMESPACE_PREFIX, + "Namnrymd f\u00F6r prefix ''{0}'' har inte deklarerats." }, - { MsgKey.ER_NO_PORT_IF_NO_HOST, - "Port f\u00e5r inte anges om v\u00e4rden inte \u00e4r angiven"}, + /* + * Note to translators: This message is reported if the stylesheet + * being processed attempted to construct an XML document with an + * attribute in a place other than on an element. The substitution text + * specifies the name of the attribute. + */ + { MsgKey.ER_STRAY_ATTRIBUTE, + "Attributet ''{0}'' finns utanf\u00F6r elementet." }, - { MsgKey.ER_NO_USERINFO_IF_NO_HOST, - "Userinfo f\u00e5r inte anges om v\u00e4rden inte \u00e4r angiven"}, + /* + * Note to translators: As with the preceding message, a namespace + * declaration has the form of an attribute and is only permitted to + * appear on an element. The substitution text {0} is the namespace + * prefix and {1} is the URI that was being used in the erroneous + * namespace declaration. + */ + { MsgKey.ER_STRAY_NAMESPACE, + "Namnrymdsdeklarationen ''{0}''=''{1}'' finns utanf\u00F6r element." }, - { MsgKey.ER_SCHEME_REQUIRED, - "Schema kr\u00e4vs!"} + { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, + "Kunde inte ladda ''{0}'' (kontrollera CLASSPATH), anv\u00E4nder nu enbart standardv\u00E4rden" }, - }; - return contents; - } + { MsgKey.ER_ILLEGAL_CHARACTER, + "F\u00F6rs\u00F6k att skriva utdatatecken med integralv\u00E4rdet {0} som inte \u00E4r representerat i angiven utdatakodning av {1}." }, + + { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, + "Kunde inte ladda egenskapsfilen ''{0}'' f\u00F6r utdatametoden ''{1}'' (kontrollera CLASSPATH)" }, + + { MsgKey.ER_INVALID_PORT, + "Ogiltigt portnummer" }, + + { MsgKey.ER_PORT_WHEN_HOST_NULL, + "Port kan inte st\u00E4llas in n\u00E4r v\u00E4rd \u00E4r null" }, + + { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, + "V\u00E4rd \u00E4r inte en v\u00E4lformulerad adress" }, + + { MsgKey.ER_SCHEME_NOT_CONFORMANT, + "Schemat \u00E4r inte likformigt." }, + + { MsgKey.ER_SCHEME_FROM_NULL_STRING, + "Kan inte st\u00E4lla in schema fr\u00E5n null-str\u00E4ng" }, + + { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, + "S\u00F6kv\u00E4gen inneh\u00E5ller en ogiltig escape-sekvens" }, + + { MsgKey.ER_PATH_INVALID_CHAR, + "S\u00F6kv\u00E4gen inneh\u00E5ller ett ogiltigt tecken: {0}" }, + + { MsgKey.ER_FRAG_INVALID_CHAR, + "Fragment inneh\u00E5ller ett ogiltigt tecken" }, + + { MsgKey.ER_FRAG_WHEN_PATH_NULL, + "Fragment kan inte st\u00E4llas in n\u00E4r s\u00F6kv\u00E4g \u00E4r null" }, + + { MsgKey.ER_FRAG_FOR_GENERIC_URI, + "Fragment kan bara st\u00E4llas in f\u00F6r en allm\u00E4n URI" }, + + { MsgKey.ER_NO_SCHEME_IN_URI, + "Schema saknas i URI" }, + + { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, + "Kan inte initiera URI med tomma parametrar" }, + + { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, + "Fragment kan inte anges i b\u00E5de s\u00F6kv\u00E4gen och fragmentet" }, + + { MsgKey.ER_NO_QUERY_STRING_IN_PATH, + "Fr\u00E5gestr\u00E4ng kan inte anges i b\u00E5de s\u00F6kv\u00E4gen och fr\u00E5gestr\u00E4ngen" }, + + { MsgKey.ER_NO_PORT_IF_NO_HOST, + "Port f\u00E5r inte anges om v\u00E4rden inte \u00E4r angiven" }, + + { MsgKey.ER_NO_USERINFO_IF_NO_HOST, + "Anv\u00E4ndarinfo f\u00E5r inte anges om v\u00E4rden inte \u00E4r angiven" }, + + { MsgKey.ER_XML_VERSION_NOT_SUPPORTED, + "Varning: Versionen av utdatadokumentet som beg\u00E4rts \u00E4r ''{0}''. Den h\u00E4r versionen av XML st\u00F6ds inte. Versionen av utdatadokumentet kommer att vara ''1.0''." }, + + { MsgKey.ER_SCHEME_REQUIRED, + "Schema kr\u00E4vs!" }, + + /* + * Note to translators: The words 'Properties' and + * 'SerializerFactory' in this message are Java class names + * and should not be translated. + */ + { MsgKey.ER_FACTORY_PROPERTY_MISSING, + "Egenskapsobjektet som \u00F6verf\u00F6rts till SerializerFactory har ingen ''{0}''-egenskap." }, + + { MsgKey.ER_ENCODING_NOT_SUPPORTED, + "Varning: Kodningen ''{0}'' st\u00F6ds inte av Java runtime." }, + + + }; + + return contents; + } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_CN.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_CN.java index cc41c7f1f75..9bc7c1e0554 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_CN.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_CN.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,105 +18,191 @@ * limitations under the License. */ /* - * $Id: SerializerMessages_zh_CN.java,v 1.1.4.1 2005/09/08 11:03:18 suresh_emailid Exp $ + * $Id: SerializerMessages_zh_CN.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 04:44:25 gmolloy Exp $ */ - package com.sun.org.apache.xml.internal.serializer.utils; import java.util.ListResourceBundle; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +/** + * An instance of this class is a ListResourceBundle that + * has the required getContents() method that returns + * an array of message-key/message associations. + *

    + * The message keys are defined in {@link MsgKey}. The + * messages that those keys map to are defined here. + *

    + * The messages in the English version are intended to be + * translated. + * + * This class is not a public API, it is only public because it is + * used in com.sun.org.apache.xml.internal.serializer. + * + * @xsl.usage internal + */ public class SerializerMessages_zh_CN extends ListResourceBundle { - public Object[][] getContents() { - Object[][] contents = new Object[][] { - // BAD_MSGKEY needs translation - // BAD_MSGFORMAT needs translation - { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, - "\u4e32\u884c\u5668\u7c7b\u201c{0}\u201d\u4e0d\u5b9e\u73b0 org.xml.sax.ContentHandler."}, - { MsgKey.ER_RESOURCE_COULD_NOT_FIND, - "\u627e\u4e0d\u5230\u8d44\u6e90 [ {0} ]\u3002\n {1}"}, + /* + * This file contains error and warning messages related to + * Serializer Error Handling. + * + * General notes to translators: - { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, - "\u8d44\u6e90 [ {0} ] \u65e0\u6cd5\u88c5\u5165\uff1a{1} \n {2} \n {3}"}, + * 1) A stylesheet is a description of how to transform an input XML document + * into a resultant XML document (or HTML document or text). The + * stylesheet itself is described in the form of an XML document. - { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, - "\u7f13\u51b2\u533a\u5927\u5c0f <=0"}, + * + * 2) An element is a mark-up tag in an XML document; an attribute is a + * modifier on the tag. For example, in + * "elem" is an element name, "attr" and "attr2" are attribute names with + * the values "val" and "val2", respectively. + * + * 3) A namespace declaration is a special attribute that is used to associate + * a prefix with a URI (the namespace). The meanings of element names and + * attribute names that use that prefix are defined with respect to that + * namespace. + * + * + */ - { MsgKey.ER_INVALID_UTF16_SURROGATE, - "\u68c0\u6d4b\u5230\u65e0\u6548\u7684 UTF-16 \u66ff\u4ee3\u8005\uff1a{0}\uff1f"}, + /** The lookup table for error messages. */ + public Object[][] getContents() { + Object[][] contents = new Object[][] { + { MsgKey.BAD_MSGKEY, + "\u6D88\u606F\u5173\u952E\u5B57 ''{0}'' \u4E0D\u5728\u6D88\u606F\u7C7B ''{1}'' \u4E2D" }, - { MsgKey.ER_OIERROR, - "IO \u9519\u8bef"}, + { MsgKey.BAD_MSGFORMAT, + "\u6D88\u606F\u7C7B ''{1}'' \u4E2D\u6D88\u606F ''{0}'' \u7684\u683C\u5F0F\u5316\u5931\u8D25\u3002" }, - { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, - "\u5728\u751f\u6210\u5b50\u8282\u70b9\u4e4b\u540e\u6216\u5728\u751f\u6210\u5143\u7d20\u4e4b\u524d\u65e0\u6cd5\u6dfb\u52a0\u5c5e\u6027 {0}\u3002\u5c06\u5ffd\u7565\u5c5e\u6027\u3002"}, + { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, + "\u4E32\u884C\u5668\u7C7B ''{0}'' \u4E0D\u5B9E\u73B0 org.xml.sax.ContentHandler\u3002" }, - { MsgKey.ER_NAMESPACE_PREFIX, - "\u6ca1\u6709\u8bf4\u660e\u540d\u79f0\u7a7a\u95f4\u524d\u7f00\u201c{0}\u201d\u3002"}, + { MsgKey.ER_RESOURCE_COULD_NOT_FIND, + "\u627E\u4E0D\u5230\u8D44\u6E90 [ {0} ]\u3002\n {1}" }, - // ER_STRAY_ATTRIBUTE needs translation - { MsgKey.ER_STRAY_NAMESPACE, - "\u540d\u79f0\u7a7a\u95f4\u8bf4\u660e\u201c{0}\u201d=\u201c{1}\u201d\u5728\u5143\u7d20\u5916\u3002"}, + { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, + "\u8D44\u6E90 [ {0} ] \u65E0\u6CD5\u52A0\u8F7D: {1} \n {2} \t {3}" }, - { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, - "\u65e0\u6cd5\u88c5\u5165\u201c{0}\u201d\uff08\u68c0\u67e5 CLASSPATH\uff09\uff0c\u73b0\u5728\u53ea\u4f7f\u7528\u7f3a\u7701\u503c"}, + { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, + "\u7F13\u51B2\u533A\u5927\u5C0F <=0" }, - // ER_ILLEGAL_CHARACTER needs translation - { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, - "\u65e0\u6cd5\u4e3a\u8f93\u51fa\u65b9\u6cd5\u201c{1}\u201d\u88c5\u8f7d\u5c5e\u6027\u6587\u4ef6\u201c{0}\u201d\uff08\u68c0\u67e5 CLASSPATH\uff09"}, + { MsgKey.ER_INVALID_UTF16_SURROGATE, + "\u68C0\u6D4B\u5230\u65E0\u6548\u7684 UTF-16 \u4EE3\u7406: {0}?" }, - { MsgKey.ER_INVALID_PORT, - "\u65e0\u6548\u7684\u7aef\u53e3\u53f7"}, + { MsgKey.ER_OIERROR, + "IO \u9519\u8BEF" }, - { MsgKey.ER_PORT_WHEN_HOST_NULL, - "\u4e3b\u673a\u4e3a\u7a7a\u65f6\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u7aef\u53e3"}, + { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, + "\u5728\u751F\u6210\u5B50\u8282\u70B9\u4E4B\u540E\u6216\u5728\u751F\u6210\u5143\u7D20\u4E4B\u524D\u65E0\u6CD5\u6DFB\u52A0\u5C5E\u6027 {0}\u3002\u5C06\u5FFD\u7565\u5C5E\u6027\u3002" }, - { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, - "\u4e3b\u673a\u4e0d\u662f\u683c\u5f0f\u826f\u597d\u7684\u5730\u5740"}, + /* + * Note to translators: The stylesheet contained a reference to a + * namespace prefix that was undefined. The value of the substitution + * text is the name of the prefix. + */ + { MsgKey.ER_NAMESPACE_PREFIX, + "\u6CA1\u6709\u8BF4\u660E\u540D\u79F0\u7A7A\u95F4\u524D\u7F00 ''{0}''\u3002" }, - { MsgKey.ER_SCHEME_NOT_CONFORMANT, - "\u6a21\u5f0f\u4e0d\u4e00\u81f4\u3002"}, + /* + * Note to translators: This message is reported if the stylesheet + * being processed attempted to construct an XML document with an + * attribute in a place other than on an element. The substitution text + * specifies the name of the attribute. + */ + { MsgKey.ER_STRAY_ATTRIBUTE, + "\u5C5E\u6027 ''{0}'' \u5728\u5143\u7D20\u5916\u90E8\u3002" }, - { MsgKey.ER_SCHEME_FROM_NULL_STRING, - "\u65e0\u6cd5\u4ece\u7a7a\u5b57\u7b26\u4e32\u8bbe\u7f6e\u6a21\u5f0f"}, + /* + * Note to translators: As with the preceding message, a namespace + * declaration has the form of an attribute and is only permitted to + * appear on an element. The substitution text {0} is the namespace + * prefix and {1} is the URI that was being used in the erroneous + * namespace declaration. + */ + { MsgKey.ER_STRAY_NAMESPACE, + "\u540D\u79F0\u7A7A\u95F4\u58F0\u660E ''{0}''=''{1}'' \u5728\u5143\u7D20\u5916\u90E8\u3002" }, - { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, - "\u8def\u5f84\u5305\u542b\u65e0\u6548\u7684\u8f6c\u4e49\u5e8f\u5217"}, + { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, + "\u65E0\u6CD5\u52A0\u8F7D ''{0}'' (\u68C0\u67E5 CLASSPATH), \u73B0\u5728\u53EA\u4F7F\u7528\u9ED8\u8BA4\u503C" }, - { MsgKey.ER_PATH_INVALID_CHAR, - "\u8def\u5f84\u5305\u542b\u975e\u6cd5\u5b57\u7b26\uff1a{0}"}, + { MsgKey.ER_ILLEGAL_CHARACTER, + "\u5C1D\u8BD5\u8F93\u51FA\u672A\u4EE5{1}\u7684\u6307\u5B9A\u8F93\u51FA\u7F16\u7801\u8868\u793A\u7684\u6574\u6570\u503C {0} \u7684\u5B57\u7B26\u3002" }, - { MsgKey.ER_FRAG_INVALID_CHAR, - "\u7247\u6bb5\u5305\u542b\u65e0\u6548\u7684\u5b57\u7b26"}, + { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, + "\u65E0\u6CD5\u4E3A\u8F93\u51FA\u65B9\u6CD5 ''{1}'' \u52A0\u8F7D\u5C5E\u6027\u6587\u4EF6 ''{0}'' (\u68C0\u67E5 CLASSPATH)" }, - { MsgKey.ER_FRAG_WHEN_PATH_NULL, - "\u8def\u5f84\u4e3a\u7a7a\u65f6\uff0c\u65e0\u6cd5\u8bbe\u7f6e\u7247\u6bb5"}, + { MsgKey.ER_INVALID_PORT, + "\u65E0\u6548\u7684\u7AEF\u53E3\u53F7" }, - { MsgKey.ER_FRAG_FOR_GENERIC_URI, - "\u53ea\u80fd\u4e3a\u4e00\u822c URI \u8bbe\u7f6e\u7247\u6bb5"}, + { MsgKey.ER_PORT_WHEN_HOST_NULL, + "\u4E3B\u673A\u4E3A\u7A7A\u65F6, \u65E0\u6CD5\u8BBE\u7F6E\u7AEF\u53E3" }, - { MsgKey.ER_NO_SCHEME_IN_URI, - "\u5728 URI \u4e2d\u627e\u4e0d\u5230\u6a21\u5f0f\uff1a{0}"}, + { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, + "\u4E3B\u673A\u4E0D\u662F\u683C\u5F0F\u826F\u597D\u7684\u5730\u5740" }, - { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, - "\u65e0\u6cd5\u4ee5\u7a7a\u53c2\u6570\u521d\u59cb\u5316 URI"}, + { MsgKey.ER_SCHEME_NOT_CONFORMANT, + "\u65B9\u6848\u4E0D\u4E00\u81F4\u3002" }, - { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, - "\u8def\u5f84\u548c\u7247\u6bb5\u4e2d\u90fd\u65e0\u6cd5\u6307\u5b9a\u7247\u6bb5"}, + { MsgKey.ER_SCHEME_FROM_NULL_STRING, + "\u65E0\u6CD5\u4ECE\u7A7A\u5B57\u7B26\u4E32\u8BBE\u7F6E\u65B9\u6848" }, - { MsgKey.ER_NO_QUERY_STRING_IN_PATH, - "\u8def\u5f84\u548c\u67e5\u8be2\u5b57\u7b26\u4e32\u4e2d\u4e0d\u80fd\u6307\u5b9a\u67e5\u8be2\u5b57\u7b26\u4e32"}, + { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, + "\u8DEF\u5F84\u5305\u542B\u65E0\u6548\u7684\u8F6C\u4E49\u5E8F\u5217" }, - { MsgKey.ER_NO_PORT_IF_NO_HOST, - "\u5982\u679c\u6ca1\u6709\u6307\u5b9a\u4e3b\u673a\uff0c\u5219\u4e0d\u53ef\u4ee5\u6307\u5b9a\u7aef\u53e3"}, + { MsgKey.ER_PATH_INVALID_CHAR, + "\u8DEF\u5F84\u5305\u542B\u65E0\u6548\u7684\u5B57\u7B26: {0}" }, - { MsgKey.ER_NO_USERINFO_IF_NO_HOST, - "\u5982\u679c\u6ca1\u6709\u6307\u5b9a\u4e3b\u673a\uff0c\u5219\u4e0d\u53ef\u4ee5\u6307\u5b9a Userinfo"}, + { MsgKey.ER_FRAG_INVALID_CHAR, + "\u7247\u6BB5\u5305\u542B\u65E0\u6548\u7684\u5B57\u7B26" }, - { MsgKey.ER_SCHEME_REQUIRED, - "\u6a21\u5f0f\u662f\u5fc5\u9700\u7684\uff01"} + { MsgKey.ER_FRAG_WHEN_PATH_NULL, + "\u8DEF\u5F84\u4E3A\u7A7A\u65F6, \u65E0\u6CD5\u8BBE\u7F6E\u7247\u6BB5" }, - }; - return contents; - } + { MsgKey.ER_FRAG_FOR_GENERIC_URI, + "\u53EA\u80FD\u4E3A\u4E00\u822C URI \u8BBE\u7F6E\u7247\u6BB5" }, + + { MsgKey.ER_NO_SCHEME_IN_URI, + "\u5728 URI \u4E2D\u627E\u4E0D\u5230\u65B9\u6848" }, + + { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, + "\u65E0\u6CD5\u4EE5\u7A7A\u53C2\u6570\u521D\u59CB\u5316 URI" }, + + { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, + "\u8DEF\u5F84\u548C\u7247\u6BB5\u4E2D\u90FD\u65E0\u6CD5\u6307\u5B9A\u7247\u6BB5" }, + + { MsgKey.ER_NO_QUERY_STRING_IN_PATH, + "\u8DEF\u5F84\u548C\u67E5\u8BE2\u5B57\u7B26\u4E32\u4E2D\u4E0D\u80FD\u6307\u5B9A\u67E5\u8BE2\u5B57\u7B26\u4E32" }, + + { MsgKey.ER_NO_PORT_IF_NO_HOST, + "\u5982\u679C\u6CA1\u6709\u6307\u5B9A\u4E3B\u673A, \u5219\u4E0D\u53EF\u4EE5\u6307\u5B9A\u7AEF\u53E3" }, + + { MsgKey.ER_NO_USERINFO_IF_NO_HOST, + "\u5982\u679C\u6CA1\u6709\u6307\u5B9A\u4E3B\u673A, \u5219\u4E0D\u53EF\u4EE5\u6307\u5B9A Userinfo" }, + + { MsgKey.ER_XML_VERSION_NOT_SUPPORTED, + "\u8B66\u544A: \u8F93\u51FA\u6587\u6863\u7684\u7248\u672C\u5E94\u4E3A ''{0}''\u3002\u4E0D\u652F\u6301\u6B64\u7248\u672C\u7684 XML\u3002\u8F93\u51FA\u6587\u6863\u7684\u7248\u672C\u5C06\u4E3A ''1.0''\u3002" }, + + { MsgKey.ER_SCHEME_REQUIRED, + "\u65B9\u6848\u662F\u5FC5\u9700\u7684!" }, + + /* + * Note to translators: The words 'Properties' and + * 'SerializerFactory' in this message are Java class names + * and should not be translated. + */ + { MsgKey.ER_FACTORY_PROPERTY_MISSING, + "\u4F20\u9012\u5230 SerializerFactory \u7684 Properties \u5BF9\u8C61\u6CA1\u6709 ''{0}'' \u5C5E\u6027\u3002" }, + + { MsgKey.ER_ENCODING_NOT_SUPPORTED, + "\u8B66\u544A: Java \u8FD0\u884C\u65F6\u4E0D\u652F\u6301\u7F16\u7801 ''{0}''\u3002" }, + + + }; + + return contents; + } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java index a72d06e5f7f..f1f64f1acb4 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,105 +18,191 @@ * limitations under the License. */ /* - * $Id: SerializerMessages_zh_TW.java,v 1.1.4.1 2005/09/08 11:03:18 suresh_emailid Exp $ + * $Id: SerializerMessages_zh_TW.java /st_wptg_1.8.0.0.0jdk/2 2013/09/14 02:16:34 gmolloy Exp $ */ - package com.sun.org.apache.xml.internal.serializer.utils; import java.util.ListResourceBundle; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +/** + * An instance of this class is a ListResourceBundle that + * has the required getContents() method that returns + * an array of message-key/message associations. + *

    + * The message keys are defined in {@link MsgKey}. The + * messages that those keys map to are defined here. + *

    + * The messages in the English version are intended to be + * translated. + * + * This class is not a public API, it is only public because it is + * used in com.sun.org.apache.xml.internal.serializer. + * + * @xsl.usage internal + */ public class SerializerMessages_zh_TW extends ListResourceBundle { - public Object[][] getContents() { - Object[][] contents = new Object[][] { - // BAD_MSGKEY needs translation - // BAD_MSGFORMAT needs translation - { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, - "serializer \u985e\u5225 ''{0}'' \u4e0d\u5be6\u4f5c org.xml.sax.ContentHandler\u3002"}, - { MsgKey.ER_RESOURCE_COULD_NOT_FIND, - "\u627e\u4e0d\u5230\u8cc7\u6e90 [ {0} ]\u3002\n{1}"}, + /* + * This file contains error and warning messages related to + * Serializer Error Handling. + * + * General notes to translators: - { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, - "\u7121\u6cd5\u8f09\u5165\u8cc7\u6e90 [ {0} ]\uff1a{1} \n {2} \n {3}"}, + * 1) A stylesheet is a description of how to transform an input XML document + * into a resultant XML document (or HTML document or text). The + * stylesheet itself is described in the form of an XML document. - { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, - "\u7de9\u885d\u5340\u5927\u5c0f <=0"}, + * + * 2) An element is a mark-up tag in an XML document; an attribute is a + * modifier on the tag. For example, in + * "elem" is an element name, "attr" and "attr2" are attribute names with + * the values "val" and "val2", respectively. + * + * 3) A namespace declaration is a special attribute that is used to associate + * a prefix with a URI (the namespace). The meanings of element names and + * attribute names that use that prefix are defined with respect to that + * namespace. + * + * + */ - { MsgKey.ER_INVALID_UTF16_SURROGATE, - "\u5075\u6e2c\u5230\u7121\u6548\u7684 UTF-16 \u4ee3\u7406\uff1a{0}?"}, + /** The lookup table for error messages. */ + public Object[][] getContents() { + Object[][] contents = new Object[][] { + { MsgKey.BAD_MSGKEY, + "\u8A0A\u606F\u7D22\u5F15\u9375 ''{0}'' \u7684\u8A0A\u606F\u985E\u5225\u4E0D\u662F ''{1}''" }, - { MsgKey.ER_OIERROR, - "IO \u932f\u8aa4"}, + { MsgKey.BAD_MSGFORMAT, + "\u8A0A\u606F\u985E\u5225 ''{1}'' \u4E2D\u7684\u8A0A\u606F ''{0}'' \u683C\u5F0F\u4E0D\u6B63\u78BA\u3002" }, - { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, - "\u5728\u7522\u751f\u5b50\u9805\u7bc0\u9ede\u4e4b\u5f8c\uff0c\u6216\u5728\u7522\u751f\u5143\u7d20\u4e4b\u524d\uff0c\u4e0d\u53ef\u65b0\u589e\u5c6c\u6027 {0}\u3002\u5c6c\u6027\u6703\u88ab\u5ffd\u7565\u3002"}, + { MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, + "serializer \u985E\u5225 ''{0}'' \u4E0D\u5BE6\u884C org.xml.sax.ContentHandler\u3002" }, - { MsgKey.ER_NAMESPACE_PREFIX, - "\u5b57\u9996 ''{0}'' \u7684\u540d\u7a31\u7a7a\u9593\u5c1a\u672a\u5ba3\u544a\u3002"}, + { MsgKey.ER_RESOURCE_COULD_NOT_FIND, + "\u627E\u4E0D\u5230\u8CC7\u6E90 [ {0} ]\u3002\n{1}" }, - // ER_STRAY_ATTRIBUTE needs translation - { MsgKey.ER_STRAY_NAMESPACE, - "\u540d\u7a31\u7a7a\u9593\u5ba3\u544a ''{0}''=''{1}'' \u8d85\u51fa\u5143\u7d20\u5916\u3002"}, + { MsgKey.ER_RESOURCE_COULD_NOT_LOAD, + "\u7121\u6CD5\u8F09\u5165\u8CC7\u6E90 [ {0} ]: {1} \n {2} \t {3}" }, - { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, - "\u7121\u6cd5\u8f09\u5165 ''{0}''\uff08\u6aa2\u67e5 CLASSPATH\uff09\uff0c\u76ee\u524d\u53ea\u4f7f\u7528\u9810\u8a2d\u503c"}, + { MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO, + "\u7DE9\u885D\u5340\u5927\u5C0F <=0" }, - // ER_ILLEGAL_CHARACTER needs translation - { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, - "\u7121\u6cd5\u8f09\u5165\u8f38\u51fa\u65b9\u6cd5 ''{1}'' \u7684\u5167\u5bb9\u6a94 ''{0}''\uff08\u6aa2\u67e5 CLASSPATH\uff09"}, + { MsgKey.ER_INVALID_UTF16_SURROGATE, + "\u5075\u6E2C\u5230\u7121\u6548\u7684 UTF-16 \u4EE3\u7406: {0}\uFF1F" }, - { MsgKey.ER_INVALID_PORT, - "\u7121\u6548\u7684\u57e0\u7de8\u865f"}, + { MsgKey.ER_OIERROR, + "IO \u932F\u8AA4" }, - { MsgKey.ER_PORT_WHEN_HOST_NULL, - "\u4e3b\u6a5f\u70ba\u7a7a\u503c\u6642\uff0c\u7121\u6cd5\u8a2d\u5b9a\u57e0"}, + { MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION, + "\u5728\u7522\u751F\u5B50\u9805\u7BC0\u9EDE\u4E4B\u5F8C\uFF0C\u6216\u5728\u7522\u751F\u5143\u7D20\u4E4B\u524D\uFF0C\u4E0D\u53EF\u65B0\u589E\u5C6C\u6027 {0}\u3002\u5C6C\u6027\u6703\u88AB\u5FFD\u7565\u3002" }, - { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, - "\u4e3b\u6a5f\u6c92\u6709\u5b8c\u6574\u7684\u4f4d\u5740"}, + /* + * Note to translators: The stylesheet contained a reference to a + * namespace prefix that was undefined. The value of the substitution + * text is the name of the prefix. + */ + { MsgKey.ER_NAMESPACE_PREFIX, + "\u5B57\u9996 ''{0}'' \u7684\u547D\u540D\u7A7A\u9593\u5C1A\u672A\u5BA3\u544A\u3002" }, - { MsgKey.ER_SCHEME_NOT_CONFORMANT, - "\u7db1\u8981\u4e0d\u662f conformant\u3002"}, + /* + * Note to translators: This message is reported if the stylesheet + * being processed attempted to construct an XML document with an + * attribute in a place other than on an element. The substitution text + * specifies the name of the attribute. + */ + { MsgKey.ER_STRAY_ATTRIBUTE, + "\u5C6C\u6027 ''{0}'' \u5728\u5143\u7D20\u4E4B\u5916\u3002" }, - { MsgKey.ER_SCHEME_FROM_NULL_STRING, - "\u7121\u6cd5\u5f9e\u7a7a\u5b57\u4e32\u8a2d\u5b9a\u7db1\u8981"}, + /* + * Note to translators: As with the preceding message, a namespace + * declaration has the form of an attribute and is only permitted to + * appear on an element. The substitution text {0} is the namespace + * prefix and {1} is the URI that was being used in the erroneous + * namespace declaration. + */ + { MsgKey.ER_STRAY_NAMESPACE, + "\u547D\u540D\u7A7A\u9593\u5BA3\u544A ''{0}''=''{1}'' \u8D85\u51FA\u5143\u7D20\u5916\u3002" }, - { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, - "\u8def\u5f91\u5305\u542b\u7121\u6548\u7684\u8df3\u812b\u5b57\u5143"}, + { MsgKey.ER_COULD_NOT_LOAD_RESOURCE, + "\u7121\u6CD5\u8F09\u5165 ''{0}'' (\u6AA2\u67E5 CLASSPATH)\uFF0C\u76EE\u524D\u53EA\u4F7F\u7528\u9810\u8A2D\u503C" }, - { MsgKey.ER_PATH_INVALID_CHAR, - "\u8def\u5f91\u5305\u542b\u7121\u6548\u7684\u5b57\u5143\uff1a{0}"}, + { MsgKey.ER_ILLEGAL_CHARACTER, + "\u5617\u8A66\u8F38\u51FA\u6574\u6578\u503C {0} \u7684\u5B57\u5143\uFF0C\u4F46\u662F\u5B83\u4E0D\u662F\u4EE5\u6307\u5B9A\u7684 {1} \u8F38\u51FA\u7DE8\u78BC\u5448\u73FE\u3002" }, - { MsgKey.ER_FRAG_INVALID_CHAR, - "\u7247\u6bb5\u5305\u542b\u7121\u6548\u7684\u5b57\u5143"}, + { MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, + "\u7121\u6CD5\u8F09\u5165\u8F38\u51FA\u65B9\u6CD5 ''{1}'' \u7684\u5C6C\u6027\u6A94 ''{0}'' (\u6AA2\u67E5 CLASSPATH)" }, - { MsgKey.ER_FRAG_WHEN_PATH_NULL, - "\u8def\u5f91\u70ba\u7a7a\u503c\u6642\uff0c\u7121\u6cd5\u8a2d\u5b9a\u7247\u6bb5"}, + { MsgKey.ER_INVALID_PORT, + "\u7121\u6548\u7684\u9023\u63A5\u57E0\u865F\u78BC" }, - { MsgKey.ER_FRAG_FOR_GENERIC_URI, - "\u53ea\u80fd\u5c0d\u901a\u7528\u7684 URI \u8a2d\u5b9a\u7247\u6bb5"}, + { MsgKey.ER_PORT_WHEN_HOST_NULL, + "\u4E3B\u6A5F\u70BA\u7A7A\u503C\u6642\uFF0C\u7121\u6CD5\u8A2D\u5B9A\u9023\u63A5\u57E0" }, - { MsgKey.ER_NO_SCHEME_IN_URI, - "\u5728 URI\uff1a{0} \u627e\u4e0d\u5230\u7db1\u8981"}, + { MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, + "\u4E3B\u6A5F\u6C92\u6709\u5B8C\u6574\u7684\u4F4D\u5740" }, - { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, - "\u7121\u6cd5\u4ee5\u7a7a\u767d\u53c3\u6578\u8d77\u59cb\u8a2d\u5b9a URI"}, + { MsgKey.ER_SCHEME_NOT_CONFORMANT, + "\u914D\u7F6E\u4E0D\u4E00\u81F4\u3002" }, - { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, - "\u7247\u6bb5\u7121\u6cd5\u540c\u6642\u5728\u8def\u5f91\u548c\u7247\u6bb5\u4e2d\u6307\u5b9a"}, + { MsgKey.ER_SCHEME_FROM_NULL_STRING, + "\u7121\u6CD5\u5F9E\u7A7A\u503C\u5B57\u4E32\u8A2D\u5B9A\u914D\u7F6E" }, - { MsgKey.ER_NO_QUERY_STRING_IN_PATH, - "\u5728\u8def\u5f91\u53ca\u67e5\u8a62\u5b57\u4e32\u4e2d\u4e0d\u53ef\u6307\u5b9a\u67e5\u8a62\u5b57\u4e32"}, + { MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, + "\u8DEF\u5F91\u5305\u542B\u7121\u6548\u7684\u9041\u96E2\u5E8F\u5217" }, - { MsgKey.ER_NO_PORT_IF_NO_HOST, - "\u5982\u679c\u6c92\u6709\u6307\u5b9a\u4e3b\u6a5f\uff0c\u4e0d\u53ef\u6307\u5b9a\u57e0"}, + { MsgKey.ER_PATH_INVALID_CHAR, + "\u8DEF\u5F91\u5305\u542B\u7121\u6548\u7684\u5B57\u5143: {0}" }, - { MsgKey.ER_NO_USERINFO_IF_NO_HOST, - "\u5982\u679c\u6c92\u6709\u6307\u5b9a\u4e3b\u6a5f\uff0c\u4e0d\u53ef\u6307\u5b9a Userinfo"}, + { MsgKey.ER_FRAG_INVALID_CHAR, + "\u7247\u6BB5\u5305\u542B\u7121\u6548\u7684\u5B57\u5143" }, - { MsgKey.ER_SCHEME_REQUIRED, - "\u7db1\u8981\u662f\u5fc5\u9700\u7684\uff01"} + { MsgKey.ER_FRAG_WHEN_PATH_NULL, + "\u8DEF\u5F91\u70BA\u7A7A\u503C\u6642\uFF0C\u7121\u6CD5\u8A2D\u5B9A\u7247\u6BB5" }, - }; - return contents; - } + { MsgKey.ER_FRAG_FOR_GENERIC_URI, + "\u53EA\u80FD\u5C0D\u4E00\u822C URI \u8A2D\u5B9A\u7247\u6BB5" }, + + { MsgKey.ER_NO_SCHEME_IN_URI, + "\u5728 URI \u627E\u4E0D\u5230\u914D\u7F6E" }, + + { MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, + "\u7121\u6CD5\u4EE5\u7A7A\u767D\u53C3\u6578\u8D77\u59CB\u8A2D\u5B9A URI" }, + + { MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH, + "\u8DEF\u5F91\u548C\u7247\u6BB5\u4E0D\u80FD\u540C\u6642\u6307\u5B9A\u7247\u6BB5" }, + + { MsgKey.ER_NO_QUERY_STRING_IN_PATH, + "\u5728\u8DEF\u5F91\u53CA\u67E5\u8A62\u5B57\u4E32\u4E2D\u4E0D\u53EF\u6307\u5B9A\u67E5\u8A62\u5B57\u4E32" }, + + { MsgKey.ER_NO_PORT_IF_NO_HOST, + "\u5982\u679C\u6C92\u6709\u6307\u5B9A\u4E3B\u6A5F\uFF0C\u4E0D\u53EF\u6307\u5B9A\u9023\u63A5\u57E0" }, + + { MsgKey.ER_NO_USERINFO_IF_NO_HOST, + "\u5982\u679C\u6C92\u6709\u6307\u5B9A\u4E3B\u6A5F\uFF0C\u4E0D\u53EF\u6307\u5B9A Userinfo" }, + + { MsgKey.ER_XML_VERSION_NOT_SUPPORTED, + "\u8B66\u544A: \u8981\u6C42\u7684\u8F38\u51FA\u6587\u4EF6\u7248\u672C\u70BA ''{0}''\u3002\u4E0D\u652F\u63F4\u6B64\u7248\u672C\u7684 XML\u3002\u8F38\u51FA\u6587\u4EF6\u7684\u7248\u672C\u5C07\u6703\u662F ''1.0''\u3002" }, + + { MsgKey.ER_SCHEME_REQUIRED, + "\u5FC5\u9808\u6709\u914D\u7F6E\uFF01" }, + + /* + * Note to translators: The words 'Properties' and + * 'SerializerFactory' in this message are Java class names + * and should not be translated. + */ + { MsgKey.ER_FACTORY_PROPERTY_MISSING, + "\u50B3\u905E\u7D66 SerializerFactory \u7684 Properties \u7269\u4EF6\u6C92\u6709 ''{0}'' \u5C6C\u6027\u3002" }, + + { MsgKey.ER_ENCODING_NOT_SUPPORTED, + "\u8B66\u544A: Java Runtime \u4E0D\u652F\u63F4\u7DE8\u78BC ''{0}''\u3002" }, + + + }; + + return contents; + } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java index cab4f46bd42..a9c9aab1d50 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java @@ -25,12 +25,15 @@ package com.sun.org.apache.xml.internal.utils; import com.sun.org.apache.xalan.internal.XalanConstants; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; import com.sun.org.apache.xalan.internal.utils.SecuritySupport; +import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager; import java.util.HashMap; + import javax.xml.XMLConstants; import javax.xml.parsers.FactoryConfigurationError; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParserFactory; import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.XMLReaderFactory; @@ -63,11 +66,15 @@ public class XMLReaderManager { private HashMap m_inUse; private boolean m_useServicesMechanism = true; + + private boolean _secureProcessing; /** * protocols allowed for external DTD references in source file and/or stylesheet. */ private String _accessExternalDTD = XalanConstants.EXTERNAL_ACCESS_DEFAULT; + private XMLSecurityManager _xmlSecurityManager; + /** * Hidden constructor */ @@ -118,7 +125,12 @@ public class XMLReaderManager { // TransformerFactory creates a reader via the // XMLReaderFactory if setXMLReader is not used reader = XMLReaderFactory.createXMLReader(); - + try { + reader.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _secureProcessing); + } catch (SAXNotRecognizedException e) { + System.err.println("Warning: " + reader.getClass().getName() + ": " + + e.getMessage()); + } } catch (Exception e) { try { // If unable to create an instance, let's try to use @@ -164,6 +176,21 @@ public class XMLReaderManager { + se.getMessage()); } + try { + if (_xmlSecurityManager != null) { + for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) { + reader.setProperty(limit.apiProperty(), + _xmlSecurityManager.getLimitValueAsString(limit)); + } + if (_xmlSecurityManager.printEntityCountInfo()) { + reader.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES); + } + } + } catch (SAXException se) { + System.err.println("Warning: " + reader.getClass().getName() + ": " + + se.getMessage()); + } + return reader; } @@ -194,12 +221,23 @@ public class XMLReaderManager { m_useServicesMechanism = flag; } + /** + * Set feature + */ + public void setFeature(String name, boolean value) { + if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { + _secureProcessing = value; + } + } + /** * Get property value */ - public String getProperty(String name) { + public Object getProperty(String name) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { return _accessExternalDTD; + } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { + return _xmlSecurityManager; } return null; } @@ -207,9 +245,11 @@ public class XMLReaderManager { /** * Set property. */ - public void setProperty(String name, String value) { + public void setProperty(String name, Object value) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { _accessExternalDTD = (String)value; + } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { + _xmlSecurityManager = (XMLSecurityManager)value; } } } diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/XPathContext.java b/jaxp/src/com/sun/org/apache/xpath/internal/XPathContext.java index e71f61e6243..fd5db6f011e 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/XPathContext.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/XPathContext.java @@ -99,8 +99,7 @@ public class XPathContext extends DTMManager // implements ExpressionContext * the DTMManager, it really is a proxy for this object, which * is the real DTMManager. */ - protected DTMManager m_dtmManager = DTMManager.newInstance( - com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory()); + protected DTMManager m_dtmManager = null; /** * Return the DTMManager object. Though XPathContext context extends diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java index 0eac5f0c255..fee057ff361 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java @@ -33,6 +33,7 @@ import com.sun.org.apache.xpath.internal.objects.XObject; import com.sun.org.apache.xpath.internal.objects.XNodeSet; import com.sun.org.apache.xpath.internal.res.XPATHErrorResources; import com.sun.org.apache.xalan.internal.res.XSLMessages; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; import com.sun.org.apache.xpath.internal.functions.FuncExtFunction; import java.util.Vector; @@ -54,9 +55,12 @@ public class JAXPExtensionsProvider implements ExtensionsProvider { } public JAXPExtensionsProvider(XPathFunctionResolver resolver, - boolean featureSecureProcessing ) { + boolean featureSecureProcessing, FeatureManager featureManager ) { this.resolver = resolver; - this.extensionInvocationDisabled = featureSecureProcessing; + if (featureSecureProcessing && + !featureManager.isFeatureEnabled(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION)) { + this.extensionInvocationDisabled = true; + } } /** diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java index 2d7671ee8c7..925ce9c1234 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java @@ -30,6 +30,7 @@ import com.sun.org.apache.xml.internal.utils.PrefixResolver; import com.sun.org.apache.xpath.internal.res.XPATHErrorResources; import com.sun.org.apache.xalan.internal.res.XSLMessages; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; @@ -67,33 +68,36 @@ public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{ private boolean featureSecureProcessing = false; private boolean useServicesMechanism = true; + + private final FeatureManager featureManager; + /** Protected constructor to prevent direct instantiation; use compile() * from the context. */ - protected XPathExpressionImpl() { }; - - protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath, - JAXPPrefixResolver prefixResolver, - XPathFunctionResolver functionResolver, - XPathVariableResolver variableResolver ) { - this.xpath = xpath; - this.prefixResolver = prefixResolver; - this.functionResolver = functionResolver; - this.variableResolver = variableResolver; - this.featureSecureProcessing = false; + protected XPathExpressionImpl() { + this(null, null, null, null, + false, true, new FeatureManager()); }; protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath, JAXPPrefixResolver prefixResolver, XPathFunctionResolver functionResolver, - XPathVariableResolver variableResolver, - boolean featureSecureProcessing, boolean useServicesMechanism ) { + XPathVariableResolver variableResolver ) { + this(xpath, prefixResolver, functionResolver, variableResolver, + false, true, new FeatureManager()); + }; + + protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath, + JAXPPrefixResolver prefixResolver,XPathFunctionResolver functionResolver, + XPathVariableResolver variableResolver, boolean featureSecureProcessing, + boolean useServicesMechanism, FeatureManager featureManager ) { this.xpath = xpath; this.prefixResolver = prefixResolver; this.functionResolver = functionResolver; this.variableResolver = variableResolver; this.featureSecureProcessing = featureSecureProcessing; this.useServicesMechanism = useServicesMechanism; + this.featureManager = featureManager; }; public void setXPath (com.sun.org.apache.xpath.internal.XPath xpath ) { @@ -111,7 +115,7 @@ public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{ com.sun.org.apache.xpath.internal.XPathContext xpathSupport = null; if ( functionResolver != null ) { JAXPExtensionsProvider jep = new JAXPExtensionsProvider( - functionResolver, featureSecureProcessing ); + functionResolver, featureSecureProcessing, featureManager ); xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext( jep ); } else { xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext(); diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java index 7159896c27d..b050af44674 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java @@ -24,6 +24,8 @@ package com.sun.org.apache.xpath.internal.jaxp; import com.sun.org.apache.xalan.internal.XalanConstants; import com.sun.org.apache.xpath.internal.res.XPATHErrorResources; import com.sun.org.apache.xalan.internal.res.XSLMessages; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; +import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase; import javax.xml.XMLConstants; import javax.xml.xpath.XPathFactory; @@ -68,6 +70,8 @@ public class XPathFactoryImpl extends XPathFactory { private boolean _useServicesMechanism = true; + private final FeatureManager _featureManager; + public XPathFactoryImpl() { this(true); } @@ -77,9 +81,12 @@ public class XPathFactoryImpl extends XPathFactory { } public XPathFactoryImpl(boolean useServicesMechanism) { + _featureManager = new FeatureManager(); if (System.getSecurityManager() != null) { _isSecureMode = true; _isNotSecureProcessing = false; + _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION, + FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE); } this._useServicesMechanism = useServicesMechanism; } @@ -131,7 +138,8 @@ public class XPathFactoryImpl extends XPathFactory { public javax.xml.xpath.XPath newXPath() { return new com.sun.org.apache.xpath.internal.jaxp.XPathImpl( xPathVariableResolver, xPathFunctionResolver, - !_isNotSecureProcessing, _useServicesMechanism ); + !_isNotSecureProcessing, _useServicesMechanism, + _featureManager ); } /** @@ -181,6 +189,10 @@ public class XPathFactoryImpl extends XPathFactory { } _isNotSecureProcessing = !value; + if (value && _featureManager != null) { + _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION, + FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE); + } // all done processing feature return; @@ -192,6 +204,11 @@ public class XPathFactoryImpl extends XPathFactory { return; } + if (_featureManager != null && + _featureManager.setValue(name, FeaturePropertyBase.State.APIPROPERTY, value)) { + return; + } + // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_UNKNOWN, @@ -240,6 +257,14 @@ public class XPathFactoryImpl extends XPathFactory { if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) { return _useServicesMechanism; } + + /** Check to see if the property is managed by the security manager **/ + String propertyValue = (_featureManager != null) ? + _featureManager.getValueAsString(name) : null; + if (propertyValue != null) { + return _featureManager.isFeatureEnabled(name); + } + // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_GETTING_UNKNOWN_FEATURE, diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java index 6b8082586b0..af82f378917 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java @@ -35,6 +35,7 @@ import com.sun.org.apache.xpath.internal.objects.XObject; import com.sun.org.apache.xpath.internal.res.XPATHErrorResources; import com.sun.org.apache.xalan.internal.res.XSLMessages; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; import org.w3c.dom.Node; import org.w3c.dom.Document; @@ -70,18 +71,20 @@ public class XPathImpl implements javax.xml.xpath.XPath { // extensions function need to throw XPathFunctionException private boolean featureSecureProcessing = false; private boolean useServiceMechanism = true; + private final FeatureManager featureManager; XPathImpl( XPathVariableResolver vr, XPathFunctionResolver fr ) { - this.origVariableResolver = this.variableResolver = vr; - this.origFunctionResolver = this.functionResolver = fr; + this(vr, fr, false, true, new FeatureManager()); } XPathImpl( XPathVariableResolver vr, XPathFunctionResolver fr, - boolean featureSecureProcessing, boolean useServiceMechanism ) { + boolean featureSecureProcessing, boolean useServiceMechanism, + FeatureManager featureManager) { this.origVariableResolver = this.variableResolver = vr; this.origFunctionResolver = this.functionResolver = fr; this.featureSecureProcessing = featureSecureProcessing; this.useServiceMechanism = useServiceMechanism; + this.featureManager = featureManager; } /** @@ -190,7 +193,7 @@ public class XPathImpl implements javax.xml.xpath.XPath { com.sun.org.apache.xpath.internal.XPathContext xpathSupport = null; if ( functionResolver != null ) { JAXPExtensionsProvider jep = new JAXPExtensionsProvider( - functionResolver, featureSecureProcessing ); + functionResolver, featureSecureProcessing, featureManager ); xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext( jep ); } else { xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext(); @@ -391,7 +394,7 @@ public class XPathImpl implements javax.xml.xpath.XPath { // Can have errorListener XPathExpressionImpl ximpl = new XPathExpressionImpl (xpath, prefixResolver, functionResolver, variableResolver, - featureSecureProcessing, useServiceMechanism ); + featureSecureProcessing, useServiceMechanism, featureManager ); return ximpl; } catch ( javax.xml.transform.TransformerException te ) { throw new XPathExpressionException ( te ) ; diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java index 034531e1242..e7013f2ad5f 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XPATHErrorResources_es.java,v 1.2.4.1 2005/09/15 00:39:22 jeffsuttor Exp $ + * $Id: XPATHErrorResources_es.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 09:06:34 gmolloy Exp $ */ package com.sun.org.apache.xpath.internal.res; @@ -432,7 +432,7 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = "ERROR. C\u00F3digo de operaci\u00F3n desconocido: {0}"}, { ER_EXTRA_ILLEGAL_TOKENS, - "Elementos no permitidos adicionales: {0}"}, + "Tokens no permitidos adicionales: {0}"}, { ER_EXPECTED_DOUBLE_QUOTE, "literal con comillas incorrectas... se esperaban comillas dobles"}, @@ -549,7 +549,7 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = "En XPath.readObject: {0}"}, { ER_FUNCTION_TOKEN_NOT_FOUND, - "No se ha encontrado el elemento de funci\u00F3n."}, + "No se ha encontrado el token de funci\u00F3n."}, { ER_CANNOT_DEAL_XPATH_TYPE, "No se puede negociar con el tipo de XPath: {0}"}, @@ -643,13 +643,13 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = // The message indicates that such an expression was expected following the // characters '/' or '//', but was not found. { ER_EXPECTED_REL_LOC_PATH, - "Se esperaba una ruta de acceso de ubicaci\u00F3n relativa despu\u00E9s del elemento '/' o '//'."}, + "Se esperaba una ruta de acceso de ubicaci\u00F3n relativa despu\u00E9s del token '/' o '//'."}, // Note to translators: A location path is a form of XPath expression. // The message indicates that syntactically such an expression was expected,but // the characters specified by the substitution text were encountered instead. { ER_EXPECTED_LOC_PATH, - "Se esperaba una ruta de acceso de ubicaci\u00F3n, pero se ha encontrado el siguiente elemento: {0}"}, + "Se esperaba una ruta de acceso de ubicaci\u00F3n, pero se ha encontrado el siguiente token: {0}"}, // Note to translators: A location path is a form of XPath expression. // The message indicates that syntactically such a subexpression was expected, @@ -661,7 +661,7 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = // The message indicates that syntactically such an expression was expected // following the specified characters. { ER_EXPECTED_LOC_STEP, - "Se esperaba un paso de ubicaci\u00F3n despu\u00E9s del elemento '/' o '//'."}, + "Se esperaba un paso de ubicaci\u00F3n despu\u00E9s del token '/' o '//'."}, // Note to translators: A node test is part of an XPath expression that is // used to test for particular kinds of nodes. In this case, a node test that @@ -846,7 +846,7 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = "XPath necesita un objeto derivado para implantar una prueba de nodo."}, { WG_FUNCTION_TOKEN_NOT_FOUND, - "No se ha encontrado el elemento de funci\u00F3n."}, + "No se ha encontrado el token de funci\u00F3n."}, { WG_COULDNOT_FIND_FUNCTION, "No se ha encontrado la funci\u00F3n: {0}"}, diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java index 256b88c190d..e0a85145f34 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XPATHErrorResources_ja.java,v 1.2.4.1 2005/09/15 00:39:20 jeffsuttor Exp $ + * $Id: XPATHErrorResources_ja.java /st_wptg_1.8.0.0.0jdk/2 2013/09/12 17:39:58 gmolloy Exp $ */ package com.sun.org.apache.xpath.internal.res; @@ -540,7 +540,7 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = "\u7121\u52B9\u306AUTF-16\u30B5\u30ED\u30B2\u30FC\u30C8\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F: {0}\u3002"}, { ER_OIERROR, - "\u5165\u51FA\u529B\u30A8\u30E9\u30FC"}, + "IO\u30A8\u30E9\u30FC"}, { ER_CANNOT_CREATE_URL, "{0}\u306EURL\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093"}, diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java index 85504928969..188dbbc2401 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java @@ -3,13 +3,13 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -17,9 +17,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - /* - * $Id: XPATHErrorResources_pt_BR.java 3023 2011-03-01 00:53:34Z joehw $ + * $Id: XPATHErrorResources_pt_BR.java /st_wptg_1.8.0.0.0jdk/2 2013/09/11 12:46:54 gmolloy Exp $ */ package com.sun.org.apache.xpath.internal.res; @@ -517,7 +516,7 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = "O prefixo deve ser resolvido para um namespace: {0}"}, { ER_PARSE_NOT_SUPPORTED, - "parse (InputSource source) n\u00E3o suportado em XPathContext! N\u00E3o \u00E9 poss\u00EDvel abrir {0}"}, + "parsing (InputSource source) n\u00E3o suportado em XPathContext! N\u00E3o \u00E9 poss\u00EDvel abrir {0}"}, { ER_SAX_API_NOT_HANDLED, "Caracteres SAX API(char ch[]... n\u00E3o tratados por DTM!"}, diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java index f9152568fa1..a02ae333205 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java @@ -3,7 +3,7 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ * limitations under the License. */ /* - * $Id: XPATHErrorResources_sv.java,v 1.2.4.1 2005/09/15 00:39:20 jeffsuttor Exp $ + * $Id: XPATHErrorResources_sv.java /st_wptg_1.8.0.0.0jdk/2 2013/09/16 06:50:58 gmolloy Exp $ */ package com.sun.org.apache.xpath.internal.res; @@ -447,7 +447,7 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = "F\u00F6rv\u00E4ntade {0}, men hittade: {1}"}, { ER_INCORRECT_PROGRAMMER_ASSERTION, - "Programmerarens verifiering \u00E4r inte korrekt! - {0}"}, + "Programmerarens utsaga \u00E4r inte korrekt! - {0}"}, { ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL, "Argumentet boolean(...) \u00E4r inte l\u00E4ngre valfritt med 19990709 XPath-utkast."}, @@ -480,7 +480,7 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = "Fel! Hittade inte xpath select-uttryck (-select)."}, { ER_COULDNOT_FIND_ENDOP_AFTER_OPLOCATIONPATH, - "FEL! Kunde inte hitta ENDOP efter OP_LOCATIONPATH"}, + "FEL! Hittade inte ENDOP efter OP_LOCATIONPATH"}, { ER_ERROR_OCCURED, "Fel intr\u00E4ffade!"}, @@ -498,7 +498,7 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = "Funktionen count borde ta emot ett argument!"}, { ER_COULDNOT_FIND_FUNCTION, - "Kunde inte hitta funktionen: {0}"}, + "Hittade inte funktionen: {0}"}, { ER_UNSUPPORTED_ENCODING, "Kodning utan st\u00F6d: {0}"}, @@ -567,7 +567,7 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = "Felhanterare med v\u00E4rde null"}, { ER_PROG_ASSERT_UNKNOWN_OPCODE, - "Programmerarens verifiering: ok\u00E4nd op-kod: {0}"}, + "Programmerarens utsaga: ok\u00E4nd op-kod: {0}"}, { ER_ZERO_OR_ONE, "0 eller 1"}, @@ -637,7 +637,7 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = "{0} till\u00E5ter endast {1} argument"}, { ER_UNKNOWN_STEP, - "Programmerarens verifiering i getNextStepPos: ok\u00E4nt stepType: {0}"}, + "Programmerarens utsaga i getNextStepPos: ok\u00E4nt stepType: {0}"}, //Note to translators: A relative location path is a form of XPath expression. // The message indicates that such an expression was expected following the @@ -849,7 +849,7 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = "funktionstecken hittades inte."}, { WG_COULDNOT_FIND_FUNCTION, - "Kunde inte hitta funktionen: {0}"}, + "Hittade inte funktionen: {0}"}, { WG_CANNOT_MAKE_URL_FROM, "Kan inte skapa URL fr\u00E5n: {0}"}, diff --git a/jaxp/src/javax/xml/datatype/DatatypeFactory.java b/jaxp/src/javax/xml/datatype/DatatypeFactory.java index 4f9d6f67c23..56c796b10e9 100644 --- a/jaxp/src/javax/xml/datatype/DatatypeFactory.java +++ b/jaxp/src/javax/xml/datatype/DatatypeFactory.java @@ -49,7 +49,13 @@ import java.util.regex.Pattern; * *

  • * Uses the service-provider loading facilities, defined by the {@link java.util.ServiceLoader} class, to attempt - * to locate and load an implementation of the service. + * to locate and load an implementation of the service using the {@linkplain + * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: + * the service-provider loading facility will use the {@linkplain + * java.lang.Thread#getContextClassLoader() current thread's context class loader} + * to attempt to load the service. If the context class + * loader is null, the {@linkplain + * ClassLoader#getSystemClassLoader() system class loader} will be used. *
    * In case of {@link java.util.ServiceConfigurationError service * configuration error} a {@link javax.xml.datatype.DatatypeConfigurationException} diff --git a/jaxp/src/javax/xml/parsers/DocumentBuilderFactory.java b/jaxp/src/javax/xml/parsers/DocumentBuilderFactory.java index 748a1636f0a..04265f612e9 100644 --- a/jaxp/src/javax/xml/parsers/DocumentBuilderFactory.java +++ b/jaxp/src/javax/xml/parsers/DocumentBuilderFactory.java @@ -82,7 +82,13 @@ public abstract class DocumentBuilderFactory { *
  • * Uses the service-provider loading facilities, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an - * implementation of the service. + * implementation of the service using the {@linkplain + * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: + * the service-provider loading facility will use the {@linkplain + * java.lang.Thread#getContextClassLoader() current thread's context class loader} + * to attempt to load the service. If the context class + * loader is null, the {@linkplain + * ClassLoader#getSystemClassLoader() system class loader} will be used. *
  • *
  • * Otherwise, the system-default implementation is returned. diff --git a/jaxp/src/javax/xml/parsers/SAXParserFactory.java b/jaxp/src/javax/xml/parsers/SAXParserFactory.java index a7aef97bdf3..7163456780f 100644 --- a/jaxp/src/javax/xml/parsers/SAXParserFactory.java +++ b/jaxp/src/javax/xml/parsers/SAXParserFactory.java @@ -86,7 +86,13 @@ public abstract class SAXParserFactory { *
  • * Use the service-provider loading facilities, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an - * implementation of the service. + * implementation of the service using the {@linkplain + * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: + * the service-provider loading facility will use the {@linkplain + * java.lang.Thread#getContextClassLoader() current thread's context class loader} + * to attempt to load the service. If the context class + * loader is null, the {@linkplain + * ClassLoader#getSystemClassLoader() system class loader} will be used. *
  • *
  • * Otherwise the system-default implementation is returned. diff --git a/jaxp/src/javax/xml/stream/FactoryFinder.java b/jaxp/src/javax/xml/stream/FactoryFinder.java index 68f4ef21d66..886caa57ee0 100644 --- a/jaxp/src/javax/xml/stream/FactoryFinder.java +++ b/jaxp/src/javax/xml/stream/FactoryFinder.java @@ -253,7 +253,13 @@ class FactoryFinder { // Use the system property first try { - String systemProp = ss.getSystemProperty(factoryId); + + final String systemProp; + if (type.getName().equals(factoryId)) { + systemProp = ss.getSystemProperty(factoryId); + } else { + systemProp = System.getProperty(factoryId); + } if (systemProp != null) { dPrint("found system property, value=" + systemProp); // There's a bug here - because 'cl' is ignored. @@ -262,7 +268,8 @@ class FactoryFinder { } } catch (SecurityException se) { - if (debug) se.printStackTrace(); + throw new FactoryConfigurationError( + "Failed to read factoryId '" + factoryId + "'", se); } // Try read $java.home/lib/stax.properties followed by diff --git a/jaxp/src/javax/xml/stream/XMLEventFactory.java b/jaxp/src/javax/xml/stream/XMLEventFactory.java index d9e47ef0727..81a7c554bd9 100644 --- a/jaxp/src/javax/xml/stream/XMLEventFactory.java +++ b/jaxp/src/javax/xml/stream/XMLEventFactory.java @@ -84,7 +84,13 @@ public abstract class XMLEventFactory { *
  • * Use the service-provider loading facilities, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an - * implementation of the service. + * implementation of the service using the {@linkplain + * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: + * the service-provider loading facility will use the {@linkplain + * java.lang.Thread#getContextClassLoader() current thread's context class loader} + * to attempt to load the service. If the context class + * loader is null, the {@linkplain + * ClassLoader#getSystemClassLoader() system class loader} will be used. *
  • *
  • * Otherwise, the system-default implementation is returned. @@ -152,7 +158,13 @@ public abstract class XMLEventFactory { * If {@code factoryId} is "javax.xml.stream.XMLEventFactory", * use the service-provider loading facilities, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an - * implementation of the service. + * implementation of the service using the {@linkplain + * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: + * the service-provider loading facility will use the {@linkplain + * java.lang.Thread#getContextClassLoader() current thread's context class loader} + * to attempt to load the service. If the context class + * loader is null, the {@linkplain + * ClassLoader#getSystemClassLoader() system class loader} will be used. *
  • *
  • * Otherwise, throws a {@link FactoryConfigurationError}. diff --git a/jaxp/src/javax/xml/stream/XMLInputFactory.java b/jaxp/src/javax/xml/stream/XMLInputFactory.java index d894893eb6d..96bd13b2cfe 100644 --- a/jaxp/src/javax/xml/stream/XMLInputFactory.java +++ b/jaxp/src/javax/xml/stream/XMLInputFactory.java @@ -174,7 +174,13 @@ public abstract class XMLInputFactory { *
  • * Use the service-provider loading facilities, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an - * implementation of the service. + * implementation of the service using the {@linkplain + * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: + * the service-provider loading facility will use the {@linkplain + * java.lang.Thread#getContextClassLoader() current thread's context class loader} + * to attempt to load the service. If the context class + * loader is null, the {@linkplain + * ClassLoader#getSystemClassLoader() system class loader} will be used. *
  • *
  • * Otherwise, the system-default implementation is returned. @@ -242,7 +248,13 @@ public abstract class XMLInputFactory { * If {@code factoryId} is "javax.xml.stream.XMLInputFactory", * use the service-provider loading facilities, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an - * implementation of the service. + * implementation of the service using the {@linkplain + * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: + * the service-provider loading facility will use the {@linkplain + * java.lang.Thread#getContextClassLoader() current thread's context class loader} + * to attempt to load the service. If the context class + * loader is null, the {@linkplain + * ClassLoader#getSystemClassLoader() system class loader} will be used. *
  • *
  • * Otherwise, throws a {@link FactoryConfigurationError}. diff --git a/jaxp/src/javax/xml/stream/XMLOutputFactory.java b/jaxp/src/javax/xml/stream/XMLOutputFactory.java index a5a593c9cd0..55ced98941b 100644 --- a/jaxp/src/javax/xml/stream/XMLOutputFactory.java +++ b/jaxp/src/javax/xml/stream/XMLOutputFactory.java @@ -150,7 +150,13 @@ public abstract class XMLOutputFactory { *
  • * Use the service-provider loading facilities, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an - * implementation of the service. + * implementation of the service using the {@linkplain + * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: + * the service-provider loading facility will use the {@linkplain + * java.lang.Thread#getContextClassLoader() current thread's context class loader} + * to attempt to load the service. If the context class + * loader is null, the {@linkplain + * ClassLoader#getSystemClassLoader() system class loader} will be used. *
  • *
  • * Otherwise, the system-default implementation is returned. @@ -216,7 +222,13 @@ public abstract class XMLOutputFactory { * If {@code factoryId} is "javax.xml.stream.XMLOutputFactory", * use the service-provider loading facilities, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an - * implementation of the service. + * implementation of the service using the {@linkplain + * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: + * the service-provider loading facility will use the {@linkplain + * java.lang.Thread#getContextClassLoader() current thread's context class loader} + * to attempt to load the service. If the context class + * loader is null, the {@linkplain + * ClassLoader#getSystemClassLoader() system class loader} will be used. *
  • *
  • * Otherwise, throws a {@link FactoryConfigurationError}. diff --git a/jaxp/src/javax/xml/transform/TransformerFactory.java b/jaxp/src/javax/xml/transform/TransformerFactory.java index 9c4a076549d..cde66def0ea 100644 --- a/jaxp/src/javax/xml/transform/TransformerFactory.java +++ b/jaxp/src/javax/xml/transform/TransformerFactory.java @@ -77,7 +77,13 @@ public abstract class TransformerFactory { *
  • * Use the service-provider loading facilities, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an - * implementation of the service. + * implementation of the service using the {@linkplain + * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: + * the service-provider loading facility will use the {@linkplain + * java.lang.Thread#getContextClassLoader() current thread's context class loader} + * to attempt to load the service. If the context class + * loader is null, the {@linkplain + * ClassLoader#getSystemClassLoader() system class loader} will be used. *
  • *
  • * Otherwise, the system-default implementation is returned. diff --git a/jaxp/src/javax/xml/validation/SchemaFactory.java b/jaxp/src/javax/xml/validation/SchemaFactory.java index d99f45011f7..ebbbe405546 100644 --- a/jaxp/src/javax/xml/validation/SchemaFactory.java +++ b/jaxp/src/javax/xml/validation/SchemaFactory.java @@ -148,7 +148,14 @@ public abstract class SchemaFactory { *
  • * Use the service-provider loading facilities, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an - * implementation of the service.
    + * implementation of the service using the {@linkplain + * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: + * the service-provider loading facility will use the {@linkplain + * java.lang.Thread#getContextClassLoader() current thread's context class loader} + * to attempt to load the service. If the context class + * loader is null, the {@linkplain + * ClassLoader#getSystemClassLoader() system class loader} will be used. + *
    * Each potential service provider is required to implement the method * {@link #isSchemaLanguageSupported(String schemaLanguage)}. *
    diff --git a/jaxp/src/javax/xml/xpath/XPathFactory.java b/jaxp/src/javax/xml/xpath/XPathFactory.java index d4c60d60637..72de2b18d03 100644 --- a/jaxp/src/javax/xml/xpath/XPathFactory.java +++ b/jaxp/src/javax/xml/xpath/XPathFactory.java @@ -123,7 +123,13 @@ public abstract class XPathFactory { *
  • * Use the service-provider loading facilities, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an - * implementation of the service. + * implementation of the service using the {@linkplain + * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: + * the service-provider loading facility will use the {@linkplain + * java.lang.Thread#getContextClassLoader() current thread's context class loader} + * to attempt to load the service. If the context class + * loader is null, the {@linkplain + * ClassLoader#getSystemClassLoader() system class loader} will be used. *
    * Each potential service provider is required to implement the method * {@link #isObjectModelSupported(String objectModel)}. diff --git a/jaxws/.hgtags b/jaxws/.hgtags index 6a23622251b..cee784b95fa 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -230,3 +230,10 @@ b1fb4612a2caea52b5661b87509e560fa044b194 jdk8-b98 6908370afe834ff01739e8ec992d4246c74b7e6e jdk8-b106 e3c9328f75638289a342ce15fbe532f05078946e jdk8-b107 d1ea68556fd7925a3c7078dd9f77c6ca73d5aa9e jdk8-b108 +df5d4d01642572e77fd3c01e4c8703ed3f6eec87 jdk8-b109 +cc682329886be2fc26220fc30597ee4e5bba43ed jdk8-b110 +32edc7a2c86696dfcbdb6ffae641ff153f8e34bd jdk8-b111 +dbdd5c76250928582cb5342bcf7b299a6007d538 jdk8-b112 +9261f342aa73a79bbd1a817ae72fa72b15ef30bc jdk8-b113 +9ad289610fc6effe9076280b7920d0f16470709f jdk8-b114 +e126d8eca69b83a1cc159c2375b7c33140346d2b jdk8-b115 diff --git a/jaxws/make/jprt.properties b/jaxws/make/jprt.properties index 12ce773022a..8afa5316423 100644 --- a/jaxws/make/jprt.properties +++ b/jaxws/make/jprt.properties @@ -33,9 +33,7 @@ jprt.build.flavors=product,fastdebug # Standard list of jprt build targets for this source tree jprt.build.targets= \ - solaris_sparc_5.10-{product|fastdebug}, \ solaris_sparcv9_5.10-{product|fastdebug}, \ - solaris_i586_5.10-{product|fastdebug}, \ solaris_x64_5.10-{product|fastdebug}, \ linux_i586_2.6-{product|fastdebug}, \ linux_x64_2.6-{product|fastdebug}, \ diff --git a/jaxws/makefiles/BuildJaxws.gmk b/jaxws/makefiles/BuildJaxws.gmk index c70086e073b..204dd47fb53 100644 --- a/jaxws/makefiles/BuildJaxws.gmk +++ b/jaxws/makefiles/BuildJaxws.gmk @@ -30,42 +30,42 @@ include $(SPEC) include MakeBase.gmk include JavaCompilation.gmk -DISABLE_JAXWS_WARNINGS:=-Xlint:all,-varargs,-rawtypes,-deprecation,-unchecked,-serial,-dep-ann,-cast,-fallthrough,-static +DISABLE_JAXWS_WARNINGS := -Xlint:all,-varargs,-rawtypes,-deprecation,-unchecked,-serial,-dep-ann,-cast,-fallthrough,-static # The generate new bytecode uses the new compiler for to generate bytecode # for the new jdk that is being built. The code compiled by this setup # cannot necessarily be run with the boot jdk. -$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG,\ - JVM:=$(JAVA),\ - JAVAC:=$(NEW_JAVAC),\ - FLAGS:=-XDignore.symbol.file=true $(DISABLE_JAXWS_WARNINGS) -g,\ - SERVER_DIR:=$(SJAVAC_SERVER_DIR),\ - SERVER_JVM:=$(SJAVAC_SERVER_JAVA))) +$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG, \ + JVM := $(JAVA), \ + JAVAC := $(NEW_JAVAC), \ + FLAGS := -XDignore.symbol.file=true $(DISABLE_JAXWS_WARNINGS) -g, \ + SERVER_DIR := $(SJAVAC_SERVER_DIR), \ + SERVER_JVM := $(SJAVAC_SERVER_JAVA))) # Dummy here is needed to trigger copying of META-INF -$(eval $(call SetupJavaCompilation,BUILD_JAF,\ - SETUP:=GENERATE_NEWBYTECODE_DEBUG,\ - SRC:=$(JAXWS_TOPDIR)/src/share/jaf_classes,\ - COPY:="dummy",\ - BIN:=$(JAXWS_OUTPUTDIR)/jaf_classes)) +$(eval $(call SetupJavaCompilation,BUILD_JAF, \ + SETUP := GENERATE_NEWBYTECODE_DEBUG, \ + SRC := $(JAXWS_TOPDIR)/src/share/jaf_classes, \ + COPY := "dummy", \ + BIN := $(JAXWS_OUTPUTDIR)/jaf_classes)) -$(eval $(call SetupJavaCompilation,BUILD_JAXWS,\ - SETUP:=GENERATE_NEWBYTECODE_DEBUG,\ - SRC:=$(JAXWS_TOPDIR)/src/share/jaxws_classes,\ - BIN:=$(JAXWS_OUTPUTDIR)/jaxws_classes,\ - COPY:=.xsd,\ - COPY_FILES:=$(JAXWS_TOPDIR)/src/share/jaxws_classes/com/sun/tools/internal/xjc/runtime/JAXBContextFactory.java \ - $(JAXWS_TOPDIR)/src/share/jaxws_classes/com/sun/tools/internal/xjc/runtime/ZeroOneBooleanAdapter.java \ - $(JAXWS_TOPDIR)/src/share/jaxws_classes/com/sun/xml/internal/ws/assembler/jaxws-tubes-default.xml,\ - ADD_JAVAC_FLAGS=-cp $(OUTPUT_ROOT)/jaxp/dist/lib/classes.jar)) +$(eval $(call SetupJavaCompilation,BUILD_JAXWS, \ + SETUP := GENERATE_NEWBYTECODE_DEBUG, \ + SRC := $(JAXWS_TOPDIR)/src/share/jaxws_classes, \ + BIN := $(JAXWS_OUTPUTDIR)/jaxws_classes, \ + COPY := .xsd, \ + COPY_FILES := $(JAXWS_TOPDIR)/src/share/jaxws_classes/com/sun/tools/internal/xjc/runtime/JAXBContextFactory.java \ + $(JAXWS_TOPDIR)/src/share/jaxws_classes/com/sun/tools/internal/xjc/runtime/ZeroOneBooleanAdapter.java \ + $(JAXWS_TOPDIR)/src/share/jaxws_classes/com/sun/xml/internal/ws/assembler/jaxws-tubes-default.xml, \ + ADD_JAVAC_FLAGS = -Xbootclasspath/p:$(OUTPUT_ROOT)/jaxp/dist/lib/classes.jar)) $(JAXWS_OUTPUTDIR)/jaxws_classes/META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin: \ - $(JAXWS_TOPDIR)/src/share/jaxws_classes/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin + $(JAXWS_TOPDIR)/src/share/jaxws_classes/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin mkdir -p $(@D) cp $< $@ $(JAXWS_OUTPUTDIR)/jaxws_classes/META-INF/services/com.sun.tools.internal.xjc.Plugin: \ - $(JAXWS_TOPDIR)/src/share/jaxws_classes/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.xjc.Plugin + $(JAXWS_TOPDIR)/src/share/jaxws_classes/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.xjc.Plugin mkdir -p $(@D) cp $< $@ @@ -73,7 +73,7 @@ $(JAXWS_OUTPUTDIR)/jaxws_classes/META-INF/services/com.sun.tools.internal.xjc.Pl BUILD_JAXWS += $(JAXWS_OUTPUTDIR)/jaxws_classes/META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \ $(JAXWS_OUTPUTDIR)/jaxws_classes/META-INF/services/com.sun.tools.internal.xjc.Plugin -# Imitate the property cleaning mechanism in the old build. This will likely be replaced +# Imitate the property cleaning mechanism in the old build. This will likely be replaced # by the unified functionality in JavaCompilation.gmk, but keep it the same as old build # for now, even though it actually breaks properties containing # in the value. # Using nawk to avoid solaris sed. @@ -84,8 +84,8 @@ $(JAXWS_OUTPUTDIR)/jaxws_classes/%.properties: $(JAXWS_TOPDIR)/src/share/jaxws_c $(MV) $@.tmp $@ JAXWS_SRC_PROP_FILES := $(shell $(FIND) $(JAXWS_TOPDIR)/src/share/jaxws_classes -name "*.properties") -TARGET_PROP_FILES := $(patsubst $(JAXWS_TOPDIR)/src/share/jaxws_classes/%,\ - $(JAXWS_OUTPUTDIR)/jaxws_classes/%,$(JAXWS_SRC_PROP_FILES)) +TARGET_PROP_FILES := $(patsubst $(JAXWS_TOPDIR)/src/share/jaxws_classes/%, \ + $(JAXWS_OUTPUTDIR)/jaxws_classes/%, $(JAXWS_SRC_PROP_FILES)) $(JAXWS_OUTPUTDIR)/jaf_classes/%.properties: $(JAXWS_TOPDIR)/src/share/jaf_classes/%.properties $(MKDIR) -p $(@D) @@ -94,20 +94,20 @@ $(JAXWS_OUTPUTDIR)/jaf_classes/%.properties: $(JAXWS_TOPDIR)/src/share/jaf_class $(MV) $@.tmp $@ JAF_SRC_PROP_FILES := $(shell $(FIND) $(JAXWS_TOPDIR)/src/share/jaf_classes -name "*.properties") -TARGET_PROP_FILES += $(patsubst $(JAXWS_TOPDIR)/src/share/jaf_classes/%,\ - $(JAXWS_OUTPUTDIR)/jaf_classes/%,$(JAF_SRC_PROP_FILES)) +TARGET_PROP_FILES += $(patsubst $(JAXWS_TOPDIR)/src/share/jaf_classes/%, \ + $(JAXWS_OUTPUTDIR)/jaf_classes/%, $(JAF_SRC_PROP_FILES)) -$(eval $(call SetupArchive,ARCHIVE_JAXWS,$(BUILD_JAXWS) $(BUILD_JAF) $(TARGET_PROP_FILES),\ - SRCS:=$(JAXWS_OUTPUTDIR)/jaxws_classes $(JAXWS_OUTPUTDIR)/jaf_classes,\ - SUFFIXES:=.class .properties .xsd .xml .java \ - com.sun.mirror.apt.AnnotationProcessorFactory \ - com.sun.tools.internal.xjc.Plugin,\ - JAR:=$(JAXWS_OUTPUTDIR)/dist/lib/classes.jar)) +$(eval $(call SetupArchive,ARCHIVE_JAXWS, $(BUILD_JAXWS) $(BUILD_JAF) $(TARGET_PROP_FILES), \ + SRCS := $(JAXWS_OUTPUTDIR)/jaxws_classes $(JAXWS_OUTPUTDIR)/jaf_classes, \ + SUFFIXES := .class .properties .xsd .xml .java \ + com.sun.mirror.apt.AnnotationProcessorFactory \ + com.sun.tools.internal.xjc.Plugin, \ + JAR := $(JAXWS_OUTPUTDIR)/dist/lib/classes.jar)) -$(eval $(call SetupZipArchive,ZIP_JAXWS_SOURCES,\ - SRC:=$(JAXWS_TOPDIR)/src/share/jaf_classes $(JAXWS_TOPDIR)/src/share/jaxws_classes,\ - ZIP:=$(JAXWS_OUTPUTDIR)/dist/lib/src.zip)) +$(eval $(call SetupZipArchive,ZIP_JAXWS_SOURCES, \ + SRC := $(JAXWS_TOPDIR)/src/share/jaf_classes $(JAXWS_TOPDIR)/src/share/jaxws_classes, \ + ZIP := $(JAXWS_OUTPUTDIR)/dist/lib/src.zip)) all: $(JAXWS_OUTPUTDIR)/dist/lib/classes.jar $(JAXWS_OUTPUTDIR)/dist/lib/src.zip -.PHONY: default all +.PHONY: default all diff --git a/jaxws/makefiles/Makefile b/jaxws/makefiles/Makefile index 9539fe0e255..c7d0dd00cbb 100644 --- a/jaxws/makefiles/Makefile +++ b/jaxws/makefiles/Makefile @@ -24,19 +24,19 @@ # # Locate this Makefile -ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),) - makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST)) +ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))), ) + makefile_path := $(CURDIR)/$(lastword $(MAKEFILE_LIST)) else - makefile_path:=$(lastword $(MAKEFILE_LIST)) + makefile_path := $(lastword $(MAKEFILE_LIST)) endif -repo_dir:=$(patsubst %/makefiles/Makefile,%,$(makefile_path)) +repo_dir := $(patsubst %/makefiles/Makefile, %, $(makefile_path)) # What is the name of this subsystem (langtools, corba, etc)? -subsystem_name:=$(notdir $(repo_dir)) +subsystem_name := $(notdir $(repo_dir)) # Try to locate top-level makefile -top_level_makefile:=$(repo_dir)/../common/makefiles/Makefile -ifneq ($(wildcard $(top_level_makefile)),) +top_level_makefile := $(repo_dir)/../common/makefiles/Makefile +ifneq ($(wildcard $(top_level_makefile)), ) $(info Will run $(subsystem_name) target on top-level Makefile) $(info WARNING: This is a non-recommended way of building!) $(info ===================================================) diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/ExternalMetadataFeature.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/ExternalMetadataFeature.java index ff182cd86af..4f0b2119513 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/ExternalMetadataFeature.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/ExternalMetadataFeature.java @@ -88,9 +88,9 @@ public class ExternalMetadataFeature extends WebServiceFeature { return ID; } - public MetadataReader getMetadataReader(ClassLoader classLoader, boolean disableSecureXmlProcessing) { + public MetadataReader getMetadataReader(ClassLoader classLoader, boolean disableXmlSecurity) { if (reader != null && enabled) return reader; - return enabled ? new ExternalMetadataReader(files, resourceNames, classLoader, true, disableSecureXmlProcessing) : null; + return enabled ? new ExternalMetadataReader(files, resourceNames, classLoader, true, disableXmlSecurity) : null; } @Override diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle.properties index 430a8d8ef0d..a21b4dee0ac 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle.properties @@ -30,10 +30,10 @@ BASEDIR_DOESNT_EXIST = \ Non-existent directory: {0} VERSION = \ - schemagen 2.2.8-b20130806.1801 + schemagen 2.2.8-b130911.1802 FULLVERSION = \ - schemagen full version "2.2.8-b20130806.1801" + schemagen full version "2.2.8-b130911.1802" USAGE = \ Usage: schemagen [-options ...] \n\ diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_de.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_de.properties index ddf736faf0a..11c7bb7007a 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_de.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_de.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Nicht erkanntes {0} in Zeile {1} Spalte {2} BASEDIR_DOESNT_EXIST = Nicht vorhandenes Verzeichnis: {0} -VERSION = schemagen 2.2.8-b20130806.1801 +VERSION = schemagen 2.2.8-b130911.1802 -FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.8-b20130806.1801" +FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.8-b130911.1802" USAGE = Verwendung: schemagen [-options ...] \nOptionen: \n\\ \\ \\ \\ -d : Gibt an, wo die von Prozessor und javac generierten Klassendateien gespeichert werden sollen\n\\ \\ \\ \\ -cp : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -classpath : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -encoding : Gibt die Codierung f\u00FCr die Annotationsverarbeitung/den javac-Aufruf an \n\\ \\ \\ \\ -episode : Generiert Episodendatei f\u00FCr separate Kompilierung\n\\ \\ \\ \\ -version : Zeigt Versionsinformation an\n\\ \\ \\ \\ -fullversion : Zeigt vollst\u00E4ndige Versionsinformationen an\n\\ \\ \\ \\ -help : Zeigt diese Verwendungsmeldung an diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_es.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_es.properties index d9a1b2ee510..c85d08ea05e 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_es.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_es.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Aparece un {0} inesperado en la l\u00EDnea {1} y la colu BASEDIR_DOESNT_EXIST = Directorio no existente: {0} -VERSION = schemagen 2.2.8-b20130806.1801 +VERSION = schemagen 2.2.8-b130911.1802 -FULLVERSION = versi\u00F3n completa de schemagen "2.2.8-b20130806.1801" +FULLVERSION = versi\u00F3n completa de schemagen "2.2.8-b130911.1802" USAGE = Sintaxis: schemagen [-options ...] \nOpciones: \n\\ \\ \\ \\ -d : especifique d\u00F3nde se colocan los archivos de clase generados por javac y el procesador\n\\ \\ \\ \\ -cp : especifique d\u00F3nde se encuentran los archivos especificados por el usuario\n\\ \\ \\ \\ -encoding : especifique la codificaci\u00F3n que se va a utilizar para el procesamiento de anotaciones/llamada de javac\n\\ \\ \\ \\ -episode : genera un archivo de episodio para una compilaci\u00F3n diferente\n\\ \\ \\ \\ -version : muestra la informaci\u00F3n de la versi\u00F3n\n\\ \\ \\ \\ -fullversion : muestra la informaci\u00F3n completa de la versi\u00F3n\n\\ \\ \\ \\ -help : muestra este mensaje de sintaxis diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties index 1ed6126bac8..2dd5246cef4 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Un \u00E9l\u00E9ment {0} inattendu appara\u00EEt \u00E0 BASEDIR_DOESNT_EXIST = R\u00E9pertoire {0} inexistant -VERSION = schemagen 2.2.8-b20130806.1801 +VERSION = schemagen 2.2.8-b130911.1802 -FULLVERSION = version compl\u00E8te de schemagen "2.2.8-b20130806.1801" +FULLVERSION = version compl\u00E8te de schemagen "2.2.8-b130911.1802" USAGE = Syntaxe : schemagen [-options ...] \nOptions : \n\ \ \ \ -d : indiquez o\u00F9 placer les fichiers de classe g\u00E9n\u00E9r\u00E9s par le processeur et le compilateur javac\n\ \ \ \ -cp : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -classpath : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -encoding : indiquez l'encodage \u00E0 utiliser pour l'appel de javac/traitement de l'annotation \n\ \ \ \ -episode : g\u00E9n\u00E9rez un fichier d'\u00E9pisode pour la compilation s\u00E9par\u00E9e\n\ \ \ \ -version : affichez les informations de version\n\ \ \ \ -fullversion : affichez les informations compl\u00E8tes de version\n\ \ \ \ -help : affichez ce message de syntaxe diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_it.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_it.properties index 0208b66294e..98ea9f37239 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_it.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_it.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = {0} imprevisto visualizzato sulla riga {1} colonna {2} BASEDIR_DOESNT_EXIST = Directory non esistente: {0} -VERSION = schemagen 2.2.8-b20130806.1801 +VERSION = schemagen 2.2.8-b130911.1802 -FULLVERSION = versione completa schemagen "2.2.8-b20130806.1801" +FULLVERSION = versione completa schemagen "2.2.8-b130911.1802" USAGE = Uso: schemagen [-options ...] \nOpzioni: \n\ \ \ \ -d : specifica dove posizionare il processore e i file della classe generata javac\n\ \ \ \ -cp : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -classpath : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -encoding : specifica la codifica da usare per l'elaborazione dell'annotazione/richiamo javac \n\ \ \ \ -episode : genera il file di episodio per la compilazione separata\n\ \ \ \ -version : visualizza le informazioni sulla versione\n\ \ \ \ -fullversion : visualizza le informazioni sulla versione completa\n\ \ \ \ -help : visualizza questo messaggio sull'uso diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties index 7678e5d8f3b..365b689bc33 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u4E88\u671F\u3057\u306A\u3044{0}\u304C\u884C{1}\u3001\u BASEDIR_DOESNT_EXIST = \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0} -VERSION = schemagen 2.2.8-b20130806.1801 +VERSION = schemagen 2.2.8-b130911.1802 -FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.8-b20130806.1801" +FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.8-b130911.1802" USAGE = \u4F7F\u7528\u65B9\u6CD5: schemagen [-options ...] \n\u30AA\u30D7\u30B7\u30E7\u30F3: \n\ \ \ \ -d : \u30D7\u30ED\u30BB\u30C3\u30B5\u304A\u3088\u3073javac\u304C\u751F\u6210\u3057\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u7F6E\u304F\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -cp : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -classpath : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -encoding : \u6CE8\u91C8\u51E6\u7406/javac\u547C\u51FA\u3057\u306B\u4F7F\u7528\u3059\u308B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -episode : \u30B3\u30F3\u30D1\u30A4\u30EB\u3054\u3068\u306B\u30A8\u30D4\u30BD\u30FC\u30C9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3057\u307E\u3059\n\ \ \ \ -version : \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -fullversion : \u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -help : \u3053\u306E\u4F7F\u7528\u4F8B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u307E\u3059 diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties index cfc4364d80a..1261644c751 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \uC608\uC0C1\uCE58 \uC54A\uC740 {0}\uC774(\uAC00) {1}\uD BASEDIR_DOESNT_EXIST = \uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 \uB514\uB809\uD1A0\uB9AC: {0} -VERSION = schemagen 2.2.8-b20130806.1801 +VERSION = schemagen 2.2.8-b130911.1802 -FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.8-b20130806.1801" +FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.8-b130911.1802" USAGE = \uC0AC\uC6A9\uBC95: schemagen [-options ...] \n\uC635\uC158: \n\ \ \ \ -d : \uD504\uB85C\uC138\uC11C \uBC0F javac\uC5D0\uC11C \uC0DD\uC131\uD55C \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uBC30\uCE58\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -cp : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -classpath : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -encoding : \uC8FC\uC11D \uCC98\uB9AC/javac \uD638\uCD9C\uC5D0 \uC0AC\uC6A9\uD560 \uC778\uCF54\uB529\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4. \n\ \ \ \ -episode : \uBCC4\uB3C4 \uCEF4\uD30C\uC77C\uC744 \uC704\uD574 episode \uD30C\uC77C\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n\ \ \ \ -version : \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -fullversion : \uC815\uC2DD \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -help : \uC774 \uC0AC\uC6A9\uBC95 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4. diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties index 318ab2c54f2..006fbbc9e87 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = {0} inesperado aparece na linha {1} coluna {2} BASEDIR_DOESNT_EXIST = Diret\u00F3rio n\u00E3o existente: {0} -VERSION = gera\u00E7\u00E3o do esquema 2.2.8-b20130806.1801 +VERSION = gera\u00E7\u00E3o do esquema 2.2.8-b130911.1802 -FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.8-b20130806.1801" +FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.8-b130911.1802" USAGE = Uso: gera\u00E7\u00E3o do esquema [-options ...] \nOp\u00E7\u00F5es: \n\\ \\ \\ \\ -d : especificar onde colocar o processador e os arquivos da classe gerados por javac\n\\ \\ \\ \\ -cp : especificar onde localizar arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -classpath : especificar onde localizar os arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -encoding : especificar codifica\u00E7\u00E3o a ser usada para processamento de anota\u00E7\u00E3o/chamada javac \n\\ \\ \\ \\ -episode : gerar arquivo do epis\u00F3dio para compila\u00E7\u00E3o separada\n\\ \\ \\ \\ -version : exibir informa\u00E7\u00F5es da vers\u00E3o\n\\ \\ \\ \\ -fullversion : exibir informa\u00E7\u00F5es da vers\u00E3o completa\n\\ \\ \\ \\ -help : exibir esta mensagem de uso diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties index 87636c0d3cd..073ba65afa8 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u5728\u7B2C {1} \u884C, \u7B2C {2} \u5217\u51FA\u73B0\u BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u5F55: {0} -VERSION = schemagen 2.2.8-b20130806.1801 +VERSION = schemagen 2.2.8-b130911.1802 -FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.8-b20130806.1801" +FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.8-b130911.1802" USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9009\u9879: \n\ \ \ \ -d : \u6307\u5B9A\u653E\u7F6E\u5904\u7406\u7A0B\u5E8F\u548C javac \u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -cp : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -classpath : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -encoding : \u6307\u5B9A\u7528\u4E8E\u6CE8\u91CA\u5904\u7406/javac \u8C03\u7528\u7684\u7F16\u7801\n\ \ \ \ -episode : \u751F\u6210\u7247\u6BB5\u6587\u4EF6\u4EE5\u4F9B\u5355\u72EC\u7F16\u8BD1\n\ \ \ \ -version : \u663E\u793A\u7248\u672C\u4FE1\u606F\n\ \ \ \ -fullversion : \u663E\u793A\u5B8C\u6574\u7684\u7248\u672C\u4FE1\u606F\n\ \ \ \ -help : \u663E\u793A\u6B64\u7528\u6CD5\u6D88\u606F diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties index d828ed5f8e4..c7d7d5f1a41 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u672A\u9810\u671F\u7684 {0} \u986F\u793A\u65BC\u884C {1 BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u9304: {0} -VERSION = schemagen 2.2.8-b20130806.1801 +VERSION = schemagen 2.2.8-b130911.1802 -FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.8-b20130806.1801" +FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.8-b130911.1802" USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9078\u9805: \n\\ \\ \\ \\ -d : \u6307\u5B9A\u8655\u7406\u5668\u4EE5\u53CA javac \u7522\u751F\u7684\u985E\u5225\u6A94\u6848\u653E\u7F6E\u4F4D\u7F6E\n\\ \\ \\ \\ -cp : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -classpath : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -encoding : \u6307\u5B9A\u8981\u7528\u65BC\u8A3B\u89E3\u8655\u7406/javac \u547C\u53EB\u7684\u7DE8\u78BC \n\\ \\ \\ \\ -episode : \u7522\u751F\u7368\u7ACB\u7DE8\u8B6F\u7684\u4E8B\u4EF6 (episode) \u6A94\u6848\n\\ \\ \\ \\ -version : \u986F\u793A\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -fullversion : \u986F\u793A\u5B8C\u6574\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -help : \u986F\u793A\u6B64\u7528\u6CD5\u8A0A\u606F diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/WscompileMessages.java b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/WscompileMessages.java index 0cf792a87b3..6e3aeb0706d 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/WscompileMessages.java +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/WscompileMessages.java @@ -269,6 +269,20 @@ public final class WscompileMessages { return localizer.localize(localizableWSIMPORT_USAGE(arg0)); } + public static Localizable localizableWSGEN_USAGE_EXTENSIONS() { + return messageFactory.getMessage("wsgen.usage.extensions"); + } + + /** + * + * Extensions: + * -Xnocompile do not compile generated Java files + * + */ + public static String WSGEN_USAGE_EXTENSIONS() { + return localizer.localize(localizableWSGEN_USAGE_EXTENSIONS()); + } + public static Localizable localizablePLEASE() { return messageFactory.getMessage("Please"); } @@ -283,6 +297,19 @@ public final class WscompileMessages { return localizer.localize(localizablePLEASE()); } + public static Localizable localizableWSCOMPILE_EXISTING_OPTION(Object arg0) { + return messageFactory.getMessage("wscompile.existingOption", arg0); + } + + /** + * Ignoring already defined option {0} + * + * + */ + public static String WSCOMPILE_EXISTING_OPTION(Object arg0) { + return localizer.localize(localizableWSCOMPILE_EXISTING_OPTION(arg0)); + } + public static Localizable localizableWSIMPORT_PARSING_WSDL() { return messageFactory.getMessage("wsimport.ParsingWSDL"); } @@ -323,6 +350,8 @@ public final class WscompileMessages { * -B Pass this option to JAXB schema compiler * -catalog specify catalog file to resolve external entity references * supports TR9401, XCatalog, and OASIS XML Catalog format. + * -classpath specify where to find user class files and wsimport extensions + * -cp specify where to find user class files and wsimport extensions * -d specify where to place generated output files * -encoding specify character encoding used by source files * -extension allow vendor extensions - functionality not specified @@ -332,6 +361,7 @@ public final class WscompileMessages { * -help display help * -httpproxy: set a HTTP proxy. Format is [user[:password]@]proxyHost:proxyPort * (port defaults to 8080) + * -J pass this option to javac * -keep keep generated files * -p specifies the target package * -quiet suppress wsimport output @@ -343,7 +373,7 @@ public final class WscompileMessages { * -version print version information * -fullversion print full version information * -wsdllocation @WebServiceClient.wsdlLocation value - * -clientjar Creates the jar file of the generated artifacts along with the + * -clientjar creates the jar file of the generated artifacts along with the * WSDL metadata required for invoking the web service. * -generateJWS generate stubbed JWS implementation file * -implDestDir specify where to generate JWS implementation file @@ -656,8 +686,8 @@ public final class WscompileMessages { * Usage: {0} [options] * * where [options] include: - * -classpath specify where to find input class files - * -cp same as -classpath + * -classpath specify where to find input class files and wsgen extensions + * -cp specify where to find input class files and wsgen extensions * -d specify where to place generated output files * -encoding specify character encoding used by source files * -extension allow vendor extensions - functionality not specified @@ -665,6 +695,7 @@ public final class WscompileMessages { * result in applications that are not portable or * may not interoperate with other implementations * -help display help + * -J pass this option to javac * -keep keep generated files * -r resource destination directory, specify where to * place resouce files such as WSDLs @@ -675,7 +706,7 @@ public final class WscompileMessages { * -wsdl[:protocol] generate a WSDL file. The protocol is optional. * Valid protocols are {1}, * the default is soap1.1. - * The non stanadard protocols {2} + * The non standard protocols {2} * can only be used in conjunction with the * -extension option. * -inlineSchemas inline schemas in the generated wsdl. Must be @@ -684,6 +715,7 @@ public final class WscompileMessages { * Used in conjunction with the -wsdl option. * -portname specify the Port name to use in the generated WSDL * Used in conjunction with the -wsdl option. + * -x specify External Web Service Metadata xml descriptor * */ public static String WSGEN_HELP(Object arg0, Object arg1, Object arg2) { @@ -835,6 +867,18 @@ public final class WscompileMessages { return localizer.localize(localizableWSIMPORT_AUTH_INFO_LINENO(arg0, arg1)); } + public static Localizable localizableWSGEN_SERVICENAME_MISSING_LOCALNAME(Object arg0) { + return messageFactory.getMessage("wsgen.servicename.missing.localname", arg0); + } + + /** + * The service name "{0}" is missing a localname. + * + */ + public static String WSGEN_SERVICENAME_MISSING_LOCALNAME(Object arg0) { + return localizer.localize(localizableWSGEN_SERVICENAME_MISSING_LOCALNAME(arg0)); + } + public static Localizable localizableWSGEN_USAGE(Object arg0) { return messageFactory.getMessage("wsgen.usage", arg0); } @@ -849,18 +893,6 @@ public final class WscompileMessages { return localizer.localize(localizableWSGEN_USAGE(arg0)); } - public static Localizable localizableWSGEN_SERVICENAME_MISSING_LOCALNAME(Object arg0) { - return messageFactory.getMessage("wsgen.servicename.missing.localname", arg0); - } - - /** - * The service name "{0}" is missing a localname. - * - */ - public static String WSGEN_SERVICENAME_MISSING_LOCALNAME(Object arg0) { - return localizer.localize(localizableWSGEN_SERVICENAME_MISSING_LOCALNAME(arg0)); - } - public static Localizable localizableWSGEN_SERVICENAME_MISSING_NAMESPACE(Object arg0) { return messageFactory.getMessage("wsgen.servicename.missing.namespace", arg0); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/wscompile.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/wscompile.properties index c6f72cd8c0e..ab332df746f 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/wscompile.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/resources/wscompile.properties @@ -33,6 +33,8 @@ wsimport.help=\nUsage: {0} [options] \n\n\ \ -B Pass this option to JAXB schema compiler\n\ \ -catalog specify catalog file to resolve external entity references\n\ \ supports TR9401, XCatalog, and OASIS XML Catalog format.\n\ +\ -classpath specify where to find user class files and wsimport extensions\n\ +\ -cp specify where to find user class files and wsimport extensions\n\ \ -d specify where to place generated output files\n\ \ -encoding specify character encoding used by source files\n\ \ -extension allow vendor extensions - functionality not specified\n\ @@ -42,6 +44,7 @@ wsimport.help=\nUsage: {0} [options] \n\n\ \ -help display help\n\ \ -httpproxy: set a HTTP proxy. Format is [user[:password]@]proxyHost:proxyPort\n\ \ (port defaults to 8080)\n\ +\ -J pass this option to javac\n\ \ -keep keep generated files\n\ \ -p specifies the target package\n\ \ -quiet suppress wsimport output\n\ @@ -53,7 +56,7 @@ wsimport.help=\nUsage: {0} [options] \n\n\ \ -version print version information\n\ \ -fullversion print full version information\n\ \ -wsdllocation @WebServiceClient.wsdlLocation value\n\ -\ -clientjar Creates the jar file of the generated artifacts along with the\n\ +\ -clientjar creates the jar file of the generated artifacts along with the\n\ \ WSDL metadata required for invoking the web service.\n\ \ -generateJWS generate stubbed JWS implementation file\n\ \ -implDestDir specify where to generate JWS implementation file\n\ @@ -91,8 +94,8 @@ Use "wsgen -help" for a detailed description of options. wsgen.help=\nUsage: {0} [options] \n\n\ \where [options] include:\n\ -\ -classpath specify where to find input class files\n\ -\ -cp same as -classpath \n\ +\ -classpath specify where to find input class files and wsgen extensions\n\ +\ -cp specify where to find input class files and wsgen extensions\n\ \ -d specify where to place generated output files\n\ \ -encoding specify character encoding used by source files\n\ \ -extension allow vendor extensions - functionality not specified\n\ @@ -100,6 +103,7 @@ wsgen.help=\nUsage: {0} [options] \n\n\ \ result in applications that are not portable or\n\ \ may not interoperate with other implementations\n\ \ -help display help\n\ +\ -J pass this option to javac\n\ \ -keep keep generated files\n\ \ -r resource destination directory, specify where to\n\ \ place resouce files such as WSDLs\n\ @@ -110,7 +114,7 @@ wsgen.help=\nUsage: {0} [options] \n\n\ \ -wsdl[:protocol] generate a WSDL file. The protocol is optional.\n\ \ Valid protocols are {1},\n\ \ the default is soap1.1.\n\ -\ The non stanadard protocols {2}\n\ +\ The non standard protocols {2}\n\ \ can only be used in conjunction with the\n\ \ -extension option.\n\ \ -inlineSchemas inline schemas in the generated wsdl. Must be\n\ @@ -118,8 +122,12 @@ wsgen.help=\nUsage: {0} [options] \n\n\ \ -servicename specify the Service name to use in the generated WSDL\n\ \ Used in conjunction with the -wsdl option.\n\ \ -portname specify the Port name to use in the generated WSDL\n\ -\ Used in conjunction with the -wsdl option. +\ Used in conjunction with the -wsdl option.\n\ +\ -x specify External Web Service Metadata xml descriptor +wsgen.usage.extensions=\n\ +\Extensions:\n\ +\ -Xnocompile do not compile generated Java files wsgen.usage.examples=\n\ \Examples:\n\ @@ -151,6 +159,7 @@ or use -Xendorsed option. # Generic Messages # wscompile.invalidOption=unrecognized parameter {0} +wscompile.existingOption=Ignoring already defined option {0}\n wsimport.noSuchJaxbOption=no such JAXB option: {0} wscompile.error=error: {0} diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/version.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/version.properties index 9862bdc6bb2..c0aaf9f9fa7 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/version.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/version.properties @@ -23,7 +23,7 @@ # questions. # -build-id=2.2.9-b14140 -build-version=JAX-WS RI 2.2.9-b14140 +build-id=2.2.9-b130926.1035 +build-version=JAX-WS RI 2.2.9-b130926.1035 major-version=2.2.9 -svn-revision=14140 +svn-revision=8c29a9a53251ff741fca1664a8221dc876b2eac8 diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Options.java b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Options.java index fbb4cb3fe27..f9fb8bdcfc3 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Options.java +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Options.java @@ -87,6 +87,13 @@ public class Options { public String classpath = System.getProperty("java.class.path"); + /** + * -javacOptions + * + * @since 2.2.9 + */ + public List javacOptions; + /** * -Xnocompile @@ -94,10 +101,13 @@ public class Options { public boolean nocompile; /** - * Disable secure xml processing. - * -XdisableSecureXmlProcessing + * If true XML security features when parsing XML documents will be disabled. + * The default value is false. + * + * Boolean + * @since 2.2.9 */ - public boolean disableSecureXmlProcessing = false; + public boolean disableXmlSecurity; public enum Target { V2_0, V2_1, V2_2; @@ -354,13 +364,24 @@ public class Options { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } return 2; - } else if (args[i].equals("-XdisableSecureXmlProcessing")) { - disableSecureXmlProcessing= true; + } else if (args[i].equals("-disableXmlSecurity")) { + disableXmlSecurity(); + return 1; + } else if (args[i].startsWith("-J")) { + if (javacOptions == null) { + javacOptions = new ArrayList(); + } + javacOptions.add(args[i].substring(2)); return 1; } return 0; } + // protected method to allow overriding + protected void disableXmlSecurity() { + disableXmlSecurity= true; + } + /** * Obtains an operand and reports an error if it's not there. */ @@ -372,7 +393,28 @@ public class Options { return args[i]; } - + List getJavacOptions(List existingOptions, WsimportListener listener) { + List result = new ArrayList(); + for (String o: javacOptions) { + if (o.contains("=") && !o.startsWith("A")) { + int i = o.indexOf('='); + String key = o.substring(0, i); + if (existingOptions.contains(key)) { + listener.message(WscompileMessages.WSCOMPILE_EXISTING_OPTION(key)); + } else { + result.add(key); + result.add(o.substring(i + 1)); + } + } else { + if (existingOptions.contains(o)) { + listener.message(WscompileMessages.WSCOMPILE_EXISTING_OPTION(o)); + } else { + result.add(o); + } + } + } + return result; + } /** * Used to signal that we've finished processing. diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java index f8cdca41a03..debc4cc8e58 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java @@ -161,7 +161,7 @@ public class WsgenTool { final ErrorReceiverFilter errReceiver = new ErrorReceiverFilter(listener); boolean bootCP = useBootClasspath(EndpointReference.class) || useBootClasspath(XmlSeeAlso.class); - Collection args = new ArrayList(6 + (bootCP ? 1 : 0) + (options.nocompile ? 1 : 0) + List args = new ArrayList(6 + (bootCP ? 1 : 0) + (options.nocompile ? 1 : 0) + (options.encoding != null ? 2 : 0)); args.add("-d"); args.add(options.destDir.getAbsolutePath()); @@ -183,6 +183,9 @@ public class WsgenTool { .append(File.pathSeparator) .append(JavaCompilerHelper.getJarFile(XmlSeeAlso.class)).toString()); } + if (options.javacOptions != null) { + args.addAll(options.getJavacOptions(args, listener)); + } JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();// compiler = JavacTool.create(); DiagnosticCollector diagnostics = new DiagnosticCollector(); @@ -205,9 +208,9 @@ public class WsgenTool { DatabindingConfig config = new DatabindingConfig(); List externalMetadataFileNames = options.externalMetadataFiles; - boolean disableSecureXmlProcessing = options.disableSecureXmlProcessing; + boolean disableXmlSecurity = options.disableXmlSecurity; if (externalMetadataFileNames != null && externalMetadataFileNames.size() > 0) { - config.setMetadataReader(new ExternalMetadataReader(getExternalFiles(externalMetadataFileNames), null, null, true, disableSecureXmlProcessing)); + config.setMetadataReader(new ExternalMetadataReader(getExternalFiles(externalMetadataFileNames), null, null, true, disableXmlSecurity)); } String tmpPath = options.destDir.getAbsolutePath() + File.pathSeparator + options.classpath; @@ -243,7 +246,7 @@ public class WsgenTool { final Map schemaFiles = new HashMap(); WSDLGenInfo wsdlGenInfo = new WSDLGenInfo(); - wsdlGenInfo.setSecureXmlProcessingDisabled(disableSecureXmlProcessing); + wsdlGenInfo.setSecureXmlProcessingDisabled(disableXmlSecurity); wsdlGenInfo.setWsdlResolver( new WSDLResolver() { @@ -404,6 +407,7 @@ public class WsgenTool { System.out.println(WscompileMessages.WSGEN_HELP("WSGEN", ((WsgenOptions)options).protocols, ((WsgenOptions)options).nonstdProtocols.keySet())); + System.out.println(WscompileMessages.WSGEN_USAGE_EXTENSIONS()); System.out.println(WscompileMessages.WSGEN_USAGE_EXAMPLES()); } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportOptions.java b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportOptions.java index bf74e98d7b3..6816f63b00f 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportOptions.java +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportOptions.java @@ -774,4 +774,10 @@ public class WsimportOptions extends Options { is.setSystemId(systemId); } } + + @Override + protected void disableXmlSecurity() { + super.disableXmlSecurity(); + schemaCompiler.getOptions().disableXmlSecurity = true; + } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java index 512b29395b7..87e9f42234b 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java @@ -332,7 +332,7 @@ public class WsimportTool { if(options.verbose) { listener.message(WscompileMessages.WSIMPORT_ARCHIVE_ARTIFACT(f, options.clientjar)); } - String entry = f.getCanonicalPath().substring(base.length()+1); + String entry = f.getCanonicalPath().substring(base.length()+1).replace(File.separatorChar, '/'); fi = new FileInputStream(f); bis = new BufferedInputStream(fi); JarEntry jarEntry = new JarEntry(entry); @@ -524,29 +524,34 @@ public class WsimportTool { String classDir = options.destDir.getAbsolutePath(); String classpathString = createClasspathString(); boolean bootCP = useBootClasspath(EndpointContext.class) || useBootClasspath(JAXBPermission.class); - String[] args = new String[4 + (bootCP ? 1 : 0) + (options.debug ? 1 : 0) - + (options.encoding != null ? 2 : 0) + sourceFiles.size()]; - args[0] = "-d"; - args[1] = classDir; - args[2] = "-classpath"; - args[3] = classpathString; - int baseIndex = 4; + List args = new ArrayList(); + args.add("-d"); + args.add(classDir); + args.add("-classpath"); + args.add(classpathString); //javac is not working in osgi as the url starts with a bundle if (bootCP) { - args[baseIndex++] = "-Xbootclasspath/p:"+JavaCompilerHelper.getJarFile(EndpointContext.class)+File.pathSeparator+JavaCompilerHelper.getJarFile(JAXBPermission.class); + args.add("-Xbootclasspath/p:" + + JavaCompilerHelper.getJarFile(EndpointContext.class) + + File.pathSeparator + + JavaCompilerHelper.getJarFile(JAXBPermission.class)); } if (options.debug) { - args[baseIndex++] = "-g"; + args.add("-g"); } if (options.encoding != null) { - args[baseIndex++] = "-encoding"; - args[baseIndex++] = options.encoding; + args.add("-encoding"); + args.add(options.encoding); + } + + if (options.javacOptions != null) { + args.addAll(options.getJavacOptions(args, listener)); } for (int i = 0; i < sourceFiles.size(); ++i) { - args[baseIndex + i] = sourceFiles.get(i); + args.add(sourceFiles.get(i)); } listener.message(WscompileMessages.WSIMPORT_COMPILING_CODE()); @@ -558,7 +563,7 @@ public class WsimportTool { listener.message("javac "+ argstr.toString()); } - return JavaCompilerHelper.compile(args, out, receiver); + return JavaCompilerHelper.compile(args.toArray(new String[args.size()]), out, receiver); } //there are no files to compile, so return true? return true; diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java index f62aea6b267..aed48abe794 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java @@ -114,7 +114,7 @@ public class DOMForest { this.logic = logic; try { // secure xml processing can be switched off if input requires it - boolean secureProcessingEnabled = options == null || !options.disableSecureXmlProcessing; + boolean secureProcessingEnabled = options == null || !options.disableXmlSecurity; DocumentBuilderFactory dbf = XmlUtil.newDocumentBuilderFactory(secureProcessingEnabled); dbf.setNamespaceAware(true); this.documentBuilder = dbf.newDocumentBuilder(); @@ -365,7 +365,7 @@ public class DOMForest { try { // create identity transformer // secure xml processing can be switched off if input requires it - boolean secureProcessingEnabled = options == null || !options.disableSecureXmlProcessing; + boolean secureProcessingEnabled = options == null || !options.disableXmlSecurity; TransformerFactory tf = XmlUtil.newTransformerFactory(secureProcessingEnabled); Transformer it = tf.newTransformer(); diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle.properties index bf21c1ee0f9..3fc147e740a 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle.properties @@ -171,20 +171,20 @@ Driver.CompilingSchema = \ Driver.FailedToGenerateCode = \ Failed to produce code. -# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant +# DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn Driver.FilePrologComment = \ - This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b20130806.1801 \n\ + This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 \n\ See http://java.sun.com/xml/jaxb \n\ Any modifications to this file will be lost upon recompilation of the source schema. \n\ Generated on: {0} \n Driver.Version = \ - xjc 2.2.8-b20130806.1801 + xjc 2.2.8-b130911.1802 Driver.FullVersion = \ - xjc full version "2.2.8-b20130806.1801" + xjc full version "2.2.8-b130911.1802" -Driver.BuildID = 2.2.8-b20130806.1801 +Driver.BuildID = 2.2.8-b130911.1802 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_de.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_de.properties index 560d6b66a90..8069d4f3fd0 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_de.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_de.properties @@ -96,14 +96,14 @@ Driver.CompilingSchema = Ein Schema wird kompiliert ... Driver.FailedToGenerateCode = Code konnte nicht erzeugt werden. -# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant -Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b20130806.1801 generiert \nSiehe http://java.sun.com/xml/jaxb \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n +# DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn +Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 generiert \nSiehe http://java.sun.com/xml/jaxb \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n -Driver.Version = xjc 2.2.8-b20130806.1801 +Driver.Version = xjc 2.2.8-b130911.1802 -Driver.FullVersion = xjc vollst\u00E4ndige Version "2.2.8-b20130806.1801" +Driver.FullVersion = xjc vollst\u00E4ndige Version "2.2.8-b130911.1802" -Driver.BuildID = 2.2.8-b20130806.1801 +Driver.BuildID = 2.2.8-b130911.1802 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_es.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_es.properties index 47a66fc719e..c96e2a509a4 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_es.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_es.properties @@ -96,14 +96,14 @@ Driver.CompilingSchema = Compilando un esquema... Driver.FailedToGenerateCode = Fallo al producir c\u00f3digo. -# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant -Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.8-b20130806.1801 \nVisite http://java.sun.com/xml/jaxb \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n +# DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn +Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.8-b130911.1802 \nVisite http://java.sun.com/xml/jaxb \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n -Driver.Version = xjc 2.2.8-b20130806.1801 +Driver.Version = xjc 2.2.8-b130911.1802 -Driver.FullVersion = versi\u00F3n completa de xjc "2.2.8-b20130806.1801" +Driver.FullVersion = versi\u00F3n completa de xjc "2.2.8-b130911.1802" -Driver.BuildID = 2.2.8-b20130806.1801 +Driver.BuildID = 2.2.8-b130911.1802 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties index a9dea414d78..da2d95645b4 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties @@ -96,14 +96,14 @@ Driver.CompilingSchema = compilation d'un sch\u00e9ma... Driver.FailedToGenerateCode = Echec de la production du code. -# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant -Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.8-b20130806.1801 \nVoir http://java.sun.com/xml/jaxb \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n +# DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn +Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.8-b130911.1802 \nVoir http://java.sun.com/xml/jaxb \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n -Driver.Version = xjc 2.2.8-b20130806.1801 +Driver.Version = xjc 2.2.8-b130911.1802 -Driver.FullVersion = version compl\u00E8te xjc "2.2.8-b20130806.1801" +Driver.FullVersion = version compl\u00E8te xjc "2.2.8-b130911.1802" -Driver.BuildID = 2.2.8-b20130806.1801 +Driver.BuildID = 2.2.8-b130911.1802 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_it.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_it.properties index b63eb553179..a6a55a896c1 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_it.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_it.properties @@ -96,14 +96,14 @@ Driver.CompilingSchema = compilazione di uno schema in corso... Driver.FailedToGenerateCode = Produzione del codice non riuscita. -# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant -Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.8-b20130806.1801 \nVedere http://java.sun.com/xml/jaxb \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n +# DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn +Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.8-b130911.1802 \nVedere http://java.sun.com/xml/jaxb \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n -Driver.Version = xjc 2.2.8-b20130806.1801 +Driver.Version = xjc 2.2.8-b130911.1802 -Driver.FullVersion = versione completa xjc "2.2.8-b20130806.1801" +Driver.FullVersion = versione completa xjc "2.2.8-b130911.1802" -Driver.BuildID = 2.2.8-b20130806.1801 +Driver.BuildID = 2.2.8-b130911.1802 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties index 8dd5b8a84af..4dd97d0e992 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties @@ -96,14 +96,14 @@ Driver.CompilingSchema = \u30b9\u30ad\u30fc\u30de\u306e\u30b3\u30f3\u30d1\u30a4\ Driver.FailedToGenerateCode = \u30b3\u30fc\u30c9\u306e\u751f\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant -Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.8-b20130806.1801\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttp://java.sun.com/xml/jaxb\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n +# DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn +Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.8-b130911.1802\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttp://java.sun.com/xml/jaxb\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n -Driver.Version = xjc 2.2.8-b20130806.1801 +Driver.Version = xjc 2.2.8-b130911.1802 -Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.8-b20130806.1801" +Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.8-b130911.1802" -Driver.BuildID = 2.2.8-b20130806.1801 +Driver.BuildID = 2.2.8-b130911.1802 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties index 3d0f6b9f369..c023a02e3a3 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties @@ -96,14 +96,14 @@ Driver.CompilingSchema = \uc2a4\ud0a4\ub9c8\ub97c \ucef4\ud30c\uc77c\ud558\ub294 Driver.FailedToGenerateCode = \ucf54\ub4dc \uc0dd\uc131\uc744 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. -# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant -Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.8-b20130806.1801 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttp://java.sun.com/xml/jaxb\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n +# DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn +Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.8-b130911.1802 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttp://java.sun.com/xml/jaxb\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n -Driver.Version = XJC 2.2.8-b20130806.1801 +Driver.Version = XJC 2.2.8-b130911.1802 -Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.2.8-b20130806.1801" +Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.2.8-b130911.1802" -Driver.BuildID = 2.2.8-b20130806.1801 +Driver.BuildID = 2.2.8-b130911.1802 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties index c7eb0286e2e..11119180b98 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties @@ -96,14 +96,14 @@ Driver.CompilingSchema = compilando um esquema... Driver.FailedToGenerateCode = Falha ao produzir o c\u00f3digo. -# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant -Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.8-b20130806.1801 \nConsulte http://java.sun.com/xml/jaxb \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n +# DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn +Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.8-b130911.1802 \nConsulte http://java.sun.com/xml/jaxb \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n -Driver.Version = xjc 2.2.8-b20130806.1801 +Driver.Version = xjc 2.2.8-b130911.1802 -Driver.FullVersion = vers\u00E3o completa de xjc "2.2.8-b20130806.1801" +Driver.FullVersion = vers\u00E3o completa de xjc "2.2.8-b130911.1802" -Driver.BuildID = 2.2.8-b20130806.1801 +Driver.BuildID = 2.2.8-b130911.1802 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties index 748aab67e38..38838e8e467 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties @@ -96,14 +96,14 @@ Driver.CompilingSchema = \u6b63\u5728\u7f16\u8bd1\u6a21\u5f0f... Driver.FailedToGenerateCode = \u65e0\u6cd5\u751f\u6210\u4ee3\u7801\u3002 -# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant -Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.8-b20130806.1801 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee http://java.sun.com/xml/jaxb \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n +# DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn +Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.8-b130911.1802 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee http://java.sun.com/xml/jaxb \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n -Driver.Version = xjc 2.2.8-b20130806.1801 +Driver.Version = xjc 2.2.8-b130911.1802 -Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.8-b20130806.1801" +Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.8-b130911.1802" -Driver.BuildID = 2.2.8-b20130806.1801 +Driver.BuildID = 2.2.8-b130911.1802 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties index a305e7e7445..c9c60d1d8a8 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties @@ -96,14 +96,14 @@ Driver.CompilingSchema = \u6b63\u5728\u7de8\u8b6f\u7db1\u8981... Driver.FailedToGenerateCode = \u7121\u6cd5\u7522\u751f\u7a0b\u5f0f\u78bc. -# DO NOT localize the 2.2.8-b20130806.1801 string - it is a token for an ant -Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b20130806.1801 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 http://java.sun.com/xml/jaxb \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n +# DO NOT localize the 2.2.8-b130911.1802 string - it is a token for an mvn +Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 http://java.sun.com/xml/jaxb \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n -Driver.Version = xjc 2.2.8-b20130806.1801 +Driver.Version = xjc 2.2.8-b130911.1802 -Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.8-b20130806.1801" +Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.8-b130911.1802" -Driver.BuildID = 2.2.8-b20130806.1801 +Driver.BuildID = 2.2.8-b130911.1802 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/SchemaCache.java b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/SchemaCache.java index c28fd50db86..2277dd471b8 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/SchemaCache.java +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/SchemaCache.java @@ -35,7 +35,7 @@ import com.sun.xml.internal.bind.v2.util.XmlFactory; import javax.xml.XMLConstants; import org.xml.sax.SAXException; -import static com.sun.xml.internal.bind.v2.util.XmlFactory.allowFileAccess; +import static com.sun.xml.internal.bind.v2.util.XmlFactory.allowExternalAccess; /** * Wraps a JAXP {@link Schema} object and lazily instantiate it. @@ -61,7 +61,7 @@ public final class SchemaCache { try { // do not disable secure processing - these are well-known schemas SchemaFactory sf = XmlFactory.createSchemaFactory(XMLConstants.W3C_XML_SCHEMA_NS_URI, false); - schema = allowFileAccess(sf, false).newSchema(source); + schema = allowExternalAccess(sf, "file", false).newSchema(source); } catch (SAXException e) { // we make sure that the schema is correct before we ship. throw new AssertionError(e); diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java index b31ae389454..bea319e5733 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java @@ -59,7 +59,7 @@ import java.io.OutputStream; import java.io.OutputStreamWriter; import java.util.*; -import static com.sun.xml.internal.bind.v2.util.XmlFactory.allowFileAccess; +import static com.sun.xml.internal.bind.v2.util.XmlFactory.allowExternalAccess; import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI; @@ -460,7 +460,7 @@ public final class DOMForest { } try { - allowFileAccess(sf, options.disableXmlSecurity).newSchema(sources.toArray(new SAXSource[0])); + allowExternalAccess(sf, "file,http", options.disableXmlSecurity).newSchema(sources.toArray(new SAXSource[0])); } catch (SAXException e) { // error should have been reported. } catch (RuntimeException re) { diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/AbstractExtendedComplexTypeBuilder.java b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/AbstractExtendedComplexTypeBuilder.java index b2363612044..e15b3aa999f 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/AbstractExtendedComplexTypeBuilder.java +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/AbstractExtendedComplexTypeBuilder.java @@ -41,6 +41,7 @@ import com.sun.xml.internal.xsom.XSParticle; import com.sun.xml.internal.xsom.XSType; import com.sun.xml.internal.xsom.XSWildcard; import com.sun.xml.internal.xsom.visitor.XSTermFunction; +import javax.xml.namespace.QName; import com.sun.xml.internal.rngom.nc.ChoiceNameClass; import com.sun.xml.internal.rngom.nc.NameClass; @@ -65,14 +66,17 @@ abstract class AbstractExtendedComplexTypeBuilder extends CTBuilder { * Computes a name class that represents everything in a given content model. */ protected final XSTermFunction contentModelNameClassBuilder = new XSTermFunction() { + @Override public NameClass wildcard(XSWildcard wc) { return WildcardNameClassBuilder.build(wc); } + @Override public NameClass modelGroupDecl(XSModelGroupDecl decl) { return modelGroup(decl.getModelGroup()); } + @Override public NameClass modelGroup(XSModelGroup group) { NameClass nc = NameClass.NULL; for( int i=0; i extends PropertyImpl */ private final Loader itemsLoader = new Loader(false) { - private ThreadLocal target = new ThreadLocal(); - private ThreadLocal map = new ThreadLocal(); - private int depthCounter = 0; // needed to clean ThreadLocals + private ThreadLocal> target = new ThreadLocal>(); + private ThreadLocal> map = new ThreadLocal>(); @Override public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException { // create or obtain the Map object try { - target.set((BeanT)state.prev.target); - map.set(acc.get(target.get())); - depthCounter++; - if(map.get() == null) { - map.set(ClassFactory.create(mapImplClass)); - } - map.get().clear(); - state.target = map.get(); + BeanT target = (BeanT) state.prev.target; + ValueT mapValue = acc.get(target); + if(mapValue == null) + mapValue = ClassFactory.create(mapImplClass); + else + mapValue.clear(); + + Stack.push(this.target, target); + Stack.push(map, mapValue); + state.target = mapValue; } catch (AccessorException e) { // recover from error by setting a dummy Map that receives and discards the values handleGenericException(e,true); @@ -167,11 +168,7 @@ final class SingleMapNodeProperty extends PropertyImpl public void leaveElement(State state, TagName ea) throws SAXException { super.leaveElement(state, ea); try { - acc.set(target.get(), map.get()); - if (--depthCounter == 0) { - target.remove(); - map.remove(); - } + acc.set(Stack.pop(target), Stack.pop(map)); } catch (AccessorException ex) { handleGenericException(ex,true); } @@ -289,4 +286,36 @@ final class SingleMapNodeProperty extends PropertyImpl return acc; return null; } + + private static final class Stack { + private Stack parent; + private T value; + + private Stack(Stack parent, T value) { + this.parent = parent; + this.value = value; + } + + private Stack(T value) { + this.value = value; + } + + private static void push(ThreadLocal> holder, T value) { + Stack parent = holder.get(); + if (parent == null) + holder.set(new Stack(value)); + else + holder.set(new Stack(parent, value)); + } + + private static T pop(ThreadLocal> holder) { + Stack current = holder.get(); + if (current.parent == null) + holder.remove(); + else + holder.set(current.parent); + return current.value; + } + + } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java index 7e7b8262892..adc2610b8f6 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,19 +63,15 @@ class AccessorInjector { ClassLoader cl = SecureLoader.getClassClassLoader(beanClass); if(cl==null) return null; // how do I inject classes to this "null" class loader? for now, back off. - Class c = null; - synchronized (AccessorInjector.class) { - c = Injector.find(cl,newClassName); - if(c==null) { - byte[] image = tailor(templateClassName,newClassName,replacements); - // try { - // new FileOutputStream("debug.class").write(image); - // } catch (IOException e) { - // e.printStackTrace(); - // } - if(image==null) - return null; - c = Injector.inject(cl,newClassName,image); + Class c = Injector.find(cl,newClassName); + if (c==null) { + byte[] image = tailor(templateClassName,newClassName,replacements); + if (image==null) { + return null; + } + c = Injector.inject(cl,newClassName,image); + if (c == null) { + Injector.find(cl, newClassName); } } return c; @@ -112,4 +108,5 @@ class AccessorInjector { } private static final ClassLoader CLASS_LOADER = SecureLoader.getClassClassLoader(AccessorInjector.class); + } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java index 4d74b1d86a0..78f4746abea 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -156,6 +156,7 @@ final class Injector { } AccessController.doPrivileged(new PrivilegedAction() { + @Override public Void run() { // TODO: check security implication // do these setAccessible allow anyone to call these methods freely?s diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedAccessorFactory.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedAccessorFactory.java index e52dccba418..ee1506f5ae7 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedAccessorFactory.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedAccessorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -127,8 +127,11 @@ public abstract class OptimizedAccessorFactory { return null; Accessor acc = instanciate(opt); - if(acc!=null) - logger.log(Level.FINE,"Using optimized Accessor for "+getter+" and "+setter); + if (acc!=null) { + if (logger.isLoggable(Level.FINE)) { + logger.log(Level.FINE, "Using optimized Accessor for {0} and {1}", new Object[]{getter, setter}); + } + } return acc; } @@ -174,8 +177,11 @@ public abstract class OptimizedAccessorFactory { return null; Accessor acc = instanciate(opt); - if(acc!=null) - logger.log(Level.FINE,"Using optimized Accessor for "+field); + if (acc!=null) { + if (logger.isLoggable(Level.FINE)) { + logger.log(Level.FINE, "Using optimized Accessor for {0}", field); + } + } return acc; } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/util/XmlFactory.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/util/XmlFactory.java index 969cf451649..1bcae09e56f 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/util/XmlFactory.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/util/XmlFactory.java @@ -43,6 +43,8 @@ import org.xml.sax.SAXException; import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotSupportedException; +import static com.sun.xml.internal.bind.Util.getSystemProperty; + /** * Provides helper methods for creating properly configured XML parser * factory instances with namespace support turned on and configured for @@ -53,6 +55,7 @@ public class XmlFactory { // not in older JDK, so must be duplicated here, otherwise javax.xml.XMLConstants should be used public static final String ACCESS_EXTERNAL_SCHEMA = "http://javax.xml.XMLConstants/property/accessExternalSchema"; + public static final String ACCESS_EXTERNAL_DTD = "http://javax.xml.XMLConstants/property/accessExternalDTD"; private static final Logger LOGGER = Logger.getLogger(XmlFactory.class.getName()); @@ -65,11 +68,10 @@ public class XmlFactory { */ private static final String DISABLE_XML_SECURITY = "com.sun.xml.internal.bind.disableXmlSecurity"; - public static final boolean DISABLE_SECURE_PROCESSING = - Boolean.parseBoolean(Util.getSystemProperty(DISABLE_XML_SECURITY)); + public static final boolean XML_SECURITY_DISABLED = Boolean.parseBoolean(getSystemProperty(DISABLE_XML_SECURITY)); - private static boolean xmlFeatureValue(boolean runtimeSetting) { - return !(DISABLE_SECURE_PROCESSING || runtimeSetting); + private static boolean isXMLSecurityDisabled(boolean runtimeSetting) { + return XML_SECURITY_DISABLED || runtimeSetting; } /** @@ -83,7 +85,7 @@ public class XmlFactory { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "SchemaFactory instance: {0}", factory); } - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, xmlFeatureValue(disableSecureProcessing)); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !isXMLSecurityDisabled(disableSecureProcessing)); return factory; } catch (SAXNotRecognizedException ex) { LOGGER.log(Level.SEVERE, null, ex); @@ -109,7 +111,7 @@ public class XmlFactory { LOGGER.log(Level.FINE, "SAXParserFactory instance: {0}", factory); } factory.setNamespaceAware(true); - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, xmlFeatureValue(disableSecureProcessing)); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !isXMLSecurityDisabled(disableSecureProcessing)); return factory; } catch (ParserConfigurationException ex) { LOGGER.log(Level.SEVERE, null, ex); @@ -136,7 +138,7 @@ public class XmlFactory { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "XPathFactory instance: {0}", factory); } - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, xmlFeatureValue(disableSecureProcessing)); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !isXMLSecurityDisabled(disableSecureProcessing)); return factory; } catch (XPathFactoryConfigurationException ex) { LOGGER.log(Level.SEVERE, null, ex); @@ -157,7 +159,7 @@ public class XmlFactory { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "TransformerFactory instance: {0}", factory); } - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, xmlFeatureValue(disableSecureProcessing)); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !isXMLSecurityDisabled(disableSecureProcessing)); return factory; } catch (TransformerConfigurationException ex) { LOGGER.log(Level.SEVERE, null, ex); @@ -180,7 +182,7 @@ public class XmlFactory { LOGGER.log(Level.FINE, "DocumentBuilderFactory instance: {0}", factory); } factory.setNamespaceAware(true); - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, xmlFeatureValue(disableSecureProcessing)); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !isXMLSecurityDisabled(disableSecureProcessing)); return factory; } catch (ParserConfigurationException ex) { LOGGER.log(Level.SEVERE, null, ex); @@ -191,20 +193,64 @@ public class XmlFactory { } } - public static SchemaFactory allowFileAccess(SchemaFactory sf, boolean disableSecureProcessing) { + public static SchemaFactory allowExternalAccess(SchemaFactory sf, String value, boolean disableSecureProcessing) { - // if feature secure processing enabled, nothing to do, file is allowed, - // or user is able to control access by standard JAXP mechanisms - if (disableSecureProcessing) { + // if xml security (feature secure processing) disabled, nothing to do, no restrictions applied + if (isXMLSecurityDisabled(disableSecureProcessing)) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, Messages.JAXP_XML_SECURITY_DISABLED.format()); + } + return sf; + } + + if (System.getProperty("javax.xml.accessExternalSchema") != null) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, Messages.JAXP_EXTERNAL_ACCESS_CONFIGURED.format()); + } return sf; } try { - sf.setProperty(ACCESS_EXTERNAL_SCHEMA, "file"); - LOGGER.log(Level.FINE, Messages.JAXP_SUPPORTED_PROPERTY.format(ACCESS_EXTERNAL_SCHEMA)); + sf.setProperty(ACCESS_EXTERNAL_SCHEMA, value); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, Messages.JAXP_SUPPORTED_PROPERTY.format(ACCESS_EXTERNAL_SCHEMA)); + } } catch (SAXException ignored) { // nothing to do; support depends on version JDK or SAX implementation - LOGGER.log(Level.CONFIG, Messages.JAXP_UNSUPPORTED_PROPERTY.format(ACCESS_EXTERNAL_SCHEMA), ignored); + if (LOGGER.isLoggable(Level.CONFIG)) { + LOGGER.log(Level.CONFIG, Messages.JAXP_UNSUPPORTED_PROPERTY.format(ACCESS_EXTERNAL_SCHEMA), ignored); + } + } + return sf; + } + + public static SchemaFactory allowExternalDTDAccess(SchemaFactory sf, String value, boolean disableSecureProcessing) { + + // if xml security (feature secure processing) disabled, nothing to do, no restrictions applied + if (isXMLSecurityDisabled(disableSecureProcessing)) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, Messages.JAXP_XML_SECURITY_DISABLED.format()); + } + return sf; + } + + if (System.getProperty("javax.xml.accessExternalDTD") != null) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, Messages.JAXP_EXTERNAL_ACCESS_CONFIGURED.format()); + } + return sf; + } + + try { + sf.setProperty(ACCESS_EXTERNAL_DTD, value); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, Messages.JAXP_SUPPORTED_PROPERTY.format(ACCESS_EXTERNAL_DTD)); + } + } catch (SAXException ignored) { + // nothing to do; support depends on version JDK or SAX implementation + if (LOGGER.isLoggable(Level.CONFIG)) { + LOGGER.log(Level.CONFIG, Messages.JAXP_UNSUPPORTED_PROPERTY.format(ACCESS_EXTERNAL_DTD), ignored); + } } return sf; } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/Base64Data.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/Base64Data.java index fa7512c06e1..c749840848f 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/Base64Data.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/org/jvnet/staxex/Base64Data.java @@ -287,10 +287,11 @@ public class Base64Data implements CharSequence, Cloneable { * @throws IOException if i/o error occurs */ public InputStream getInputStream() throws IOException { - if(dataHandler!=null) + if(dataHandler!=null) { return dataHandler.getInputStream(); - else + } else { return new ByteArrayInputStream(data,0,dataLen); + } } /** @@ -342,8 +343,9 @@ public class Base64Data implements CharSequence, Cloneable { } public String getMimeType() { - if(mimeType==null) + if (mimeType==null) { return "application/octet-stream"; + } return mimeType; } @@ -376,31 +378,35 @@ public class Base64Data implements CharSequence, Cloneable { case 0: return Base64Encoder.encode(data[base]>>2); case 1: - if(base+1>4)&0xF)); case 2: - if(base+1>6)&0x3)); - } else + } else { return '='; + } case 3: - if(base+2 value.length()) - pos = value.length(); - return localizer.message("display_param", value.substring(0, pos), value.substring(pos)); + private static class ValidationContextImpl implements ValidationContext { + + private ValidationContext vc; + private String ns; + + ValidationContextImpl(ValidationContext vc, String ns) { + this.vc = vc; + this.ns = ns.length() == 0 ? null : ns; + } + + public String resolveNamespacePrefix(String prefix) { + return prefix.length() == 0 ? ns : vc.resolveNamespacePrefix(prefix); + } + + public String getBaseUri() { + return vc.getBaseUri(); + } + + public boolean isUnparsedEntity(String entityName) { + return vc.isUnparsedEntity(entityName); + } + + public boolean isNotation(String notationName) { + return vc.isNotation(notationName); + } } - public ParsedPattern makePattern(Location loc, Annotations anno) + private class DataPatternBuilderImpl implements DataPatternBuilder { + + private DatatypeBuilder dtb; + + DataPatternBuilderImpl(DatatypeBuilder dtb) { + this.dtb = dtb; + } + + public void addParam(String name, String value, Context context, String ns, Location loc, Annotations anno) + throws BuildException { + try { + dtb.addParameter(name, value, new ValidationContextImpl(context, ns)); + } catch (DatatypeException e) { + String detail = e.getMessage(); + int pos = e.getIndex(); + String displayedParam; + if (pos == DatatypeException.UNKNOWN) { + displayedParam = null; + } else { + displayedParam = displayParam(value, pos); + } + if (displayedParam != null) { + if (detail != null) { + error("invalid_param_detail_display", detail, displayedParam, (Locator) loc); + } else { + error("invalid_param_display", displayedParam, (Locator) loc); + } + } else if (detail != null) { + error("invalid_param_detail", detail, (Locator) loc); + } else { + error("invalid_param", (Locator) loc); + } + } + } + + String displayParam(String value, int pos) { + if (pos < 0) { + pos = 0; + } else if (pos > value.length()) { + pos = value.length(); + } + return localizer.message("display_param", value.substring(0, pos), value.substring(pos)); + } + + public ParsedPattern makePattern(Location loc, Annotations anno) + throws BuildException { + try { + return pb.makeData(dtb.createDatatype()); + } catch (DatatypeException e) { + String detail = e.getMessage(); + if (detail != null) { + error("invalid_params_detail", detail, (Locator) loc); + } else { + error("invalid_params", (Locator) loc); + } + return pb.makeError(); + } + } + + public ParsedPattern makePattern(ParsedPattern except, Location loc, Annotations anno) + throws BuildException { + try { + return pb.makeDataExcept(dtb.createDatatype(), (Pattern) except, (Locator) loc); + } catch (DatatypeException e) { + String detail = e.getMessage(); + if (detail != null) { + error("invalid_params_detail", detail, (Locator) loc); + } else { + error("invalid_params", (Locator) loc); + } + return pb.makeError(); + } + } + + public void annotation(ParsedElementAnnotation ea) { + } + } + + public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, Location loc) throws BuildException { - try { - return pb.makeData(dtb.createDatatype()); - } - catch (DatatypeException e) { - String detail = e.getMessage(); - if (detail != null) - error("invalid_params_detail", detail, (Locator)loc); - else - error("invalid_params", (Locator)loc); - return pb.makeError(); - } + DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary); + if (dl == null) { + error("unrecognized_datatype_library", datatypeLibrary, (Locator) loc); + } else { + try { + return new DataPatternBuilderImpl(dl.createDatatypeBuilder(type)); + } catch (DatatypeException e) { + String detail = e.getMessage(); + if (detail != null) { + error("unsupported_datatype_detail", datatypeLibrary, type, detail, (Locator) loc); + } else { + error("unrecognized_datatype", datatypeLibrary, type, (Locator) loc); + } + } + } + return new DummyDataPatternBuilder(); } - public ParsedPattern makePattern(ParsedPattern except, Location loc, Annotations anno) + public ParsedPattern makeValue(String datatypeLibrary, String type, String value, Context context, String ns, + Location loc, Annotations anno) throws BuildException { + DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary); + if (dl == null) { + error("unrecognized_datatype_library", datatypeLibrary, (Locator) loc); + } else { + try { + DatatypeBuilder dtb = dl.createDatatypeBuilder(type); + try { + Datatype dt = dtb.createDatatype(); + Object obj = dt.createValue(value, new ValidationContextImpl(context, ns)); + if (obj != null) { + return pb.makeValue(dt, obj); + } + error("invalid_value", value, (Locator) loc); + } catch (DatatypeException e) { + String detail = e.getMessage(); + if (detail != null) { + error("datatype_requires_param_detail", detail, (Locator) loc); + } else { + error("datatype_requires_param", (Locator) loc); + } + } + } catch (DatatypeException e) { + error("unrecognized_datatype", datatypeLibrary, type, (Locator) loc); + } + } + return pb.makeError(); + } + + static class GrammarImpl implements Grammar, Div, IncludedGrammar { + + private final SchemaBuilderImpl sb; + private final Hashtable defines; + private final RefPattern startRef; + private final Scope parent; + + private GrammarImpl(SchemaBuilderImpl sb, Scope parent) { + this.sb = sb; + this.parent = parent; + this.defines = new Hashtable(); + this.startRef = new RefPattern(null); + } + + protected GrammarImpl(SchemaBuilderImpl sb, GrammarImpl g) { + this.sb = sb; + parent = g.parent; + startRef = g.startRef; + defines = g.defines; + } + + public ParsedPattern endGrammar(Location loc, Annotations anno) throws BuildException { + for (Enumeration e = defines.keys(); + e.hasMoreElements();) { + String name = (String) e.nextElement(); + RefPattern rp = (RefPattern) defines.get(name); + if (rp.getPattern() == null) { + sb.error("reference_to_undefined", name, rp.getRefLocator()); + rp.setPattern(sb.pb.makeError()); + } + } + Pattern start = startRef.getPattern(); + if (start == null) { + sb.error("missing_start_element", (Locator) loc); + start = sb.pb.makeError(); + } + return start; + } + + public void endDiv(Location loc, Annotations anno) throws BuildException { + // nothing to do + } + + public ParsedPattern endIncludedGrammar(Location loc, Annotations anno) throws BuildException { + return null; + } + + public void define(String name, GrammarSection.Combine combine, ParsedPattern pattern, Location loc, Annotations anno) + throws BuildException { + define(lookup(name), combine, pattern, loc); + } + + private void define(RefPattern rp, GrammarSection.Combine combine, ParsedPattern pattern, Location loc) + throws BuildException { + switch (rp.getReplacementStatus()) { + case RefPattern.REPLACEMENT_KEEP: + if (combine == null) { + if (rp.isCombineImplicit()) { + if (rp.getName() == null) { + sb.error("duplicate_start", (Locator) loc); + } else { + sb.error("duplicate_define", rp.getName(), (Locator) loc); + } + } else { + rp.setCombineImplicit(); + } + } else { + byte combineType = (combine == COMBINE_CHOICE ? RefPattern.COMBINE_CHOICE : RefPattern.COMBINE_INTERLEAVE); + if (rp.getCombineType() != RefPattern.COMBINE_NONE + && rp.getCombineType() != combineType) { + if (rp.getName() == null) { + sb.error("conflict_combine_start", (Locator) loc); + } else { + sb.error("conflict_combine_define", rp.getName(), (Locator) loc); + } + } + rp.setCombineType(combineType); + } + Pattern p = (Pattern) pattern; + if (rp.getPattern() == null) { + rp.setPattern(p); + } else if (rp.getCombineType() == RefPattern.COMBINE_INTERLEAVE) { + rp.setPattern(sb.pb.makeInterleave(rp.getPattern(), p)); + } else { + rp.setPattern(sb.pb.makeChoice(rp.getPattern(), p)); + } + break; + case RefPattern.REPLACEMENT_REQUIRE: + rp.setReplacementStatus(RefPattern.REPLACEMENT_IGNORE); + break; + case RefPattern.REPLACEMENT_IGNORE: + break; + } + } + + public void topLevelAnnotation(ParsedElementAnnotation ea) throws BuildException { + } + + public void topLevelComment(CommentList comments) throws BuildException { + } + + private RefPattern lookup(String name) { + if (name == START) { + return startRef; + } + return lookup1(name); + } + + private RefPattern lookup1(String name) { + RefPattern p = (RefPattern) defines.get(name); + if (p == null) { + p = new RefPattern(name); + defines.put(name, p); + } + return p; + } + + public ParsedPattern makeRef(String name, Location loc, Annotations anno) throws BuildException { + RefPattern p = lookup1(name); + if (p.getRefLocator() == null && loc != null) { + p.setRefLocator((Locator) loc); + } + return p; + } + + public ParsedPattern makeParentRef(String name, Location loc, Annotations anno) throws BuildException { + // TODO: do this check by the caller + if (parent == null) { + sb.error("parent_ref_outside_grammar", (Locator) loc); + return sb.makeErrorPattern(); + } + return parent.makeRef(name, loc, anno); + } + + public Div makeDiv() { + return this; + } + + public Include makeInclude() { + return new IncludeImpl(sb, this); + } + } + + static class Override { + + Override(RefPattern prp, Override next) { + this.prp = prp; + this.next = next; + } + RefPattern prp; + Override next; + byte replacementStatus; + } + + private static class IncludeImpl implements Include, Div { + + private SchemaBuilderImpl sb; + private Override overrides; + private GrammarImpl grammar; + + private IncludeImpl(SchemaBuilderImpl sb, GrammarImpl grammar) { + this.sb = sb; + this.grammar = grammar; + } + + public void define(String name, GrammarSection.Combine combine, ParsedPattern pattern, Location loc, Annotations anno) + throws BuildException { + RefPattern rp = grammar.lookup(name); + overrides = new Override(rp, overrides); + grammar.define(rp, combine, pattern, loc); + } + + public void endDiv(Location loc, Annotations anno) throws BuildException { + // nothing to do + } + + public void topLevelAnnotation(ParsedElementAnnotation ea) throws BuildException { + // nothing to do + } + + public void topLevelComment(CommentList comments) throws BuildException { + } + + public Div makeDiv() { + return this; + } + + public void endInclude(Parseable current, String uri, String ns, + Location loc, Annotations anno) throws BuildException { + for (OpenIncludes inc = sb.openIncludes; + inc != null; + inc = inc.parent) { + if (inc.uri.equals(uri)) { + sb.error("recursive_include", uri, (Locator) loc); + return; + } + } + + for (Override o = overrides; o != null; o = o.next) { + o.replacementStatus = o.prp.getReplacementStatus(); + o.prp.setReplacementStatus(RefPattern.REPLACEMENT_REQUIRE); + } + try { + SchemaBuilderImpl isb = new SchemaBuilderImpl(ns, uri, sb); + current.parseInclude(uri, isb, new GrammarImpl(isb, grammar), ns); + for (Override o = overrides; o != null; o = o.next) { + if (o.prp.getReplacementStatus() == RefPattern.REPLACEMENT_REQUIRE) { + if (o.prp.getName() == null) { + sb.error("missing_start_replacement", (Locator) loc); + } else { + sb.error("missing_define_replacement", o.prp.getName(), (Locator) loc); + } + } + } + } catch (IllegalSchemaException e) { + sb.noteError(); + } finally { + for (Override o = overrides; o != null; o = o.next) { + o.prp.setReplacementStatus(o.replacementStatus); + } + } + } + + public Include makeInclude() { + return null; + } + } + + public Grammar makeGrammar(Scope parent) { + return new GrammarImpl(this, parent); + } + + public ParsedPattern annotate(ParsedPattern p, Annotations anno) throws BuildException { + return p; + } + + public ParsedPattern annotateAfter(ParsedPattern p, ParsedElementAnnotation e) throws BuildException { + return p; + } + + public ParsedPattern commentAfter(ParsedPattern p, CommentList comments) throws BuildException { + return p; + } + + public ParsedPattern makeExternalRef(Parseable current, String uri, String ns, Scope scope, + Location loc, Annotations anno) throws BuildException { - try { - return pb.makeDataExcept(dtb.createDatatype(), (Pattern)except, (Locator)loc); - } - catch (DatatypeException e) { - String detail = e.getMessage(); - if (detail != null) - error("invalid_params_detail", detail, (Locator)loc); - else - error("invalid_params", (Locator)loc); - return pb.makeError(); - } - } - - public void annotation(ParsedElementAnnotation ea) { - } - } - - public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, Location loc) - throws BuildException { - DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary); - if (dl == null) - error("unrecognized_datatype_library", datatypeLibrary, (Locator)loc); - else { - try { - return new DataPatternBuilderImpl(dl.createDatatypeBuilder(type)); - } - catch (DatatypeException e) { - String detail = e.getMessage(); - if (detail != null) - error("unsupported_datatype_detail", datatypeLibrary, type, detail, (Locator)loc); - else - error("unrecognized_datatype", datatypeLibrary, type, (Locator)loc); - } - } - return new DummyDataPatternBuilder(); - } - - public ParsedPattern makeValue(String datatypeLibrary, String type, String value, Context context, String ns, - Location loc, Annotations anno) throws BuildException { - DatatypeLibrary dl = datatypeLibraryFactory.createDatatypeLibrary(datatypeLibrary); - if (dl == null) - error("unrecognized_datatype_library", datatypeLibrary, (Locator)loc); - else { - try { - DatatypeBuilder dtb = dl.createDatatypeBuilder(type); + for (OpenIncludes inc = openIncludes; + inc != null; + inc = inc.parent) { + if (inc.uri.equals(uri)) { + error("recursive_include", uri, (Locator) loc); + return pb.makeError(); + } + } try { - Datatype dt = dtb.createDatatype(); - Object obj = dt.createValue(value, new ValidationContextImpl(context, ns)); - if (obj != null) - return pb.makeValue(dt, obj); - error("invalid_value", value, (Locator)loc); + return current.parseExternal(uri, new SchemaBuilderImpl(ns, uri, this), scope, ns); + } catch (IllegalSchemaException e) { + noteError(); + return pb.makeError(); } - catch (DatatypeException e) { - String detail = e.getMessage(); - if (detail != null) - error("datatype_requires_param_detail", detail, (Locator)loc); - else - error("datatype_requires_param", (Locator)loc); - } - } - catch (DatatypeException e) { - error("unrecognized_datatype", datatypeLibrary, type, (Locator)loc); - } - } - return pb.makeError(); - } - - static class GrammarImpl implements Grammar, Div, IncludedGrammar { - private final SchemaBuilderImpl sb; - private final Hashtable defines; - private final RefPattern startRef; - private final Scope parent; - - private GrammarImpl(SchemaBuilderImpl sb, Scope parent) { - this.sb = sb; - this.parent = parent; - this.defines = new Hashtable(); - this.startRef = new RefPattern(null); } - protected GrammarImpl(SchemaBuilderImpl sb, GrammarImpl g) { - this.sb = sb; - parent = g.parent; - startRef = g.startRef; - defines = g.defines; + public Location makeLocation(String systemId, int lineNumber, int columnNumber) { + return new LocatorImpl(systemId, lineNumber, columnNumber); } - public ParsedPattern endGrammar(Location loc, Annotations anno) throws BuildException { - for (Enumeration e = defines.keys(); - e.hasMoreElements();) { - String name = (String)e.nextElement(); - RefPattern rp = (RefPattern)defines.get(name); - if (rp.getPattern() == null) { - sb.error("reference_to_undefined", name, rp.getRefLocator()); - rp.setPattern(sb.pb.makeError()); - } - } - Pattern start = startRef.getPattern(); - if (start == null) { - sb.error("missing_start_element", (Locator)loc); - start = sb.pb.makeError(); - } - return start; + public Annotations makeAnnotations(CommentList comments, Context context) { + return this; } - public void endDiv(Location loc, Annotations anno) throws BuildException { - // nothing to do + public ElementAnnotationBuilder makeElementAnnotationBuilder(String ns, String localName, String prefix, + Location loc, CommentList comments, Context context) { + return this; } - public ParsedPattern endIncludedGrammar(Location loc, Annotations anno) throws BuildException { + public CommentList makeCommentList() { + return this; + } + + public void addComment(String value, Location loc) throws BuildException { + } + + public void addAttribute(String ns, String localName, String prefix, String value, Location loc) { + // nothing needed + } + + public void addElement(ParsedElementAnnotation ea) { + // nothing needed + } + + public void addComment(CommentList comments) throws BuildException { + // nothing needed + } + + public void addLeadingComment(CommentList comments) throws BuildException { + // nothing needed + } + + public ParsedElementAnnotation makeElementAnnotation() { return null; } - public void define(String name, GrammarSection.Combine combine, ParsedPattern pattern, Location loc, Annotations anno) - throws BuildException { - define(lookup(name), combine, pattern, loc); + public void addText(String value, Location loc, CommentList comments) throws BuildException { } - private void define(RefPattern rp, GrammarSection.Combine combine, ParsedPattern pattern, Location loc) - throws BuildException { - switch (rp.getReplacementStatus()) { - case RefPattern.REPLACEMENT_KEEP: - if (combine == null) { - if (rp.isCombineImplicit()) { - if (rp.getName() == null) - sb.error("duplicate_start", (Locator)loc); - else - sb.error("duplicate_define", rp.getName(), (Locator)loc); - } - else - rp.setCombineImplicit(); + public boolean usesComments() { + return false; + } + + private void error(SAXParseException message) throws BuildException { + noteError(); + try { + if (eh != null) { + eh.error(message); + } + } catch (SAXException e) { + throw new BuildException(e); } - else { - byte combineType = (combine == COMBINE_CHOICE ? RefPattern.COMBINE_CHOICE : RefPattern.COMBINE_INTERLEAVE); - if (rp.getCombineType() != RefPattern.COMBINE_NONE - && rp.getCombineType() != combineType) { - if (rp.getName() == null) - sb.error("conflict_combine_start", (Locator)loc); - else - sb.error("conflict_combine_define", rp.getName(), (Locator)loc); - } - rp.setCombineType(combineType); + } + + private void error(String key, Locator loc) throws BuildException { + error(new SAXParseException(localizer.message(key), loc)); + } + + private void error(String key, String arg, Locator loc) throws BuildException { + error(new SAXParseException(localizer.message(key, arg), loc)); + } + + private void error(String key, String arg1, String arg2, Locator loc) throws BuildException { + error(new SAXParseException(localizer.message(key, arg1, arg2), loc)); + } + + private void error(String key, String arg1, String arg2, String arg3, Locator loc) throws BuildException { + error(new SAXParseException(localizer.message(key, new Object[]{arg1, arg2, arg3}), loc)); + } + + private void noteError() { + if (!hadError && parent != null) { + parent.noteError(); } - Pattern p = (Pattern)pattern; - if (rp.getPattern() == null) - rp.setPattern(p); - else if (rp.getCombineType() == RefPattern.COMBINE_INTERLEAVE) - rp.setPattern(sb.pb.makeInterleave(rp.getPattern(), p)); - else - rp.setPattern(sb.pb.makeChoice(rp.getPattern(), p)); - break; - case RefPattern.REPLACEMENT_REQUIRE: - rp.setReplacementStatus(RefPattern.REPLACEMENT_IGNORE); - break; - case RefPattern.REPLACEMENT_IGNORE: - break; - } + hadError = true; } - - public void topLevelAnnotation(ParsedElementAnnotation ea) throws BuildException { - } - - public void topLevelComment(CommentList comments) throws BuildException { - } - - private RefPattern lookup(String name) { - if (name == START) - return startRef; - return lookup1(name); - } - - private RefPattern lookup1(String name) { - RefPattern p = (RefPattern)defines.get(name); - if (p == null) { - p = new RefPattern(name); - defines.put(name, p); - } - return p; - } - - public ParsedPattern makeRef(String name, Location loc, Annotations anno) throws BuildException { - RefPattern p = lookup1(name); - if (p.getRefLocator() == null && loc != null) - p.setRefLocator((Locator)loc); - return p; - } - - public ParsedPattern makeParentRef(String name, Location loc, Annotations anno) throws BuildException { - // TODO: do this check by the caller - if (parent == null) { - sb.error("parent_ref_outside_grammar", (Locator)loc); - return sb.makeErrorPattern(); - } - return parent.makeRef(name, loc, anno); - } - - public Div makeDiv() { - return this; - } - - public Include makeInclude() { - return new IncludeImpl(sb, this); - } - - } - - - static class Override { - Override(RefPattern prp, Override next) { - this.prp = prp; - this.next = next; - } - - RefPattern prp; - Override next; - byte replacementStatus; - } - - - private static class IncludeImpl implements Include, Div { - private SchemaBuilderImpl sb; - private Override overrides; - private GrammarImpl grammar; - - private IncludeImpl(SchemaBuilderImpl sb, GrammarImpl grammar) { - this.sb = sb; - this.grammar = grammar; - } - - public void define(String name, GrammarSection.Combine combine, ParsedPattern pattern, Location loc, Annotations anno) - throws BuildException { - RefPattern rp = grammar.lookup(name); - overrides = new Override(rp, overrides); - grammar.define(rp, combine, pattern, loc); - } - - public void endDiv(Location loc, Annotations anno) throws BuildException { - // nothing to do - } - - public void topLevelAnnotation(ParsedElementAnnotation ea) throws BuildException { - // nothing to do - } - - public void topLevelComment(CommentList comments) throws BuildException { - } - - public Div makeDiv() { - return this; - } - - public void endInclude(Parseable current,String uri, String ns, - Location loc, Annotations anno) throws BuildException { - for (OpenIncludes inc = sb.openIncludes; - inc != null; - inc = inc.parent) { - if (inc.uri.equals(uri)) { - sb.error("recursive_include", uri, (Locator)loc); - return; - } - } - - for (Override o = overrides; o != null; o = o.next) { - o.replacementStatus = o.prp.getReplacementStatus(); - o.prp.setReplacementStatus(RefPattern.REPLACEMENT_REQUIRE); - } - try { - SchemaBuilderImpl isb = new SchemaBuilderImpl(ns, uri, sb); - current.parseInclude(uri, isb, new GrammarImpl(isb, grammar), ns); - for (Override o = overrides; o != null; o = o.next) { - if (o.prp.getReplacementStatus() == RefPattern.REPLACEMENT_REQUIRE) { - if (o.prp.getName() == null) - sb.error("missing_start_replacement", (Locator)loc); - else - sb.error("missing_define_replacement", o.prp.getName(), (Locator)loc); - } - } - } - catch (IllegalSchemaException e) { - sb.noteError(); - } - finally { - for (Override o = overrides; o != null; o = o.next) - o.prp.setReplacementStatus(o.replacementStatus); - } - } - - public Include makeInclude() { - return null; - } - } - - public Grammar makeGrammar(Scope parent) { - return new GrammarImpl(this, parent); - } - - public ParsedPattern annotate(ParsedPattern p, Annotations anno) throws BuildException { - return p; - } - - - public ParsedPattern annotateAfter(ParsedPattern p, ParsedElementAnnotation e) throws BuildException { - return p; - } - - public ParsedPattern commentAfter(ParsedPattern p, CommentList comments) throws BuildException { - return p; - } - - - public ParsedPattern makeExternalRef(Parseable current, String uri, String ns, Scope scope, - Location loc, Annotations anno) - throws BuildException { - for (OpenIncludes inc = openIncludes; - inc != null; - inc = inc.parent) { - if (inc.uri.equals(uri)) { - error("recursive_include", uri, (Locator)loc); - return pb.makeError(); - } - } - try { - return current.parseExternal(uri, new SchemaBuilderImpl(ns, uri, this), scope, ns ); - } - catch (IllegalSchemaException e) { - noteError(); - return pb.makeError(); - } - } - - - - public Location makeLocation(String systemId, int lineNumber, int columnNumber) { - return new LocatorImpl(systemId, lineNumber, columnNumber); - } - - public Annotations makeAnnotations(CommentList comments, Context context) { - return this; - } - - public ElementAnnotationBuilder makeElementAnnotationBuilder(String ns, String localName, String prefix, - Location loc, CommentList comments, Context context) { - return this; - } - - public CommentList makeCommentList() { - return this; - } - - public void addComment(String value, Location loc) throws BuildException { - } - - public void addAttribute(String ns, String localName, String prefix, String value, Location loc) { - // nothing needed - } - - public void addElement(ParsedElementAnnotation ea) { - // nothing needed - } - - public void addComment(CommentList comments) throws BuildException { - // nothing needed - } - - public void addLeadingComment(CommentList comments) throws BuildException { - // nothing needed - } - - public ParsedElementAnnotation makeElementAnnotation() { - return null; - } - - public void addText(String value, Location loc, CommentList comments) throws BuildException { - } - - public boolean usesComments() { - return false; - } - - private void error(SAXParseException message) throws BuildException { - noteError(); - try { - if (eh != null) - eh.error(message); - } - catch (SAXException e) { - throw new BuildException(e); - } - } - - private void warning(SAXParseException message) throws BuildException { - try { - if (eh != null) - eh.warning(message); - } - catch (SAXException e) { - throw new BuildException(e); - } - } - - private void error(String key, Locator loc) throws BuildException { - error(new SAXParseException(localizer.message(key), loc)); - } - - private void error(String key, String arg, Locator loc) throws BuildException { - error(new SAXParseException(localizer.message(key, arg), loc)); - } - - private void error(String key, String arg1, String arg2, Locator loc) throws BuildException { - error(new SAXParseException(localizer.message(key, arg1, arg2), loc)); - } - - private void error(String key, String arg1, String arg2, String arg3, Locator loc) throws BuildException { - error(new SAXParseException(localizer.message(key, new Object[]{arg1, arg2, arg3}), loc)); - } - private void noteError() { - if (!hadError && parent != null) - parent.noteError(); - hadError = true; - } - } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DDataPattern.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DDataPattern.java index eb92bb8561b..fa81b976769 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DDataPattern.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DDataPattern.java @@ -23,7 +23,7 @@ * questions. */ /* - * Copyright (C) 2004-2011 + * Copyright (C) 2004-2012 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DPattern.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DPattern.java index 2637ce4c518..e38bebafc44 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DPattern.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DPattern.java @@ -23,7 +23,7 @@ * questions. */ /* - * Copyright (C) 2004-2011 + * Copyright (C) 2004-2012 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -55,9 +55,9 @@ import org.xml.sax.Locator; * @author Kohsuke Kawaguchi (kk@kohsuke.org) */ public abstract class DPattern implements ParsedPattern { + Locator location; DAnnotation annotation; - /** * Used to chain the child patterns in a doubly-linked list. */ @@ -74,12 +74,12 @@ public abstract class DPattern implements ParsedPattern { /** * Returns the annotation associated with it. * - * @return - * may be empty, but never be null. + * @return may be empty, but never be null. */ public DAnnotation getAnnotation() { - if(annotation==null) + if (annotation == null) { return DAnnotation.EMPTY; + } return annotation; } @@ -90,7 +90,7 @@ public abstract class DPattern implements ParsedPattern { */ public abstract boolean isNullable(); - public abstract V accept( DPatternVisitor visitor ); + public abstract V accept(DPatternVisitor visitor); /** * Creates a {@link Parseable} object that reparses this pattern. diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DXMLPrinter.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DXMLPrinter.java index fd44d6bc4d5..c224f6c876b 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DXMLPrinter.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DXMLPrinter.java @@ -110,7 +110,11 @@ public class DXMLPrinter { visitor.on(grammar); visitor.endDocument(); } catch (XMLWriterException e) { - throw (XMLStreamException) e.getCause(); + if (e.getCause() instanceof XMLStreamException) { + throw (XMLStreamException) e.getCause(); + } else { + throw new XMLStreamException(e); + } } } @@ -123,7 +127,11 @@ public class DXMLPrinter { try { pattern.accept(visitor); } catch (XMLWriterException e) { - throw (XMLStreamException) e.getCause(); + if (e.getCause() instanceof XMLStreamException) { + throw (XMLStreamException) e.getCause(); + } else { + throw new XMLStreamException(e); + } } } @@ -136,7 +144,11 @@ public class DXMLPrinter { try { nc.accept(ncVisitor); } catch (XMLWriterException e) { - throw (XMLStreamException) e.getCause(); + if (e.getCause() instanceof XMLStreamException) { + throw (XMLStreamException) e.getCause(); + } else { + throw new XMLStreamException(e); + } } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DataPatternBuilderImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DataPatternBuilderImpl.java index cd81a9e393b..7d3fbfd44ca 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DataPatternBuilderImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DataPatternBuilderImpl.java @@ -23,7 +23,7 @@ * questions. */ /* - * Copyright (C) 2004-2011 + * Copyright (C) 2004-2012 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -82,8 +82,9 @@ final class DataPatternBuilderImpl implements DataPatternBuilder { public ParsedPattern makePattern(ParsedPattern except, Location loc, Annotations anno) throws BuildException { p.except = (DPattern)except; - if(anno!=null) + if (anno!=null) { p.annotation = ((Annotation)anno).getResult(); + } return p; } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/GrammarBuilderImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/GrammarBuilderImpl.java index b9cd82050dc..87e93a5c677 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/GrammarBuilderImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/GrammarBuilderImpl.java @@ -23,7 +23,7 @@ * questions. */ /* - * Copyright (C) 2004-2011 + * Copyright (C) 2004-2012 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -45,6 +45,9 @@ */ package com.sun.xml.internal.rngom.digested; +import java.util.ArrayList; +import java.util.List; + import com.sun.xml.internal.rngom.ast.builder.Annotations; import com.sun.xml.internal.rngom.ast.builder.BuildException; import com.sun.xml.internal.rngom.ast.builder.CommentList; @@ -58,9 +61,6 @@ import com.sun.xml.internal.rngom.ast.om.ParsedPattern; import com.sun.xml.internal.rngom.ast.util.LocatorImpl; import org.w3c.dom.Element; -import java.util.ArrayList; -import java.util.List; - /** * @author Kohsuke Kawaguchi (kk@kohsuke.org) */ @@ -85,12 +85,11 @@ class GrammarBuilderImpl implements Grammar, Div { } public ParsedPattern endGrammar(Location loc, Annotations anno) throws BuildException { - if(anno!=null) - grammar.annotation = ((Annotation)anno).getResult(); - if(additionalElementAnnotations!=null) { - if(grammar.annotation==null) - grammar.annotation = new DAnnotation(); - grammar.annotation.contents.addAll(additionalElementAnnotations); + // Harshit : Fixed possible NPE and issue in handling of annotations + if (anno != null) { + if (grammar.annotation != null) { + grammar.annotation.contents.addAll(((Annotation) anno).getResult().contents); + } } return grammar; } @@ -99,21 +98,28 @@ class GrammarBuilderImpl implements Grammar, Div { } public void define(String name, Combine combine, ParsedPattern pattern, Location loc, Annotations anno) throws BuildException { - if(name==START) + if(name==START) { grammar.start = (DPattern)pattern; - else { + } else { // TODO: handle combine DDefine d = grammar.getOrAdd(name); d.setPattern( (DPattern) pattern ); - if(anno!=null) + if (anno!=null) { d.annotation = ((Annotation)anno).getResult(); + } } } public void topLevelAnnotation(ParsedElementAnnotation ea) throws BuildException { - if(additionalElementAnnotations==null) + // Harshit : Fixed issue in handling of annotations + if (additionalElementAnnotations==null) { additionalElementAnnotations = new ArrayList(); + } additionalElementAnnotations.add(((ElementWrapper)ea).element); + if (grammar.annotation==null) { + grammar.annotation = new DAnnotation(); + } + grammar.annotation.contents.addAll(additionalElementAnnotations); } public void topLevelComment(CommentList comments) throws BuildException { diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/nc/AnyNameClass.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/nc/AnyNameClass.java index 92aa4070227..a4c7b6a3918 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/nc/AnyNameClass.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/nc/AnyNameClass.java @@ -77,7 +77,4 @@ final class AnyNameClass extends NameClass { return true; } - private static Object readReplace() { - return NameClass.ANY; - } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/nc/NameClassBuilderImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/nc/NameClassBuilderImpl.java index 00f16b0c0b7..f3cd769e007 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/nc/NameClassBuilderImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/nc/NameClassBuilderImpl.java @@ -23,7 +23,7 @@ * questions. */ /* - * Copyright (C) 2004-2011 + * Copyright (C) 2004-2012 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -65,17 +65,25 @@ public class NameClassBuilderImpl< A extends Annotations, CL extends CommentList> implements NameClassBuilder { + @Override public NameClass makeChoice(List nameClasses, L loc, A anno) { - NameClass result = nameClasses.get(0); - for (int i = 1; i < nameClasses.size(); i++) - result = new ChoiceNameClass(result, nameClasses.get(i)); - return result; + NameClass result = nameClasses.get(0); + for (int i = 1; i < nameClasses.size(); i++) { + result = new ChoiceNameClass(result, nameClasses.get(i)); + } + return result; } + @Override public NameClass makeName(String ns, String localName, String prefix, L loc, A anno) { - return new SimpleNameClass(ns, localName); + if (prefix == null) { + return new SimpleNameClass(ns, localName); + } else { + return new SimpleNameClass(ns, localName, prefix); + } } + @Override public NameClass makeNsName(String ns, L loc, A anno) { return new NsNameClass(ns); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/nc/SimpleNameClass.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/nc/SimpleNameClass.java index 456224990ed..62b3783f1cc 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/nc/SimpleNameClass.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/nc/SimpleNameClass.java @@ -23,7 +23,7 @@ * questions. */ /* - * Copyright (C) 2004-2011 + * Copyright (C) 2004-2012 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -55,14 +55,20 @@ public class SimpleNameClass extends NameClass { this.name = name; } - public SimpleNameClass( String nsUri, String localPart ) { - this( new QName(nsUri,localPart) ); + public SimpleNameClass(String nsUri, String localPart) { + this(new QName(nsUri, localPart)); } + public SimpleNameClass(String nsUri, String localPart, String prefix) { + this(new QName(nsUri, localPart, prefix)); + } + + @Override public boolean contains(QName name) { return this.name.equals(name); } + @Override public int containsSpecificity(QName name) { return contains(name) ? SPECIFICITY_NAME : SPECIFICITY_NONE; } @@ -74,16 +80,19 @@ public class SimpleNameClass extends NameClass { @Override public boolean equals(Object obj) { - if (obj == null || !(obj instanceof SimpleNameClass)) + if (obj == null || !(obj instanceof SimpleNameClass)) { return false; + } SimpleNameClass other = (SimpleNameClass) obj; return name.equals(other.name); } + @Override public V accept(NameClassVisitor visitor) { return visitor.visitName(name); } + @Override public boolean isOpen() { return false; } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/parse/compact/UCode_UCodeESC_CharStream.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/parse/compact/UCode_UCodeESC_CharStream.java index fd839f06f26..475258c659d 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/parse/compact/UCode_UCodeESC_CharStream.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/parse/compact/UCode_UCodeESC_CharStream.java @@ -23,7 +23,7 @@ * questions. */ /* - * Copyright (C) 2004-2011 + * Copyright (C) 2004-2012 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -45,7 +45,7 @@ */ /* Generated By:JavaCC: Do not edit this line. UCode_UCodeESC_CharStream.java Version 0.7pre6 */ /* The previous line keeps JavaCC quiet. In fact, the JavaCC generated file - has been edited to fix some bugs. */ + has been edited to fix some bugs. */ package com.sun.xml.internal.rngom.parse.compact; import com.sun.xml.internal.rngom.util.Utf16; @@ -58,537 +58,537 @@ import java.io.IOException; * contain 16-bit unicode characters. */ public final class UCode_UCodeESC_CharStream { - public static final boolean staticFlag = false; - static final int hexval(char c) { - switch (c) { - case '0': - return 0; - case '1': - return 1; - case '2': - return 2; - case '3': - return 3; - case '4': - return 4; - case '5': - return 5; - case '6': - return 6; - case '7': - return 7; - case '8': - return 8; - case '9': - return 9; + public static final boolean staticFlag = false; - case 'a': - case 'A': - return 10; - case 'b': - case 'B': - return 11; - case 'c': - case 'C': - return 12; - case 'd': - case 'D': - return 13; - case 'e': - case 'E': - return 14; - case 'f': - case 'F': - return 15; + static final int hexval(char c) { + switch (c) { + case '0': + return 0; + case '1': + return 1; + case '2': + return 2; + case '3': + return 3; + case '4': + return 4; + case '5': + return 5; + case '6': + return 6; + case '7': + return 7; + case '8': + return 8; + case '9': + return 9; + + case 'a': + case 'A': + return 10; + case 'b': + case 'B': + return 11; + case 'c': + case 'C': + return 12; + case 'd': + case 'D': + return 13; + case 'e': + case 'E': + return 14; + case 'f': + case 'F': + return 15; + } + return -1; } - return -1; - } + public int bufpos = -1; + int bufsize; + int available; + int tokenBegin; + private int bufline[]; + private int bufcolumn[]; + private int column = 0; + private int line = 1; + private java.io.Reader inputStream; + private boolean closed = false; + private boolean prevCharIsLF = false; + private char[] nextCharBuf; + private char[] buffer; + private int maxNextCharInd = 0; + private int nextCharInd = -1; + private int inBuf = 0; - public int bufpos = -1; - int bufsize; - int available; - int tokenBegin; - private int bufline[]; - private int bufcolumn[]; + private final void ExpandBuff(boolean wrapAround) { + char[] newbuffer = new char[bufsize + 2048]; + int newbufline[] = new int[bufsize + 2048]; + int newbufcolumn[] = new int[bufsize + 2048]; - private int column = 0; - private int line = 1; + if (wrapAround) { + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); + System.arraycopy(buffer, 0, newbuffer, + bufsize - tokenBegin, bufpos); + buffer = newbuffer; - private java.io.Reader inputStream; - private boolean closed = false; + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); + System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); + bufline = newbufline; - private boolean prevCharIsLF = false; + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); + System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); + bufcolumn = newbufcolumn; - private char[] nextCharBuf; - private char[] buffer; - private int maxNextCharInd = 0; - private int nextCharInd = -1; - private int inBuf = 0; + bufpos += (bufsize - tokenBegin); + } else { + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); + buffer = newbuffer; - private final void ExpandBuff(boolean wrapAround) { - char[] newbuffer = new char[bufsize + 2048]; - int newbufline[] = new int[bufsize + 2048]; - int newbufcolumn[] = new int[bufsize + 2048]; + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); + bufline = newbufline; - if (wrapAround) { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - System.arraycopy(buffer, 0, newbuffer, - bufsize - tokenBegin, bufpos); - buffer = newbuffer; + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); + bufcolumn = newbufcolumn; - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); - bufline = newbufline; + bufpos -= tokenBegin; + } - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); - bufcolumn = newbufcolumn; - - bufpos += (bufsize - tokenBegin); - } - else { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - buffer = newbuffer; - - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - bufline = newbufline; - - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - bufcolumn = newbufcolumn; - - bufpos -= tokenBegin; + available = (bufsize += 2048); + tokenBegin = 0; } - available = (bufsize += 2048); - tokenBegin = 0; - } + private final void FillBuff() throws EOFException { + int i; + if (maxNextCharInd == 4096) { + maxNextCharInd = nextCharInd = 0; + } - private final void FillBuff() throws EOFException { - int i; - if (maxNextCharInd == 4096) - maxNextCharInd = nextCharInd = 0; - - if (closed) - throw new EOFException(); - try { - if ((i = inputStream.read(nextCharBuf, maxNextCharInd, 4096 - maxNextCharInd)) == -1) { - closed = true; - inputStream.close(); - throw new EOFException(); - } - else - maxNextCharInd += i; - } - catch (IOException e) { - throw new BuildException(e); - } - } - - private final char ReadChar() throws EOFException { - if (++nextCharInd >= maxNextCharInd) - FillBuff(); - - return nextCharBuf[nextCharInd]; - } - - private final char PeekChar() throws EOFException { - char c = ReadChar(); - --nextCharInd; - return c; - } - - public final char BeginToken() throws EOFException { - if (inBuf > 0) { - --inBuf; - return buffer[tokenBegin = (bufpos == bufsize - 1) ? (bufpos = 0) - : ++bufpos]; - } - - tokenBegin = 0; - bufpos = -1; - - return readChar(); - } - - private final void AdjustBuffSize() { - if (available == bufsize) { - if (tokenBegin > 2048) { - bufpos = 0; - available = tokenBegin; - } - else - ExpandBuff(false); - } - else if (available > tokenBegin) - available = bufsize; - else if ((tokenBegin - available) < 2048) - ExpandBuff(true); - else - available = tokenBegin; - } - - private final void UpdateLineColumn(char c) { - column++; - - if (prevCharIsLF) { - prevCharIsLF = false; - line += (column = 1); - } - - switch (c) { - case NEWLINE_MARKER: - prevCharIsLF = true; - break; - case '\t': - column--; - column += (8 - (column & 07)); - break; - default : - break; - } - - bufline[bufpos] = line; - bufcolumn[bufpos] = column; - } - - private final char NEWLINE_MARKER = '\u0000'; - - public final char readChar() throws EOFException { - if (inBuf > 0) { - --inBuf; - return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; - } - - char c; - try { - c = ReadChar(); - switch (c) { - case '\r': - c = NEWLINE_MARKER; + if (closed) { + throw new EOFException(); + } try { - if (PeekChar() == '\n') - ReadChar(); - } - catch (EOFException e) { - } - break; - case '\n': - c = NEWLINE_MARKER; - break; - case '\t': - break; - default: - if (c >= 0x20) { - if (Utf16.isSurrogate(c)) { - if (Utf16.isSurrogate2(c)) - throw new EscapeSyntaxException("illegal_surrogate_pair", line, column + 1); - if (++bufpos == available) - AdjustBuffSize(); - buffer[bufpos] = c; - // UpdateLineColumn(c); - try { - c = ReadChar(); + if ((i = inputStream.read(nextCharBuf, maxNextCharInd, 4096 - maxNextCharInd)) == -1) { + closed = true; + inputStream.close(); + throw new EOFException(); + } else { + maxNextCharInd += i; } - catch (EOFException e) { - throw new EscapeSyntaxException("illegal_surrogate_pair", line, column + 1); - } - if (!Utf16.isSurrogate2(c)) - throw new EscapeSyntaxException("illegal_surrogate_pair", line, column + 2); - } - break; + } catch (IOException e) { + throw new BuildException(e); } - // fall through - case '\uFFFE': - case '\uFFFF': - throw new EscapeSyntaxException("illegal_char_code", line, column + 1); - } } - catch (EOFException e) { - if (bufpos == -1) { - if (++bufpos == available) - AdjustBuffSize(); + + private final char ReadChar() throws EOFException { + if (++nextCharInd >= maxNextCharInd) { + FillBuff(); + } + + return nextCharBuf[nextCharInd]; + } + + private final char PeekChar() throws EOFException { + char c = ReadChar(); + --nextCharInd; + return c; + } + + public final char BeginToken() throws EOFException { + if (inBuf > 0) { + --inBuf; + return buffer[tokenBegin = (bufpos == bufsize - 1) ? (bufpos = 0) + : ++bufpos]; + } + + tokenBegin = 0; + bufpos = -1; + + return readChar(); + } + + private final void AdjustBuffSize() { + if (available == bufsize) { + if (tokenBegin > 2048) { + bufpos = 0; + available = tokenBegin; + } else { + ExpandBuff(false); + } + } else if (available > tokenBegin) { + available = bufsize; + } else if ((tokenBegin - available) < 2048) { + ExpandBuff(true); + } else { + available = tokenBegin; + } + } + + private final void UpdateLineColumn(char c) { + column++; + + if (prevCharIsLF) { + prevCharIsLF = false; + line += (column = 1); + } + + switch (c) { + case NEWLINE_MARKER: + prevCharIsLF = true; + break; + case '\t': + column--; + column += (8 - (column & 07)); + break; + default: + break; + } + bufline[bufpos] = line; bufcolumn[bufpos] = column; - } - throw e; - } - if (++bufpos == available) - AdjustBuffSize(); - buffer[bufpos] = c; - UpdateLineColumn(c); - try { - if (c != '\\' || PeekChar() != 'x') - return c; - } - catch (EOFException e) { - return c; } + private static final char NEWLINE_MARKER = '\u0000'; - int xCnt = 1; - for (;;) { - ReadChar(); - if (++bufpos == available) - AdjustBuffSize(); - buffer[bufpos] = 'x'; - UpdateLineColumn('x'); - try { - c = PeekChar(); - } - catch (EOFException e) { - backup(xCnt); - return '\\'; - } - if (c == '{') { - ReadChar(); - column++; - // backup past the 'x's - bufpos -= xCnt; - if (bufpos < 0) - bufpos += bufsize; - break; - } - if (c != 'x') { - backup(xCnt); - return '\\'; - } - xCnt++; - } - try { - int scalarValue = hexval(ReadChar()); - column++; - if (scalarValue < 0) - throw new EscapeSyntaxException("illegal_hex_digit", line, column); - while ((c = ReadChar()) != '}') { - column++; - int n = hexval(c); - if (n < 0) - throw new EscapeSyntaxException("illegal_hex_digit", line, column); - scalarValue <<= 4; - scalarValue |= n; - if (scalarValue >= 0x110000) - throw new EscapeSyntaxException("char_code_too_big", line, column); - } - column++; // for the '}' - if (scalarValue <= 0xFFFF) { - c = (char)scalarValue; - switch (c) { - case '\n': - case '\r': - case '\t': - break; - default: - if (c >= 0x20 && !Utf16.isSurrogate(c)) - break; - // fall through - case '\uFFFE': - case '\uFFFF': - throw new EscapeSyntaxException("illegal_char_code_ref", line, column); + public final char readChar() throws EOFException { + if (inBuf > 0) { + --inBuf; + return buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]; + } + + char c; + try { + c = ReadChar(); + switch (c) { + case '\r': + c = NEWLINE_MARKER; + try { + if (PeekChar() == '\n') { + ReadChar(); + } + } catch (EOFException e) { + } + break; + case '\n': + c = NEWLINE_MARKER; + break; + case '\t': + break; + default: + if (c >= 0x20) { + if (Utf16.isSurrogate(c)) { + if (Utf16.isSurrogate2(c)) { + throw new EscapeSyntaxException("illegal_surrogate_pair", line, column + 1); + } + if (++bufpos == available) { + AdjustBuffSize(); + } + buffer[bufpos] = c; + // UpdateLineColumn(c); + try { + c = ReadChar(); + } catch (EOFException e) { + throw new EscapeSyntaxException("illegal_surrogate_pair", line, column + 1); + } + if (!Utf16.isSurrogate2(c)) { + throw new EscapeSyntaxException("illegal_surrogate_pair", line, column + 2); + } + } + break; + } + // fall through + case '\uFFFE': + case '\uFFFF': + throw new EscapeSyntaxException("illegal_char_code", line, column + 1); + } + } catch (EOFException e) { + if (bufpos == -1) { + if (++bufpos == available) { + AdjustBuffSize(); + } + bufline[bufpos] = line; + bufcolumn[bufpos] = column; + } + throw e; + } + if (++bufpos == available) { + AdjustBuffSize(); } buffer[bufpos] = c; - return c; - } - c = Utf16.surrogate1(scalarValue); - buffer[bufpos] = c; - int bufpos1 = bufpos; - if (++bufpos == bufsize) - bufpos = 0; - buffer[bufpos] = Utf16.surrogate2(scalarValue); - bufline[bufpos] = bufline[bufpos1]; - bufcolumn[bufpos] = bufcolumn[bufpos1]; - backup(1); - return c; - } - catch (EOFException e) { - throw new EscapeSyntaxException("incomplete_escape", line, column); - } - } + UpdateLineColumn(c); + try { + if (c != '\\' || PeekChar() != 'x') { + return c; + } + } catch (EOFException e) { + return c; + } - /** - * @deprecated - * @see #getEndColumn - */ - - public final int getColumn() { - return bufcolumn[bufpos]; - } - - /** - * @deprecated - * @see #getEndLine - */ - - public final int getLine() { - return bufline[bufpos]; - } - - public final int getEndColumn() { - return bufcolumn[bufpos]; - } - - public final int getEndLine() { - return bufline[bufpos]; - } - - public final int getBeginColumn() { - return bufcolumn[tokenBegin]; - } - - public final int getBeginLine() { - return bufline[tokenBegin]; - } - - public final void backup(int amount) { - - inBuf += amount; - if ((bufpos -= amount) < 0) - bufpos += bufsize; - } - - public UCode_UCodeESC_CharStream(java.io.Reader dstream, - int startline, int startcolumn, int buffersize) { - inputStream = dstream; - line = startline; - column = startcolumn - 1; - - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - nextCharBuf = new char[4096]; - skipBOM(); - } - - public UCode_UCodeESC_CharStream(java.io.Reader dstream, - int startline, int startcolumn) { - this(dstream, startline, startcolumn, 4096); - } - - public void ReInit(java.io.Reader dstream, - int startline, int startcolumn, int buffersize) { - inputStream = dstream; - closed = false; - line = startline; - column = startcolumn - 1; - - if (buffer == null || buffersize != buffer.length) { - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - nextCharBuf = new char[4096]; - } - prevCharIsLF = false; - tokenBegin = inBuf = maxNextCharInd = 0; - nextCharInd = bufpos = -1; - skipBOM(); - } - - public void ReInit(java.io.Reader dstream, - int startline, int startcolumn) { - ReInit(dstream, startline, startcolumn, 4096); - } - - public UCode_UCodeESC_CharStream(java.io.InputStream dstream, int startline, - int startcolumn, int buffersize) { - this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096); - } - - public UCode_UCodeESC_CharStream(java.io.InputStream dstream, int startline, - int startcolumn) { - this(dstream, startline, startcolumn, 4096); - } - - public void ReInit(java.io.InputStream dstream, int startline, - int startcolumn, int buffersize) { - ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096); - } - - public void ReInit(java.io.InputStream dstream, int startline, - int startcolumn) { - ReInit(dstream, startline, startcolumn, 4096); - } - - static private final char BOM = '\ufeff'; - - private void skipBOM() { - try { - if (PeekChar() == BOM) - ReadChar(); - } - catch (EOFException e) { - } - } - - public final String GetImage() { - if (bufpos >= tokenBegin) - return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); - else - return new String(buffer, tokenBegin, bufsize - tokenBegin) + - new String(buffer, 0, bufpos + 1); - } - - public final char[] GetSuffix(int len) { - char[] ret = new char[len]; - - if ((bufpos + 1) >= len) - System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); - else { - System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, - len - bufpos - 1); - System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); + int xCnt = 1; + for (;;) { + ReadChar(); + if (++bufpos == available) { + AdjustBuffSize(); + } + buffer[bufpos] = 'x'; + UpdateLineColumn('x'); + try { + c = PeekChar(); + } catch (EOFException e) { + backup(xCnt); + return '\\'; + } + if (c == '{') { + ReadChar(); + column++; + // backup past the 'x's + bufpos -= xCnt; + if (bufpos < 0) { + bufpos += bufsize; + } + break; + } + if (c != 'x') { + backup(xCnt); + return '\\'; + } + xCnt++; + } + try { + int scalarValue = hexval(ReadChar()); + column++; + if (scalarValue < 0) { + throw new EscapeSyntaxException("illegal_hex_digit", line, column); + } + while ((c = ReadChar()) != '}') { + column++; + int n = hexval(c); + if (n < 0) { + throw new EscapeSyntaxException("illegal_hex_digit", line, column); + } + scalarValue <<= 4; + scalarValue |= n; + if (scalarValue >= 0x110000) { + throw new EscapeSyntaxException("char_code_too_big", line, column); + } + } + column++; // for the '}' + if (scalarValue <= 0xFFFF) { + c = (char) scalarValue; + switch (c) { + case '\n': + case '\r': + case '\t': + break; + default: + if (c >= 0x20 && !Utf16.isSurrogate(c)) { + break; + } + // fall through + case '\uFFFE': + case '\uFFFF': + throw new EscapeSyntaxException("illegal_char_code_ref", line, column); + } + buffer[bufpos] = c; + return c; + } + c = Utf16.surrogate1(scalarValue); + buffer[bufpos] = c; + int bufpos1 = bufpos; + if (++bufpos == bufsize) { + bufpos = 0; + } + buffer[bufpos] = Utf16.surrogate2(scalarValue); + bufline[bufpos] = bufline[bufpos1]; + bufcolumn[bufpos] = bufcolumn[bufpos1]; + backup(1); + return c; + } catch (EOFException e) { + throw new EscapeSyntaxException("incomplete_escape", line, column); + } } - return ret; - } - - public void Done() { - nextCharBuf = null; - buffer = null; - bufline = null; - bufcolumn = null; - } - - /** - * Method to adjust line and column numbers for the start of a token.
    - */ - public void adjustBeginLineColumn(int newLine, int newCol) { - int start = tokenBegin; - int len; - - if (bufpos >= tokenBegin) { - len = bufpos - tokenBegin + inBuf + 1; - } - else { - len = bufsize - tokenBegin + bufpos + 1 + inBuf; + /** + * @deprecated @see #getEndColumn + */ + public final int getColumn() { + return bufcolumn[bufpos]; } - int i = 0, j = 0, k = 0; - int nextColDiff = 0, columnDiff = 0; - - while (i < len && - bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) { - bufline[j] = newLine; - nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; - bufcolumn[j] = newCol + columnDiff; - columnDiff = nextColDiff; - i++; + /** + * @deprecated @see #getEndLine + */ + public final int getLine() { + return bufline[bufpos]; } - if (i < len) { - bufline[j] = newLine++; - bufcolumn[j] = newCol + columnDiff; - - while (i++ < len) { - if (bufline[j = start % bufsize] != bufline[++start % bufsize]) - bufline[j] = newLine++; - else - bufline[j] = newLine; - } + public final int getEndColumn() { + return bufcolumn[bufpos]; } - line = bufline[j]; - column = bufcolumn[j]; - } + public final int getEndLine() { + return bufline[bufpos]; + } + public final int getBeginColumn() { + return bufcolumn[tokenBegin]; + } + + public final int getBeginLine() { + return bufline[tokenBegin]; + } + + public final void backup(int amount) { + + inBuf += amount; + if ((bufpos -= amount) < 0) { + bufpos += bufsize; + } + } + + public UCode_UCodeESC_CharStream(java.io.Reader dstream, + int startline, int startcolumn, int buffersize) { + inputStream = dstream; + line = startline; + column = startcolumn - 1; + + available = bufsize = buffersize; + buffer = new char[buffersize]; + bufline = new int[buffersize]; + bufcolumn = new int[buffersize]; + nextCharBuf = new char[4096]; + skipBOM(); + } + + public UCode_UCodeESC_CharStream(java.io.Reader dstream, + int startline, int startcolumn) { + this(dstream, startline, startcolumn, 4096); + } + + public void ReInit(java.io.Reader dstream, + int startline, int startcolumn, int buffersize) { + inputStream = dstream; + closed = false; + line = startline; + column = startcolumn - 1; + + if (buffer == null || buffersize != buffer.length) { + available = bufsize = buffersize; + buffer = new char[buffersize]; + bufline = new int[buffersize]; + bufcolumn = new int[buffersize]; + nextCharBuf = new char[4096]; + } + prevCharIsLF = false; + tokenBegin = inBuf = maxNextCharInd = 0; + nextCharInd = bufpos = -1; + skipBOM(); + } + + public void ReInit(java.io.Reader dstream, + int startline, int startcolumn) { + ReInit(dstream, startline, startcolumn, 4096); + } + + public UCode_UCodeESC_CharStream(java.io.InputStream dstream, int startline, + int startcolumn, int buffersize) { + this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096); + } + + public UCode_UCodeESC_CharStream(java.io.InputStream dstream, int startline, + int startcolumn) { + this(dstream, startline, startcolumn, 4096); + } + + public void ReInit(java.io.InputStream dstream, int startline, + int startcolumn, int buffersize) { + ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096); + } + + public void ReInit(java.io.InputStream dstream, int startline, + int startcolumn) { + ReInit(dstream, startline, startcolumn, 4096); + } + static private final char BOM = '\ufeff'; + + private void skipBOM() { + try { + if (PeekChar() == BOM) { + ReadChar(); + } + } catch (EOFException e) { + } + } + + public final String GetImage() { + if (bufpos >= tokenBegin) { + return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); + } else { + return new String(buffer, tokenBegin, bufsize - tokenBegin) + + new String(buffer, 0, bufpos + 1); + } + } + + public final char[] GetSuffix(int len) { + char[] ret = new char[len]; + + if ((bufpos + 1) >= len) { + System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); + } else { + System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, + len - bufpos - 1); + System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); + } + + return ret; + } + + public void Done() { + nextCharBuf = null; + buffer = null; + bufline = null; + bufcolumn = null; + } + + /** + * Method to adjust line and column numbers for the start of a token.
    + */ + public void adjustBeginLineColumn(int newLine, int newCol) { + int start = tokenBegin; + int len; + + if (bufpos >= tokenBegin) { + len = bufpos - tokenBegin + inBuf + 1; + } else { + len = bufsize - tokenBegin + bufpos + 1 + inBuf; + } + + int i = 0, j = 0, k = 0; + int nextColDiff, columnDiff = 0; + + while (i < len + && bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) { + bufline[j] = newLine; + nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; + bufcolumn[j] = newCol + columnDiff; + columnDiff = nextColDiff; + i++; + } + + if (i < len) { + bufline[j] = newLine++; + bufcolumn[j] = newCol + columnDiff; + + while (i++ < len) { + if (bufline[j = start % bufsize] != bufline[++start % bufsize]) { + bufline[j] = newLine++; + } else { + bufline[j] = newLine; + } + } + } + + line = bufline[j]; + column = bufcolumn[j]; + } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/parse/xml/SchemaParser.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/parse/xml/SchemaParser.java index 0b168fb95ed..c6b326a8de5 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/parse/xml/SchemaParser.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/parse/xml/SchemaParser.java @@ -23,7 +23,7 @@ * questions. */ /* - * Copyright (C) 2004-2011 + * Copyright (C) 2004-2012 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -91,1594 +91,1783 @@ import org.xml.sax.helpers.DefaultHandler; class SchemaParser { - private static final String relaxngURIPrefix = - WellKnownNamespaces.RELAX_NG.substring(0, WellKnownNamespaces.RELAX_NG.lastIndexOf('/') + 1); - static final String relaxng10URI = WellKnownNamespaces.RELAX_NG; - private static final Localizer localizer = new Localizer(new Localizer(Parseable.class),SchemaParser.class); - - private String relaxngURI; - private final XMLReader xr; - private final ErrorHandler eh; - private final SchemaBuilder schemaBuilder; - /** - * The value of the {@link SchemaBuilder#getNameClassBuilder()} - * for the {@link #schemaBuilder} object. - */ - private final NameClassBuilder nameClassBuilder; - private ParsedPattern startPattern; - private Locator locator; - private final XmlBaseHandler xmlBaseHandler = new XmlBaseHandler(); - private final ContextImpl context = new ContextImpl(); - - private boolean hadError = false; - - private Hashtable patternTable; - private Hashtable nameClassTable; - - static class PrefixMapping { - final String prefix; - final String uri; - final PrefixMapping next; - - PrefixMapping(String prefix, String uri, PrefixMapping next) { - this.prefix = prefix; - this.uri = uri; - this.next = next; - } - } - - static abstract class AbstractContext extends DtdContext implements Context { - PrefixMapping prefixMapping; - - AbstractContext() { - prefixMapping = new PrefixMapping("xml", WellKnownNamespaces.XML, null); - } - - AbstractContext(AbstractContext context) { - super(context); - prefixMapping = context.prefixMapping; - } - - public String resolveNamespacePrefix(String prefix) { - for (PrefixMapping p = prefixMapping; p != null; p = p.next) - if (p.prefix.equals(prefix)) - return p.uri; - return null; - } - - public Enumeration prefixes() { - Vector v = new Vector(); - for (PrefixMapping p = prefixMapping; p != null; p = p.next) { - if (!v.contains(p.prefix)) - v.addElement(p.prefix); - } - return v.elements(); - } - - public Context copy() { - return new SavedContext(this); - } - } - - static class SavedContext extends AbstractContext { - private final String baseUri; - SavedContext(AbstractContext context) { - super(context); - this.baseUri = context.getBaseUri(); - } - - public String getBaseUri() { - return baseUri; - } - } - - class ContextImpl extends AbstractContext { - public String getBaseUri() { - return xmlBaseHandler.getBaseUri(); - } - } - - static interface CommentHandler { - void comment(String value); - } - - abstract class Handler implements ContentHandler, CommentHandler { - CommentList comments; - - CommentList getComments() { - CommentList tem = comments; - comments = null; - return tem; - } - - public void comment(String value) { - if (comments == null) - comments = schemaBuilder.makeCommentList(); - comments.addComment(value, makeLocation()); - } - public void processingInstruction(String target, String date) { } - public void skippedEntity(String name) { } - public void ignorableWhitespace(char[] ch, int start, int len) { } - public void startDocument() { } - public void endDocument() { } - public void startPrefixMapping(String prefix, String uri) { - context.prefixMapping = new PrefixMapping(prefix, uri, context.prefixMapping); - } - - public void endPrefixMapping(String prefix) { - context.prefixMapping = context.prefixMapping.next; - } - - public void setDocumentLocator(Locator loc) { - locator = loc; - xmlBaseHandler.setLocator(loc); - } - } - - abstract class State extends Handler { - State parent; - String nsInherit; - String ns; - String datatypeLibrary; + private static final String relaxngURIPrefix = + WellKnownNamespaces.RELAX_NG.substring(0, WellKnownNamespaces.RELAX_NG.lastIndexOf('/') + 1); + static final String relaxng10URI = WellKnownNamespaces.RELAX_NG; + private static final Localizer localizer = new Localizer(new Localizer(Parseable.class), SchemaParser.class); + private String relaxngURI; + private final XMLReader xr; + private final ErrorHandler eh; + private final SchemaBuilder schemaBuilder; /** - * The current scope, or null if there's none. + * The value of the {@link SchemaBuilder#getNameClassBuilder()} for the + * {@link #schemaBuilder} object. */ - Scope scope; - Location startLocation; - Annotations annotations; - - void set() { - xr.setContentHandler(this); - } - - abstract State create(); - abstract State createChildState(String localName) throws SAXException; - - - void setParent(State parent) { - this.parent = parent; - this.nsInherit = parent.getNs(); - this.datatypeLibrary = parent.datatypeLibrary; - this.scope = parent.scope; - this.startLocation = makeLocation(); - if (parent.comments != null) { - annotations = schemaBuilder.makeAnnotations(parent.comments, getContext()); - parent.comments = null; - } - else if (parent instanceof RootState) - annotations = schemaBuilder.makeAnnotations(null, getContext()); - } - - String getNs() { - return ns == null ? nsInherit : ns; - } - - boolean isRelaxNGElement(String uri) throws SAXException { - return uri.equals(relaxngURI); - } - - public void startElement(String namespaceURI, - String localName, - String qName, - Attributes atts) throws SAXException { - xmlBaseHandler.startElement(); - if (isRelaxNGElement(namespaceURI)) { - State state = createChildState(localName); - if (state == null) { - xr.setContentHandler(new Skipper(this)); - return; - } - state.setParent(this); - state.set(); - state.attributes(atts); - } - else { - checkForeignElement(); - ForeignElementHandler feh = new ForeignElementHandler(this, getComments()); - feh.startElement(namespaceURI, localName, qName, atts); - xr.setContentHandler(feh); - } - } - - public void endElement(String namespaceURI, - String localName, - String qName) throws SAXException { - xmlBaseHandler.endElement(); - parent.set(); - end(); - } - - void setName(String name) throws SAXException { - error("illegal_name_attribute"); - } - - void setOtherAttribute(String name, String value) throws SAXException { - error("illegal_attribute_ignored", name); - } - - void endAttributes() throws SAXException { - } - - void checkForeignElement() throws SAXException { - } - - void attributes(Attributes atts) throws SAXException { - int len = atts.getLength(); - for (int i = 0; i < len; i++) { - String uri = atts.getURI(i); - if (uri.length() == 0) { - String name = atts.getLocalName(i); - if (name.equals("name")) - setName(atts.getValue(i).trim()); - else if (name.equals("ns")) - ns = atts.getValue(i); - else if (name.equals("datatypeLibrary")) { - datatypeLibrary = atts.getValue(i); - checkUri(datatypeLibrary); - if (!datatypeLibrary.equals("") - && !Uri.isAbsolute(datatypeLibrary)) - error("relative_datatype_library"); - if (Uri.hasFragmentId(datatypeLibrary)) - error("fragment_identifier_datatype_library"); - datatypeLibrary = Uri.escapeDisallowedChars(datatypeLibrary); - } - else - setOtherAttribute(name, atts.getValue(i)); - } - else if (uri.equals(relaxngURI)) - error("qualified_attribute", atts.getLocalName(i)); - else if (uri.equals(WellKnownNamespaces.XML) - && atts.getLocalName(i).equals("base")) - xmlBaseHandler.xmlBaseAttribute(atts.getValue(i)); - else { - if (annotations == null) - annotations = schemaBuilder.makeAnnotations(null, getContext()); - annotations.addAttribute(uri, atts.getLocalName(i), findPrefix(atts.getQName(i), uri), - atts.getValue(i), startLocation); - } - } - endAttributes(); - } - - abstract void end() throws SAXException; - - void endChild(ParsedPattern pattern) { - // XXX cannot happen; throw exception - } - - void endChild(ParsedNameClass nc) { - // XXX cannot happen; throw exception - } - - public void startDocument() { } - public void endDocument() { - if (comments != null && startPattern != null) { - startPattern = schemaBuilder.commentAfter(startPattern, comments); - comments = null; - } - } - - public void characters(char[] ch, int start, int len) throws SAXException { - for (int i = 0; i < len; i++) { - switch(ch[start + i]) { - case ' ': - case '\r': - case '\n': - case '\t': - break; - default: - error("illegal_characters_ignored"); - break; - } - } - } - - boolean isPatternNamespaceURI(String s) { - return s.equals(relaxngURI); - } - - void endForeignChild(ParsedElementAnnotation ea) { - if (annotations == null) - annotations = schemaBuilder.makeAnnotations(null, getContext()); - annotations.addElement(ea); - } - - void mergeLeadingComments() { - if (comments != null) { - if (annotations == null) - annotations = schemaBuilder.makeAnnotations(comments, getContext()); - else - annotations.addLeadingComment(comments); - comments = null; - } - } - } - - class ForeignElementHandler extends Handler { - final State nextState; - ElementAnnotationBuilder builder; - final Stack builderStack = new Stack(); - StringBuffer textBuf; - Location textLoc; - - ForeignElementHandler(State nextState, CommentList comments) { - this.nextState = nextState; - this.comments = comments; - } - - public void startElement(String namespaceURI, String localName, - String qName, Attributes atts) { - flushText(); - if (builder != null) - builderStack.push(builder); - Location loc = makeLocation(); - builder = schemaBuilder.makeElementAnnotationBuilder(namespaceURI, - localName, - findPrefix(qName, namespaceURI), - loc, - getComments(), - getContext()); - int len = atts.getLength(); - for (int i = 0; i < len; i++) { - String uri = atts.getURI(i); - builder.addAttribute(uri, atts.getLocalName(i), findPrefix(atts.getQName(i), uri), - atts.getValue(i), loc); - } - } - - public void endElement(String namespaceURI, String localName, - String qName) { - flushText(); - if (comments != null) - builder.addComment(getComments()); - ParsedElementAnnotation ea = builder.makeElementAnnotation(); - if (builderStack.empty()) { - nextState.endForeignChild(ea); - nextState.set(); - } - else { - builder = (ElementAnnotationBuilder)builderStack.pop(); - builder.addElement(ea); - } - } - - public void characters(char ch[], int start, int length) { - if (textBuf == null) - textBuf = new StringBuffer(); - textBuf.append(ch, start, length); - if (textLoc == null) - textLoc = makeLocation(); - } - - public void comment(String value) { - flushText(); - super.comment(value); - } - - void flushText() { - if (textBuf != null && textBuf.length() != 0) { - builder.addText(textBuf.toString(), textLoc, getComments()); - textBuf.setLength(0); - } - textLoc = null; - } - } - - class Skipper extends DefaultHandler implements CommentHandler { - int level = 1; - final State nextState; - - Skipper(State nextState) { - this.nextState = nextState; - } - - public void startElement(String namespaceURI, - String localName, - String qName, - Attributes atts) throws SAXException { - ++level; - } - - public void endElement(String namespaceURI, - String localName, - String qName) throws SAXException { - if (--level == 0) - nextState.set(); - } - - public void comment(String value) { - } - } - - abstract class EmptyContentState extends State { - - State createChildState(String localName) throws SAXException { - error("expected_empty", localName); - return null; - } - - abstract ParsedPattern makePattern() throws SAXException; - - void end() throws SAXException { - if (comments != null) { - if (annotations == null) - annotations = schemaBuilder.makeAnnotations(null, getContext()); - annotations.addComment(comments); - comments = null; - } - parent.endChild(makePattern()); - } - } - - static private final int INIT_CHILD_ALLOC = 5; - - abstract class PatternContainerState extends State { - List childPatterns; - - State createChildState(String localName) throws SAXException { - State state = (State)patternTable.get(localName); - if (state == null) { - error("expected_pattern", localName); - return null; - } - return state.create(); - } - - ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { - if (patterns.size() == 1 && anno == null) - return patterns.get(0); - return schemaBuilder.makeGroup(patterns, loc, anno); - } - - void endChild(ParsedPattern pattern) { - if (childPatterns == null) - childPatterns = new ArrayList(INIT_CHILD_ALLOC); - childPatterns.add(pattern); - } - - void endForeignChild(ParsedElementAnnotation ea) { - if (childPatterns == null) - super.endForeignChild(ea); - else { - int idx = childPatterns.size()-1; - childPatterns.set(idx, schemaBuilder.annotateAfter(childPatterns.get(idx), ea)); - } - } - - void end() throws SAXException { - if (childPatterns == null) { - error("missing_children"); - endChild(schemaBuilder.makeErrorPattern()); - } - if (comments != null) { - int idx = childPatterns.size()-1; - childPatterns.set(idx,schemaBuilder.commentAfter(childPatterns.get(idx), comments)); - comments = null; - } - sendPatternToParent(buildPattern(childPatterns, startLocation, annotations)); - } - - void sendPatternToParent(ParsedPattern p) { - parent.endChild(p); - } - } - - class GroupState extends PatternContainerState { - State create() { - return new GroupState(); - } - } - - class ZeroOrMoreState extends PatternContainerState { - State create() { - return new ZeroOrMoreState(); - } - - ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { - return schemaBuilder.makeZeroOrMore(super.buildPattern(patterns, loc, null), loc, anno); - } - } - - class OneOrMoreState extends PatternContainerState { - State create() { - return new OneOrMoreState(); - } - ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { - return schemaBuilder.makeOneOrMore(super.buildPattern(patterns, loc, null), loc, anno); - } - } - - class OptionalState extends PatternContainerState { - State create() { - return new OptionalState(); - } - ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { - return schemaBuilder.makeOptional(super.buildPattern(patterns, loc, null), loc, anno); - } - } - - class ListState extends PatternContainerState { - State create() { - return new ListState(); - } - ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { - return schemaBuilder.makeList(super.buildPattern(patterns, loc, null), loc, anno); - } - } - - class ChoiceState extends PatternContainerState { - State create() { - return new ChoiceState(); - } - ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { - return schemaBuilder.makeChoice(patterns, loc, anno); - } - } - - class InterleaveState extends PatternContainerState { - State create() { - return new InterleaveState(); - } - ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) { - return schemaBuilder.makeInterleave(patterns, loc, anno); - } - } - - class MixedState extends PatternContainerState { - State create() { - return new MixedState(); - } - ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { - return schemaBuilder.makeMixed(super.buildPattern(patterns, loc, null), loc, anno); - } - } - - static interface NameClassRef { - void setNameClass(ParsedNameClass nc); - } - - class ElementState extends PatternContainerState implements NameClassRef { - ParsedNameClass nameClass; - boolean nameClassWasAttribute; - String name; - - void setName(String name) { - this.name = name; - } - - public void setNameClass(ParsedNameClass nc) { - nameClass = nc; - } - - void endAttributes() throws SAXException { - if (name != null) { - nameClass = expandName(name, getNs(), null); - nameClassWasAttribute = true; - } - else - new NameClassChildState(this, this).set(); - } - - State create() { - return new ElementState(); - } - - ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { - return schemaBuilder.makeElement(nameClass, super.buildPattern(patterns, loc, null), loc, anno); - } - - void endForeignChild(ParsedElementAnnotation ea) { - if (nameClassWasAttribute || childPatterns!=null || nameClass == null) - super.endForeignChild(ea); - else - nameClass = nameClassBuilder.annotateAfter(nameClass, ea); - } - } - - class RootState extends PatternContainerState { - IncludedGrammar grammar; - - RootState() { - } - - RootState(IncludedGrammar grammar, Scope scope, String ns) { - this.grammar = grammar; - this.scope = scope; - this.nsInherit = ns; - this.datatypeLibrary = ""; - } - - State create() { - return new RootState(); - } - - State createChildState(String localName) throws SAXException { - if (grammar == null) - return super.createChildState(localName); - if (localName.equals("grammar")) - return new MergeGrammarState(grammar); - error("expected_grammar", localName); - return null; - } - - void checkForeignElement() throws SAXException { - error("root_bad_namespace_uri", WellKnownNamespaces.RELAX_NG); - } - - void endChild(ParsedPattern pattern) { - startPattern = pattern; - } - - boolean isRelaxNGElement(String uri) throws SAXException { - if (!uri.startsWith(relaxngURIPrefix)) - return false; - if (!uri.equals(WellKnownNamespaces.RELAX_NG)) - warning("wrong_uri_version", - WellKnownNamespaces.RELAX_NG.substring(relaxngURIPrefix.length()), - uri.substring(relaxngURIPrefix.length())); - relaxngURI = uri; - return true; - } - - } - - class NotAllowedState extends EmptyContentState { - State create() { - return new NotAllowedState(); - } - - ParsedPattern makePattern() { - return schemaBuilder.makeNotAllowed(startLocation, annotations); - } - } - - class EmptyState extends EmptyContentState { - State create() { - return new EmptyState(); - } - - ParsedPattern makePattern() { - return schemaBuilder.makeEmpty(startLocation, annotations); - } - } - - class TextState extends EmptyContentState { - State create() { - return new TextState(); - } - - ParsedPattern makePattern() { - return schemaBuilder.makeText(startLocation, annotations); - } - } - - class ValueState extends EmptyContentState { - final StringBuffer buf = new StringBuffer(); - String type; - - State create() { - return new ValueState(); - } - - void setOtherAttribute(String name, String value) throws SAXException { - if (name.equals("type")) - type = checkNCName(value.trim()); - else - super.setOtherAttribute(name, value); - } - - public void characters(char[] ch, int start, int len) { - buf.append(ch, start, len); - } - - void checkForeignElement() throws SAXException { - error("value_contains_foreign_element"); - } - - ParsedPattern makePattern() throws SAXException { - if (type == null) - return makePattern("", "token"); - else - return makePattern(datatypeLibrary, type); - } - - void end() throws SAXException { - mergeLeadingComments(); - super.end(); - } - - ParsedPattern makePattern(String datatypeLibrary, String type) { - return schemaBuilder.makeValue(datatypeLibrary, - type, - buf.toString(), - getContext(), - getNs(), - startLocation, - annotations); - } - - } - - class DataState extends State { - String type; - ParsedPattern except = null; - DataPatternBuilder dpb = null; - - State create() { - return new DataState(); - } - - State createChildState(String localName) throws SAXException { - if (localName.equals("param")) { - if (except != null) - error("param_after_except"); - return new ParamState(dpb); - } - if (localName.equals("except")) { - if (except != null) - error("multiple_except"); - return new ChoiceState(); - } - error("expected_param_except", localName); - return null; - } - - void setOtherAttribute(String name, String value) throws SAXException { - if (name.equals("type")) - type = checkNCName(value.trim()); - else - super.setOtherAttribute(name, value); - } - - void endAttributes() throws SAXException { - if (type == null) - error("missing_type_attribute"); - else - dpb = schemaBuilder.makeDataPatternBuilder(datatypeLibrary, type, startLocation); - } - - void endForeignChild(ParsedElementAnnotation ea) { - dpb.annotation(ea); - } - - void end() throws SAXException { - ParsedPattern p; - if (dpb != null) { - if (except != null) - p = dpb.makePattern(except, startLocation, annotations); - else - p = dpb.makePattern(startLocation, annotations); - } - else - p = schemaBuilder.makeErrorPattern(); - // XXX need to capture comments - parent.endChild(p); - } - - void endChild(ParsedPattern pattern) { - except = pattern; - } - - } - - class ParamState extends State { - private final StringBuffer buf = new StringBuffer(); - private final DataPatternBuilder dpb; - private String name; - - ParamState(DataPatternBuilder dpb) { - this.dpb = dpb; - } - - State create() { - return new ParamState(null); - } - - void setName(String name) throws SAXException { - this.name = checkNCName(name); - } - - void endAttributes() throws SAXException { - if (name == null) - error("missing_name_attribute"); - } - - State createChildState(String localName) throws SAXException { - error("expected_empty", localName); - return null; - } - - public void characters(char[] ch, int start, int len) { - buf.append(ch, start, len); - } - - void checkForeignElement() throws SAXException { - error("param_contains_foreign_element"); - } - - void end() throws SAXException { - if (name == null) - return; - if (dpb == null) - return; - mergeLeadingComments(); - dpb.addParam(name, buf.toString(), getContext(), getNs(), startLocation, annotations); - } - } - - class AttributeState extends PatternContainerState implements NameClassRef { - ParsedNameClass nameClass; - boolean nameClassWasAttribute; - String name; - - State create() { - return new AttributeState(); - } - - void setName(String name) { - this.name = name; - } - - public void setNameClass(ParsedNameClass nc) { - nameClass = nc; - } - - void endAttributes() throws SAXException { - if (name != null) { - String nsUse; - if (ns != null) - nsUse = ns; - else - nsUse = ""; - nameClass = expandName(name, nsUse, null); - nameClassWasAttribute = true; - } - else - new NameClassChildState(this, this).set(); - } - - void endForeignChild(ParsedElementAnnotation ea) { - if (nameClassWasAttribute || childPatterns!=null || nameClass == null) - super.endForeignChild(ea); - else - nameClass = nameClassBuilder.annotateAfter(nameClass, ea); - } - - void end() throws SAXException { - if (childPatterns == null) - endChild(schemaBuilder.makeText(startLocation, null)); - super.end(); - } - - ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { - return schemaBuilder.makeAttribute(nameClass, super.buildPattern(patterns, loc, null), loc, anno); - } - - State createChildState(String localName) throws SAXException { - State tem = super.createChildState(localName); - if (tem != null && childPatterns!=null) - error("attribute_multi_pattern"); - return tem; - } - - } - - abstract class SinglePatternContainerState extends PatternContainerState { - State createChildState(String localName) throws SAXException { - if (childPatterns==null) - return super.createChildState(localName); - error("too_many_children"); - return null; - } - } - - class GrammarSectionState extends State { - GrammarSection section; - - GrammarSectionState() { } - - GrammarSectionState(GrammarSection section) { - this.section = section; - } - - State create() { - return new GrammarSectionState(null); - } - - State createChildState(String localName) throws SAXException { - if (localName.equals("define")) - return new DefineState(section); - if (localName.equals("start")) - return new StartState(section); - if (localName.equals("include")) { - Include include = section.makeInclude(); - if (include != null) - return new IncludeState(include); - } - if (localName.equals("div")) - return new DivState(section.makeDiv()); - error("expected_define", localName); - // XXX better errors - return null; - } - - void end() throws SAXException { - if (comments != null) { - section.topLevelComment(comments); - comments = null; - } - } - - void endForeignChild(ParsedElementAnnotation ea) { - section.topLevelAnnotation(ea); - } - } - - class DivState extends GrammarSectionState { - final Div div; - DivState(Div div) { - super(div); - this.div = div; - } - - void end() throws SAXException { - super.end(); - div.endDiv(startLocation, annotations); - } - } - - class IncludeState extends GrammarSectionState { - String href; - final Include include; - - IncludeState(Include include) { - super(include); - this.include = include; - } - - void setOtherAttribute(String name, String value) throws SAXException { - if (name.equals("href")) { - href = value; - checkUri(href); - } - else - super.setOtherAttribute(name, value); - } - - void endAttributes() throws SAXException { - if (href == null) - error("missing_href_attribute"); - else - href = resolve(href); - } - - void end() throws SAXException { - super.end(); - if (href != null) { - try { - include.endInclude(parseable, href, getNs(), startLocation, annotations); - } - catch (IllegalSchemaException e) { - } - } - } - } - - class MergeGrammarState extends GrammarSectionState { - final IncludedGrammar grammar; - MergeGrammarState(IncludedGrammar grammar) { - super(grammar); - this.grammar = grammar; - } - - void end() throws SAXException { - super.end(); - parent.endChild(grammar.endIncludedGrammar(startLocation, annotations)); - } - } - - class GrammarState extends GrammarSectionState { - Grammar grammar; - - void setParent(State parent) { - super.setParent(parent); - grammar = schemaBuilder.makeGrammar(scope); - section = grammar; - scope = grammar; - } - - State create() { - return new GrammarState(); - } - - void end() throws SAXException { - super.end(); - parent.endChild(grammar.endGrammar(startLocation, annotations)); - } - } - - class RefState extends EmptyContentState { - String name; - - State create() { - return new RefState(); - } - - - void endAttributes() throws SAXException { - if (name == null) - error("missing_name_attribute"); - } - - void setName(String name) throws SAXException { - this.name = checkNCName(name); - } - - ParsedPattern makePattern() throws SAXException { - if (name == null) - return schemaBuilder.makeErrorPattern(); - if(scope==null) { - error("ref_outside_grammar",name); - return schemaBuilder.makeErrorPattern(); - } else - return scope.makeRef(name, startLocation, annotations); - } - } - - class ParentRefState extends RefState { - State create() { - return new ParentRefState(); - } - - ParsedPattern makePattern() throws SAXException { - if (name == null) - return schemaBuilder.makeErrorPattern(); - if(scope==null) { - error("parent_ref_outside_grammar",name); - return schemaBuilder.makeErrorPattern(); - } else - return scope.makeParentRef(name, startLocation, annotations); - } - } - - class ExternalRefState extends EmptyContentState { - String href; - ParsedPattern includedPattern; - - State create() { - return new ExternalRefState(); - } - - void setOtherAttribute(String name, String value) throws SAXException { - if (name.equals("href")) { - href = value; - checkUri(href); - } - else - super.setOtherAttribute(name, value); - } - - void endAttributes() throws SAXException { - if (href == null) - error("missing_href_attribute"); - else - href = resolve(href); - } - - ParsedPattern makePattern() { - if (href != null) { - try { - return schemaBuilder.makeExternalRef(parseable, - href, - getNs(), - scope, - startLocation, - annotations); - } - catch (IllegalSchemaException e) { } - } - return schemaBuilder.makeErrorPattern(); - } - } - - abstract class DefinitionState extends PatternContainerState { - GrammarSection.Combine combine = null; - final GrammarSection section; - - DefinitionState(GrammarSection section) { - this.section = section; - } - - void setOtherAttribute(String name, String value) throws SAXException { - if (name.equals("combine")) { - value = value.trim(); - if (value.equals("choice")) - combine = GrammarSection.COMBINE_CHOICE; - else if (value.equals("interleave")) - combine = GrammarSection.COMBINE_INTERLEAVE; - else - error("combine_attribute_bad_value", value); - } - else - super.setOtherAttribute(name, value); - } - - ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { - return super.buildPattern(patterns, loc, null); - } - } - - class DefineState extends DefinitionState { - String name; - - DefineState(GrammarSection section) { - super(section); - } - - State create() { - return new DefineState(null); - } - - void setName(String name) throws SAXException { - this.name = checkNCName(name); - } - - void endAttributes() throws SAXException { - if (name == null) - error("missing_name_attribute"); - } - - void sendPatternToParent(ParsedPattern p) { - if (name != null) - section.define(name, combine, p, startLocation, annotations); - } - - } - - class StartState extends DefinitionState { - - StartState(GrammarSection section) { - super(section); - } - - State create() { - return new StartState(null); - } - - void sendPatternToParent(ParsedPattern p) { - section.define(GrammarSection.START, combine, p, startLocation, annotations); - } - - State createChildState(String localName) throws SAXException { - State tem = super.createChildState(localName); - if (tem != null && childPatterns!=null) - error("start_multi_pattern"); - return tem; - } - - } - - abstract class NameClassContainerState extends State { - State createChildState(String localName) throws SAXException { - State state = (State)nameClassTable.get(localName); - if (state == null) { - error("expected_name_class", localName); - return null; - } - return state.create(); - } - } - - class NameClassChildState extends NameClassContainerState { - final State prevState; - final NameClassRef nameClassRef; - - State create() { - return null; - } - - NameClassChildState(State prevState, NameClassRef nameClassRef) { - this.prevState = prevState; - this.nameClassRef = nameClassRef; - setParent(prevState.parent); - this.ns = prevState.ns; - } - - void endChild(ParsedNameClass nameClass) { - nameClassRef.setNameClass(nameClass); - prevState.set(); - } - - void endForeignChild(ParsedElementAnnotation ea) { - prevState.endForeignChild(ea); - } - - void end() throws SAXException { - nameClassRef.setNameClass(nameClassBuilder.makeErrorNameClass()); - error("missing_name_class"); - prevState.set(); - prevState.end(); - } - } - - abstract class NameClassBaseState extends State { - - abstract ParsedNameClass makeNameClass() throws SAXException; - - void end() throws SAXException { - parent.endChild(makeNameClass()); - } - } - - class NameState extends NameClassBaseState { - final StringBuffer buf = new StringBuffer(); - - State createChildState(String localName) throws SAXException { - error("expected_name", localName); - return null; - } - - State create() { - return new NameState(); - } - - public void characters(char[] ch, int start, int len) { - buf.append(ch, start, len); - } - - void checkForeignElement() throws SAXException { - error("name_contains_foreign_element"); - } - - ParsedNameClass makeNameClass() throws SAXException { - mergeLeadingComments(); - return expandName(buf.toString().trim(), getNs(), annotations); - } - - } - - private static final int PATTERN_CONTEXT = 0; - private static final int ANY_NAME_CONTEXT = 1; - private static final int NS_NAME_CONTEXT = 2; -private SAXParseable parseable; - - class AnyNameState extends NameClassBaseState { - ParsedNameClass except = null; - - State create() { - return new AnyNameState(); - } - - State createChildState(String localName) throws SAXException { - if (localName.equals("except")) { - if (except != null) - error("multiple_except"); - return new NameClassChoiceState(getContext()); - } - error("expected_except", localName); - return null; - } - - int getContext() { - return ANY_NAME_CONTEXT; - } - - ParsedNameClass makeNameClass() { - if (except == null) - return makeNameClassNoExcept(); - else - return makeNameClassExcept(except); - } - - ParsedNameClass makeNameClassNoExcept() { - return nameClassBuilder.makeAnyName(startLocation, annotations); - } - - ParsedNameClass makeNameClassExcept(ParsedNameClass except) { - return nameClassBuilder.makeAnyName(except, startLocation, annotations); - } - - void endChild(ParsedNameClass nameClass) { - except = nameClass; - } - - } - - class NsNameState extends AnyNameState { - State create() { - return new NsNameState(); - } - - ParsedNameClass makeNameClassNoExcept() { - return nameClassBuilder.makeNsName(getNs(), null, null); - } - - ParsedNameClass makeNameClassExcept(ParsedNameClass except) { - return nameClassBuilder.makeNsName(getNs(), except, null, null); - } - - int getContext() { - return NS_NAME_CONTEXT; - } - - } - - class NameClassChoiceState extends NameClassContainerState { - private ParsedNameClass[] nameClasses; - private int nNameClasses; - private int context; - - NameClassChoiceState() { - this.context = PATTERN_CONTEXT; - } - - NameClassChoiceState(int context) { - this.context = context; - } - - void setParent(State parent) { - super.setParent(parent); - if (parent instanceof NameClassChoiceState) - this.context = ((NameClassChoiceState)parent).context; - } - - State create() { - return new NameClassChoiceState(); - } - - State createChildState(String localName) throws SAXException { - if (localName.equals("anyName")) { - if (context >= ANY_NAME_CONTEXT) { - error(context == ANY_NAME_CONTEXT - ? "any_name_except_contains_any_name" - : "ns_name_except_contains_any_name"); - return null; - } - } - else if (localName.equals("nsName")) { - if (context == NS_NAME_CONTEXT) { - error("ns_name_except_contains_ns_name"); - return null; - } - } - return super.createChildState(localName); - } - - void endChild(ParsedNameClass nc) { - if (nameClasses == null) - nameClasses = new ParsedNameClass[INIT_CHILD_ALLOC]; - else if (nNameClasses >= nameClasses.length) { - ParsedNameClass[] newNameClasses = new ParsedNameClass[nameClasses.length * 2]; - System.arraycopy(nameClasses, 0, newNameClasses, 0, nameClasses.length); - nameClasses = newNameClasses; - } - nameClasses[nNameClasses++] = nc; - } - - void endForeignChild(ParsedElementAnnotation ea) { - if (nNameClasses == 0) - super.endForeignChild(ea); - else - nameClasses[nNameClasses - 1] = nameClassBuilder.annotateAfter(nameClasses[nNameClasses - 1], ea); - } - - void end() throws SAXException { - if (nNameClasses == 0) { - error("missing_name_class"); - parent.endChild(nameClassBuilder.makeErrorNameClass()); - return; - } - if (comments != null) { - nameClasses[nNameClasses - 1] = nameClassBuilder.commentAfter(nameClasses[nNameClasses - 1], comments); - comments = null; - } - parent.endChild(nameClassBuilder.makeChoice(Arrays.asList(nameClasses).subList(0,nNameClasses), startLocation, annotations)); - } - } - - private void initPatternTable() { - patternTable = new Hashtable(); - patternTable.put("zeroOrMore", new ZeroOrMoreState()); - patternTable.put("oneOrMore", new OneOrMoreState()); - patternTable.put("optional", new OptionalState()); - patternTable.put("list", new ListState()); - patternTable.put("choice", new ChoiceState()); - patternTable.put("interleave", new InterleaveState()); - patternTable.put("group", new GroupState()); - patternTable.put("mixed", new MixedState()); - patternTable.put("element", new ElementState()); - patternTable.put("attribute", new AttributeState()); - patternTable.put("empty", new EmptyState()); - patternTable.put("text", new TextState()); - patternTable.put("value", new ValueState()); - patternTable.put("data", new DataState()); - patternTable.put("notAllowed", new NotAllowedState()); - patternTable.put("grammar", new GrammarState()); - patternTable.put("ref", new RefState()); - patternTable.put("parentRef", new ParentRefState()); - patternTable.put("externalRef", new ExternalRefState()); - } - - private void initNameClassTable() { - nameClassTable = new Hashtable(); - nameClassTable.put("name", new NameState()); - nameClassTable.put("anyName", new AnyNameState()); - nameClassTable.put("nsName", new NsNameState()); - nameClassTable.put("choice", new NameClassChoiceState()); - } - - public ParsedPattern getParsedPattern() throws IllegalSchemaException { - if (hadError) - throw new IllegalSchemaException(); - return startPattern; - } - - private void error(String key) throws SAXException { - error(key, locator); - } - - private void error(String key, String arg) throws SAXException { - error(key, arg, locator); - } - - void error(String key, String arg1, String arg2) throws SAXException { - error(key, arg1, arg2, locator); - } - - private void error(String key, Locator loc) throws SAXException { - error(new SAXParseException(localizer.message(key), loc)); - } - - private void error(String key, String arg, Locator loc) throws SAXException { - error(new SAXParseException(localizer.message(key, arg), loc)); - } - - private void error(String key, String arg1, String arg2, Locator loc) - throws SAXException { - error(new SAXParseException(localizer.message(key, arg1, arg2), loc)); - } - - private void error(SAXParseException e) throws SAXException { - hadError = true; - if (eh != null) - eh.error(e); - } - - void warning(String key) throws SAXException { - warning(key, locator); - } - - private void warning(String key, String arg) throws SAXException { - warning(key, arg, locator); - } - - private void warning(String key, String arg1, String arg2) throws SAXException { - warning(key, arg1, arg2, locator); - } - - private void warning(String key, Locator loc) throws SAXException { - warning(new SAXParseException(localizer.message(key), loc)); - } - - private void warning(String key, String arg, Locator loc) throws SAXException { - warning(new SAXParseException(localizer.message(key, arg), loc)); - } - - private void warning(String key, String arg1, String arg2, Locator loc) - throws SAXException { - warning(new SAXParseException(localizer.message(key, arg1, arg2), loc)); - } - - private void warning(SAXParseException e) throws SAXException { - if (eh != null) - eh.warning(e); - } - - SchemaParser(SAXParseable parseable, - XMLReader xr, - ErrorHandler eh, - SchemaBuilder schemaBuilder, - IncludedGrammar grammar, - Scope scope, - String inheritedNs) throws SAXException { - this.parseable = parseable; - this.xr = xr; - this.eh = eh; - this.schemaBuilder = schemaBuilder; - this.nameClassBuilder = schemaBuilder.getNameClassBuilder(); - if (eh != null) - xr.setErrorHandler(eh); - xr.setDTDHandler(context); - if (schemaBuilder.usesComments()) { - try { - xr.setProperty("http://xml.org/sax/properties/lexical-handler", new LexicalHandlerImpl()); - } - catch (SAXNotRecognizedException e) { - warning("no_comment_support", xr.getClass().getName()); - } - catch (SAXNotSupportedException e) { - warning("no_comment_support", xr.getClass().getName()); - } - } - initPatternTable(); - initNameClassTable(); - new RootState(grammar, scope, inheritedNs).set(); - } - - - private Context getContext() { - return context; - } - - class LexicalHandlerImpl extends AbstractLexicalHandler { - private boolean inDtd = false; - - public void startDTD(String s, String s1, String s2) throws SAXException { - inDtd = true; - } - - public void endDTD() throws SAXException { - inDtd = false; - } - - public void comment(char[] chars, int start, int length) throws SAXException { - if (!inDtd) - ((CommentHandler)xr.getContentHandler()).comment(new String(chars, start, length)); - } - } - - private ParsedNameClass expandName(String name, String ns, Annotations anno) throws SAXException { - int ic = name.indexOf(':'); - if (ic == -1) - return nameClassBuilder.makeName(ns, checkNCName(name), null, null, anno); - String prefix = checkNCName(name.substring(0, ic)); - String localName = checkNCName(name.substring(ic + 1)); - for (PrefixMapping tem = context.prefixMapping; tem != null; tem = tem.next) - if (tem.prefix.equals(prefix)) - return nameClassBuilder.makeName(tem.uri, localName, prefix, null, anno); - error("undefined_prefix", prefix); - return nameClassBuilder.makeName("", localName, null, null, anno); - } - - private String findPrefix(String qName, String uri) { - String prefix = null; - if (qName == null || qName.equals("")) { - for (PrefixMapping p = context.prefixMapping; p != null; p = p.next) - if (p.uri.equals(uri)) { - prefix = p.prefix; - break; + private final NameClassBuilder nameClassBuilder; + private ParsedPattern startPattern; + private Locator locator; + private final XmlBaseHandler xmlBaseHandler = new XmlBaseHandler(); + private final ContextImpl context = new ContextImpl(); + private boolean hadError = false; + private Hashtable patternTable; + private Hashtable nameClassTable; + + static class PrefixMapping { + + final String prefix; + final String uri; + final PrefixMapping next; + + PrefixMapping(String prefix, String uri, PrefixMapping next) { + this.prefix = prefix; + this.uri = uri; + this.next = next; } } - else { - int off = qName.indexOf(':'); - if (off > 0) - prefix = qName.substring(0, off); + + static abstract class AbstractContext extends DtdContext implements Context { + + PrefixMapping prefixMapping; + + AbstractContext() { + prefixMapping = new PrefixMapping("xml", WellKnownNamespaces.XML, null); + } + + AbstractContext(AbstractContext context) { + super(context); + prefixMapping = context.prefixMapping; + } + + public String resolveNamespacePrefix(String prefix) { + for (PrefixMapping p = prefixMapping; p != null; p = p.next) { + if (p.prefix.equals(prefix)) { + return p.uri; + } + } + return null; + } + + public Enumeration prefixes() { + Vector v = new Vector(); + for (PrefixMapping p = prefixMapping; p != null; p = p.next) { + if (!v.contains(p.prefix)) { + v.addElement(p.prefix); + } + } + return v.elements(); + } + + public Context copy() { + return new SavedContext(this); + } } - return prefix; - } - private String checkNCName(String str) throws SAXException { - if (!Naming.isNcname(str)) - error("invalid_ncname", str); - return str; - } - private String resolve(String systemId) throws SAXException { - if (Uri.hasFragmentId(systemId)) - error("href_fragment_id"); - systemId = Uri.escapeDisallowedChars(systemId); - return Uri.resolve(xmlBaseHandler.getBaseUri(), systemId); - } + static class SavedContext extends AbstractContext { - private Location makeLocation() { - if (locator == null) - return null; - return schemaBuilder.makeLocation(locator.getSystemId(), - locator.getLineNumber(), - locator.getColumnNumber()); - } + private final String baseUri; - private void checkUri(String s) throws SAXException { - if (!Uri.isValid(s)) - error("invalid_uri", s); - } + SavedContext(AbstractContext context) { + super(context); + this.baseUri = context.getBaseUri(); + } + + public String getBaseUri() { + return baseUri; + } + } + + class ContextImpl extends AbstractContext { + + public String getBaseUri() { + return xmlBaseHandler.getBaseUri(); + } + } + + static interface CommentHandler { + + void comment(String value); + } + + abstract class Handler implements ContentHandler, CommentHandler { + + CommentList comments; + + CommentList getComments() { + CommentList tem = comments; + comments = null; + return tem; + } + + public void comment(String value) { + if (comments == null) { + comments = schemaBuilder.makeCommentList(); + } + comments.addComment(value, makeLocation()); + } + + public void processingInstruction(String target, String date) { + } + + public void skippedEntity(String name) { + } + + public void ignorableWhitespace(char[] ch, int start, int len) { + } + + public void startDocument() { + } + + public void endDocument() { + } + + public void startPrefixMapping(String prefix, String uri) { + context.prefixMapping = new PrefixMapping(prefix, uri, context.prefixMapping); + } + + public void endPrefixMapping(String prefix) { + context.prefixMapping = context.prefixMapping.next; + } + + public void setDocumentLocator(Locator loc) { + locator = loc; + xmlBaseHandler.setLocator(loc); + } + } + + abstract class State extends Handler { + + State parent; + String nsInherit; + String ns; + String datatypeLibrary; + /** + * The current scope, or null if there's none. + */ + Scope scope; + Location startLocation; + Annotations annotations; + + void set() { + xr.setContentHandler(this); + } + + abstract State create(); + + abstract State createChildState(String localName) throws SAXException; + + void setParent(State parent) { + this.parent = parent; + this.nsInherit = parent.getNs(); + this.datatypeLibrary = parent.datatypeLibrary; + this.scope = parent.scope; + this.startLocation = makeLocation(); + if (parent.comments != null) { + annotations = schemaBuilder.makeAnnotations(parent.comments, getContext()); + parent.comments = null; + } else if (parent instanceof RootState) { + annotations = schemaBuilder.makeAnnotations(null, getContext()); + } + } + + String getNs() { + return ns == null ? nsInherit : ns; + } + + boolean isRelaxNGElement(String uri) throws SAXException { + return uri.equals(relaxngURI); + } + + public void startElement(String namespaceURI, + String localName, + String qName, + Attributes atts) throws SAXException { + xmlBaseHandler.startElement(); + if (isRelaxNGElement(namespaceURI)) { + State state = createChildState(localName); + if (state == null) { + xr.setContentHandler(new Skipper(this)); + return; + } + state.setParent(this); + state.set(); + state.attributes(atts); + } else { + checkForeignElement(); + ForeignElementHandler feh = new ForeignElementHandler(this, getComments()); + feh.startElement(namespaceURI, localName, qName, atts); + xr.setContentHandler(feh); + } + } + + public void endElement(String namespaceURI, + String localName, + String qName) throws SAXException { + xmlBaseHandler.endElement(); + parent.set(); + end(); + } + + void setName(String name) throws SAXException { + error("illegal_name_attribute"); + } + + void setOtherAttribute(String name, String value) throws SAXException { + error("illegal_attribute_ignored", name); + } + + void endAttributes() throws SAXException { + } + + void checkForeignElement() throws SAXException { + } + + void attributes(Attributes atts) throws SAXException { + int len = atts.getLength(); + for (int i = 0; i < len; i++) { + String uri = atts.getURI(i); + if (uri.length() == 0) { + String name = atts.getLocalName(i); + if (name.equals("name")) { + setName(atts.getValue(i).trim()); + } else if (name.equals("ns")) { + ns = atts.getValue(i); + } else if (name.equals("datatypeLibrary")) { + datatypeLibrary = atts.getValue(i); + checkUri(datatypeLibrary); + if (!datatypeLibrary.equals("") + && !Uri.isAbsolute(datatypeLibrary)) { + error("relative_datatype_library"); + } + if (Uri.hasFragmentId(datatypeLibrary)) { + error("fragment_identifier_datatype_library"); + } + datatypeLibrary = Uri.escapeDisallowedChars(datatypeLibrary); + } else { + setOtherAttribute(name, atts.getValue(i)); + } + } else if (uri.equals(relaxngURI)) { + error("qualified_attribute", atts.getLocalName(i)); + } else if (uri.equals(WellKnownNamespaces.XML) + && atts.getLocalName(i).equals("base")) { + xmlBaseHandler.xmlBaseAttribute(atts.getValue(i)); + } else { + if (annotations == null) { + annotations = schemaBuilder.makeAnnotations(null, getContext()); + } + annotations.addAttribute(uri, atts.getLocalName(i), findPrefix(atts.getQName(i), uri), + atts.getValue(i), startLocation); + } + } + endAttributes(); + } + + abstract void end() throws SAXException; + + void endChild(ParsedPattern pattern) { + // XXX cannot happen; throw exception + } + + void endChild(ParsedNameClass nc) { + // XXX cannot happen; throw exception + } + + @Override + public void startDocument() { + } + + @Override + public void endDocument() { + if (comments != null && startPattern != null) { + startPattern = schemaBuilder.commentAfter(startPattern, comments); + comments = null; + } + } + + public void characters(char[] ch, int start, int len) throws SAXException { + for (int i = 0; i < len; i++) { + switch (ch[start + i]) { + case ' ': + case '\r': + case '\n': + case '\t': + break; + default: + error("illegal_characters_ignored"); + break; + } + } + } + + boolean isPatternNamespaceURI(String s) { + return s.equals(relaxngURI); + } + + void endForeignChild(ParsedElementAnnotation ea) { + if (annotations == null) { + annotations = schemaBuilder.makeAnnotations(null, getContext()); + } + annotations.addElement(ea); + } + + void mergeLeadingComments() { + if (comments != null) { + if (annotations == null) { + annotations = schemaBuilder.makeAnnotations(comments, getContext()); + } else { + annotations.addLeadingComment(comments); + } + comments = null; + } + } + } + + class ForeignElementHandler extends Handler { + + final State nextState; + ElementAnnotationBuilder builder; + final Stack builderStack = new Stack(); + StringBuffer textBuf; + Location textLoc; + + ForeignElementHandler(State nextState, CommentList comments) { + this.nextState = nextState; + this.comments = comments; + } + + public void startElement(String namespaceURI, String localName, + String qName, Attributes atts) { + flushText(); + if (builder != null) { + builderStack.push(builder); + } + Location loc = makeLocation(); + builder = schemaBuilder.makeElementAnnotationBuilder(namespaceURI, + localName, + findPrefix(qName, namespaceURI), + loc, + getComments(), + getContext()); + int len = atts.getLength(); + for (int i = 0; i < len; i++) { + String uri = atts.getURI(i); + builder.addAttribute(uri, atts.getLocalName(i), findPrefix(atts.getQName(i), uri), + atts.getValue(i), loc); + } + } + + public void endElement(String namespaceURI, String localName, + String qName) { + flushText(); + if (comments != null) { + builder.addComment(getComments()); + } + ParsedElementAnnotation ea = builder.makeElementAnnotation(); + if (builderStack.empty()) { + nextState.endForeignChild(ea); + nextState.set(); + } else { + builder = (ElementAnnotationBuilder) builderStack.pop(); + builder.addElement(ea); + } + } + + public void characters(char ch[], int start, int length) { + if (textBuf == null) { + textBuf = new StringBuffer(); + } + textBuf.append(ch, start, length); + if (textLoc == null) { + textLoc = makeLocation(); + } + } + + @Override + public void comment(String value) { + flushText(); + super.comment(value); + } + + void flushText() { + if (textBuf != null && textBuf.length() != 0) { + builder.addText(textBuf.toString(), textLoc, getComments()); + textBuf.setLength(0); + } + textLoc = null; + } + } + + static class Skipper extends DefaultHandler implements CommentHandler { + + int level = 1; + final State nextState; + + Skipper(State nextState) { + this.nextState = nextState; + } + + @Override + public void startElement(String namespaceURI, + String localName, + String qName, + Attributes atts) throws SAXException { + ++level; + } + + @Override + public void endElement(String namespaceURI, + String localName, + String qName) throws SAXException { + if (--level == 0) { + nextState.set(); + } + } + + public void comment(String value) { + } + } + + abstract class EmptyContentState extends State { + + State createChildState(String localName) throws SAXException { + error("expected_empty", localName); + return null; + } + + abstract ParsedPattern makePattern() throws SAXException; + + void end() throws SAXException { + if (comments != null) { + if (annotations == null) { + annotations = schemaBuilder.makeAnnotations(null, getContext()); + } + annotations.addComment(comments); + comments = null; + } + parent.endChild(makePattern()); + } + } + static private final int INIT_CHILD_ALLOC = 5; + + abstract class PatternContainerState extends State { + + List childPatterns; + + State createChildState(String localName) throws SAXException { + State state = (State) patternTable.get(localName); + if (state == null) { + error("expected_pattern", localName); + return null; + } + return state.create(); + } + + ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { + if (patterns.size() == 1 && anno == null) { + return patterns.get(0); + } + return schemaBuilder.makeGroup(patterns, loc, anno); + } + + @Override + void endChild(ParsedPattern pattern) { + if (childPatterns == null) { + childPatterns = new ArrayList(INIT_CHILD_ALLOC); + } + childPatterns.add(pattern); + } + + @Override + void endForeignChild(ParsedElementAnnotation ea) { + // Harshit : Annotation handling should always be taken care of, irrespective of childPatterns being null or not. + super.endForeignChild(ea); + if (childPatterns != null) { + int idx = childPatterns.size() - 1; + childPatterns.set(idx, schemaBuilder.annotateAfter(childPatterns.get(idx), ea)); + } + } + + void end() throws SAXException { + if (childPatterns == null) { + error("missing_children"); + endChild(schemaBuilder.makeErrorPattern()); + } + if (comments != null) { + int idx = childPatterns.size() - 1; + childPatterns.set(idx, schemaBuilder.commentAfter(childPatterns.get(idx), comments)); + comments = null; + } + sendPatternToParent(buildPattern(childPatterns, startLocation, annotations)); + } + + void sendPatternToParent(ParsedPattern p) { + parent.endChild(p); + } + } + + class GroupState extends PatternContainerState { + + State create() { + return new GroupState(); + } + } + + class ZeroOrMoreState extends PatternContainerState { + + State create() { + return new ZeroOrMoreState(); + } + + @Override + ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { + return schemaBuilder.makeZeroOrMore(super.buildPattern(patterns, loc, null), loc, anno); + } + } + + class OneOrMoreState extends PatternContainerState { + + State create() { + return new OneOrMoreState(); + } + + @Override + ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { + return schemaBuilder.makeOneOrMore(super.buildPattern(patterns, loc, null), loc, anno); + } + } + + class OptionalState extends PatternContainerState { + + State create() { + return new OptionalState(); + } + + @Override + ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { + return schemaBuilder.makeOptional(super.buildPattern(patterns, loc, null), loc, anno); + } + } + + class ListState extends PatternContainerState { + + State create() { + return new ListState(); + } + + @Override + ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { + return schemaBuilder.makeList(super.buildPattern(patterns, loc, null), loc, anno); + } + } + + class ChoiceState extends PatternContainerState { + + State create() { + return new ChoiceState(); + } + + @Override + ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { + return schemaBuilder.makeChoice(patterns, loc, anno); + } + } + + class InterleaveState extends PatternContainerState { + + State create() { + return new InterleaveState(); + } + + @Override + ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) { + return schemaBuilder.makeInterleave(patterns, loc, anno); + } + } + + class MixedState extends PatternContainerState { + + State create() { + return new MixedState(); + } + + @Override + ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { + return schemaBuilder.makeMixed(super.buildPattern(patterns, loc, null), loc, anno); + } + } + + static interface NameClassRef { + + void setNameClass(ParsedNameClass nc); + } + + class ElementState extends PatternContainerState implements NameClassRef { + + ParsedNameClass nameClass; + boolean nameClassWasAttribute; + String name; + + @Override + void setName(String name) { + this.name = name; + } + + public void setNameClass(ParsedNameClass nc) { + nameClass = nc; + } + + @Override + void endAttributes() throws SAXException { + if (name != null) { + nameClass = expandName(name, getNs(), null); + nameClassWasAttribute = true; + } else { + new NameClassChildState(this, this).set(); + } + } + + State create() { + return new ElementState(); + } + + @Override + ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { + return schemaBuilder.makeElement(nameClass, super.buildPattern(patterns, loc, null), loc, anno); + } + + @Override + void endForeignChild(ParsedElementAnnotation ea) { + if (nameClassWasAttribute || childPatterns != null || nameClass == null) { + super.endForeignChild(ea); + } else { + nameClass = nameClassBuilder.annotateAfter(nameClass, ea); + } + } + } + + class RootState extends PatternContainerState { + + IncludedGrammar grammar; + + RootState() { + } + + RootState(IncludedGrammar grammar, Scope scope, String ns) { + this.grammar = grammar; + this.scope = scope; + this.nsInherit = ns; + this.datatypeLibrary = ""; + } + + State create() { + return new RootState(); + } + + @Override + State createChildState(String localName) throws SAXException { + if (grammar == null) { + return super.createChildState(localName); + } + if (localName.equals("grammar")) { + return new MergeGrammarState(grammar); + } + error("expected_grammar", localName); + return null; + } + + @Override + void checkForeignElement() throws SAXException { + error("root_bad_namespace_uri", WellKnownNamespaces.RELAX_NG); + } + + @Override + void endChild(ParsedPattern pattern) { + startPattern = pattern; + } + + @Override + boolean isRelaxNGElement(String uri) throws SAXException { + if (!uri.startsWith(relaxngURIPrefix)) { + return false; + } + if (!uri.equals(WellKnownNamespaces.RELAX_NG)) { + warning("wrong_uri_version", + WellKnownNamespaces.RELAX_NG.substring(relaxngURIPrefix.length()), + uri.substring(relaxngURIPrefix.length())); + } + relaxngURI = uri; + return true; + } + } + + class NotAllowedState extends EmptyContentState { + + State create() { + return new NotAllowedState(); + } + + ParsedPattern makePattern() { + return schemaBuilder.makeNotAllowed(startLocation, annotations); + } + } + + class EmptyState extends EmptyContentState { + + State create() { + return new EmptyState(); + } + + ParsedPattern makePattern() { + return schemaBuilder.makeEmpty(startLocation, annotations); + } + } + + class TextState extends EmptyContentState { + + State create() { + return new TextState(); + } + + ParsedPattern makePattern() { + return schemaBuilder.makeText(startLocation, annotations); + } + } + + class ValueState extends EmptyContentState { + + final StringBuffer buf = new StringBuffer(); + String type; + + State create() { + return new ValueState(); + } + + @Override + void setOtherAttribute(String name, String value) throws SAXException { + if (name.equals("type")) { + type = checkNCName(value.trim()); + } else { + super.setOtherAttribute(name, value); + } + } + + @Override + public void characters(char[] ch, int start, int len) { + buf.append(ch, start, len); + } + + @Override + void checkForeignElement() throws SAXException { + error("value_contains_foreign_element"); + } + + ParsedPattern makePattern() throws SAXException { + if (type == null) { + return makePattern("", "token"); + } else { + return makePattern(datatypeLibrary, type); + } + } + + @Override + void end() throws SAXException { + mergeLeadingComments(); + super.end(); + } + + ParsedPattern makePattern(String datatypeLibrary, String type) { + return schemaBuilder.makeValue(datatypeLibrary, + type, + buf.toString(), + getContext(), + getNs(), + startLocation, + annotations); + } + } + + class DataState extends State { + + String type; + ParsedPattern except = null; + DataPatternBuilder dpb = null; + + State create() { + return new DataState(); + } + + State createChildState(String localName) throws SAXException { + if (localName.equals("param")) { + if (except != null) { + error("param_after_except"); + } + return new ParamState(dpb); + } + if (localName.equals("except")) { + if (except != null) { + error("multiple_except"); + } + return new ChoiceState(); + } + error("expected_param_except", localName); + return null; + } + + @Override + void setOtherAttribute(String name, String value) throws SAXException { + if (name.equals("type")) { + type = checkNCName(value.trim()); + } else { + super.setOtherAttribute(name, value); + } + } + + @Override + void endAttributes() throws SAXException { + if (type == null) { + error("missing_type_attribute"); + } else { + dpb = schemaBuilder.makeDataPatternBuilder(datatypeLibrary, type, startLocation); + } + } + + void end() throws SAXException { + ParsedPattern p; + if (dpb != null) { + if (except != null) { + p = dpb.makePattern(except, startLocation, annotations); + } else { + p = dpb.makePattern(startLocation, annotations); + } + } else { + p = schemaBuilder.makeErrorPattern(); + } + // XXX need to capture comments + parent.endChild(p); + } + + @Override + void endChild(ParsedPattern pattern) { + except = pattern; + } + } + + class ParamState extends State { + + private final StringBuffer buf = new StringBuffer(); + private final DataPatternBuilder dpb; + private String name; + + ParamState(DataPatternBuilder dpb) { + this.dpb = dpb; + } + + State create() { + return new ParamState(null); + } + + @Override + void setName(String name) throws SAXException { + this.name = checkNCName(name); + } + + @Override + void endAttributes() throws SAXException { + if (name == null) { + error("missing_name_attribute"); + } + } + + State createChildState(String localName) throws SAXException { + error("expected_empty", localName); + return null; + } + + @Override + public void characters(char[] ch, int start, int len) { + buf.append(ch, start, len); + } + + @Override + void checkForeignElement() throws SAXException { + error("param_contains_foreign_element"); + } + + void end() throws SAXException { + if (name == null) { + return; + } + if (dpb == null) { + return; + } + mergeLeadingComments(); + dpb.addParam(name, buf.toString(), getContext(), getNs(), startLocation, annotations); + } + } + + class AttributeState extends PatternContainerState implements NameClassRef { + + ParsedNameClass nameClass; + boolean nameClassWasAttribute; + String name; + + State create() { + return new AttributeState(); + } + + @Override + void setName(String name) { + this.name = name; + } + + public void setNameClass(ParsedNameClass nc) { + nameClass = nc; + } + + @Override + void endAttributes() throws SAXException { + if (name != null) { + String nsUse; + if (ns != null) { + nsUse = ns; + } else { + nsUse = ""; + } + nameClass = expandName(name, nsUse, null); + nameClassWasAttribute = true; + } else { + new NameClassChildState(this, this).set(); + } + } + + @Override + void endForeignChild(ParsedElementAnnotation ea) { + if (nameClassWasAttribute || childPatterns != null || nameClass == null) { + super.endForeignChild(ea); + } else { + nameClass = nameClassBuilder.annotateAfter(nameClass, ea); + } + } + + @Override + void end() throws SAXException { + if (childPatterns == null) { + endChild(schemaBuilder.makeText(startLocation, null)); + } + super.end(); + } + + @Override + ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { + return schemaBuilder.makeAttribute(nameClass, super.buildPattern(patterns, loc, null), loc, anno); + } + + @Override + State createChildState(String localName) throws SAXException { + State tem = super.createChildState(localName); + if (tem != null && childPatterns != null) { + error("attribute_multi_pattern"); + } + return tem; + } + } + + abstract class SinglePatternContainerState extends PatternContainerState { + + @Override + State createChildState(String localName) throws SAXException { + if (childPatterns == null) { + return super.createChildState(localName); + } + error("too_many_children"); + return null; + } + } + + class GrammarSectionState extends State { + + GrammarSection section; + + GrammarSectionState() { + } + + GrammarSectionState(GrammarSection section) { + this.section = section; + } + + State create() { + return new GrammarSectionState(null); + } + + State createChildState(String localName) throws SAXException { + if (localName.equals("define")) { + return new DefineState(section); + } + if (localName.equals("start")) { + return new StartState(section); + } + if (localName.equals("include")) { + Include include = section.makeInclude(); + if (include != null) { + return new IncludeState(include); + } + } + if (localName.equals("div")) { + return new DivState(section.makeDiv()); + } + error("expected_define", localName); + // XXX better errors + return null; + } + + void end() throws SAXException { + if (comments != null) { + section.topLevelComment(comments); + comments = null; + } + } + + @Override + void endForeignChild(ParsedElementAnnotation ea) { + section.topLevelAnnotation(ea); + } + } + + class DivState extends GrammarSectionState { + + final Div div; + + DivState(Div div) { + super(div); + this.div = div; + } + + @Override + void end() throws SAXException { + super.end(); + div.endDiv(startLocation, annotations); + } + } + + class IncludeState extends GrammarSectionState { + + String href; + final Include include; + + IncludeState(Include include) { + super(include); + this.include = include; + } + + @Override + void setOtherAttribute(String name, String value) throws SAXException { + if (name.equals("href")) { + href = value; + checkUri(href); + } else { + super.setOtherAttribute(name, value); + } + } + + @Override + void endAttributes() throws SAXException { + if (href == null) { + error("missing_href_attribute"); + } else { + href = resolve(href); + } + } + + @Override + void end() throws SAXException { + super.end(); + if (href != null) { + try { + include.endInclude(parseable, href, getNs(), startLocation, annotations); + } catch (IllegalSchemaException e) { + } + } + } + } + + class MergeGrammarState extends GrammarSectionState { + + final IncludedGrammar grammar; + + MergeGrammarState(IncludedGrammar grammar) { + super(grammar); + this.grammar = grammar; + } + + @Override + void end() throws SAXException { + super.end(); + parent.endChild(grammar.endIncludedGrammar(startLocation, annotations)); + } + } + + class GrammarState extends GrammarSectionState { + + Grammar grammar; + + @Override + void setParent(State parent) { + super.setParent(parent); + grammar = schemaBuilder.makeGrammar(scope); + section = grammar; + scope = grammar; + } + + @Override + State create() { + return new GrammarState(); + } + + @Override + void end() throws SAXException { + super.end(); + parent.endChild(grammar.endGrammar(startLocation, annotations)); + } + } + + class RefState extends EmptyContentState { + + String name; + + State create() { + return new RefState(); + } + + @Override + void endAttributes() throws SAXException { + if (name == null) { + error("missing_name_attribute"); + } + } + + @Override + void setName(String name) throws SAXException { + this.name = checkNCName(name); + } + + ParsedPattern makePattern() throws SAXException { + if (name == null) { + return schemaBuilder.makeErrorPattern(); + } + if (scope == null) { + error("ref_outside_grammar", name); + return schemaBuilder.makeErrorPattern(); + } else { + return scope.makeRef(name, startLocation, annotations); + } + } + } + + class ParentRefState extends RefState { + + @Override + State create() { + return new ParentRefState(); + } + + @Override + ParsedPattern makePattern() throws SAXException { + if (name == null) { + return schemaBuilder.makeErrorPattern(); + } + if (scope == null) { + error("parent_ref_outside_grammar", name); + return schemaBuilder.makeErrorPattern(); + } else { + return scope.makeParentRef(name, startLocation, annotations); + } + } + } + + class ExternalRefState extends EmptyContentState { + + String href; + + State create() { + return new ExternalRefState(); + } + + @Override + void setOtherAttribute(String name, String value) throws SAXException { + if (name.equals("href")) { + href = value; + checkUri(href); + } else { + super.setOtherAttribute(name, value); + } + } + + @Override + void endAttributes() throws SAXException { + if (href == null) { + error("missing_href_attribute"); + } else { + href = resolve(href); + } + } + + ParsedPattern makePattern() { + if (href != null) { + try { + return schemaBuilder.makeExternalRef(parseable, + href, + getNs(), + scope, + startLocation, + annotations); + } catch (IllegalSchemaException e) { + } + } + return schemaBuilder.makeErrorPattern(); + } + } + + abstract class DefinitionState extends PatternContainerState { + + GrammarSection.Combine combine = null; + final GrammarSection section; + + DefinitionState(GrammarSection section) { + this.section = section; + } + + @Override + void setOtherAttribute(String name, String value) throws SAXException { + if (name.equals("combine")) { + value = value.trim(); + if (value.equals("choice")) { + combine = GrammarSection.COMBINE_CHOICE; + } else if (value.equals("interleave")) { + combine = GrammarSection.COMBINE_INTERLEAVE; + } else { + error("combine_attribute_bad_value", value); + } + } else { + super.setOtherAttribute(name, value); + } + } + + @Override + ParsedPattern buildPattern(List patterns, Location loc, Annotations anno) throws SAXException { + return super.buildPattern(patterns, loc, null); + } + } + + class DefineState extends DefinitionState { + + String name; + + DefineState(GrammarSection section) { + super(section); + } + + State create() { + return new DefineState(null); + } + + @Override + void setName(String name) throws SAXException { + this.name = checkNCName(name); + } + + @Override + void endAttributes() throws SAXException { + if (name == null) { + error("missing_name_attribute"); + } + } + + @Override + void sendPatternToParent(ParsedPattern p) { + if (name != null) { + section.define(name, combine, p, startLocation, annotations); + } + } + } + + class StartState extends DefinitionState { + + StartState(GrammarSection section) { + super(section); + } + + State create() { + return new StartState(null); + } + + @Override + void sendPatternToParent(ParsedPattern p) { + section.define(GrammarSection.START, combine, p, startLocation, annotations); + } + + @Override + State createChildState(String localName) throws SAXException { + State tem = super.createChildState(localName); + if (tem != null && childPatterns != null) { + error("start_multi_pattern"); + } + return tem; + } + } + + abstract class NameClassContainerState extends State { + + State createChildState(String localName) throws SAXException { + State state = (State) nameClassTable.get(localName); + if (state == null) { + error("expected_name_class", localName); + return null; + } + return state.create(); + } + } + + class NameClassChildState extends NameClassContainerState { + + final State prevState; + final NameClassRef nameClassRef; + + State create() { + return null; + } + + NameClassChildState(State prevState, NameClassRef nameClassRef) { + this.prevState = prevState; + this.nameClassRef = nameClassRef; + setParent(prevState.parent); + this.ns = prevState.ns; + } + + @Override + void endChild(ParsedNameClass nameClass) { + nameClassRef.setNameClass(nameClass); + prevState.set(); + } + + @Override + void endForeignChild(ParsedElementAnnotation ea) { + prevState.endForeignChild(ea); + } + + void end() throws SAXException { + nameClassRef.setNameClass(nameClassBuilder.makeErrorNameClass()); + error("missing_name_class"); + prevState.set(); + prevState.end(); + } + } + + abstract class NameClassBaseState extends State { + + abstract ParsedNameClass makeNameClass() throws SAXException; + + void end() throws SAXException { + parent.endChild(makeNameClass()); + } + } + + class NameState extends NameClassBaseState { + + final StringBuffer buf = new StringBuffer(); + + State createChildState(String localName) throws SAXException { + error("expected_name", localName); + return null; + } + + State create() { + return new NameState(); + } + + @Override + public void characters(char[] ch, int start, int len) { + buf.append(ch, start, len); + } + + @Override + void checkForeignElement() throws SAXException { + error("name_contains_foreign_element"); + } + + ParsedNameClass makeNameClass() throws SAXException { + mergeLeadingComments(); + return expandName(buf.toString().trim(), getNs(), annotations); + } + } + private static final int PATTERN_CONTEXT = 0; + private static final int ANY_NAME_CONTEXT = 1; + private static final int NS_NAME_CONTEXT = 2; + private SAXParseable parseable; + + class AnyNameState extends NameClassBaseState { + + ParsedNameClass except = null; + + State create() { + return new AnyNameState(); + } + + State createChildState(String localName) throws SAXException { + if (localName.equals("except")) { + if (except != null) { + error("multiple_except"); + } + return new NameClassChoiceState(getContext()); + } + error("expected_except", localName); + return null; + } + + int getContext() { + return ANY_NAME_CONTEXT; + } + + ParsedNameClass makeNameClass() { + if (except == null) { + return makeNameClassNoExcept(); + } else { + return makeNameClassExcept(except); + } + } + + ParsedNameClass makeNameClassNoExcept() { + return nameClassBuilder.makeAnyName(startLocation, annotations); + } + + ParsedNameClass makeNameClassExcept(ParsedNameClass except) { + return nameClassBuilder.makeAnyName(except, startLocation, annotations); + } + + @Override + void endChild(ParsedNameClass nameClass) { + except = nameClass; + } + } + + class NsNameState extends AnyNameState { + + @Override + State create() { + return new NsNameState(); + } + + @Override + ParsedNameClass makeNameClassNoExcept() { + return nameClassBuilder.makeNsName(getNs(), null, null); + } + + @Override + ParsedNameClass makeNameClassExcept(ParsedNameClass except) { + return nameClassBuilder.makeNsName(getNs(), except, null, null); + } + + @Override + int getContext() { + return NS_NAME_CONTEXT; + } + } + + class NameClassChoiceState extends NameClassContainerState { + + private ParsedNameClass[] nameClasses; + private int nNameClasses; + private int context; + + NameClassChoiceState() { + this.context = PATTERN_CONTEXT; + } + + NameClassChoiceState(int context) { + this.context = context; + } + + @Override + void setParent(State parent) { + super.setParent(parent); + if (parent instanceof NameClassChoiceState) { + this.context = ((NameClassChoiceState) parent).context; + } + } + + State create() { + return new NameClassChoiceState(); + } + + @Override + State createChildState(String localName) throws SAXException { + if (localName.equals("anyName")) { + if (context >= ANY_NAME_CONTEXT) { + error(context == ANY_NAME_CONTEXT + ? "any_name_except_contains_any_name" + : "ns_name_except_contains_any_name"); + return null; + } + } else if (localName.equals("nsName")) { + if (context == NS_NAME_CONTEXT) { + error("ns_name_except_contains_ns_name"); + return null; + } + } + return super.createChildState(localName); + } + + @Override + void endChild(ParsedNameClass nc) { + if (nameClasses == null) { + nameClasses = new ParsedNameClass[INIT_CHILD_ALLOC]; + } else if (nNameClasses >= nameClasses.length) { + ParsedNameClass[] newNameClasses = new ParsedNameClass[nameClasses.length * 2]; + System.arraycopy(nameClasses, 0, newNameClasses, 0, nameClasses.length); + nameClasses = newNameClasses; + } + nameClasses[nNameClasses++] = nc; + } + + @Override + void endForeignChild(ParsedElementAnnotation ea) { + if (nNameClasses == 0) { + super.endForeignChild(ea); + } else { + nameClasses[nNameClasses - 1] = nameClassBuilder.annotateAfter(nameClasses[nNameClasses - 1], ea); + } + } + + void end() throws SAXException { + if (nNameClasses == 0) { + error("missing_name_class"); + parent.endChild(nameClassBuilder.makeErrorNameClass()); + return; + } + if (comments != null) { + nameClasses[nNameClasses - 1] = nameClassBuilder.commentAfter(nameClasses[nNameClasses - 1], comments); + comments = null; + } + parent.endChild(nameClassBuilder.makeChoice(Arrays.asList(nameClasses).subList(0, nNameClasses), startLocation, annotations)); + } + } + + private void initPatternTable() { + patternTable = new Hashtable(); + patternTable.put("zeroOrMore", new ZeroOrMoreState()); + patternTable.put("oneOrMore", new OneOrMoreState()); + patternTable.put("optional", new OptionalState()); + patternTable.put("list", new ListState()); + patternTable.put("choice", new ChoiceState()); + patternTable.put("interleave", new InterleaveState()); + patternTable.put("group", new GroupState()); + patternTable.put("mixed", new MixedState()); + patternTable.put("element", new ElementState()); + patternTable.put("attribute", new AttributeState()); + patternTable.put("empty", new EmptyState()); + patternTable.put("text", new TextState()); + patternTable.put("value", new ValueState()); + patternTable.put("data", new DataState()); + patternTable.put("notAllowed", new NotAllowedState()); + patternTable.put("grammar", new GrammarState()); + patternTable.put("ref", new RefState()); + patternTable.put("parentRef", new ParentRefState()); + patternTable.put("externalRef", new ExternalRefState()); + } + + private void initNameClassTable() { + nameClassTable = new Hashtable(); + nameClassTable.put("name", new NameState()); + nameClassTable.put("anyName", new AnyNameState()); + nameClassTable.put("nsName", new NsNameState()); + nameClassTable.put("choice", new NameClassChoiceState()); + } + + public ParsedPattern getParsedPattern() throws IllegalSchemaException { + if (hadError) { + throw new IllegalSchemaException(); + } + return startPattern; + } + + private void error(String key) throws SAXException { + error(key, locator); + } + + private void error(String key, String arg) throws SAXException { + error(key, arg, locator); + } + + void error(String key, String arg1, String arg2) throws SAXException { + error(key, arg1, arg2, locator); + } + + private void error(String key, Locator loc) throws SAXException { + error(new SAXParseException(localizer.message(key), loc)); + } + + private void error(String key, String arg, Locator loc) throws SAXException { + error(new SAXParseException(localizer.message(key, arg), loc)); + } + + private void error(String key, String arg1, String arg2, Locator loc) + throws SAXException { + error(new SAXParseException(localizer.message(key, arg1, arg2), loc)); + } + + private void error(SAXParseException e) throws SAXException { + hadError = true; + if (eh != null) { + eh.error(e); + } + } + + void warning(String key) throws SAXException { + warning(key, locator); + } + + private void warning(String key, String arg) throws SAXException { + warning(key, arg, locator); + } + + private void warning(String key, String arg1, String arg2) throws SAXException { + warning(key, arg1, arg2, locator); + } + + private void warning(String key, Locator loc) throws SAXException { + warning(new SAXParseException(localizer.message(key), loc)); + } + + private void warning(String key, String arg, Locator loc) throws SAXException { + warning(new SAXParseException(localizer.message(key, arg), loc)); + } + + private void warning(String key, String arg1, String arg2, Locator loc) + throws SAXException { + warning(new SAXParseException(localizer.message(key, arg1, arg2), loc)); + } + + private void warning(SAXParseException e) throws SAXException { + if (eh != null) { + eh.warning(e); + } + } + + SchemaParser(SAXParseable parseable, + XMLReader xr, + ErrorHandler eh, + SchemaBuilder schemaBuilder, + IncludedGrammar grammar, + Scope scope, + String inheritedNs) throws SAXException { + this.parseable = parseable; + this.xr = xr; + this.eh = eh; + this.schemaBuilder = schemaBuilder; + this.nameClassBuilder = schemaBuilder.getNameClassBuilder(); + if (eh != null) { + xr.setErrorHandler(eh); + } + xr.setDTDHandler(context); + if (schemaBuilder.usesComments()) { + try { + xr.setProperty("http://xml.org/sax/properties/lexical-handler", new LexicalHandlerImpl()); + } catch (SAXNotRecognizedException e) { + warning("no_comment_support", xr.getClass().getName()); + } catch (SAXNotSupportedException e) { + warning("no_comment_support", xr.getClass().getName()); + } + } + initPatternTable(); + initNameClassTable(); + new RootState(grammar, scope, inheritedNs).set(); + } + + private Context getContext() { + return context; + } + + class LexicalHandlerImpl extends AbstractLexicalHandler { + + private boolean inDtd = false; + + @Override + public void startDTD(String s, String s1, String s2) throws SAXException { + inDtd = true; + } + + @Override + public void endDTD() throws SAXException { + inDtd = false; + } + + @Override + public void comment(char[] chars, int start, int length) throws SAXException { + if (!inDtd) { + ((CommentHandler) xr.getContentHandler()).comment(new String(chars, start, length)); + } + } + } + + private ParsedNameClass expandName(String name, String ns, Annotations anno) throws SAXException { + int ic = name.indexOf(':'); + if (ic == -1) { + return nameClassBuilder.makeName(ns, checkNCName(name), null, null, anno); + } + String prefix = checkNCName(name.substring(0, ic)); + String localName = checkNCName(name.substring(ic + 1)); + for (PrefixMapping tem = context.prefixMapping; tem != null; tem = tem.next) { + if (tem.prefix.equals(prefix)) { + return nameClassBuilder.makeName(tem.uri, localName, prefix, null, anno); + } + } + error("undefined_prefix", prefix); + return nameClassBuilder.makeName("", localName, null, null, anno); + } + + private String findPrefix(String qName, String uri) { + String prefix = null; + if (qName == null || qName.equals("")) { + for (PrefixMapping p = context.prefixMapping; p != null; p = p.next) { + if (p.uri.equals(uri)) { + prefix = p.prefix; + break; + } + } + } else { + int off = qName.indexOf(':'); + if (off > 0) { + prefix = qName.substring(0, off); + } + } + return prefix; + } + + private String checkNCName(String str) throws SAXException { + if (!Naming.isNcname(str)) { + error("invalid_ncname", str); + } + return str; + } + + private String resolve(String systemId) throws SAXException { + if (Uri.hasFragmentId(systemId)) { + error("href_fragment_id"); + } + systemId = Uri.escapeDisallowedChars(systemId); + return Uri.resolve(xmlBaseHandler.getBaseUri(), systemId); + } + + private Location makeLocation() { + if (locator == null) { + return null; + } + return schemaBuilder.makeLocation(locator.getSystemId(), + locator.getLineNumber(), + locator.getColumnNumber()); + } + + private void checkUri(String s) throws SAXException { + if (!Uri.isValid(s)) { + error("invalid_uri", s); + } + } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/xml/sax/JAXPXMLReaderCreator.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/xml/sax/JAXPXMLReaderCreator.java index f9f15c70a11..455143d1cbe 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/xml/sax/JAXPXMLReaderCreator.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/xml/sax/JAXPXMLReaderCreator.java @@ -23,7 +23,7 @@ * questions. */ /* - * Copyright (C) 2004-2011 + * Copyright (C) 2004-2012 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -45,10 +45,15 @@ */ package com.sun.xml.internal.rngom.xml.sax; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.xml.XMLConstants; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParserFactory; import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; import org.xml.sax.XMLReader; /** @@ -72,7 +77,16 @@ public class JAXPXMLReaderCreator implements XMLReaderCreator { */ public JAXPXMLReaderCreator() { spf = SAXParserFactory.newInstance(); - spf.setNamespaceAware(true); + try { + spf.setNamespaceAware(true); + spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + } catch (ParserConfigurationException ex) { + Logger.getLogger(JAXPXMLReaderCreator.class.getName()).log(Level.SEVERE, null, ex); + } catch (SAXNotRecognizedException ex) { + Logger.getLogger(JAXPXMLReaderCreator.class.getName()).log(Level.SEVERE, null, ex); + } catch (SAXNotSupportedException ex) { + Logger.getLogger(JAXPXMLReaderCreator.class.getName()).log(Level.SEVERE, null, ex); + } } /** diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaTubeHelper.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaTubeHelper.java index 0a0c10c312b..fdfeb1c245b 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaTubeHelper.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/WsaTubeHelper.java @@ -40,7 +40,6 @@ import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.model.SEIModel; import com.sun.xml.internal.ws.api.model.JavaMethod; import com.sun.xml.internal.ws.api.model.WSDLOperationMapping; -import com.sun.xml.internal.ws.model.wsdl.WSDLOperationImpl; import com.sun.xml.internal.ws.model.JavaMethodImpl; import com.sun.xml.internal.ws.model.CheckedExceptionImpl; import com.sun.istack.internal.Nullable; @@ -236,7 +235,7 @@ public abstract class WsaTubeHelper { } WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation(); WSDLOperation op = wbo.getOperation(); - return ((WSDLOperationImpl) op).getInput().isDefaultAction(); + return op.getInput().isDefaultAction(); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundOperation.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundOperation.java index d2f975a02be..b0f48427abe 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundOperation.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundOperation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,9 +27,11 @@ package com.sun.xml.internal.ws.api.model.wsdl; import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; +import com.sun.xml.internal.ws.api.model.ParameterBinding; import javax.jws.WebParam.Mode; import javax.xml.namespace.QName; + import java.util.Map; /** @@ -78,21 +80,90 @@ public interface WSDLBoundOperation extends WSDLObject, WSDLExtensible { */ @Nullable WSDLPart getPart(@NotNull String partName, @NotNull Mode mode); + /** + * Gets {@link ParameterBinding} for a given wsdl part in wsdl:input + * + * @param part Name of wsdl:part, must be non-null + * @return null if the part is not found. + */ + public ParameterBinding getInputBinding(String part); + + /** + * Gets {@link ParameterBinding} for a given wsdl part in wsdl:output + * + * @param part Name of wsdl:part, must be non-null + * @return null if the part is not found. + */ + public ParameterBinding getOutputBinding(String part); + + /** + * Gets {@link ParameterBinding} for a given wsdl part in wsdl:fault + * + * @param part Name of wsdl:part, must be non-null + * @return null if the part is not found. + */ + public ParameterBinding getFaultBinding(String part); + + /** + * Gets the MIME type for a given wsdl part in wsdl:input + * + * @param part Name of wsdl:part, must be non-null + * @return null if the part is not found. + */ + public String getMimeTypeForInputPart(String part); + + /** + * Gets the MIME type for a given wsdl part in wsdl:output + * + * @param part Name of wsdl:part, must be non-null + * @return null if the part is not found. + */ + public String getMimeTypeForOutputPart(String part); + + /** + * Gets the MIME type for a given wsdl part in wsdl:fault + * + * @param part Name of wsdl:part, must be non-null + * @return null if the part is not found. + */ + public String getMimeTypeForFaultPart(String part); + /** * Gets all inbound {@link WSDLPart} by its {@link WSDLPart#getName() name}. */ - @NotNull Map getInParts(); + @NotNull Map getInParts(); /** * Gets all outbound {@link WSDLPart} by its {@link WSDLPart#getName() name}. */ - @NotNull Map getOutParts(); + @NotNull Map getOutParts(); /** * Gets all the {@link WSDLFault} bound to this operation. */ @NotNull Iterable getFaults(); + /** + * Map of wsdl:input part name and the binding as {@link ParameterBinding} + * + * @return empty Map if there is no parts + */ + public Map getInputParts(); + + /** + * Map of wsdl:output part name and the binding as {@link ParameterBinding} + * + * @return empty Map if there is no parts + */ + public Map getOutputParts(); + + /** + * Map of wsdl:fault part name and the binding as {@link ParameterBinding} + * + * @return empty Map if there is no parts + */ + public Map getFaultParts(); + /** * Gets the payload QName of the request message. * @@ -100,7 +171,7 @@ public interface WSDLBoundOperation extends WSDLObject, WSDLExtensible { * It's possible for an operation to define no body part, in which case * this method returns null. */ - @Nullable QName getReqPayloadName(); + @Nullable QName getRequestPayloadName(); /** * Gets the payload QName of the response message. @@ -109,7 +180,7 @@ public interface WSDLBoundOperation extends WSDLObject, WSDLExtensible { * It's possible for an operation to define no body part, in which case * this method returns null. */ - @Nullable QName getResPayloadName(); + @Nullable QName getResponsePayloadName(); /** * Gets the namespace of request payload. diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundPortType.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundPortType.java index a2b400e53e5..f89e12b513e 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundPortType.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundPortType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtensible.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtensible.java index cae65be9785..eb3c869009b 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtensible.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtensible.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,12 @@ package com.sun.xml.internal.ws.api.model.wsdl; +import java.util.List; + +import javax.xml.namespace.QName; + +import org.xml.sax.Locator; + /** * Interface that represents WSDL concepts that * can have extensions. @@ -82,4 +88,23 @@ public interface WSDLExtensible extends WSDLObject { * must not be null. */ void addExtension(WSDLExtension extension); + + /** + * True if all required WSDL extensions on Port and Binding are understood + * @return true if all wsdl required extensions on Port and Binding are understood + */ + public boolean areRequiredExtensionsUnderstood(); + + /** + * Marks extension as not understood + * @param extnEl QName of extension + * @param locator Locator + */ + public void addNotUnderstoodExtension(QName extnEl, Locator locator); + + /** + * Lists extensions marked as not understood + * @return List of not understood extensions + */ + public List getNotUnderstoodExtensions(); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFault.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFault.java index 36a6ffdb8bf..d2d2adb8af2 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFault.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFault.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -76,4 +76,10 @@ public interface WSDLFault extends WSDLObject, WSDLExtensible { * @return Action */ String getAction(); + + /** + * True if this is the default action + * @return + */ + public boolean isDefaultAction(); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLModel.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLModel.java index cc63395d001..3e24853582a 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLModel.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,10 +34,12 @@ import com.sun.xml.internal.ws.api.policy.PolicyResolver; import com.sun.xml.internal.ws.api.policy.PolicyResolverFactory; import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser; import com.sun.xml.internal.ws.policy.PolicyMap; + import org.xml.sax.SAXException; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; + import java.io.IOException; import java.util.Map; @@ -96,7 +98,7 @@ public interface WSDLModel extends WSDLExtensible { * * @return an empty Map if the wsdl document has no wsdl:binding */ - @NotNull Map getBindings(); + @NotNull Map getBindings(); /** * Gives a {@link Map} of wsdl:service qualified name and {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLService} @@ -105,6 +107,25 @@ public interface WSDLModel extends WSDLExtensible { */ @NotNull Map getServices(); + /** + * Returns the first service QName from insertion order + */ + public QName getFirstServiceName(); + + /** + * Returns the message with the given QName + * @param name Message name + * @return Message + */ + public WSDLMessage getMessage(QName name); + + /** + * Gives a {@link Map} of wsdl:message qualified name and {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLMesage} + * + * @return an empty Map if the wsdl document has no wsdl:message + */ + @NotNull Map getMessages(); + /** * Gives the PolicyMap associated with the WSDLModel * @@ -115,7 +136,6 @@ public interface WSDLModel extends WSDLExtensible { */ public PolicyMap getPolicyMap(); - /** * Main purpose of this class is to parsing of a WSDL and get the {@link WSDLModel} from it. */ diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOperation.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOperation.java index 1a08f017c98..856980441cc 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOperation.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOperation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,8 +56,6 @@ public interface WSDLOperation extends WSDLObject, WSDLExtensible { */ @Nullable WSDLOutput getOutput(); - - /** * Returns true if this operation is an one-way operation. */ @@ -112,4 +110,10 @@ public interface WSDLOperation extends WSDLObject, WSDLExtensible { * Gives the enclosing wsdl:portType@name attribute value. */ @NotNull QName getPortTypeName(); + + /** + * Returns parameter order + * @return Parameter order + */ + public String getParameterOrder(); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOutput.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOutput.java index 8743f73e018..71c9035aff9 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOutput.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -79,4 +79,11 @@ public interface WSDLOutput extends WSDLObject, WSDLExtensible { */ @NotNull QName getQName(); + + /** + * Checks if the Action value is implicitly derived using the rules defined in WS-Addressing. + * + * @return true if the Action value is implicitly derived using the rules defined in WS-Addressing. + */ + public boolean isDefaultAction(); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPort.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPort.java index 4b01852f62f..337294b4f6b 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPort.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPort.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,9 @@ package com.sun.xml.internal.ws.api.model.wsdl; import com.sun.istack.internal.NotNull; +import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.EndpointAddress; +import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; import javax.xml.namespace.QName; @@ -64,4 +66,10 @@ public interface WSDLPort extends WSDLFeaturedObject, WSDLExtensible { */ @NotNull WSDLService getOwner(); + + /** + * Returns endpoint reference + * @return Endpoint reference + */ + public @Nullable WSEndpointReference getEPR(); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPortType.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPortType.java index 5fcc5ec1ddf..6a96b454066 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPortType.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPortType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,6 @@ public interface WSDLPortType extends WSDLObject, WSDLExtensible { */ public WSDLOperation get(String operationName); - /** * Gets {@link Iterable}<{@link WSDLOperation}> */ diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLService.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLService.java index 52cb76aad6a..285e737e66e 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLService.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ package com.sun.xml.internal.ws.api.model.wsdl; import com.sun.istack.internal.NotNull; +import com.sun.istack.internal.Nullable; import javax.xml.namespace.QName; @@ -61,6 +62,12 @@ public interface WSDLService extends WSDLObject, WSDLExtensible { */ WSDLPort getFirstPort(); + /** + * Gets the first port in this service which matches the portType + */ + @Nullable + WSDLPort getMatchingPort(QName portTypeName); + /** * Gives all the {@link WSDLPort} in a wsdl:service {@link WSDLService} */ diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLBoundFault.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLBoundFault.java new file mode 100644 index 00000000000..f99058ec017 --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLBoundFault.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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.xml.internal.ws.api.model.wsdl.editable; + +import com.sun.istack.internal.NotNull; +import com.sun.istack.internal.Nullable; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundFault; + +public interface EditableWSDLBoundFault extends WSDLBoundFault { + + @Override + @Nullable + EditableWSDLFault getFault(); + + @Override + @NotNull + EditableWSDLBoundOperation getBoundOperation(); + + /** + * Freezes WSDL model to prevent further modification + * + * @param operation Operation + */ + void freeze(EditableWSDLBoundOperation operation); +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLBoundOperation.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLBoundOperation.java new file mode 100644 index 00000000000..565c9d7c162 --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLBoundOperation.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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.xml.internal.ws.api.model.wsdl.editable; + +import java.util.Map; + +import javax.jws.WebParam.Mode; +import javax.jws.soap.SOAPBinding.Style; + +import com.sun.istack.internal.NotNull; +import com.sun.istack.internal.Nullable; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; + +public interface EditableWSDLBoundOperation extends WSDLBoundOperation { + + @Override + @NotNull EditableWSDLOperation getOperation(); + + @Override + @NotNull EditableWSDLBoundPortType getBoundPortType(); + + @Override + @Nullable EditableWSDLPart getPart(@NotNull String partName, @NotNull Mode mode); + + @Override + @NotNull Map getInParts(); + + @Override + @NotNull Map getOutParts(); + + @Override + @NotNull Iterable getFaults(); + + /** + * Add Part + * @param part Part + * @param mode Mode + */ + public void addPart(EditableWSDLPart part, Mode mode); + + /** + * Add Fault + * @param fault Fault + */ + public void addFault(@NotNull EditableWSDLBoundFault fault); + + /** + * Sets the soapbinding:binding/operation/wsaw:Anonymous. + * + * @param anonymous Anonymous value of the operation + */ + public void setAnonymous(ANONYMOUS anonymous); + + /** + * Sets input explicit body parts + * @param b True, if input body part is explicit + */ + public void setInputExplicitBodyParts(boolean b); + + /** + * Sets output explicit body parts + * @param b True, if output body part is explicit + */ + public void setOutputExplicitBodyParts(boolean b); + + /** + * Sets fault explicit body parts + * @param b True, if fault body part is explicit + */ + public void setFaultExplicitBodyParts(boolean b); + + /** + * Set request namespace + * @param ns Namespace + */ + public void setRequestNamespace(String ns); + + /** + * Set response namespace + * @param ns Namespace + */ + public void setResponseNamespace(String ns); + + /** + * Set SOAP action + * @param soapAction SOAP action + */ + public void setSoapAction(String soapAction); + + /** + * Set parameter style + * @param style Style + */ + public void setStyle(Style style); + + /** + * Freezes WSDL model to prevent further modification + * @param root WSDL Model + */ + public void freeze(EditableWSDLModel root); +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLBoundPortType.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLBoundPortType.java new file mode 100644 index 00000000000..ba910bc1318 --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLBoundPortType.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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.xml.internal.ws.api.model.wsdl.editable; + +import javax.jws.soap.SOAPBinding.Style; +import javax.xml.namespace.QName; + +import com.sun.istack.internal.NotNull; +import com.sun.istack.internal.Nullable; +import com.sun.xml.internal.ws.api.BindingID; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType; + +public interface EditableWSDLBoundPortType extends WSDLBoundPortType { + + @Override + @NotNull EditableWSDLModel getOwner(); + + @Override + public EditableWSDLBoundOperation get(QName operationName); + + @Override + EditableWSDLPortType getPortType(); + + @Override + Iterable getBindingOperations(); + + @Override + @Nullable EditableWSDLBoundOperation getOperation(String namespaceUri, String localName); + + /** + * Populates the Map that holds operation name as key and {@link WSDLBoundOperation} as the value. + * + * @param opName Must be non-null + * @param ptOp Must be non-null + * @throws NullPointerException if either opName or ptOp is null + */ + public void put(QName opName, EditableWSDLBoundOperation ptOp); + + /** + * Sets the binding ID + * @param bindingId Binding ID + */ + public void setBindingId(BindingID bindingId); + + /** + * sets whether the {@link WSDLBoundPortType} is rpc or lit + */ + public void setStyle(Style style); + + /** + * Freezes WSDL model to prevent further modification + */ + public void freeze(); +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLFault.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLFault.java new file mode 100644 index 00000000000..e7da811a4a5 --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLFault.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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.xml.internal.ws.api.model.wsdl.editable; + +import com.sun.istack.internal.NotNull; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault; + +public interface EditableWSDLFault extends WSDLFault { + + @Override + EditableWSDLMessage getMessage(); + + @Override + @NotNull + EditableWSDLOperation getOperation(); + + /** + * Sets action + * + * @param action Action + */ + public void setAction(String action); + + /** + * Set to true if this is the default action + * + * @param defaultAction True, if default action + */ + public void setDefaultAction(boolean defaultAction); + + /** + * Freezes WSDL model to prevent further modification + * + * @param root WSDL Model + */ + public void freeze(EditableWSDLModel root); + +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLInput.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLInput.java new file mode 100644 index 00000000000..fc5d56c3303 --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLInput.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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.xml.internal.ws.api.model.wsdl.editable; + +import com.sun.istack.internal.NotNull; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLInput; + +public interface EditableWSDLInput extends WSDLInput { + + @Override + EditableWSDLMessage getMessage(); + + @Override + @NotNull + EditableWSDLOperation getOperation(); + + /** + * Sets action + * + * @param action Action + */ + public void setAction(String action); + + /** + * Set to true if this is the default action + * + * @param defaultAction True, if default action + */ + public void setDefaultAction(boolean defaultAction); + + /** + * Freezes WSDL model to prevent further modification + * + * @param root WSDL Model + */ + public void freeze(EditableWSDLModel root); + +} diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CMouseInfoPeer.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLMessage.java similarity index 67% rename from jdk/src/macosx/classes/sun/lwawt/macosx/CMouseInfoPeer.java rename to jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLMessage.java index 8ee580108dc..f7a80860a48 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CMouseInfoPeer.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,23 +23,20 @@ * questions. */ -package sun.lwawt.macosx; +package com.sun.xml.internal.ws.api.model.wsdl.editable; -import java.awt.Window; -import sun.lwawt.LWMouseInfoPeer; -import sun.lwawt.LWWindowPeer; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage; + +public interface EditableWSDLMessage extends WSDLMessage { -public class CMouseInfoPeer extends LWMouseInfoPeer -{ - //If a new window is to appear under the cursor, - //we get wrong window. - //This is a workaround for macosx. @Override - public boolean isWindowUnderMouse(Window w) { - if (w == null) { - return false; - } + Iterable parts(); + + /** + * Add part + * + * @param part Part + */ + public void add(EditableWSDLPart part); - return ((LWWindowPeer)w.getPeer()).getPlatformWindow().isUnderMouse(); - } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLModel.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLModel.java new file mode 100644 index 00000000000..7fee15a1de4 --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLModel.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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.xml.internal.ws.api.model.wsdl.editable; + +import java.util.Map; + +import javax.xml.namespace.QName; + +import com.sun.istack.internal.NotNull; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; +import com.sun.xml.internal.ws.policy.PolicyMap; + +public interface EditableWSDLModel extends WSDLModel { + + @Override + EditableWSDLPortType getPortType(@NotNull QName name); + + /** + * Add Binding + * + * @param portType Bound port type + */ + void addBinding(EditableWSDLBoundPortType portType); + + @Override + EditableWSDLBoundPortType getBinding(@NotNull QName name); + + @Override + EditableWSDLBoundPortType getBinding(@NotNull QName serviceName, @NotNull QName portName); + + @Override + EditableWSDLService getService(@NotNull QName name); + + @Override + @NotNull + Map getMessages(); + + /** + * Add message + * + * @param msg Message + */ + public void addMessage(EditableWSDLMessage msg); + + @Override + @NotNull + Map getPortTypes(); + + /** + * Add port type + * + * @param pt Port type + */ + public void addPortType(EditableWSDLPortType pt); + + @Override + @NotNull + Map getBindings(); + + @Override + @NotNull + Map getServices(); + + /** + * Add service + * + * @param svc Service + */ + public void addService(EditableWSDLService svc); + + @Override + public EditableWSDLMessage getMessage(QName name); + + /** + * @param policyMap + * @deprecated + */ + public void setPolicyMap(PolicyMap policyMap); + + /** + * Finalize rpc-lit binding + * + * @param portType Binding + */ + public void finalizeRpcLitBinding(EditableWSDLBoundPortType portType); + + /** + * Freezes WSDL model to prevent further modification + */ + public void freeze(); + +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLOperation.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLOperation.java new file mode 100644 index 00000000000..b0536d9691b --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLOperation.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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.xml.internal.ws.api.model.wsdl.editable; + +import javax.xml.namespace.QName; + +import com.sun.istack.internal.NotNull; +import com.sun.istack.internal.Nullable; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation; + +public interface EditableWSDLOperation extends WSDLOperation { + + @Override + @NotNull + EditableWSDLInput getInput(); + + /** + * Set input + * + * @param input Input + */ + public void setInput(EditableWSDLInput input); + + @Override + @Nullable + EditableWSDLOutput getOutput(); + + /** + * Set output + * + * @param output Output + */ + public void setOutput(EditableWSDLOutput output); + + @Override + Iterable getFaults(); + + /** + * Add fault + * + * @param fault Fault + */ + public void addFault(EditableWSDLFault fault); + + @Override + @Nullable + EditableWSDLFault getFault(QName faultDetailName); + + /** + * Set parameter order + * + * @param parameterOrder Parameter order + */ + public void setParameterOrder(String parameterOrder); + + /** + * Freezes WSDL model to prevent further modification + * + * @param root WSDL Model + */ + public void freeze(EditableWSDLModel root); +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLOutput.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLOutput.java new file mode 100644 index 00000000000..2befb50578c --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLOutput.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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.xml.internal.ws.api.model.wsdl.editable; + +import com.sun.istack.internal.NotNull; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput; + +public interface EditableWSDLOutput extends WSDLOutput { + + @Override + EditableWSDLMessage getMessage(); + + @Override + @NotNull + EditableWSDLOperation getOperation(); + + /** + * Sets action + * + * @param action Action + */ + public void setAction(String action); + + /** + * Set to true if this is the default action + * + * @param defaultAction True, if default action + */ + public void setDefaultAction(boolean defaultAction); + + /** + * Freezes WSDL model to prevent further modification + * + * @param root WSDL Model + */ + public void freeze(EditableWSDLModel root); + +} diff --git a/jdk/src/share/classes/java/lang/invoke/MagicLambdaImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLPart.java similarity index 64% rename from jdk/src/share/classes/java/lang/invoke/MagicLambdaImpl.java rename to jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLPart.java index b78588bf8fa..3db619503d9 100644 --- a/jdk/src/share/classes/java/lang/invoke/MagicLambdaImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLPart.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,18 +22,26 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package java.lang.invoke; -/**

    MagicLambdaImpl (named for similarity to MagicAccessorImpl and - others, not because it actually implements an interface) is a - marker class in the hierarchy. All subclasses of this class are - "magically" granted access by the VM to otherwise inaccessible - fields and methods of other classes. It is distinct from MagicAccessorImpl - because, while we want to bypass accessibility checks, we do not want to - bypass verification.

    +package com.sun.xml.internal.ws.api.model.wsdl.editable; -

    Do not change the name of this class without also changing the - VM's code.

    */ +import com.sun.xml.internal.ws.api.model.ParameterBinding; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLPart; + +public interface EditableWSDLPart extends WSDLPart { + + /** + * Sets binding + * + * @param binding Binding + */ + public void setBinding(ParameterBinding binding); + + /** + * Sets index + * + * @param index Index + */ + public void setIndex(int index); -class MagicLambdaImpl { } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLPort.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLPort.java new file mode 100644 index 00000000000..6f78a56af04 --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLPort.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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.xml.internal.ws.api.model.wsdl.editable; + +import com.sun.istack.internal.NotNull; +import com.sun.xml.internal.ws.api.EndpointAddress; +import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; + +public interface EditableWSDLPort extends WSDLPort { + + @Override + @NotNull + EditableWSDLBoundPortType getBinding(); + + @Override + @NotNull + EditableWSDLService getOwner(); + + /** + * Sets endpoint address + * + * @param address Endpoint address + */ + public void setAddress(EndpointAddress address); + + /** + * Sets endpoint reference + * + * @param epr Endpoint reference + */ + public void setEPR(@NotNull WSEndpointReference epr); + + /** + * Freezes WSDL model to prevent further modification + * + * @param root WSDL Model + */ + void freeze(EditableWSDLModel root); +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLPortType.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLPortType.java new file mode 100644 index 00000000000..0a1d3b6b3bb --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLPortType.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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.xml.internal.ws.api.model.wsdl.editable; + +import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType; + +public interface EditableWSDLPortType extends WSDLPortType { + + @Override + public EditableWSDLOperation get(String operationName); + + @Override + public Iterable getOperations(); + + /** + * Associate WSDL operation with operation name + * + * @param opName Operation name + * @param ptOp Operation + */ + public void put(String opName, EditableWSDLOperation ptOp); + + /** + * Freezes WSDL model to prevent further modification + */ + public void freeze(); +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLService.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLService.java new file mode 100644 index 00000000000..a162e5074e5 --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/model/wsdl/editable/EditableWSDLService.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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.xml.internal.ws.api.model.wsdl.editable; + +import javax.xml.namespace.QName; + +import com.sun.istack.internal.NotNull; +import com.sun.istack.internal.Nullable; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLService; + +public interface EditableWSDLService extends WSDLService { + + @Override + @NotNull + EditableWSDLModel getParent(); + + @Override + EditableWSDLPort get(QName portName); + + @Override + EditableWSDLPort getFirstPort(); + + @Override + @Nullable + EditableWSDLPort getMatchingPort(QName portTypeName); + + @Override + Iterable getPorts(); + + /** + * Associate WSDL port with port QName + * + * @param portName Port QName + * @param port Port + */ + public void put(QName portName, EditableWSDLPort port); + + /** + * Freezes WSDL model to prevent further modification + * + * @param root WSDL Model + */ + void freeze(EditableWSDLModel root); +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AbstractInstanceResolver.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AbstractInstanceResolver.java index e670ac452e6..560e98e9085 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AbstractInstanceResolver.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AbstractInstanceResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,7 +66,7 @@ public abstract class AbstractInstanceResolver extends InstanceResolver { if (!method.isAccessible()) { method.setAccessible(true); } - method.invoke(instance,args); + MethodUtil.invoke(instance,method, args); } catch (IllegalAccessException e) { throw new ServerRtException("server.rt.err",e); } catch (InvocationTargetException e) { diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java index 625f59f47b0..7c11e6455f7 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -232,7 +232,7 @@ public abstract class InstanceResolver { public Object invoke(Packet p, Method m, Object... args) throws InvocationTargetException, IllegalAccessException { T t = resolve(p); try { - return m.invoke(t, args ); + return MethodUtil.invoke(t, m, args ); } finally { postInvoke(p,t); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/MethodUtil.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/MethodUtil.java new file mode 100644 index 00000000000..c8497055678 --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/MethodUtil.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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.xml.internal.ws.api.server; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks + * to java.lang,reflect.Method.invoke() + * + * Be careful, copy of this class exists in several packages, iny modification must be done to other copies too! + */ +class MethodUtil { + + private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName()); + private static final Method INVOKE_METHOD; + + static { + Method method; + try { + Class clazz = Class.forName("sun.reflect.misc.MethodUtil"); + method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods."); + } + } catch (Throwable t) { + method = null; + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM"); + } + } + INVOKE_METHOD = method; + } + + static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException { + if (INVOKE_METHOD != null) { + // sun.reflect.misc.MethodUtil.invoke(method, owner, args) + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil"); + } + try { + return INVOKE_METHOD.invoke(null, method, target, args); + } catch (InvocationTargetException ite) { + // unwrap invocation exception added by reflection code ... + throw unwrapException(ite); + } + } else { + // other then Oracle JDK ... + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM"); + } + return method.invoke(target, args); + } + } + + private static InvocationTargetException unwrapException(InvocationTargetException ite) { + Throwable targetException = ite.getTargetException(); + if (targetException != null && targetException instanceof InvocationTargetException) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Unwrapping invocation target exception"); + } + return (InvocationTargetException) targetException; + } else { + return ite; + } + } + +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtension.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtension.java index f8cbabc06a0..27375730c7e 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtension.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtension.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,17 @@ package com.sun.xml.internal.ws.api.wsdl.parser; import com.sun.xml.internal.ws.api.WSService; -import com.sun.xml.internal.ws.api.model.wsdl.*; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundFault; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundPortType; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLFault; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLInput; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOutput; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPort; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPortType; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLService; import com.sun.xml.internal.ws.api.pipe.Tube; import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser; @@ -138,34 +148,36 @@ import javax.xml.ws.WebServiceException; * @author Kohsuke Kawaguchi */ public abstract class WSDLParserExtension { + public void start(WSDLParserExtensionContext context){ // noop } - public void serviceAttributes(WSDLService service, XMLStreamReader reader) { + + public void serviceAttributes(EditableWSDLService service, XMLStreamReader reader) { // noop } - public boolean serviceElements(WSDLService service, XMLStreamReader reader) { + public boolean serviceElements(EditableWSDLService service, XMLStreamReader reader) { return false; } - public void portAttributes(WSDLPort port, XMLStreamReader reader) { + public void portAttributes(EditableWSDLPort port, XMLStreamReader reader) { // noop } - public boolean portElements(WSDLPort port, XMLStreamReader reader) { + public boolean portElements(EditableWSDLPort port, XMLStreamReader reader) { return false; } - public boolean portTypeOperationInput(WSDLOperation op, XMLStreamReader reader) { + public boolean portTypeOperationInput(EditableWSDLOperation op, XMLStreamReader reader) { return false; } - public boolean portTypeOperationOutput(WSDLOperation op, XMLStreamReader reader) { + public boolean portTypeOperationOutput(EditableWSDLOperation op, XMLStreamReader reader) { return false; } - public boolean portTypeOperationFault(WSDLOperation op, XMLStreamReader reader) { + public boolean portTypeOperationFault(EditableWSDLOperation op, XMLStreamReader reader) { return false; } @@ -173,81 +185,81 @@ public abstract class WSDLParserExtension { return false; } - public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader) { + public boolean bindingElements(EditableWSDLBoundPortType binding, XMLStreamReader reader) { return false; } - public void bindingAttributes(WSDLBoundPortType binding, XMLStreamReader reader) { + public void bindingAttributes(EditableWSDLBoundPortType binding, XMLStreamReader reader) { } - public boolean portTypeElements(WSDLPortType portType, XMLStreamReader reader) { + public boolean portTypeElements(EditableWSDLPortType portType, XMLStreamReader reader) { return false; } - public void portTypeAttributes(WSDLPortType portType, XMLStreamReader reader) { + public void portTypeAttributes(EditableWSDLPortType portType, XMLStreamReader reader) { } - public boolean portTypeOperationElements(WSDLOperation operation, XMLStreamReader reader) { + public boolean portTypeOperationElements(EditableWSDLOperation operation, XMLStreamReader reader) { return false; } - public void portTypeOperationAttributes(WSDLOperation operation, XMLStreamReader reader) { + public void portTypeOperationAttributes(EditableWSDLOperation operation, XMLStreamReader reader) { } - public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) { + public boolean bindingOperationElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) { return false; } - public void bindingOperationAttributes(WSDLBoundOperation operation, XMLStreamReader reader) { + public void bindingOperationAttributes(EditableWSDLBoundOperation operation, XMLStreamReader reader) { } - public boolean messageElements(WSDLMessage msg, XMLStreamReader reader) { + public boolean messageElements(EditableWSDLMessage msg, XMLStreamReader reader) { return false; } - public void messageAttributes(WSDLMessage msg, XMLStreamReader reader) { + public void messageAttributes(EditableWSDLMessage msg, XMLStreamReader reader) { } - public boolean portTypeOperationInputElements(WSDLInput input, XMLStreamReader reader) { + public boolean portTypeOperationInputElements(EditableWSDLInput input, XMLStreamReader reader) { return false; } - public void portTypeOperationInputAttributes(WSDLInput input, XMLStreamReader reader) { + public void portTypeOperationInputAttributes(EditableWSDLInput input, XMLStreamReader reader) { } - public boolean portTypeOperationOutputElements(WSDLOutput output, XMLStreamReader reader) { + public boolean portTypeOperationOutputElements(EditableWSDLOutput output, XMLStreamReader reader) { return false; } - public void portTypeOperationOutputAttributes(WSDLOutput output, XMLStreamReader reader) { + public void portTypeOperationOutputAttributes(EditableWSDLOutput output, XMLStreamReader reader) { } - public boolean portTypeOperationFaultElements(WSDLFault fault, XMLStreamReader reader) { + public boolean portTypeOperationFaultElements(EditableWSDLFault fault, XMLStreamReader reader) { return false; } - public void portTypeOperationFaultAttributes(WSDLFault fault, XMLStreamReader reader) { + public void portTypeOperationFaultAttributes(EditableWSDLFault fault, XMLStreamReader reader) { } - public boolean bindingOperationInputElements(WSDLBoundOperation operation, XMLStreamReader reader) { + public boolean bindingOperationInputElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) { return false; } - public void bindingOperationInputAttributes(WSDLBoundOperation operation, XMLStreamReader reader) { + public void bindingOperationInputAttributes(EditableWSDLBoundOperation operation, XMLStreamReader reader) { } - public boolean bindingOperationOutputElements(WSDLBoundOperation operation, XMLStreamReader reader) { + public boolean bindingOperationOutputElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) { return false; } - public void bindingOperationOutputAttributes(WSDLBoundOperation operation, XMLStreamReader reader) { + public void bindingOperationOutputAttributes(EditableWSDLBoundOperation operation, XMLStreamReader reader) { } - public boolean bindingOperationFaultElements(WSDLBoundFault fault, XMLStreamReader reader) { + public boolean bindingOperationFaultElements(EditableWSDLBoundFault fault, XMLStreamReader reader) { return false; } - public void bindingOperationFaultAttributes(WSDLBoundFault fault, XMLStreamReader reader) { + public void bindingOperationFaultAttributes(EditableWSDLBoundFault fault, XMLStreamReader reader) { } // TODO: complete the rest of the callback diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtensionContext.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtensionContext.java index e67bbc0b51e..ebad3d5e7a1 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtensionContext.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtensionContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ package com.sun.xml.internal.ws.api.wsdl.parser; import com.sun.istack.internal.NotNull; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel; import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.api.policy.PolicyResolver; @@ -44,10 +44,10 @@ public interface WSDLParserExtensionContext { boolean isClientSide(); /** - * Gives the {@link WSDLModel}. The WSDLModel may not be complete until + * Gives the {@link EditableWSDLModel}. The WSDLModel may not be complete until * {@link WSDLParserExtension#finished(WSDLParserExtensionContext)} is called. */ - WSDLModel getWSDLModel(); + EditableWSDLModel getWSDLModel(); /** * Provides the {@link Container} in which this service or client is running. diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/binding/WebServiceFeatureList.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/binding/WebServiceFeatureList.java index adcf63f865f..32bf6832777 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/binding/WebServiceFeatureList.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/binding/WebServiceFeatureList.java @@ -38,7 +38,6 @@ import com.sun.xml.internal.ws.api.FeatureConstructor; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.model.wsdl.WSDLFeaturedObject; import com.sun.xml.internal.ws.model.RuntimeModelerException; -import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl; import com.sun.xml.internal.ws.resources.ModelerMessages; import com.sun.xml.internal.bind.util.Which; @@ -440,9 +439,9 @@ public final class WebServiceFeatureList extends AbstractMap ports = owner.getWsdlService().getPorts(); - for (WSDLPortImpl port : ports){ + Iterable ports = owner.getWsdlService().getPorts(); + for (WSDLPort port : ports){ if (port.getName().equals(portName)) return port; } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/Stub.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/Stub.java index 31bb91fba4b..8f7c918f03d 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/Stub.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/Stub.java @@ -62,7 +62,6 @@ import com.sun.xml.internal.ws.binding.BindingImpl; import com.sun.xml.internal.ws.developer.JAXWSProperties; import com.sun.xml.internal.ws.developer.WSBindingProvider; import com.sun.xml.internal.ws.model.wsdl.WSDLDirectProperties; -import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl; import com.sun.xml.internal.ws.model.wsdl.WSDLPortProperties; import com.sun.xml.internal.ws.model.wsdl.WSDLProperties; import com.sun.xml.internal.ws.resources.ClientMessages; @@ -354,7 +353,7 @@ public abstract class Stub implements WSBindingProvider, ResponseContextReceiver */ private static void checkAllWSDLExtensionsUnderstood(WSPortInfo port, WSBinding binding) { if (port.getPort() != null && binding.isFeatureEnabled(RespectBindingFeature.class)) { - ((WSDLPortImpl) port.getPort()).areRequiredExtensionsUnderstood(); + port.getPort().areRequiredExtensionsUnderstood(); } } @@ -649,7 +648,7 @@ public abstract class Stub implements WSBindingProvider, ResponseContextReceiver //gather EPRExtensions specified in WSDL. try { - WSEndpointReference wsdlEpr = ((WSDLPortImpl) wsdlPort).getEPR(); + WSEndpointReference wsdlEpr = wsdlPort.getEPR(); if (wsdlEpr != null) { for (WSEndpointReference.EPRExtension extnEl : wsdlEpr.getEPRExtensions()) { wsdlEPRExtensions.add(new WSEPRExtension( diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java index 8b4eaa274ff..7805320d90a 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java @@ -41,7 +41,9 @@ import com.sun.xml.internal.ws.api.databinding.DatabindingConfig; import com.sun.xml.internal.ws.api.databinding.DatabindingFactory; import com.sun.xml.internal.ws.api.databinding.MetadataReader; import com.sun.xml.internal.ws.api.model.SEIModel; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLService; import com.sun.xml.internal.ws.api.pipe.Stubs; import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.api.server.ContainerResolver; @@ -51,15 +53,11 @@ import com.sun.xml.internal.ws.binding.WebServiceFeatureList; import com.sun.xml.internal.ws.client.HandlerConfigurator.AnnotationConfigurator; import com.sun.xml.internal.ws.client.HandlerConfigurator.HandlerResolverImpl; import com.sun.xml.internal.ws.client.sei.SEIStub; - import com.sun.xml.internal.ws.developer.MemberSubmissionAddressingFeature; import com.sun.xml.internal.ws.developer.UsesJAXBContextFeature; import com.sun.xml.internal.ws.developer.WSBindingProvider; import com.sun.xml.internal.ws.model.RuntimeModeler; import com.sun.xml.internal.ws.model.SOAPSEIModel; -import com.sun.xml.internal.ws.model.wsdl.WSDLModelImpl; -import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl; -import com.sun.xml.internal.ws.model.wsdl.WSDLServiceImpl; import com.sun.xml.internal.ws.resources.ClientMessages; import com.sun.xml.internal.ws.resources.DispatchMessages; import com.sun.xml.internal.ws.resources.ProviderApiMessages; @@ -67,6 +65,7 @@ import com.sun.xml.internal.ws.util.JAXWSUtils; import com.sun.xml.internal.ws.util.ServiceConfigurationError; import com.sun.xml.internal.ws.util.ServiceFinder; import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser; + import org.xml.sax.EntityResolver; import org.xml.sax.SAXException; @@ -86,6 +85,7 @@ import javax.xml.ws.WebServiceException; import javax.xml.ws.WebServiceFeature; import javax.xml.ws.handler.HandlerResolver; import javax.xml.ws.soap.AddressingFeature; + import java.io.IOException; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Proxy; @@ -179,7 +179,7 @@ public class WSServiceDelegate extends WSService { * This fiels can be be null if the service is created without wsdl but later * the epr supplies a wsdl that can be parsed. */ - private @Nullable WSDLServiceImpl wsdlService; + private @Nullable WSDLService wsdlService; private final Container container; /** @@ -219,7 +219,7 @@ public class WSServiceDelegate extends WSService { * @param serviceClass * Either {@link Service}.class or other generated service-derived classes. */ - public WSServiceDelegate(@Nullable Source wsdl, @Nullable WSDLServiceImpl service, @NotNull QName serviceName, @NotNull final Class serviceClass, WebServiceFeature... features) { + public WSServiceDelegate(@Nullable Source wsdl, @Nullable WSDLService service, @NotNull QName serviceName, @NotNull final Class serviceClass, WebServiceFeature... features) { this(wsdl, service, serviceName, serviceClass, new WebServiceFeatureList(features)); } @@ -227,7 +227,7 @@ public class WSServiceDelegate extends WSService { * @param serviceClass * Either {@link Service}.class or other generated service-derived classes. */ - public WSServiceDelegate(@Nullable Source wsdl, @Nullable WSDLServiceImpl service, @NotNull QName serviceName, @NotNull final Class serviceClass, WebServiceFeatureList features) { + public WSServiceDelegate(@Nullable Source wsdl, @Nullable WSDLService service, @NotNull QName serviceName, @NotNull final Class serviceClass, WebServiceFeatureList features) { //we cant create a Service without serviceName if (serviceName == null) { throw new WebServiceException(ClientMessages.INVALID_SERVICE_NAME_NULL(null)); @@ -303,7 +303,7 @@ public class WSServiceDelegate extends WSService { if (wsdl != null) { try { URL url = wsdl.getSystemId()==null ? null : JAXWSUtils.getEncodedURL(wsdl.getSystemId()); - WSDLModelImpl model = parseWSDL(url, wsdl, serviceClass); + WSDLModel model = parseWSDL(url, wsdl, serviceClass); service = model.getService(this.serviceName); if (service == null) throw new WebServiceException( @@ -316,6 +316,10 @@ public class WSServiceDelegate extends WSService { throw new WebServiceException(ClientMessages.INVALID_WSDL_URL(wsdl.getSystemId())); } } + } else { + // fill in statically known ports + for (WSDLPort port : service.getPorts()) + ports.put(port.getName(), new PortInfo(this, port)); } this.wsdlService = service; @@ -339,7 +343,7 @@ public class WSServiceDelegate extends WSService { * Either this or wsdl parameter must be given. * Null location means the system won't be able to resolve relative references in the WSDL, */ - private WSDLModelImpl parseWSDL(URL wsdlDocumentLocation, Source wsdlSource, Class serviceClass) { + private WSDLModel parseWSDL(URL wsdlDocumentLocation, Source wsdlSource, Class serviceClass) { try { return RuntimeWSDLParser.parse(wsdlDocumentLocation, wsdlSource, createCatalogResolver(), true, getContainer(), serviceClass, ServiceFinder.find(WSDLParserExtension.class).toArray()); @@ -385,7 +389,7 @@ public class WSServiceDelegate extends WSService { public T getPort(QName portName, Class portInterface, WebServiceFeature... features) { if (portName == null || portInterface == null) throw new IllegalArgumentException(); - WSDLServiceImpl tWsdlService = this.wsdlService; + WSDLService tWsdlService = this.wsdlService; if (tWsdlService == null) { // assigning it to local variable and not setting it back to this.wsdlService intentionally // as we don't want to include the service instance with information gathered from sei @@ -396,7 +400,7 @@ public class WSServiceDelegate extends WSService { } } - WSDLPortImpl portModel = getPortModel(tWsdlService, portName); + WSDLPort portModel = getPortModel(tWsdlService, portName); return getPort(portModel.getEPR(), portName, portInterface, new WebServiceFeatureList(features)); } @@ -436,7 +440,7 @@ public class WSServiceDelegate extends WSService { public T getPort(Class portInterface, WebServiceFeature... features) { //get the portType from SEI QName portTypeName = RuntimeModeler.getPortTypeName(portInterface, getMetadadaReader(new WebServiceFeatureList(features), portInterface.getClassLoader())); - WSDLServiceImpl tmpWsdlService = this.wsdlService; + WSDLService tmpWsdlService = this.wsdlService; if (tmpWsdlService == null) { // assigning it to local variable and not setting it back to this.wsdlService intentionally // as we don't want to include the service instance with information gathered from sei @@ -447,7 +451,7 @@ public class WSServiceDelegate extends WSService { } } //get the first port corresponding to the SEI - WSDLPortImpl port = tmpWsdlService.getMatchingPort(portTypeName); + WSDLPort port = tmpWsdlService.getMatchingPort(portTypeName); if (port == null) { throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName)); } @@ -672,7 +676,7 @@ public class WSServiceDelegate extends WSService { throw new WebServiceException(ProviderApiMessages.NULL_WSDL()); } try { - WSDLModelImpl eprWsdlMdl = parseWSDL(new URL(wsepr.getAddress()), eprWsdlSource, null); + WSDLModel eprWsdlMdl = parseWSDL(new URL(wsepr.getAddress()), eprWsdlSource, null); wsdlService = eprWsdlMdl.getService(serviceName); if (wsdlService == null) throw new WebServiceException(ClientMessages.INVALID_SERVICE_NAME(serviceName, @@ -685,7 +689,7 @@ public class WSServiceDelegate extends WSService { if (portName == null && portTypeName != null) { //get the first port corresponding to the SEI - WSDLPortImpl port = wsdlService.getMatchingPort(portTypeName); + WSDLPort port = wsdlService.getMatchingPort(portTypeName); if (port == null) throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName)); portName = port.getName(); @@ -732,7 +736,7 @@ public class WSServiceDelegate extends WSService { ); } - private WSDLServiceImpl getWSDLModelfromSEI(final Class sei) { + private WSDLService getWSDLModelfromSEI(final Class sei) { WebService ws = AccessController.doPrivileged(new PrivilegedAction() { public WebService run() { return (WebService) sei.getAnnotation(WebService.class); @@ -743,11 +747,11 @@ public class WSServiceDelegate extends WSService { String wsdlLocation = ws.wsdlLocation(); wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation)); Source wsdl = new StreamSource(wsdlLocation); - WSDLServiceImpl service = null; + WSDLService service = null; try { URL url = wsdl.getSystemId() == null ? null : new URL(wsdl.getSystemId()); - WSDLModelImpl model = parseWSDL(url, wsdl, sei); + WSDLModel model = parseWSDL(url, wsdl, sei); service = model.getService(this.serviceName); if (service == null) throw new WebServiceException( @@ -815,7 +819,7 @@ public class WSServiceDelegate extends WSService { */ private StringBuilder buildWsdlPortNames() { Set wsdlPortNames = new HashSet(); - for (WSDLPortImpl port : wsdlService.getPorts()) { + for (WSDLPort port : wsdlService.getPorts()) { wsdlPortNames.add(port.getName()); } return buildNameList(wsdlPortNames); @@ -826,8 +830,8 @@ public class WSServiceDelegate extends WSService { * * @return guaranteed to be non-null. */ - public @NotNull WSDLPortImpl getPortModel(WSDLServiceImpl wsdlService, QName portName) { - WSDLPortImpl port = wsdlService.get(portName); + public @NotNull WSDLPort getPortModel(WSDLService wsdlService, QName portName) { + WSDLPort port = wsdlService.get(portName); if (port == null) throw new WebServiceException( ClientMessages.INVALID_PORT_NAME(portName,buildWsdlPortNames())); @@ -884,7 +888,7 @@ public class WSServiceDelegate extends WSService { } private SEIPortInfo createSEIPortInfo(QName portName, Class portInterface, WebServiceFeatureList features) { - WSDLPortImpl wsdlPort = getPortModel(wsdlService, portName); + WSDLPort wsdlPort = getPortModel(wsdlService, portName); SEIModel model = buildRuntimeModel(serviceName, portName, portInterface, wsdlPort, features); return new SEIPortInfo(this, portInterface, (SOAPSEIModel) model, wsdlPort); @@ -894,7 +898,7 @@ public class WSServiceDelegate extends WSService { return features.contains(UsesJAXBContextFeature.class); } - public WSDLServiceImpl getWsdlService() { + public WSDLService getWsdlService() { return wsdlService; } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java new file mode 100644 index 00000000000..f0daea51faf --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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.xml.internal.ws.client.sei; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks + * to java.lang,reflect.Method.invoke() + *

    + * Be careful, copy of this class exists in several packages, iny modification must be done to other copies too! + */ +class MethodUtil { + + private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName()); + private static final Method INVOKE_METHOD; + + static { + Method method; + try { + Class clazz = Class.forName("sun.reflect.misc.MethodUtil"); + method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods."); + } + } catch (Throwable t) { + method = null; + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM"); + } + } + INVOKE_METHOD = method; + } + + static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException { + if (INVOKE_METHOD != null) { + // sun.reflect.misc.MethodUtil.invoke(method, owner, args) + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil"); + } + try { + return INVOKE_METHOD.invoke(null, method, target, args); + } catch (InvocationTargetException ite) { + // unwrap invocation exception added by reflection code ... + throw unwrapException(ite); + } + } else { + // other then Oracle JDK ... + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM"); + } + return method.invoke(target, args); + } + } + + private static InvocationTargetException unwrapException(InvocationTargetException ite) { + Throwable targetException = ite.getTargetException(); + if (targetException != null && targetException instanceof InvocationTargetException) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Unwrapping invocation target exception"); + } + return (InvocationTargetException) targetException; + } else { + return ite; + } + } + +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java index 7a5f0e3a1a7..9ad1f6edfba 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java @@ -28,6 +28,7 @@ package com.sun.xml.internal.ws.client.sei; import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.SOAPVersion; +import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; import com.sun.xml.internal.ws.api.client.WSPortInfo; import com.sun.xml.internal.ws.api.databinding.Databinding; import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; @@ -36,12 +37,16 @@ import com.sun.xml.internal.ws.api.message.Headers; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.model.MEP; import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; -import com.sun.xml.internal.ws.api.pipe.Tube; import com.sun.xml.internal.ws.api.pipe.Fiber; +import com.sun.xml.internal.ws.api.pipe.Tube; import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.api.server.ContainerResolver; import com.sun.xml.internal.ws.binding.BindingImpl; -import com.sun.xml.internal.ws.client.*; +import com.sun.xml.internal.ws.client.AsyncResponseImpl; +import com.sun.xml.internal.ws.client.RequestContext; +import com.sun.xml.internal.ws.client.ResponseContextReceiver; +import com.sun.xml.internal.ws.client.Stub; +import com.sun.xml.internal.ws.client.WSServiceDelegate; import com.sun.xml.internal.ws.model.JavaMethodImpl; import com.sun.xml.internal.ws.model.SOAPSEIModel; import com.sun.xml.internal.ws.wsdl.OperationDispatcher; @@ -50,6 +55,8 @@ import javax.xml.namespace.QName; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.lang.reflect.Proxy; import java.util.HashMap; import java.util.Map; @@ -132,6 +139,7 @@ public final class SEIStub extends Stub implements InvocationHandler { private final Map methodHandlers = new HashMap(); public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + validateInputs(proxy, method); Container old = ContainerResolver.getDefault().enterContainer(owner.getContainer()); try { MethodHandler handler = methodHandlers.get(method); @@ -155,6 +163,17 @@ public final class SEIStub extends Stub implements InvocationHandler { } } + private void validateInputs(Object proxy, Method method) { + if (proxy == null || !Proxy.isProxyClass(proxy.getClass())) { + throw new IllegalStateException("Passed object is not proxy!"); + } + Class declaringClass = method.getDeclaringClass(); + if (method == null || declaringClass == null + || Modifier.isStatic(method.getModifiers())) { + throw new IllegalStateException("Invoking static method is not allowed!"); + } + } + public final Packet doProcess(Packet request, RequestContext rc, ResponseContextReceiver receiver) { return super.process(request, rc, receiver); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/ExternalMetadataReader.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/ExternalMetadataReader.java index 41cf3f7f4b4..2de13dc362c 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/ExternalMetadataReader.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/ExternalMetadataReader.java @@ -75,13 +75,13 @@ public class ExternalMetadataReader extends ReflectAnnotationReader { private Map readers = new HashMap(); public ExternalMetadataReader(Collection files, Collection resourcePaths, ClassLoader classLoader, - boolean xsdValidation, boolean disableSecureXmlProcessing) { + boolean xsdValidation, boolean disableXmlSecurity) { if (files != null) { for (File file : files) { try { - String namespace = Util.documentRootNamespace(newSource(file), disableSecureXmlProcessing); - JavaWsdlMappingType externalMapping = parseMetadata(xsdValidation, newSource(file), namespace, disableSecureXmlProcessing); + String namespace = Util.documentRootNamespace(newSource(file), disableXmlSecurity); + JavaWsdlMappingType externalMapping = parseMetadata(xsdValidation, newSource(file), namespace, disableXmlSecurity); readers.put(externalMapping.getJavaTypeName(), externalMapping); } catch (Exception e) { throw new RuntimeModelerException("runtime.modeler.external.metadata.unable.to.read", file.getAbsolutePath()); @@ -92,8 +92,8 @@ public class ExternalMetadataReader extends ReflectAnnotationReader { if (resourcePaths != null) { for (String resourcePath : resourcePaths) { try { - String namespace = Util.documentRootNamespace(newSource(resourcePath, classLoader), disableSecureXmlProcessing); - JavaWsdlMappingType externalMapping = parseMetadata(xsdValidation, newSource(resourcePath, classLoader), namespace, disableSecureXmlProcessing); + String namespace = Util.documentRootNamespace(newSource(resourcePath, classLoader), disableXmlSecurity); + JavaWsdlMappingType externalMapping = parseMetadata(xsdValidation, newSource(resourcePath, classLoader), namespace, disableXmlSecurity); readers.put(externalMapping.getJavaTypeName(), externalMapping); } catch (Exception e) { throw new RuntimeModelerException("runtime.modeler.external.metadata.unable.to.read", resourcePath); @@ -107,11 +107,11 @@ public class ExternalMetadataReader extends ReflectAnnotationReader { return new StreamSource(is); } - private JavaWsdlMappingType parseMetadata(boolean xsdValidation, StreamSource source, String namespace, boolean disableSecureXmlProcessing) throws JAXBException, IOException, TransformerException { + private JavaWsdlMappingType parseMetadata(boolean xsdValidation, StreamSource source, String namespace, boolean disableXmlSecurity) throws JAXBException, IOException, TransformerException { if (NAMESPACE_WEBLOGIC_WSEE_DATABINDING.equals(namespace)) { - return Util.transformAndRead(source, disableSecureXmlProcessing); + return Util.transformAndRead(source, disableXmlSecurity); } if (NAMESPACE_JAXWS_RI_EXTERNAL_METADATA.equals(namespace)) { - return Util.read(source, xsdValidation, disableSecureXmlProcessing); + return Util.read(source, xsdValidation, disableXmlSecurity); } else { throw new RuntimeModelerException("runtime.modeler.external.metadata.unsupported.schema", namespace, Arrays.asList(NAMESPACE_WEBLOGIC_WSEE_DATABINDING, NAMESPACE_JAXWS_RI_EXTERNAL_METADATA).toString()); } @@ -425,8 +425,8 @@ public class ExternalMetadataReader extends ReflectAnnotationReader { } @SuppressWarnings("unchecked") - public static JavaWsdlMappingType read(Source src, boolean xsdValidation, boolean disableSecureXmlProcessing) throws IOException, JAXBException { - JAXBContext ctx = jaxbContext(disableSecureXmlProcessing); + public static JavaWsdlMappingType read(Source src, boolean xsdValidation, boolean disableXmlSecurity) throws IOException, JAXBException { + JAXBContext ctx = jaxbContext(disableXmlSecurity); try { Unmarshaller um = ctx.createUnmarshaller(); if (xsdValidation) { @@ -455,16 +455,16 @@ public class ExternalMetadataReader extends ReflectAnnotationReader { } } - private static JAXBContext jaxbContext(boolean disableSecureXmlProcessing) { + private static JAXBContext jaxbContext(boolean disableXmlSecurity) { // as it is supposed to have security enabled in most cases, we create and don't cache // "insecure" JAXBContext - these should be corner cases - return disableSecureXmlProcessing ? createJaxbContext(true) : jaxbContext; + return disableXmlSecurity ? createJaxbContext(true) : jaxbContext; } - public static JavaWsdlMappingType transformAndRead(Source src, boolean disableSecureXmlProcessing) throws TransformerException, JAXBException { + public static JavaWsdlMappingType transformAndRead(Source src, boolean disableXmlSecurity) throws TransformerException, JAXBException { Source xsl = new StreamSource(Util.class.getResourceAsStream(TRANSLATE_NAMESPACES_XSL)); - JAXBResult result = new JAXBResult(jaxbContext(disableSecureXmlProcessing)); - TransformerFactory tf = XmlUtil.newTransformerFactory(!disableSecureXmlProcessing); + JAXBResult result = new JAXBResult(jaxbContext(disableXmlSecurity)); + TransformerFactory tf = XmlUtil.newTransformerFactory(!disableXmlSecurity); Transformer transformer = tf.newTemplates(xsl).newTransformer(); transformer.transform(src, result); return getJavaWsdlMapping(result.getResult()); @@ -534,9 +534,9 @@ public class ExternalMetadataReader extends ReflectAnnotationReader { return elems.toArray(new Element[elems.size()]); } - static String documentRootNamespace(Source src, boolean disableSecureXmlProcessing) throws XMLStreamException { + static String documentRootNamespace(Source src, boolean disableXmlSecurity) throws XMLStreamException { XMLInputFactory factory; - factory = XmlUtil.newXMLInputFactory(!disableSecureXmlProcessing); + factory = XmlUtil.newXMLInputFactory(!disableXmlSecurity); XMLStreamReader streamReader = factory.createXMLStreamReader(src); XMLStreamReaderUtil.nextElementContent(streamReader); String namespaceURI = streamReader.getName().getNamespaceURI(); diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/JavaMethodImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/JavaMethodImpl.java index 7d248807c46..c6acfe0ba84 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/JavaMethodImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/JavaMethodImpl.java @@ -25,7 +25,6 @@ package com.sun.xml.internal.ws.model; -import com.sun.istack.internal.NotNull; import com.sun.xml.internal.bind.api.TypeReference; import com.sun.xml.internal.ws.api.databinding.MetadataReader; import com.sun.xml.internal.ws.api.model.JavaMethod; @@ -216,14 +215,14 @@ public final class JavaMethodImpl implements JavaMethod { * @return soap:Body's first child name for request message. */ public @Nullable QName getRequestPayloadName() { - return (wsdlOperation != null)? wsdlOperation.getReqPayloadName(): requestPayloadName; + return (wsdlOperation != null)? wsdlOperation.getRequestPayloadName(): requestPayloadName; } /** * @return soap:Body's first child name for response message. */ public @Nullable QName getResponsePayloadName() { - return (mep == MEP.ONE_WAY) ? null : wsdlOperation.getResPayloadName(); + return (mep == MEP.ONE_WAY) ? null : wsdlOperation.getResponsePayloadName(); } /** diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/AbstractExtensibleImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/AbstractExtensibleImpl.java index cb3ac1fe133..d7b3be40b08 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/AbstractExtensibleImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/AbstractExtensibleImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,11 +29,9 @@ import com.sun.xml.internal.ws.api.model.wsdl.WSDLExtensible; import com.sun.xml.internal.ws.api.model.wsdl.WSDLExtension; import com.sun.xml.internal.ws.api.model.wsdl.WSDLObject; import com.sun.xml.internal.ws.resources.UtilMessages; -import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants; import com.sun.istack.internal.NotNull; import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.Location; import javax.xml.namespace.QName; import javax.xml.ws.WebServiceException; import java.util.ArrayList; @@ -42,7 +40,6 @@ import java.util.List; import java.util.Set; import org.xml.sax.Locator; -import org.xml.sax.helpers.LocatorImpl; /** * All the WSDL 1.1 elements that are extensible should subclass from this abstract implementation of @@ -95,6 +92,10 @@ abstract class AbstractExtensibleImpl extends AbstractObjectImpl implements WSDL extensions.add(ex); } + public List getNotUnderstoodExtensions() { + return notUnderstoodExtensions; + } + /** * This can be used if a WSDL extension element that has wsdl:required=true * is not understood diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundFaultImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundFaultImpl.java index 86dd0dc8eb4..bdd590e2117 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundFaultImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundFaultImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,10 +26,10 @@ package com.sun.xml.internal.ws.model.wsdl; import com.sun.istack.internal.NotNull; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundFault; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundFault; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLFault; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOperation; import javax.xml.stream.XMLStreamReader; import javax.xml.namespace.QName; @@ -37,12 +37,12 @@ import javax.xml.namespace.QName; /** * @author Vivek Pandey */ -public class WSDLBoundFaultImpl extends AbstractExtensibleImpl implements WSDLBoundFault { +public class WSDLBoundFaultImpl extends AbstractExtensibleImpl implements EditableWSDLBoundFault { private final String name; - private WSDLFault fault; - private WSDLBoundOperationImpl owner; + private EditableWSDLFault fault; + private EditableWSDLBoundOperation owner; - public WSDLBoundFaultImpl(XMLStreamReader xsr, String name, WSDLBoundOperationImpl owner) { + public WSDLBoundFaultImpl(XMLStreamReader xsr, String name, EditableWSDLBoundOperation owner) { super(xsr); this.name = name; this.owner = owner; @@ -61,20 +61,20 @@ public class WSDLBoundFaultImpl extends AbstractExtensibleImpl implements WSDLBo return null; } - public WSDLFault getFault() { + public EditableWSDLFault getFault() { return fault; } @NotNull - public WSDLBoundOperation getBoundOperation() { + public EditableWSDLBoundOperation getBoundOperation() { return owner; } - void freeze(WSDLBoundOperationImpl root) { + public void freeze(EditableWSDLBoundOperation root) { assert root != null; - WSDLOperation op = root.getOperation(); + EditableWSDLOperation op = root.getOperation(); if (op != null) { - for (WSDLFault f : op.getFaults()) { + for (EditableWSDLFault f : op.getFaults()) { if (f.getName().equals(name)) { this.fault = f; break; diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java index 917e5c60e1b..e4f00970908 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java @@ -29,12 +29,20 @@ import com.sun.istack.internal.Nullable; import com.sun.istack.internal.NotNull; import com.sun.xml.internal.ws.api.model.ParameterBinding; import com.sun.xml.internal.ws.api.model.wsdl.*; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundFault; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundPortType; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPart; import com.sun.xml.internal.ws.model.RuntimeModeler; import javax.jws.WebParam.Mode; import javax.jws.soap.SOAPBinding.Style; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamReader; + import java.util.*; /** @@ -42,7 +50,7 @@ import java.util.*; * * @author Vivek Pandey */ -public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl implements WSDLBoundOperation { +public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl implements EditableWSDLBoundOperation { private final QName name; // map of wsdl:part to the binding @@ -61,20 +69,20 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme private Boolean emptyOutputBody; private Boolean emptyFaultBody; - private final Map inParts; - private final Map outParts; - private final List wsdlBoundFaults; - private WSDLOperationImpl operation; + private final Map inParts; + private final Map outParts; + private final List wsdlBoundFaults; + private EditableWSDLOperation operation; private String soapAction; private ANONYMOUS anonymous; - private final WSDLBoundPortTypeImpl owner; + private final EditableWSDLBoundPortType owner; /** * * @param name wsdl:operation name qualified value */ - public WSDLBoundOperationImpl(XMLStreamReader xsr, WSDLBoundPortTypeImpl owner, QName name) { + public WSDLBoundOperationImpl(XMLStreamReader xsr, EditableWSDLBoundPortType owner, QName name) { super(xsr); this.name = name; inputParts = new HashMap(); @@ -83,9 +91,9 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme inputMimeTypes = new HashMap(); outputMimeTypes = new HashMap(); faultMimeTypes = new HashMap(); - inParts = new HashMap(); - outParts = new HashMap(); - wsdlBoundFaults = new ArrayList(); + inParts = new HashMap(); + outParts = new HashMap(); + wsdlBoundFaults = new ArrayList(); this.owner = owner; } @@ -104,7 +112,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme } @Override - public WSDLPartImpl getPart(String partName, Mode mode) { + public EditableWSDLPart getPart(String partName, Mode mode) { if(mode==Mode.IN){ return inParts.get(partName); }else if(mode==Mode.OUT){ @@ -113,7 +121,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme return null; } - public void addPart(WSDLPartImpl part, Mode mode){ + public void addPart(EditableWSDLPart part, Mode mode){ if(mode==Mode.IN) inParts.put(part.getName(), part); else if(mode==Mode.OUT) @@ -149,53 +157,26 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme // TODO: what's the difference between this and inputParts/outputParts? @Override - public Map getInParts() { - return Collections.unmodifiableMap(inParts); + public Map getInParts() { + return Collections.unmodifiableMap(inParts); } @Override - public Map getOutParts() { - return Collections.unmodifiableMap(outParts); + public Map getOutParts() { + return Collections.unmodifiableMap(outParts); } @NotNull @Override - public List getFaults() { + public List getFaults() { return wsdlBoundFaults; } - public void addFault(@NotNull WSDLBoundFaultImpl fault){ + public void addFault(@NotNull EditableWSDLBoundFault fault){ wsdlBoundFaults.add(fault); } - /** - * Map of mime:content@part and the mime type from mime:content@type for wsdl:output - * - * @return empty Map if there is no parts - */ - public Map getInputMimeTypes() { - return inputMimeTypes; - } - - /** - * Map of mime:content@part and the mime type from mime:content@type for wsdl:output - * - * @return empty Map if there is no parts - */ - public Map getOutputMimeTypes() { - return outputMimeTypes; - } - - /** - * Map of mime:content@part and the mime type from mime:content@type for wsdl:fault - * - * @return empty Map if there is no parts - */ - public Map getFaultMimeTypes() { - return faultMimeTypes; - } - /** * Gets {@link ParameterBinding} for a given wsdl part in wsdl:input * @@ -296,13 +277,13 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme } @Override - public WSDLOperationImpl getOperation() { + public EditableWSDLOperation getOperation() { return operation; } @Override - public WSDLBoundPortType getBoundPortType() { + public EditableWSDLBoundPortType getBoundPortType() { return owner; } @@ -324,7 +305,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme } @Override - public @Nullable QName getReqPayloadName() { + public @Nullable QName getRequestPayloadName() { if (emptyRequestPayload) return null; @@ -337,8 +318,8 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme return requestPayloadName; }else{ QName inMsgName = operation.getInput().getMessage().getName(); - WSDLMessageImpl message = messages.get(inMsgName); - for(WSDLPartImpl part:message.parts()){ + EditableWSDLMessage message = messages.get(inMsgName); + for(EditableWSDLPart part:message.parts()){ ParameterBinding binding = getInputBinding(part.getName()); if(binding.isBody()){ requestPayloadName = part.getDescriptor().name(); @@ -354,7 +335,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme } @Override - public @Nullable QName getResPayloadName() { + public @Nullable QName getResponsePayloadName() { if (emptyResponsePayload) return null; @@ -367,8 +348,8 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme return responsePayloadName; }else{ QName outMsgName = operation.getOutput().getMessage().getName(); - WSDLMessageImpl message = messages.get(outMsgName); - for(WSDLPartImpl part:message.parts()){ + EditableWSDLMessage message = messages.get(outMsgName); + for(EditableWSDLPart part:message.parts()){ ParameterBinding binding = getOutputBinding(part.getName()); if(binding.isBody()){ responsePayloadName = part.getDescriptor().name(); @@ -402,7 +383,6 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme reqNamespace = ns; } - /** * For rpclit gives namespace value on soapbinding:body@namespace * @@ -418,7 +398,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme respNamespace = ns; } - WSDLBoundPortTypeImpl getOwner(){ + EditableWSDLBoundPortType getOwner(){ return owner; } @@ -426,12 +406,12 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme private QName responsePayloadName; private boolean emptyRequestPayload; private boolean emptyResponsePayload; - private Map messages; + private Map messages; - void freeze(WSDLModelImpl parent) { + public void freeze(EditableWSDLModel parent) { messages = parent.getMessages(); operation = owner.getPortType().get(name.getLocalPart()); - for(WSDLBoundFaultImpl bf : wsdlBoundFaults){ + for(EditableWSDLBoundFault bf : wsdlBoundFaults){ bf.freeze(this); } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundPortTypeImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundPortTypeImpl.java index c77c6876e93..ddd052de068 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundPortTypeImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundPortTypeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,10 @@ import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.model.ParameterBinding; import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundPortType; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPortType; import com.sun.xml.internal.ws.resources.ClientMessages; import com.sun.xml.internal.ws.util.QNameMap; import com.sun.xml.internal.ws.util.exception.LocatableWebServiceException; @@ -47,26 +51,26 @@ import javax.xml.ws.soap.MTOMFeature; * * @author Vivek Pandey */ -public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl implements WSDLBoundPortType { +public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl implements EditableWSDLBoundPortType { private final QName name; private final QName portTypeName; - private WSDLPortTypeImpl portType; + private EditableWSDLPortType portType; private BindingID bindingId; - private final @NotNull WSDLModelImpl owner; - private final QNameMap bindingOperations = new QNameMap(); + private final @NotNull EditableWSDLModel owner; + private final QNameMap bindingOperations = new QNameMap(); /** * Operations keyed by the payload tag name. */ - private QNameMap payloadMap; + private QNameMap payloadMap; /** * {@link #payloadMap} doesn't allow null key, so we store the value for it here. */ - private WSDLBoundOperationImpl emptyPayloadOperation; + private EditableWSDLBoundOperation emptyPayloadOperation; - public WSDLBoundPortTypeImpl(XMLStreamReader xsr,@NotNull WSDLModelImpl owner, QName name, QName portTypeName) { + public WSDLBoundPortTypeImpl(XMLStreamReader xsr,@NotNull EditableWSDLModel owner, QName name, QName portTypeName) { super(xsr); this.owner = owner; this.name = name; @@ -78,11 +82,11 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl return name; } - public @NotNull WSDLModelImpl getOwner() { + public @NotNull EditableWSDLModel getOwner() { return owner; } - public WSDLBoundOperationImpl get(QName operationName) { + public EditableWSDLBoundOperation get(QName operationName) { return bindingOperations.get(operationName); } @@ -93,7 +97,7 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl * @param ptOp Must be non-null * @throws NullPointerException if either opName or ptOp is null */ - public void put(QName opName, WSDLBoundOperationImpl ptOp) { + public void put(QName opName, EditableWSDLBoundOperation ptOp) { bindingOperations.put(opName,ptOp); } @@ -101,11 +105,11 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl return portTypeName; } - public WSDLPortTypeImpl getPortType() { + public EditableWSDLPortType getPortType() { return portType; } - public Iterable getBindingOperations() { + public Iterable getBindingOperations() { return bindingOperations.values(); } @@ -149,7 +153,7 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl * @return null if the binding could not be resolved for the part. */ public ParameterBinding getBinding(QName operation, String part, Mode mode) { - WSDLBoundOperationImpl op = get(operation); + EditableWSDLBoundOperation op = get(operation); if (op == null) { //TODO throw exception return null; @@ -160,23 +164,7 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl return op.getOutputBinding(part); } - /** - * Gets mime:content@part value which is the MIME type for a given operation, part and {@link Mode}. - * - * @param operation wsdl:operation@name value. Must be non-null. - * @param part wsdl:part@name such as value of soap:header@part. Must be non-null. - * @param mode {@link Mode#IN} or {@link Mode#OUT}. Must be non-null. - * @return null if the binding could not be resolved for the part. - */ - public String getMimeType(QName operation, String part, Mode mode) { - WSDLBoundOperationImpl op = get(operation); - if (Mode.IN == mode) - return op.getMimeTypeForInputPart(part); - else - return op.getMimeTypeForOutputPart(part); - } - - public WSDLBoundOperationImpl getOperation(String namespaceUri, String localName) { + public EditableWSDLBoundOperation getOperation(String namespaceUri, String localName) { if(namespaceUri==null && localName == null) return emptyPayloadOperation; else{ @@ -184,19 +172,7 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl } } - public void enableMTOM() { - features.add(new MTOMFeature()); - } - - public boolean isMTOMEnabled() { - return features.isEnabled(MTOMFeature.class); - } - - public SOAPVersion getSOAPVersion(){ - return getBindingId().getSOAPVersion(); - } - - void freeze() { + public void freeze() { portType = owner.getPortType(portTypeName); if(portType == null){ throw new LocatableWebServiceException( @@ -204,7 +180,7 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl } portType.freeze(); - for (WSDLBoundOperationImpl op : bindingOperations.values()) { + for (EditableWSDLBoundOperation op : bindingOperations.values()) { op.freeze(owner); } @@ -214,15 +190,15 @@ public final class WSDLBoundPortTypeImpl extends AbstractFeaturedObjectImpl impl private void freezePayloadMap() { if(style== Style.RPC) { - payloadMap = new QNameMap(); - for(WSDLBoundOperationImpl op : bindingOperations.values()){ - payloadMap.put(op.getReqPayloadName(), op); + payloadMap = new QNameMap(); + for(EditableWSDLBoundOperation op : bindingOperations.values()){ + payloadMap.put(op.getRequestPayloadName(), op); } } else { - payloadMap = new QNameMap(); + payloadMap = new QNameMap(); // For doclit The tag will be the operation that has the same input part descriptor value - for(WSDLBoundOperationImpl op : bindingOperations.values()){ - QName name = op.getReqPayloadName(); + for(EditableWSDLBoundOperation op : bindingOperations.values()){ + QName name = op.getRequestPayloadName(); if(name == null){ //empty payload emptyPayloadOperation = op; diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLFaultImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLFaultImpl.java index d35b63378d3..cfe3d5bb3ff 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLFaultImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLFaultImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,8 +25,10 @@ package com.sun.xml.internal.ws.model.wsdl; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLFault; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOperation; import com.sun.istack.internal.NotNull; import javax.xml.namespace.QName; @@ -35,15 +37,15 @@ import javax.xml.stream.XMLStreamReader; /** * @author Vivek Pandey */ -public final class WSDLFaultImpl extends AbstractExtensibleImpl implements WSDLFault { +public final class WSDLFaultImpl extends AbstractExtensibleImpl implements EditableWSDLFault { private final String name; private final QName messageName; - private WSDLMessageImpl message; - private WSDLOperationImpl operation; + private EditableWSDLMessage message; + private EditableWSDLOperation operation; private String action = ""; private boolean defaultAction = true; - public WSDLFaultImpl(XMLStreamReader xsr, String name, QName messageName, WSDLOperationImpl operation) { + public WSDLFaultImpl(XMLStreamReader xsr, String name, QName messageName, EditableWSDLOperation operation) { super(xsr); this.name = name; this.messageName = messageName; @@ -54,12 +56,12 @@ public final class WSDLFaultImpl extends AbstractExtensibleImpl implements WSDLF return name; } - public WSDLMessageImpl getMessage() { + public EditableWSDLMessage getMessage() { return message; } @NotNull - public WSDLOperation getOperation() { + public EditableWSDLOperation getOperation() { return operation; } @@ -72,6 +74,7 @@ public final class WSDLFaultImpl extends AbstractExtensibleImpl implements WSDLF public String getAction() { return action; } + public void setAction(String action) { this.action = action; } @@ -84,7 +87,7 @@ public final class WSDLFaultImpl extends AbstractExtensibleImpl implements WSDLF this.defaultAction = defaultAction; } - void freeze(WSDLModelImpl root){ + public void freeze(EditableWSDLModel root){ message = root.getMessage(messageName); } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLInputImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLInputImpl.java index cde05d05d95..c90c84cd5cd 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLInputImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLInputImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,11 +25,11 @@ package com.sun.xml.internal.ws.model.wsdl; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLInput; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLInput; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOperation; import com.sun.istack.internal.NotNull; -import com.sun.istack.internal.Nullable; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamReader; @@ -37,15 +37,15 @@ import javax.xml.stream.XMLStreamReader; /** * @author Vivek Pandey */ -public final class WSDLInputImpl extends AbstractExtensibleImpl implements WSDLInput { +public final class WSDLInputImpl extends AbstractExtensibleImpl implements EditableWSDLInput { private String name; private QName messageName; - private WSDLOperationImpl operation; - private WSDLMessageImpl message; + private EditableWSDLOperation operation; + private EditableWSDLMessage message; private String action; private boolean defaultAction = true; - public WSDLInputImpl(XMLStreamReader xsr,String name, QName messageName, WSDLOperationImpl operation) { + public WSDLInputImpl(XMLStreamReader xsr,String name, QName messageName, EditableWSDLOperation operation) { super(xsr); this.name = name; this.messageName = messageName; @@ -59,7 +59,7 @@ public final class WSDLInputImpl extends AbstractExtensibleImpl implements WSDLI return (operation.isOneWay())?operation.getName().getLocalPart():operation.getName().getLocalPart()+"Request"; } - public WSDLMessage getMessage() { + public EditableWSDLMessage getMessage() { return message; } @@ -68,7 +68,7 @@ public final class WSDLInputImpl extends AbstractExtensibleImpl implements WSDLI } @NotNull - public WSDLOperation getOperation() { + public EditableWSDLOperation getOperation() { return operation; } @@ -88,7 +88,7 @@ public final class WSDLInputImpl extends AbstractExtensibleImpl implements WSDLI this.defaultAction = defaultAction; } - void freeze(WSDLModelImpl parent) { + public void freeze(EditableWSDLModel parent) { message = parent.getMessage(messageName); } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLMessageImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLMessageImpl.java index c3a08652060..22dcc2b1a16 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLMessageImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLMessageImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,19 +25,21 @@ package com.sun.xml.internal.ws.model.wsdl; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPart; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamReader; + import java.util.ArrayList; /** * Provides abstraction for wsdl:message * @author Vivek Pandey */ -public final class WSDLMessageImpl extends AbstractExtensibleImpl implements WSDLMessage { +public final class WSDLMessageImpl extends AbstractExtensibleImpl implements EditableWSDLMessage { private final QName name; - private final ArrayList parts; + private final ArrayList parts; /** * @param name wsdl:message name attribute value @@ -45,18 +47,18 @@ public final class WSDLMessageImpl extends AbstractExtensibleImpl implements WSD public WSDLMessageImpl(XMLStreamReader xsr,QName name) { super(xsr); this.name = name; - this.parts = new ArrayList(); + this.parts = new ArrayList(); } public QName getName() { return name; } - public void add(WSDLPartImpl part){ + public void add(EditableWSDLPart part){ parts.add(part); } - public Iterable parts(){ + public Iterable parts(){ return parts; } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLModelImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLModelImpl.java index 78aa5cab554..798388ac8a1 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLModelImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLModelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,21 +27,25 @@ package com.sun.xml.internal.ws.model.wsdl; import com.sun.istack.internal.NotNull; import com.sun.xml.internal.ws.api.model.ParameterBinding; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType; import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage; import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLService; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundPortType; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPart; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPort; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPortType; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLService; import com.sun.xml.internal.ws.policy.PolicyMap; import javax.jws.WebParam.Mode; import javax.xml.namespace.QName; -import java.net.URL; + import java.util.Collections; import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; @@ -50,15 +54,15 @@ import java.util.Map; * * @author Vivek Pandey */ -public final class WSDLModelImpl extends AbstractExtensibleImpl implements WSDLModel { - private final Map messages = new HashMap(); - private final Map portTypes = new HashMap(); - private final Map bindings = new HashMap(); - private final Map services = new LinkedHashMap(); +public final class WSDLModelImpl extends AbstractExtensibleImpl implements EditableWSDLModel { + private final Map messages = new HashMap(); + private final Map portTypes = new HashMap(); + private final Map bindings = new HashMap(); + private final Map services = new LinkedHashMap(); private PolicyMap policyMap; - private final Map unmBindings - = Collections.unmodifiableMap(bindings); + private final Map unmBindings + = Collections.unmodifiableMap(bindings); public WSDLModelImpl(@NotNull String systemId) { @@ -72,52 +76,52 @@ public final class WSDLModelImpl extends AbstractExtensibleImpl implements WSDLM super(null,-1); } - public void addMessage(WSDLMessageImpl msg){ + public void addMessage(EditableWSDLMessage msg){ messages.put(msg.getName(), msg); } - public WSDLMessageImpl getMessage(QName name){ + public EditableWSDLMessage getMessage(QName name){ return messages.get(name); } - public void addPortType(WSDLPortTypeImpl pt){ + public void addPortType(EditableWSDLPortType pt){ portTypes.put(pt.getName(), pt); } - public WSDLPortTypeImpl getPortType(QName name){ + public EditableWSDLPortType getPortType(QName name){ return portTypes.get(name); } - public void addBinding(WSDLBoundPortTypeImpl boundPortType){ + public void addBinding(EditableWSDLBoundPortType boundPortType){ assert !bindings.containsValue(boundPortType); bindings.put(boundPortType.getName(), boundPortType); } - public WSDLBoundPortTypeImpl getBinding(QName name){ + public EditableWSDLBoundPortType getBinding(QName name){ return bindings.get(name); } - public void addService(WSDLServiceImpl svc){ + public void addService(EditableWSDLService svc){ services.put(svc.getName(), svc); } - public WSDLServiceImpl getService(QName name){ + public EditableWSDLService getService(QName name){ return services.get(name); } - public Map getMessages() { + public Map getMessages() { return messages; } - public @NotNull Map getPortTypes() { + public @NotNull Map getPortTypes() { return portTypes; } - public @NotNull Map getBindings() { + public @NotNull Map getBindings() { return unmBindings; } - public @NotNull Map getServices(){ + public @NotNull Map getServices(){ return services; } @@ -130,33 +134,6 @@ public final class WSDLModelImpl extends AbstractExtensibleImpl implements WSDLM return services.values().iterator().next().getName(); } - /** - * Returns first port QName from first service as per the insertion order - */ - public QName getFirstPortName(){ - WSDLPort fp = getFirstPort(); - if(fp==null) - return null; - else - return fp.getName(); - } - - private WSDLPort getFirstPort(){ - if(services.isEmpty()) - return null; - WSDLService service = services.values().iterator().next(); - Iterator iter = service.getPorts().iterator(); - WSDLPort port = iter.hasNext()?iter.next():null; - return port; - } - - /** - * gets the first port in the wsdl which matches the serviceName and portType - */ - public WSDLPortImpl getMatchingPort(QName serviceName, QName portType){ - return getService(serviceName).getMatchingPort(portType); - } - /** * * @param serviceName non-null service QName @@ -164,17 +141,17 @@ public final class WSDLModelImpl extends AbstractExtensibleImpl implements WSDLM * @return * WSDLBoundOperation on success otherwise null. throws NPE if any of the parameters null */ - public WSDLBoundPortTypeImpl getBinding(QName serviceName, QName portName){ - WSDLServiceImpl service = services.get(serviceName); + public EditableWSDLBoundPortType getBinding(QName serviceName, QName portName){ + EditableWSDLService service = services.get(serviceName); if(service != null){ - WSDLPortImpl port = service.get(portName); + EditableWSDLPort port = service.get(portName); if(port != null) return port.getBinding(); } return null; } - void finalizeRpcLitBinding(WSDLBoundPortTypeImpl boundPortType){ + public void finalizeRpcLitBinding(EditableWSDLBoundPortType boundPortType){ assert(boundPortType != null); QName portTypeName = boundPortType.getPortTypeName(); if(portTypeName == null) @@ -182,15 +159,15 @@ public final class WSDLModelImpl extends AbstractExtensibleImpl implements WSDLM WSDLPortType pt = portTypes.get(portTypeName); if(pt == null) return; - for (WSDLBoundOperationImpl bop : boundPortType.getBindingOperations()) { + for (EditableWSDLBoundOperation bop : boundPortType.getBindingOperations()) { WSDLOperation pto = pt.get(bop.getName().getLocalPart()); WSDLMessage inMsgName = pto.getInput().getMessage(); if(inMsgName == null) continue; - WSDLMessageImpl inMsg = messages.get(inMsgName.getName()); + EditableWSDLMessage inMsg = messages.get(inMsgName.getName()); int bodyindex = 0; if(inMsg != null){ - for(WSDLPartImpl part:inMsg.parts()){ + for(EditableWSDLPart part:inMsg.parts()){ String name = part.getName(); ParameterBinding pb = bop.getInputBinding(name); if(pb.isBody()){ @@ -206,9 +183,9 @@ public final class WSDLModelImpl extends AbstractExtensibleImpl implements WSDLM WSDLMessage outMsgName = pto.getOutput().getMessage(); if(outMsgName == null) continue; - WSDLMessageImpl outMsg = messages.get(outMsgName.getName()); + EditableWSDLMessage outMsg = messages.get(outMsgName.getName()); if(outMsg!= null){ - for(WSDLPartImpl part:outMsg.parts()){ + for(EditableWSDLPart part:outMsg.parts()){ String name = part.getName(); ParameterBinding pb = bop.getOutputBinding(name); if(pb.isBody()){ @@ -242,14 +219,14 @@ public final class WSDLModelImpl extends AbstractExtensibleImpl implements WSDLM * Invoked at the end of the model construction to fix up references, etc. */ public void freeze() { - for (WSDLServiceImpl service : services.values()) { + for (EditableWSDLService service : services.values()) { service.freeze(this); } - for (WSDLBoundPortTypeImpl bp : bindings.values()) { + for (EditableWSDLBoundPortType bp : bindings.values()) { bp.freeze(); } // Enforce freeze all the portTypes referenced by this endpoints, see Bug8966673 for detail - for (WSDLPortTypeImpl pt : portTypes.values()) { + for (EditableWSDLPortType pt : portTypes.values()) { pt.freeze(); } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOperationImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOperationImpl.java index 5f6532c6f3c..c4699940089 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOperationImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOperationImpl.java @@ -26,13 +26,20 @@ package com.sun.xml.internal.ws.model.wsdl; import com.sun.istack.internal.NotNull; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault; import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLFault; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLInput; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOutput; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPart; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPortType; import com.sun.xml.internal.ws.util.QNameMap; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamReader; + import java.util.ArrayList; import java.util.List; @@ -41,21 +48,21 @@ import java.util.List; * * @author Vivek Pandey */ -public final class WSDLOperationImpl extends AbstractExtensibleImpl implements WSDLOperation { +public final class WSDLOperationImpl extends AbstractExtensibleImpl implements EditableWSDLOperation { private final QName name; private String parameterOrder; - private WSDLInputImpl input; - private WSDLOutputImpl output; - private final List faults; - private final QNameMap faultMap; - protected Iterable messages; - private final WSDLPortType owner; + private EditableWSDLInput input; + private EditableWSDLOutput output; + private final List faults; + private final QNameMap faultMap; + protected Iterable messages; + private final EditableWSDLPortType owner; - public WSDLOperationImpl(XMLStreamReader xsr,WSDLPortTypeImpl owner, QName name) { + public WSDLOperationImpl(XMLStreamReader xsr, EditableWSDLPortType owner, QName name) { super(xsr); this.name = name; - this.faults = new ArrayList(); - this.faultMap = new QNameMap(); + this.faults = new ArrayList(); + this.faultMap = new QNameMap(); this.owner = owner; } @@ -71,15 +78,15 @@ public final class WSDLOperationImpl extends AbstractExtensibleImpl implements W this.parameterOrder = parameterOrder; } - public WSDLInputImpl getInput() { + public EditableWSDLInput getInput() { return input; } - public void setInput(WSDLInputImpl input) { + public void setInput(EditableWSDLInput input) { this.input = input; } - public WSDLOutputImpl getOutput() { + public EditableWSDLOutput getOutput() { return output; } @@ -87,22 +94,22 @@ public final class WSDLOperationImpl extends AbstractExtensibleImpl implements W return output == null; } - public void setOutput(WSDLOutputImpl output) { + public void setOutput(EditableWSDLOutput output) { this.output = output; } - public Iterable getFaults() { + public Iterable getFaults() { return faults; } - public WSDLFault getFault(QName faultDetailName) { - WSDLFaultImpl fault = faultMap.get(faultDetailName); + public EditableWSDLFault getFault(QName faultDetailName) { + EditableWSDLFault fault = faultMap.get(faultDetailName); if(fault != null) return fault; - for(WSDLFaultImpl fi:faults){ + for(EditableWSDLFault fi : faults){ assert fi.getMessage().parts().iterator().hasNext(); - WSDLPartImpl part = fi.getMessage().parts().iterator().next(); + EditableWSDLPart part = fi.getMessage().parts().iterator().next(); if(part.getDescriptor().name().equals(faultDetailName)){ faultMap.put(faultDetailName, fi); return fi; @@ -111,25 +118,21 @@ public final class WSDLOperationImpl extends AbstractExtensibleImpl implements W return null; } - WSDLPortType getOwner() { - return owner; - } - @NotNull public QName getPortTypeName() { return owner.getName(); } - public void addFault(WSDLFaultImpl fault) { + public void addFault(EditableWSDLFault fault) { faults.add(fault); } - public void freez(WSDLModelImpl root) { + public void freeze(EditableWSDLModel root) { assert input != null; input.freeze(root); if(output != null) output.freeze(root); - for(WSDLFaultImpl fault : faults){ + for(EditableWSDLFault fault : faults){ fault.freeze(root); } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOutputImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOutputImpl.java index 851ba7254fb..672c36801a6 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOutputImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOutputImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,10 @@ package com.sun.xml.internal.ws.model.wsdl; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOutput; import com.sun.istack.internal.NotNull; import javax.xml.namespace.QName; @@ -36,14 +37,15 @@ import javax.xml.stream.XMLStreamReader; /** * @author Vivek Pandey */ -public final class WSDLOutputImpl extends AbstractExtensibleImpl implements WSDLOutput { +public final class WSDLOutputImpl extends AbstractExtensibleImpl implements EditableWSDLOutput { private String name; private QName messageName; - private WSDLOperationImpl operation; - private WSDLMessageImpl message; + private EditableWSDLOperation operation; + private EditableWSDLMessage message; private String action; private boolean defaultAction = true; - public WSDLOutputImpl(XMLStreamReader xsr,String name, QName messageName, WSDLOperationImpl operation) { + + public WSDLOutputImpl(XMLStreamReader xsr,String name, QName messageName, EditableWSDLOperation operation) { super(xsr); this.name = name; this.messageName = messageName; @@ -54,7 +56,7 @@ public final class WSDLOutputImpl extends AbstractExtensibleImpl implements WSDL return (name == null)?operation.getName().getLocalPart()+"Response":name; } - public WSDLMessage getMessage() { + public EditableWSDLMessage getMessage() { return message; } @@ -71,7 +73,7 @@ public final class WSDLOutputImpl extends AbstractExtensibleImpl implements WSDL } @NotNull - public WSDLOperation getOperation() { + public EditableWSDLOperation getOperation() { return operation; } @@ -84,7 +86,7 @@ public final class WSDLOutputImpl extends AbstractExtensibleImpl implements WSDL this.action = action; } - void freeze(WSDLModelImpl root) { + public void freeze(EditableWSDLModel root) { message = root.getMessage(messageName); } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPartImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPartImpl.java index 1a0dcf12b8a..64df1c0ae0a 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPartImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPartImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ package com.sun.xml.internal.ws.model.wsdl; import com.sun.xml.internal.ws.api.model.ParameterBinding; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPart; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPartDescriptor; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPart; import javax.xml.stream.XMLStreamReader; @@ -36,7 +37,7 @@ import javax.xml.stream.XMLStreamReader; * * @author Vivek Pandey */ -public final class WSDLPartImpl extends AbstractObjectImpl implements WSDLPart { +public final class WSDLPartImpl extends AbstractObjectImpl implements EditableWSDLPart { private final String name; private ParameterBinding binding; private int index; @@ -72,10 +73,6 @@ public final class WSDLPartImpl extends AbstractObjectImpl implements WSDLPart { this.index = index; } - boolean isBody(){ - return binding.isBody(); - } - public WSDLPartDescriptor getDescriptor() { return descriptor; } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortImpl.java index 2813d60847c..f5c9e845c94 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,16 @@ package com.sun.xml.internal.ws.model.wsdl; +import java.util.List; + import com.sun.xml.internal.ws.api.EndpointAddress; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundPortType; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPort; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLService; import com.sun.xml.internal.ws.resources.ClientMessages; import com.sun.xml.internal.ws.util.exception.LocatableWebServiceException; import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser; @@ -44,19 +50,19 @@ import javax.xml.stream.XMLStreamReader; * * @author Vivek Pandey */ -public final class WSDLPortImpl extends AbstractFeaturedObjectImpl implements WSDLPort { +public final class WSDLPortImpl extends AbstractFeaturedObjectImpl implements EditableWSDLPort { private final QName name; private EndpointAddress address; private final QName bindingName; - private final WSDLServiceImpl owner; + private final EditableWSDLService owner; private WSEndpointReference epr; /** * To be set after the WSDL parsing is complete. */ - private WSDLBoundPortTypeImpl boundPortType; + private EditableWSDLBoundPortType boundPortType; - public WSDLPortImpl(XMLStreamReader xsr,WSDLServiceImpl owner, QName name, QName binding) { + public WSDLPortImpl(XMLStreamReader xsr, EditableWSDLService owner, QName name, QName binding) { super(xsr); this.owner = owner; this.name = name; @@ -75,7 +81,7 @@ public final class WSDLPortImpl extends AbstractFeaturedObjectImpl implements WS return address; } - public WSDLServiceImpl getOwner() { + public EditableWSDLService getOwner() { return owner; } @@ -99,15 +105,13 @@ public final class WSDLPortImpl extends AbstractFeaturedObjectImpl implements WS public @Nullable WSEndpointReference getEPR() { return epr; } - public WSDLBoundPortTypeImpl getBinding() { + + public EditableWSDLBoundPortType getBinding() { return boundPortType; } - public SOAPVersion getSOAPVersion(){ - return boundPortType.getSOAPVersion(); - } - - void freeze(WSDLModelImpl root) { + @SuppressWarnings("unchecked") + public void freeze(EditableWSDLModel root) { boundPortType = root.getBinding(bindingName); if(boundPortType==null) { throw new LocatableWebServiceException( @@ -116,6 +120,6 @@ public final class WSDLPortImpl extends AbstractFeaturedObjectImpl implements WS if(features == null) features = new WebServiceFeatureList(); features.setParentFeaturedObject(boundPortType); - notUnderstoodExtensions.addAll(boundPortType.notUnderstoodExtensions); + notUnderstoodExtensions.addAll((List)boundPortType.getNotUnderstoodExtensions()); } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortTypeImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortTypeImpl.java index 6fb98e6ba6b..6ad0980cd51 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortTypeImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLPortTypeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,9 +27,13 @@ package com.sun.xml.internal.ws.model.wsdl; import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPortType; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamReader; + import java.util.Hashtable; import java.util.Map; @@ -38,27 +42,27 @@ import java.util.Map; * * @author Vivek Pandey */ -public final class WSDLPortTypeImpl extends AbstractExtensibleImpl implements WSDLPortType { +public final class WSDLPortTypeImpl extends AbstractExtensibleImpl implements EditableWSDLPortType { private QName name; - private final Map portTypeOperations; - private WSDLModelImpl owner; + private final Map portTypeOperations; + private EditableWSDLModel owner; - public WSDLPortTypeImpl(XMLStreamReader xsr,WSDLModelImpl owner, QName name) { + public WSDLPortTypeImpl(XMLStreamReader xsr, EditableWSDLModel owner, QName name) { super(xsr); this.name = name; this.owner = owner; - portTypeOperations = new Hashtable(); + portTypeOperations = new Hashtable(); } public QName getName() { return name; } - public WSDLOperationImpl get(String operationName) { + public EditableWSDLOperation get(String operationName) { return portTypeOperations.get(operationName); } - public Iterable getOperations() { + public Iterable getOperations() { return portTypeOperations.values(); } @@ -68,17 +72,17 @@ public final class WSDLPortTypeImpl extends AbstractExtensibleImpl implements W * @param ptOp Must be non-null * @throws NullPointerException if either opName or ptOp is null */ - public void put(String opName, WSDLOperationImpl ptOp){ + public void put(String opName, EditableWSDLOperation ptOp){ portTypeOperations.put(opName, ptOp); } - WSDLModelImpl getOwner(){ + EditableWSDLModel getOwner(){ return owner; } - void freeze() { - for(WSDLOperationImpl op : portTypeOperations.values()){ - op.freez(owner); + public void freeze() { + for(EditableWSDLOperation op : portTypeOperations.values()){ + op.freeze(owner); } } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLProperties.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLProperties.java index f1a75edc67b..0d2d287a3d7 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLProperties.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLProperties.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ package com.sun.xml.internal.ws.model.wsdl; import com.oracle.webservices.internal.api.message.BasePropertySet; -import com.oracle.webservices.internal.api.message.PropertySet; import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.model.SEIModel; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLServiceImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLServiceImpl.java index a24419f7295..acc1d37ad30 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLServiceImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,9 +29,13 @@ import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.model.wsdl.WSDLService; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPort; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLService; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamReader; + import java.util.LinkedHashMap; import java.util.Map; @@ -40,20 +44,20 @@ import java.util.Map; * * @author Vivek Pandey */ -public final class WSDLServiceImpl extends AbstractExtensibleImpl implements WSDLService { +public final class WSDLServiceImpl extends AbstractExtensibleImpl implements EditableWSDLService { private final QName name; - private final Map ports; - private final WSDLModelImpl parent; + private final Map ports; + private final EditableWSDLModel parent; - public WSDLServiceImpl(XMLStreamReader xsr,WSDLModelImpl parent, QName name) { + public WSDLServiceImpl(XMLStreamReader xsr, EditableWSDLModel parent, QName name) { super(xsr); this.parent = parent; this.name = name; - ports = new LinkedHashMap(); + ports = new LinkedHashMap(); } public @NotNull - WSDLModelImpl getParent() { + EditableWSDLModel getParent() { return parent; } @@ -61,18 +65,18 @@ public final class WSDLServiceImpl extends AbstractExtensibleImpl implements WSD return name; } - public WSDLPortImpl get(QName portName) { + public EditableWSDLPort get(QName portName) { return ports.get(portName); } - public WSDLPort getFirstPort() { + public EditableWSDLPort getFirstPort() { if(ports.isEmpty()) return null; else return ports.values().iterator().next(); } - public Iterable getPorts(){ + public Iterable getPorts(){ return ports.values(); } @@ -80,8 +84,8 @@ public final class WSDLServiceImpl extends AbstractExtensibleImpl implements WSD * gets the first port in this service which matches the portType */ public @Nullable - WSDLPortImpl getMatchingPort(QName portTypeName){ - for(WSDLPortImpl port : getPorts()){ + EditableWSDLPort getMatchingPort(QName portTypeName){ + for(EditableWSDLPort port : getPorts()){ QName ptName = port.getBinding().getPortTypeName(); assert (ptName != null); if(ptName.equals(portTypeName)) @@ -97,14 +101,14 @@ public final class WSDLServiceImpl extends AbstractExtensibleImpl implements WSD * @param port Must be non-null * @throws NullPointerException if either opName or ptOp is null */ - public void put(QName portName, WSDLPortImpl port) { + public void put(QName portName, EditableWSDLPort port) { if (portName == null || port == null) throw new NullPointerException(); ports.put(portName, port); } - void freeze(WSDLModelImpl root) { - for (WSDLPortImpl port : ports.values()) { + public void freeze(EditableWSDLModel root) { + for (EditableWSDLPort port : ports.values()) { port.freeze(root); } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/PolicyWSDLParserExtension.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/PolicyWSDLParserExtension.java index 93cba73b864..42166f41a46 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/PolicyWSDLParserExtension.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/PolicyWSDLParserExtension.java @@ -25,7 +25,8 @@ package com.sun.xml.internal.ws.policy.jaxws; -import com.sun.xml.internal.ws.api.model.wsdl.*; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLObject; +import com.sun.xml.internal.ws.api.model.wsdl.editable.*; import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension; import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtensionContext; import com.sun.xml.internal.ws.api.policy.PolicyResolver; @@ -37,7 +38,6 @@ import com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModel; import com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModelContext; import com.sun.xml.internal.ws.policy.sourcemodel.wspolicy.NamespaceVersion; import com.sun.xml.internal.ws.policy.sourcemodel.wspolicy.XmlToken; -import com.sun.xml.internal.ws.model.wsdl.WSDLModelImpl; import com.sun.xml.internal.ws.policy.PolicyException; import com.sun.xml.internal.ws.policy.PolicyMap; import com.sun.xml.internal.ws.util.xml.XmlUtil; @@ -54,12 +54,11 @@ import java.util.Collection; import java.util.HashMap; import java.util.LinkedList; import java.util.Map; + import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLInputFactory; import javax.xml.ws.WebServiceException; -import javax.xml.xpath.XPathFactoryConfigurationException; /** * This class parses the Policy Attachments in the WSDL and creates a PolicyMap thaty captures the policies configured on @@ -376,7 +375,7 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } @Override - public boolean portElements(final WSDLPort port, final XMLStreamReader reader) { + public boolean portElements(final EditableWSDLPort port, final XMLStreamReader reader) { LOGGER.entering(); final boolean result = processSubelement(port, reader, getHandlers4PortMap()); LOGGER.exiting(); @@ -384,14 +383,14 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } @Override - public void portAttributes(final WSDLPort port, final XMLStreamReader reader) { + public void portAttributes(final EditableWSDLPort port, final XMLStreamReader reader) { LOGGER.entering(); processAttributes(port, reader, getHandlers4PortMap()); LOGGER.exiting(); } @Override - public boolean serviceElements(final WSDLService service, final XMLStreamReader reader) { + public boolean serviceElements(final EditableWSDLService service, final XMLStreamReader reader) { LOGGER.entering(); final boolean result = processSubelement(service, reader, getHandlers4ServiceMap()); LOGGER.exiting(); @@ -399,7 +398,7 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } @Override - public void serviceAttributes(final WSDLService service, final XMLStreamReader reader) { + public void serviceAttributes(final EditableWSDLService service, final XMLStreamReader reader) { LOGGER.entering(); processAttributes(service, reader, getHandlers4ServiceMap()); LOGGER.exiting(); @@ -424,7 +423,7 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } @Override - public boolean bindingElements(final WSDLBoundPortType binding, final XMLStreamReader reader) { + public boolean bindingElements(final EditableWSDLBoundPortType binding, final XMLStreamReader reader) { LOGGER.entering(); final boolean result = processSubelement(binding, reader, getHandlers4BindingMap()); LOGGER.exiting(); @@ -432,14 +431,14 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } @Override - public void bindingAttributes(final WSDLBoundPortType binding, final XMLStreamReader reader) { + public void bindingAttributes(final EditableWSDLBoundPortType binding, final XMLStreamReader reader) { LOGGER.entering(); processAttributes(binding, reader, getHandlers4BindingMap()); LOGGER.exiting(); } @Override - public boolean portTypeElements(final WSDLPortType portType, final XMLStreamReader reader) { + public boolean portTypeElements(final EditableWSDLPortType portType, final XMLStreamReader reader) { LOGGER.entering(); final boolean result = processSubelement(portType, reader, getHandlers4PortTypeMap()); LOGGER.exiting(); @@ -447,14 +446,14 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } @Override - public void portTypeAttributes(final WSDLPortType portType, final XMLStreamReader reader) { + public void portTypeAttributes(final EditableWSDLPortType portType, final XMLStreamReader reader) { LOGGER.entering(); processAttributes(portType, reader, getHandlers4PortTypeMap()); LOGGER.exiting(); } @Override - public boolean portTypeOperationElements(final WSDLOperation operation, final XMLStreamReader reader) { + public boolean portTypeOperationElements(final EditableWSDLOperation operation, final XMLStreamReader reader) { LOGGER.entering(); final boolean result = processSubelement(operation, reader, getHandlers4OperationMap()); LOGGER.exiting(); @@ -462,14 +461,14 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } @Override - public void portTypeOperationAttributes(final WSDLOperation operation, final XMLStreamReader reader) { + public void portTypeOperationAttributes(final EditableWSDLOperation operation, final XMLStreamReader reader) { LOGGER.entering(); processAttributes(operation, reader, getHandlers4OperationMap()); LOGGER.exiting(); } @Override - public boolean bindingOperationElements(final WSDLBoundOperation boundOperation, final XMLStreamReader reader) { + public boolean bindingOperationElements(final EditableWSDLBoundOperation boundOperation, final XMLStreamReader reader) { LOGGER.entering(); final boolean result = processSubelement(boundOperation, reader, getHandlers4BoundOperationMap()); LOGGER.exiting(); @@ -477,14 +476,14 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } @Override - public void bindingOperationAttributes(final WSDLBoundOperation boundOperation, final XMLStreamReader reader) { + public void bindingOperationAttributes(final EditableWSDLBoundOperation boundOperation, final XMLStreamReader reader) { LOGGER.entering(); processAttributes(boundOperation, reader, getHandlers4BoundOperationMap()); LOGGER.exiting(); } @Override - public boolean messageElements(final WSDLMessage msg, final XMLStreamReader reader) { + public boolean messageElements(final EditableWSDLMessage msg, final XMLStreamReader reader) { LOGGER.entering(); final boolean result = processSubelement(msg, reader, getHandlers4MessageMap()); LOGGER.exiting(); @@ -492,14 +491,14 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } @Override - public void messageAttributes(final WSDLMessage msg, final XMLStreamReader reader) { + public void messageAttributes(final EditableWSDLMessage msg, final XMLStreamReader reader) { LOGGER.entering(); processAttributes(msg, reader, getHandlers4MessageMap()); LOGGER.exiting(); } @Override - public boolean portTypeOperationInputElements(final WSDLInput input, final XMLStreamReader reader) { + public boolean portTypeOperationInputElements(final EditableWSDLInput input, final XMLStreamReader reader) { LOGGER.entering(); final boolean result = processSubelement(input, reader, getHandlers4InputMap()); LOGGER.exiting(); @@ -507,7 +506,7 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } @Override - public void portTypeOperationInputAttributes(final WSDLInput input, final XMLStreamReader reader) { + public void portTypeOperationInputAttributes(final EditableWSDLInput input, final XMLStreamReader reader) { LOGGER.entering(); processAttributes(input, reader, getHandlers4InputMap()); LOGGER.exiting(); @@ -515,7 +514,7 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { @Override - public boolean portTypeOperationOutputElements(final WSDLOutput output, final XMLStreamReader reader) { + public boolean portTypeOperationOutputElements(final EditableWSDLOutput output, final XMLStreamReader reader) { LOGGER.entering(); final boolean result = processSubelement(output, reader, getHandlers4OutputMap()); LOGGER.exiting(); @@ -523,7 +522,7 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } @Override - public void portTypeOperationOutputAttributes(final WSDLOutput output, final XMLStreamReader reader) { + public void portTypeOperationOutputAttributes(final EditableWSDLOutput output, final XMLStreamReader reader) { LOGGER.entering(); processAttributes(output, reader, getHandlers4OutputMap()); LOGGER.exiting(); @@ -531,7 +530,7 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { @Override - public boolean portTypeOperationFaultElements(final WSDLFault fault, final XMLStreamReader reader) { + public boolean portTypeOperationFaultElements(final EditableWSDLFault fault, final XMLStreamReader reader) { LOGGER.entering(); final boolean result = processSubelement(fault, reader, getHandlers4FaultMap()); LOGGER.exiting(); @@ -539,14 +538,14 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } @Override - public void portTypeOperationFaultAttributes(final WSDLFault fault, final XMLStreamReader reader) { + public void portTypeOperationFaultAttributes(final EditableWSDLFault fault, final XMLStreamReader reader) { LOGGER.entering(); processAttributes(fault, reader, getHandlers4FaultMap()); LOGGER.exiting(); } @Override - public boolean bindingOperationInputElements(final WSDLBoundOperation operation, final XMLStreamReader reader) { + public boolean bindingOperationInputElements(final EditableWSDLBoundOperation operation, final XMLStreamReader reader) { LOGGER.entering(); final boolean result = processSubelement(operation, reader, getHandlers4BindingInputOpMap()); LOGGER.exiting(); @@ -554,7 +553,7 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } @Override - public void bindingOperationInputAttributes(final WSDLBoundOperation operation, final XMLStreamReader reader) { + public void bindingOperationInputAttributes(final EditableWSDLBoundOperation operation, final XMLStreamReader reader) { LOGGER.entering(); processAttributes(operation, reader, getHandlers4BindingInputOpMap()); LOGGER.exiting(); @@ -562,7 +561,7 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { @Override - public boolean bindingOperationOutputElements(final WSDLBoundOperation operation, final XMLStreamReader reader) { + public boolean bindingOperationOutputElements(final EditableWSDLBoundOperation operation, final XMLStreamReader reader) { LOGGER.entering(); final boolean result = processSubelement(operation, reader, getHandlers4BindingOutputOpMap()); LOGGER.exiting(); @@ -570,14 +569,14 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } @Override - public void bindingOperationOutputAttributes(final WSDLBoundOperation operation, final XMLStreamReader reader) { + public void bindingOperationOutputAttributes(final EditableWSDLBoundOperation operation, final XMLStreamReader reader) { LOGGER.entering(); processAttributes(operation, reader, getHandlers4BindingOutputOpMap()); LOGGER.exiting(); } @Override - public boolean bindingOperationFaultElements(final WSDLBoundFault fault, final XMLStreamReader reader) { + public boolean bindingOperationFaultElements(final EditableWSDLBoundFault fault, final XMLStreamReader reader) { LOGGER.entering(); final boolean result = processSubelement(fault, reader, getHandlers4BindingFaultOpMap()); LOGGER.exiting(result); @@ -585,7 +584,7 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } @Override - public void bindingOperationFaultAttributes(final WSDLBoundFault fault, final XMLStreamReader reader) { + public void bindingOperationFaultAttributes(final EditableWSDLBoundFault fault, final XMLStreamReader reader) { LOGGER.entering(); processAttributes(fault, reader, getHandlers4BindingFaultOpMap()); LOGGER.exiting(); @@ -701,7 +700,7 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { // may otherwise be multiple entries for policies that are contained // by fault messages. HashSet messageSet = new HashSet(); - for (WSDLService service : context.getWSDLModel().getServices().values()) { + for (EditableWSDLService service : context.getWSDLModel().getServices().values()) { if (getHandlers4ServiceMap().containsKey(service)) { getPolicyMapBuilder().registerHandler(new BuilderHandlerServiceScope( getPolicyURIs(getHandlers4ServiceMap().get(service),modelContext) @@ -711,7 +710,7 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } // end service scope - for (WSDLPort port : service.getPorts()) { + for (EditableWSDLPort port : service.getPorts()) { if (getHandlers4PortMap().containsKey(port)) { getPolicyMapBuilder().registerHandler( new BuilderHandlerEndpointScope( @@ -747,9 +746,9 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } // endif handler for port type // end endpoint scope - for (WSDLBoundOperation boundOperation : port.getBinding().getBindingOperations()) { + for (EditableWSDLBoundOperation boundOperation : port.getBinding().getBindingOperations()) { - final WSDLOperation operation = boundOperation.getOperation(); + final EditableWSDLOperation operation = boundOperation.getOperation(); final QName operationName = new QName(boundOperation.getBoundPortType().getName().getNamespaceURI(), boundOperation.getName().getLocalPart()); // We store the message and portType/operation under the same namespace as the binding/operation so that we can match them up later if ( // handler for operation scope -- by boundOperation @@ -778,9 +777,9 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } // endif for portType:operation scope // end operation scope - final WSDLInput input = operation.getInput(); + final EditableWSDLInput input = operation.getInput(); if (null!=input) { - WSDLMessage inputMsg = input.getMessage(); + EditableWSDLMessage inputMsg = input.getMessage(); if (inputMsg != null && getHandlers4MessageMap().containsKey(inputMsg)) { messageSet.add(new BuilderHandlerMessageScope( getPolicyURIs( @@ -825,9 +824,9 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } // endif portType op input msg // end input message scope - final WSDLOutput output = operation.getOutput(); + final EditableWSDLOutput output = operation.getOutput(); if (null!=output) { - WSDLMessage outputMsg = output.getMessage(); + EditableWSDLMessage outputMsg = output.getMessage(); if (outputMsg != null && getHandlers4MessageMap().containsKey(outputMsg)) { messageSet.add(new BuilderHandlerMessageScope( getPolicyURIs( @@ -872,8 +871,8 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { } // endif portType op output msg // end output message scope - for (WSDLBoundFault boundFault : boundOperation.getFaults()) { - final WSDLFault fault = boundFault.getFault(); + for (EditableWSDLBoundFault boundFault : boundOperation.getFaults()) { + final EditableWSDLFault fault = boundFault.getFault(); // this shouldn't happen ususally, // but since this scenario tested in lagacy tests, dont' fail here @@ -882,7 +881,7 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { continue; } - final WSDLMessage faultMessage = fault.getMessage(); + final EditableWSDLMessage faultMessage = fault.getMessage(); final QName faultName = new QName(boundOperation.getBoundPortType().getName().getNamespaceURI(), boundFault.getName()); // We store the message and portType/fault under the same namespace as the binding/fault so that we can match them up later if (faultMessage != null && getHandlers4MessageMap().containsKey(faultMessage)) { @@ -948,14 +947,14 @@ final public class PolicyWSDLParserExtension extends WSDLParserExtension { @Override public void postFinished(final WSDLParserExtensionContext context) { // finally register the PolicyMap on the WSDLModel - WSDLModel wsdlModel = context.getWSDLModel(); + EditableWSDLModel wsdlModel = context.getWSDLModel(); PolicyMap effectiveMap; try { if(context.isClientSide()) effectiveMap = context.getPolicyResolver().resolve(new PolicyResolver.ClientContext(policyBuilder.getPolicyMap(),context.getContainer())); else effectiveMap = context.getPolicyResolver().resolve(new PolicyResolver.ServerContext(policyBuilder.getPolicyMap(), context.getContainer(),null)); - ((WSDLModelImpl) wsdlModel).setPolicyMap(effectiveMap); + wsdlModel.setPolicyMap(effectiveMap); } catch (PolicyException e) { LOGGER.logSevereException(e); throw LOGGER.logSevereException(new WebServiceException(PolicyMessages.WSP_1007_POLICY_EXCEPTION_WHILE_FINISHING_PARSING_WSDL(), e)); diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java new file mode 100644 index 00000000000..ad2ad4a6ef5 --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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.xml.internal.ws.policy.privateutil; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks + * to java.lang,reflect.Method.invoke() + */ +class MethodUtil { + + private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName()); + private static final Method INVOKE_METHOD; + + static { + Method method; + try { + Class clazz = Class.forName("sun.reflect.misc.MethodUtil"); + method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods."); + } + } catch (Throwable t) { + method = null; + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM"); + } + } + INVOKE_METHOD = method; + } + + static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException { + if (INVOKE_METHOD != null) { + // sun.reflect.misc.MethodUtil.invoke(method, owner, args) + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil"); + } + try { + return INVOKE_METHOD.invoke(null, method, target, args); + } catch (InvocationTargetException ite) { + // unwrap invocation exception added by reflection code ... + throw unwrapException(ite); + } + } else { + // other then Oracle JDK ... + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM"); + } + return method.invoke(target, args); + } + } + + private static InvocationTargetException unwrapException(InvocationTargetException ite) { + Throwable targetException = ite.getTargetException(); + if (targetException != null && targetException instanceof InvocationTargetException) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Unwrapping invocation target exception"); + } + return (InvocationTargetException) targetException; + } else { + return ite; + } + } + +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/PolicyUtils.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/PolicyUtils.java index d3a2752ad5e..ec537d88358 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/PolicyUtils.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/PolicyUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -282,13 +282,13 @@ public final class PolicyUtils { /** * Reflection utilities wrapper */ - public static class Reflection { + static class Reflection { private static final PolicyLogger LOGGER = PolicyLogger.getLogger(PolicyUtils.Reflection.class); /** * Reflectively invokes specified method on the specified target */ - public static T invoke(final Object target, final String methodName, + static T invoke(final Object target, final String methodName, final Class resultClass, final Object... parameters) throws RuntimePolicyUtilsException { Class[] parameterTypes; if (parameters != null && parameters.length > 0) { @@ -311,7 +311,7 @@ public final class PolicyUtils { final Object[] parameters, final Class[] parameterTypes) throws RuntimePolicyUtilsException { try { final Method method = target.getClass().getMethod(methodName, parameterTypes); - final Object result = method.invoke(target, parameters); + final Object result = MethodUtil.invoke(target, method,parameters); return resultClass.cast(result); } catch (IllegalArgumentException e) { diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/WsservletMessages.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/WsservletMessages.java index 909c111ef9c..e424adf4aad 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/WsservletMessages.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/WsservletMessages.java @@ -507,6 +507,20 @@ public final class WsservletMessages { return localizer.localize(localizableSERVLET_ERROR_NO_RESPONSE_MESSAGE()); } + public static Localizable localizableMESSAGE_TOO_LONG(Object arg0) { + return messageFactory.getMessage("message.too.long", arg0); + } + + /** + * + * Message has been truncated + * use {0} property to increase the amount of printed part of the message + * + */ + public static String MESSAGE_TOO_LONG(Object arg0) { + return localizer.localize(localizableMESSAGE_TOO_LONG(arg0)); + } + public static Localizable localizableLISTENER_INFO_INITIALIZE() { return messageFactory.getMessage("listener.info.initialize"); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/wsservlet.properties b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/wsservlet.properties index a51a4b70a1b..fd981e7195c 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/wsservlet.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/wsservlet.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -243,3 +243,6 @@ html.rootPage.body2b=

    # Concatenated with html.rootPage.body3a #html.rootPage.body3b='>here.

    html.rootPage.body4=

    This endpoint is incorrectly configured. Please check the location and contents of the configuration file.

    + +message.too.long=\nMessage has been truncated\n\ +use {0} property to increase the amount of printed part of the message diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/server/EndpointFactory.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/server/EndpointFactory.java index 3e3bffa2217..c78aef5ffbf 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/server/EndpointFactory.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/server/EndpointFactory.java @@ -36,7 +36,9 @@ import com.sun.xml.internal.ws.api.databinding.DatabindingFactory; import com.sun.xml.internal.ws.api.databinding.MetadataReader; import com.sun.xml.internal.ws.api.databinding.WSDLGenInfo; import com.sun.xml.internal.ws.api.model.SEIModel; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLService; import com.sun.xml.internal.ws.api.policy.PolicyResolver; import com.sun.xml.internal.ws.api.policy.PolicyResolverFactory; import com.sun.xml.internal.ws.api.server.AsyncProvider; @@ -59,9 +61,6 @@ import com.sun.xml.internal.ws.model.AbstractSEIModelImpl; import com.sun.xml.internal.ws.model.ReflectAnnotationReader; import com.sun.xml.internal.ws.model.RuntimeModeler; import com.sun.xml.internal.ws.model.SOAPSEIModel; -import com.sun.xml.internal.ws.model.wsdl.WSDLModelImpl; -import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl; -import com.sun.xml.internal.ws.model.wsdl.WSDLServiceImpl; import com.sun.xml.internal.ws.policy.PolicyMap; import com.sun.xml.internal.ws.policy.jaxws.PolicyUtil; import com.sun.xml.internal.ws.resources.ServerMessages; @@ -73,6 +72,7 @@ import com.sun.xml.internal.ws.util.ServiceConfigurationError; import com.sun.xml.internal.ws.util.ServiceFinder; import com.sun.xml.internal.ws.util.xml.XmlUtil; import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser; + import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -86,6 +86,7 @@ import javax.xml.ws.WebServiceException; import javax.xml.ws.WebServiceFeature; import javax.xml.ws.WebServiceProvider; import javax.xml.ws.soap.SOAPBinding; + import java.io.IOException; import java.net.URL; import java.util.ArrayList; @@ -232,7 +233,7 @@ public class EndpointFactory { SDDocumentImpl primaryDoc = primaryWsdl != null ? SDDocumentImpl.create(primaryWsdl,serviceName,portTypeName) : findPrimary(docList); EndpointAwareTube terminal; - WSDLPortImpl wsdlPort = null; + WSDLPort wsdlPort = null; AbstractSEIModelImpl seiModel = null; // create WSDL model if (primaryDoc != null) { @@ -709,23 +710,23 @@ public class EndpointFactory { * @param container container in which this service is running * @return non-null wsdl port object */ - private static @NotNull WSDLPortImpl getWSDLPort(SDDocumentSource primaryWsdl, List metadata, + private static @NotNull WSDLPort getWSDLPort(SDDocumentSource primaryWsdl, List metadata, @NotNull QName serviceName, @NotNull QName portName, Container container, EntityResolver resolver) { URL wsdlUrl = primaryWsdl.getSystemId(); try { // TODO: delegate to another entity resolver - WSDLModelImpl wsdlDoc = RuntimeWSDLParser.parse( + WSDLModel wsdlDoc = RuntimeWSDLParser.parse( new Parser(primaryWsdl), new EntityResolverImpl(metadata, resolver), false, container, ServiceFinder.find(WSDLParserExtension.class).toArray()); if(wsdlDoc.getServices().size() == 0) { throw new ServerRtException(ServerMessages.localizableRUNTIME_PARSER_WSDL_NOSERVICE_IN_WSDLMODEL(wsdlUrl)); } - WSDLServiceImpl wsdlService = wsdlDoc.getService(serviceName); + WSDLService wsdlService = wsdlDoc.getService(serviceName); if (wsdlService == null) { throw new ServerRtException(ServerMessages.localizableRUNTIME_PARSER_WSDL_INCORRECTSERVICE(serviceName,wsdlUrl)); } - WSDLPortImpl wsdlPort = wsdlService.get(portName); + WSDLPort wsdlPort = wsdlService.get(portName); if (wsdlPort == null) { throw new ServerRtException(ServerMessages.localizableRUNTIME_PARSER_WSDL_INCORRECTSERVICEPORT(serviceName, portName, wsdlUrl)); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/server/WSEndpointImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/server/WSEndpointImpl.java index cd9dd1fa96d..f0afa41118f 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/server/WSEndpointImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/server/WSEndpointImpl.java @@ -46,7 +46,6 @@ import com.sun.xml.internal.ws.api.server.*; import com.sun.xml.internal.ws.binding.BindingImpl; import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; import com.sun.xml.internal.ws.model.wsdl.WSDLDirectProperties; -import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl; import com.sun.xml.internal.ws.model.wsdl.WSDLPortProperties; import com.sun.xml.internal.ws.model.wsdl.WSDLProperties; import com.sun.xml.internal.ws.policy.PolicyMap; @@ -195,7 +194,7 @@ public /*final*/ class WSEndpointImpl extends WSEndpoint implements LazyMO try { if (port != null) { //gather EPR extrensions from WSDL Model - WSEndpointReference wsdlEpr = ((WSDLPortImpl) port).getEPR(); + WSEndpointReference wsdlEpr = port.getEPR(); if (wsdlEpr != null) { for (WSEndpointReference.EPRExtension extnEl : wsdlEpr.getEPRExtensions()) { eprExtensions.put(extnEl.getQName(), extnEl); diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/ProviderImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/ProviderImpl.java index 5db1bc06fe3..05b7a2f080a 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/ProviderImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/ProviderImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ import com.sun.xml.internal.ws.api.WSService; import com.sun.xml.internal.ws.api.ServiceSharedFeatureMarker; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; import com.sun.xml.internal.ws.api.model.wsdl.WSDLService; import com.sun.xml.internal.ws.api.server.BoundEndpoint; @@ -41,12 +42,12 @@ import com.sun.xml.internal.ws.api.server.WSEndpoint; import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension; import com.sun.xml.internal.ws.client.WSServiceDelegate; import com.sun.xml.internal.ws.developer.MemberSubmissionEndpointReference; -import com.sun.xml.internal.ws.model.wsdl.WSDLModelImpl; import com.sun.xml.internal.ws.resources.ProviderApiMessages; import com.sun.xml.internal.ws.transport.http.server.EndpointImpl; import com.sun.xml.internal.ws.util.ServiceFinder; import com.sun.xml.internal.ws.util.xml.XmlUtil; import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser; + import org.w3c.dom.Element; import org.xml.sax.EntityResolver; @@ -65,6 +66,7 @@ import javax.xml.ws.spi.Provider; import javax.xml.ws.spi.ServiceDelegate; import javax.xml.ws.spi.Invoker; import javax.xml.ws.wsaddressing.W3CEndpointReference; + import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; @@ -217,7 +219,7 @@ public class ProviderImpl extends Provider { EntityResolver er = XmlUtil.createDefaultCatalogResolver(); URL wsdlLoc = new URL(wsdlDocumentLocation); - WSDLModelImpl wsdlDoc = RuntimeWSDLParser.parse(wsdlLoc, new StreamSource(wsdlLoc.toExternalForm()), er, + WSDLModel wsdlDoc = RuntimeWSDLParser.parse(wsdlLoc, new StreamSource(wsdlLoc.toExternalForm()), er, true, container, ServiceFinder.find(WSDLParserExtension.class).toArray()); if (serviceName != null) { WSDLService wsdlService = wsdlDoc.getService(serviceName); diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java index f54a0a4e9bb..452eb985cec 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java @@ -89,6 +89,8 @@ import com.sun.xml.internal.ws.util.Pool; */ public class HttpAdapter extends Adapter { + private static final Logger LOGGER = Logger.getLogger(HttpAdapter.class.getName()); + /** * {@link com.sun.xml.internal.ws.api.server.SDDocument}s keyed by the query string like "?abc". * Used for serving documents via HTTP GET. @@ -852,7 +854,14 @@ public class HttpAdapter extends Adapter { } } } - buf.writeTo(baos); + if (buf.size() > dump_threshold) { + byte[] b = buf.getRawData(); + baos.write(b, 0, dump_threshold); + pw.println(); + pw.println(WsservletMessages.MESSAGE_TOO_LONG(HttpAdapter.class.getName() + ".dumpTreshold")); + } else { + buf.writeTo(baos); + } pw.println("--------------------"); String msg = baos.toString(); @@ -946,6 +955,8 @@ public class HttpAdapter extends Adapter { */ public static volatile boolean dump = false; + public static volatile int dump_threshold = 4096; + public static volatile boolean publishStatusPage = true; public static synchronized void setPublishStatus(boolean publish) { @@ -954,19 +965,32 @@ public class HttpAdapter extends Adapter { static { try { - dump = Boolean.getBoolean(HttpAdapter.class.getName()+".dump"); - } catch( Throwable t ) { - // OK to ignore this + dump = Boolean.getBoolean(HttpAdapter.class.getName() + ".dump"); + } catch (SecurityException se) { + if (LOGGER.isLoggable(Level.CONFIG)) { + LOGGER.log(Level.CONFIG, "Cannot read ''{0}'' property, using defaults.", + new Object[] {HttpAdapter.class.getName() + ".dump"}); + } } try { - setPublishStatus(System.getProperty(HttpAdapter.class.getName()+".publishStatusPage").equals("true")); - } catch( Throwable t ) { - // OK to ignore this + dump_threshold = Integer.getInteger(HttpAdapter.class.getName() + ".dumpTreshold", 4096); + } catch (SecurityException se) { + if (LOGGER.isLoggable(Level.CONFIG)) { + LOGGER.log(Level.CONFIG, "Cannot read ''{0}'' property, using defaults.", + new Object[] {HttpAdapter.class.getName() + ".dumpTreshold"}); + } + } + try { + setPublishStatus(Boolean.getBoolean(HttpAdapter.class.getName() + ".publishStatusPage")); + } catch (SecurityException se) { + if (LOGGER.isLoggable(Level.CONFIG)) { + LOGGER.log(Level.CONFIG, "Cannot read ''{0}'' property, using defaults.", + new Object[] {HttpAdapter.class.getName() + ".publishStatusPage"}); + } } } public static void setDump(boolean dumpMessages) { HttpAdapter.dump = dumpMessages; } - private static final Logger LOGGER = Logger.getLogger(HttpAdapter.class.getName()); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/client/HttpTransportPipe.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/client/HttpTransportPipe.java index 048af965e93..f8633d182dc 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/client/HttpTransportPipe.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/client/HttpTransportPipe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,9 @@ import com.sun.xml.internal.ws.api.pipe.helper.AbstractTubeImpl; import com.sun.xml.internal.ws.client.ClientTransportException; import com.sun.xml.internal.ws.developer.HttpConfigFeature; import com.sun.xml.internal.ws.resources.ClientMessages; +import com.sun.xml.internal.ws.resources.WsservletMessages; import com.sun.xml.internal.ws.transport.Headers; +import com.sun.xml.internal.ws.transport.http.HttpAdapter; import com.sun.xml.internal.ws.util.ByteArrayBuffer; import com.sun.xml.internal.ws.util.RuntimeVersion; import com.sun.xml.internal.ws.util.StreamUtils; @@ -426,7 +428,14 @@ public class HttpTransportPipe extends AbstractTubeImpl { } } - buf.writeTo(baos); + if (buf.size() > HttpAdapter.dump_threshold) { + byte[] b = buf.getRawData(); + baos.write(b, 0, HttpAdapter.dump_threshold); + pw.println(); + pw.println(WsservletMessages.MESSAGE_TOO_LONG(HttpAdapter.class.getName() + ".dumpTreshold")); + } else { + buf.writeTo(baos); + } pw.println("--------------------"); String msg = baos.toString(); diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/pipe/AbstractSchemaValidationTube.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/pipe/AbstractSchemaValidationTube.java index e4b3ed2b130..12d1507d7a5 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/pipe/AbstractSchemaValidationTube.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/pipe/AbstractSchemaValidationTube.java @@ -72,7 +72,7 @@ import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; -import static com.sun.xml.internal.ws.util.xml.XmlUtil.allowFileAccess; +import static com.sun.xml.internal.ws.util.xml.XmlUtil.allowExternalAccess; /** * {@link Tube} that does the schema validation. @@ -92,7 +92,7 @@ public abstract class AbstractSchemaValidationTube extends AbstractFilterTubeImp super(next); this.binding = binding; feature = binding.getFeature(SchemaValidationFeature.class); - sf = allowFileAccess(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI), false); + sf = allowExternalAccess(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI), "file", false); } protected AbstractSchemaValidationTube(AbstractSchemaValidationTube that, TubeCloner cloner) { diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/version.properties b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/version.properties index 9862bdc6bb2..c0aaf9f9fa7 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/version.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/version.properties @@ -23,7 +23,7 @@ # questions. # -build-id=2.2.9-b14140 -build-version=JAX-WS RI 2.2.9-b14140 +build-id=2.2.9-b130926.1035 +build-version=JAX-WS RI 2.2.9-b130926.1035 major-version=2.2.9 -svn-revision=14140 +svn-revision=8c29a9a53251ff741fca1664a8221dc876b2eac8 diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java index 8ae256f67e0..f6b63d48823 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java @@ -84,11 +84,11 @@ public class XmlUtil { private static final Logger LOGGER = Logger.getLogger(XmlUtil.class.getName()); - private static boolean globalSecureXmlProcessingEnabled; + private static boolean XML_SECURITY_DISABLED; static { - String disableSecureXmlProcessing = System.getProperty("disableSecureXmlProcessing"); - globalSecureXmlProcessingEnabled = disableSecureXmlProcessing == null || !Boolean.valueOf(disableSecureXmlProcessing); + String disableXmlSecurity = System.getProperty("com.sun.xml.internal.ws.disableXmlSecurity"); + XML_SECURITY_DISABLED = disableXmlSecurity == null || !Boolean.valueOf(disableXmlSecurity); } public static String getPrefix(String s) { @@ -364,9 +364,9 @@ public class XmlUtil { public static DocumentBuilderFactory newDocumentBuilderFactory(boolean secureXmlProcessing) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, checkGlobalOverride(secureXmlProcessing)); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, isXMLSecurityDisabled(secureXmlProcessing)); } catch (ParserConfigurationException e) { - LOGGER.log(Level.WARNING, "Factory [{}] doesn't support secure xml processing!", new Object[] { factory.getClass().getName() } ); + LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support secure xml processing!", new Object[] { factory.getClass().getName() } ); } return factory; } @@ -374,9 +374,9 @@ public class XmlUtil { public static TransformerFactory newTransformerFactory(boolean secureXmlProcessingEnabled) { TransformerFactory factory = TransformerFactory.newInstance(); try { - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, checkGlobalOverride(secureXmlProcessingEnabled)); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, isXMLSecurityDisabled(secureXmlProcessingEnabled)); } catch (TransformerConfigurationException e) { - LOGGER.log(Level.WARNING, "Factory [{}] doesn't support secure xml processing!", new Object[]{factory.getClass().getName()}); + LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support secure xml processing!", new Object[]{factory.getClass().getName()}); } return factory; } @@ -388,9 +388,9 @@ public class XmlUtil { public static SAXParserFactory newSAXParserFactory(boolean secureXmlProcessingEnabled) { SAXParserFactory factory = SAXParserFactory.newInstance(); try { - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, checkGlobalOverride(secureXmlProcessingEnabled)); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, isXMLSecurityDisabled(secureXmlProcessingEnabled)); } catch (Exception e) { - LOGGER.log(Level.WARNING, "Factory [{}] doesn't support secure xml processing!", new Object[]{factory.getClass().getName()}); + LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support secure xml processing!", new Object[]{factory.getClass().getName()}); } return factory; } @@ -398,16 +398,16 @@ public class XmlUtil { public static XPathFactory newXPathFactory(boolean secureXmlProcessingEnabled) { XPathFactory factory = XPathFactory.newInstance(); try { - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, checkGlobalOverride(secureXmlProcessingEnabled)); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, isXMLSecurityDisabled(secureXmlProcessingEnabled)); } catch (XPathFactoryConfigurationException e) { - LOGGER.log(Level.WARNING, "Factory [{}] doesn't support secure xml processing!", new Object[] { factory.getClass().getName() } ); + LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support secure xml processing!", new Object[] { factory.getClass().getName() } ); } return factory; } public static XMLInputFactory newXMLInputFactory(boolean secureXmlProcessingEnabled) { XMLInputFactory factory = XMLInputFactory.newInstance(); - if (checkGlobalOverride(secureXmlProcessingEnabled)) { + if (isXMLSecurityDisabled(secureXmlProcessingEnabled)) { // TODO-Miran: are those apppropriate defaults? factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); @@ -415,25 +415,39 @@ public class XmlUtil { return factory; } - private static boolean checkGlobalOverride(boolean localSecureXmlProcessingEnabled) { - return globalSecureXmlProcessingEnabled && localSecureXmlProcessingEnabled; + private static boolean isXMLSecurityDisabled(boolean runtimeDisabled) { + return XML_SECURITY_DISABLED || runtimeDisabled; } - public static SchemaFactory allowFileAccess(SchemaFactory sf, boolean disableSecureProcessing) { + public static SchemaFactory allowExternalAccess(SchemaFactory sf, String value, boolean disableSecureProcessing) { - // if feature secure processing enabled, nothing to do, file is allowed, - // or user is able to control access by standard JAXP mechanisms - if (checkGlobalOverride(disableSecureProcessing)) { + // if xml security (feature secure processing) disabled, nothing to do, no restrictions applied + if (isXMLSecurityDisabled(disableSecureProcessing)) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Xml Security disabled, no JAXP xsd external access configuration necessary."); + } + return sf; + } + + if (System.getProperty("javax.xml.accessExternalSchema") != null) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Detected explicitly JAXP configuration, no JAXP xsd external access configuration necessary."); + } return sf; } try { - sf.setProperty(ACCESS_EXTERNAL_SCHEMA, "file"); - LOGGER.log(Level.FINE, "Property \"{}\" is supported and has been successfully set by used JAXP implementation.", new Object[]{ACCESS_EXTERNAL_SCHEMA}); + sf.setProperty(ACCESS_EXTERNAL_SCHEMA, value); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Property \"{0}\" is supported and has been successfully set by used JAXP implementation.", new Object[]{ACCESS_EXTERNAL_SCHEMA}); + } } catch (SAXException ignored) { - // depending on JDK/SAX implementation used - LOGGER.log(Level.CONFIG, "Property \"{}\" is not supported by used JAXP implementation.", new Object[]{ACCESS_EXTERNAL_SCHEMA}); + // nothing to do; support depends on version JDK or SAX implementation + if (LOGGER.isLoggable(Level.CONFIG)) { + LOGGER.log(Level.CONFIG, "Property \"{0}\" is not supported by used JAXP implementation.", new Object[]{ACCESS_EXTERNAL_SCHEMA}); + } } return sf; } + } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/ActionBasedOperationFinder.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/ActionBasedOperationFinder.java index 1c13367b16f..f9e7577765d 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/ActionBasedOperationFinder.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/ActionBasedOperationFinder.java @@ -102,7 +102,7 @@ final class ActionBasedOperationFinder extends WSDLOperationFinder { } } else { for (WSDLBoundOperation wsdlOp : wsdlModel.getBinding().getBindingOperations()) { - QName payloadName = wsdlOp.getReqPayloadName(); + QName payloadName = wsdlOp.getRequestPayloadName(); if (payloadName == null) payloadName = EMPTY_PAYLOAD; String action = wsdlOp.getOperation().getInput().getAction(); diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/PayloadQNameBasedOperationFinder.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/PayloadQNameBasedOperationFinder.java index d246ed060ac..172d5cd12e1 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/PayloadQNameBasedOperationFinder.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/PayloadQNameBasedOperationFinder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -104,7 +104,7 @@ final class PayloadQNameBasedOperationFinder extends WSDLOperationFinder { } } else { for (WSDLBoundOperation wsdlOp : wsdlModel.getBinding().getBindingOperations()) { - QName name = wsdlOp.getReqPayloadName(); + QName name = wsdlOp.getRequestPayloadName(); if (name == null) name = EMPTY_PAYLOAD; methodHandlers.put(name, wsdlOperationMapping(wsdlOp)); diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/DelegatingParserExtension.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/DelegatingParserExtension.java index e715003bd4a..d02d9c4f562 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/DelegatingParserExtension.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/DelegatingParserExtension.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ package com.sun.xml.internal.ws.wsdl.parser; -import com.sun.xml.internal.ws.api.model.wsdl.*; +import com.sun.xml.internal.ws.api.model.wsdl.editable.*; import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension; import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtensionContext; @@ -48,31 +48,31 @@ class DelegatingParserExtension extends WSDLParserExtension { core.start(context); } - public void serviceAttributes(WSDLService service, XMLStreamReader reader) { + public void serviceAttributes(EditableWSDLService service, XMLStreamReader reader) { core.serviceAttributes(service, reader); } - public boolean serviceElements(WSDLService service, XMLStreamReader reader) { + public boolean serviceElements(EditableWSDLService service, XMLStreamReader reader) { return core.serviceElements(service, reader); } - public void portAttributes(WSDLPort port, XMLStreamReader reader) { + public void portAttributes(EditableWSDLPort port, XMLStreamReader reader) { core.portAttributes(port, reader); } - public boolean portElements(WSDLPort port, XMLStreamReader reader) { + public boolean portElements(EditableWSDLPort port, XMLStreamReader reader) { return core.portElements(port, reader); } - public boolean portTypeOperationInput(WSDLOperation op, XMLStreamReader reader) { + public boolean portTypeOperationInput(EditableWSDLOperation op, XMLStreamReader reader) { return core.portTypeOperationInput(op, reader); } - public boolean portTypeOperationOutput(WSDLOperation op, XMLStreamReader reader) { + public boolean portTypeOperationOutput(EditableWSDLOperation op, XMLStreamReader reader) { return core.portTypeOperationOutput(op, reader); } - public boolean portTypeOperationFault(WSDLOperation op, XMLStreamReader reader) { + public boolean portTypeOperationFault(EditableWSDLOperation op, XMLStreamReader reader) { return core.portTypeOperationFault(op, reader); } @@ -80,91 +80,91 @@ class DelegatingParserExtension extends WSDLParserExtension { return core.definitionsElements(reader); } - public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader) { + public boolean bindingElements(EditableWSDLBoundPortType binding, XMLStreamReader reader) { return core.bindingElements(binding, reader); } - public void bindingAttributes(WSDLBoundPortType binding, XMLStreamReader reader) { + public void bindingAttributes(EditableWSDLBoundPortType binding, XMLStreamReader reader) { core.bindingAttributes(binding, reader); } - public boolean portTypeElements(WSDLPortType portType, XMLStreamReader reader) { + public boolean portTypeElements(EditableWSDLPortType portType, XMLStreamReader reader) { return core.portTypeElements(portType, reader); } - public void portTypeAttributes(WSDLPortType portType, XMLStreamReader reader) { + public void portTypeAttributes(EditableWSDLPortType portType, XMLStreamReader reader) { core.portTypeAttributes(portType, reader); } - public boolean portTypeOperationElements(WSDLOperation operation, XMLStreamReader reader) { + public boolean portTypeOperationElements(EditableWSDLOperation operation, XMLStreamReader reader) { return core.portTypeOperationElements(operation, reader); } - public void portTypeOperationAttributes(WSDLOperation operation, XMLStreamReader reader) { + public void portTypeOperationAttributes(EditableWSDLOperation operation, XMLStreamReader reader) { core.portTypeOperationAttributes(operation, reader); } - public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) { + public boolean bindingOperationElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) { return core.bindingOperationElements(operation, reader); } - public void bindingOperationAttributes(WSDLBoundOperation operation, XMLStreamReader reader) { + public void bindingOperationAttributes(EditableWSDLBoundOperation operation, XMLStreamReader reader) { core.bindingOperationAttributes(operation, reader); } - public boolean messageElements(WSDLMessage msg, XMLStreamReader reader) { + public boolean messageElements(EditableWSDLMessage msg, XMLStreamReader reader) { return core.messageElements(msg, reader); } - public void messageAttributes(WSDLMessage msg, XMLStreamReader reader) { + public void messageAttributes(EditableWSDLMessage msg, XMLStreamReader reader) { core.messageAttributes(msg, reader); } - public boolean portTypeOperationInputElements(WSDLInput input, XMLStreamReader reader) { + public boolean portTypeOperationInputElements(EditableWSDLInput input, XMLStreamReader reader) { return core.portTypeOperationInputElements(input, reader); } - public void portTypeOperationInputAttributes(WSDLInput input, XMLStreamReader reader) { + public void portTypeOperationInputAttributes(EditableWSDLInput input, XMLStreamReader reader) { core.portTypeOperationInputAttributes(input, reader); } - public boolean portTypeOperationOutputElements(WSDLOutput output, XMLStreamReader reader) { + public boolean portTypeOperationOutputElements(EditableWSDLOutput output, XMLStreamReader reader) { return core.portTypeOperationOutputElements(output, reader); } - public void portTypeOperationOutputAttributes(WSDLOutput output, XMLStreamReader reader) { + public void portTypeOperationOutputAttributes(EditableWSDLOutput output, XMLStreamReader reader) { core.portTypeOperationOutputAttributes(output, reader); } - public boolean portTypeOperationFaultElements(WSDLFault fault, XMLStreamReader reader) { + public boolean portTypeOperationFaultElements(EditableWSDLFault fault, XMLStreamReader reader) { return core.portTypeOperationFaultElements(fault, reader); } - public void portTypeOperationFaultAttributes(WSDLFault fault, XMLStreamReader reader) { + public void portTypeOperationFaultAttributes(EditableWSDLFault fault, XMLStreamReader reader) { core.portTypeOperationFaultAttributes(fault, reader); } - public boolean bindingOperationInputElements(WSDLBoundOperation operation, XMLStreamReader reader) { + public boolean bindingOperationInputElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) { return core.bindingOperationInputElements(operation, reader); } - public void bindingOperationInputAttributes(WSDLBoundOperation operation, XMLStreamReader reader) { + public void bindingOperationInputAttributes(EditableWSDLBoundOperation operation, XMLStreamReader reader) { core.bindingOperationInputAttributes(operation, reader); } - public boolean bindingOperationOutputElements(WSDLBoundOperation operation, XMLStreamReader reader) { + public boolean bindingOperationOutputElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) { return core.bindingOperationOutputElements(operation, reader); } - public void bindingOperationOutputAttributes(WSDLBoundOperation operation, XMLStreamReader reader) { + public void bindingOperationOutputAttributes(EditableWSDLBoundOperation operation, XMLStreamReader reader) { core.bindingOperationOutputAttributes(operation, reader); } - public boolean bindingOperationFaultElements(WSDLBoundFault fault, XMLStreamReader reader) { + public boolean bindingOperationFaultElements(EditableWSDLBoundFault fault, XMLStreamReader reader) { return core.bindingOperationFaultElements(fault, reader); } - public void bindingOperationFaultAttributes(WSDLBoundFault fault, XMLStreamReader reader) { + public void bindingOperationFaultAttributes(EditableWSDLBoundFault fault, XMLStreamReader reader) { core.bindingOperationFaultAttributes(fault, reader); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/FoolProofParserExtension.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/FoolProofParserExtension.java index 4c0b14126f4..414ccc9dcc4 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/FoolProofParserExtension.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/FoolProofParserExtension.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ package com.sun.xml.internal.ws.wsdl.parser; -import com.sun.xml.internal.ws.api.model.wsdl.*; +import com.sun.xml.internal.ws.api.model.wsdl.editable.*; import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension; import javax.xml.namespace.QName; @@ -73,11 +73,11 @@ final class FoolProofParserExtension extends DelegatingParserExtension { throw new AssertionError("XMLStreamReader is placed at the wrong place after invoking "+core); } - public boolean serviceElements(WSDLService service, XMLStreamReader reader) { + public boolean serviceElements(EditableWSDLService service, XMLStreamReader reader) { return post(pre(reader),reader,super.serviceElements(service, reader)); } - public boolean portElements(WSDLPort port, XMLStreamReader reader) { + public boolean portElements(EditableWSDLPort port, XMLStreamReader reader) { return post(pre(reader),reader,super.portElements(port, reader)); } @@ -85,47 +85,47 @@ final class FoolProofParserExtension extends DelegatingParserExtension { return post(pre(reader),reader,super.definitionsElements(reader)); } - public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader) { + public boolean bindingElements(EditableWSDLBoundPortType binding, XMLStreamReader reader) { return post(pre(reader),reader,super.bindingElements(binding, reader)); } - public boolean portTypeElements(WSDLPortType portType, XMLStreamReader reader) { + public boolean portTypeElements(EditableWSDLPortType portType, XMLStreamReader reader) { return post(pre(reader),reader,super.portTypeElements(portType, reader)); } - public boolean portTypeOperationElements(WSDLOperation operation, XMLStreamReader reader) { + public boolean portTypeOperationElements(EditableWSDLOperation operation, XMLStreamReader reader) { return post(pre(reader),reader,super.portTypeOperationElements(operation, reader)); } - public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) { + public boolean bindingOperationElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) { return post(pre(reader),reader,super.bindingOperationElements(operation, reader)); } - public boolean messageElements(WSDLMessage msg, XMLStreamReader reader) { + public boolean messageElements(EditableWSDLMessage msg, XMLStreamReader reader) { return post(pre(reader),reader,super.messageElements(msg, reader)); } - public boolean portTypeOperationInputElements(WSDLInput input, XMLStreamReader reader) { + public boolean portTypeOperationInputElements(EditableWSDLInput input, XMLStreamReader reader) { return post(pre(reader),reader,super.portTypeOperationInputElements(input, reader)); } - public boolean portTypeOperationOutputElements(WSDLOutput output, XMLStreamReader reader) { + public boolean portTypeOperationOutputElements(EditableWSDLOutput output, XMLStreamReader reader) { return post(pre(reader),reader,super.portTypeOperationOutputElements(output, reader)); } - public boolean portTypeOperationFaultElements(WSDLFault fault, XMLStreamReader reader) { + public boolean portTypeOperationFaultElements(EditableWSDLFault fault, XMLStreamReader reader) { return post(pre(reader),reader,super.portTypeOperationFaultElements(fault, reader)); } - public boolean bindingOperationInputElements(WSDLBoundOperation operation, XMLStreamReader reader) { + public boolean bindingOperationInputElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) { return super.bindingOperationInputElements(operation, reader); } - public boolean bindingOperationOutputElements(WSDLBoundOperation operation, XMLStreamReader reader) { + public boolean bindingOperationOutputElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) { return post(pre(reader),reader,super.bindingOperationOutputElements(operation, reader)); } - public boolean bindingOperationFaultElements(WSDLBoundFault fault, XMLStreamReader reader) { + public boolean bindingOperationFaultElements(EditableWSDLBoundFault fault, XMLStreamReader reader) { return post(pre(reader),reader,super.bindingOperationFaultElements(fault, reader)); } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/MemberSubmissionAddressingWSDLParserExtension.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/MemberSubmissionAddressingWSDLParserExtension.java index fc57f89d289..e259b3a6b17 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/MemberSubmissionAddressingWSDLParserExtension.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/MemberSubmissionAddressingWSDLParserExtension.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,13 +27,8 @@ package com.sun.xml.internal.ws.wsdl.parser; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; import com.sun.xml.internal.ws.developer.MemberSubmissionAddressingFeature; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType; import com.sun.xml.internal.ws.api.model.wsdl.WSDLFeaturedObject; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; -import com.sun.xml.internal.ws.model.wsdl.WSDLBoundPortTypeImpl; -import com.sun.xml.internal.ws.model.wsdl.WSDLOperationImpl; +import com.sun.xml.internal.ws.api.model.wsdl.editable.*; import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil; import javax.xml.namespace.QName; @@ -46,12 +41,12 @@ import javax.xml.stream.XMLStreamReader; */ public class MemberSubmissionAddressingWSDLParserExtension extends W3CAddressingWSDLParserExtension { @Override - public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader) { + public boolean bindingElements(EditableWSDLBoundPortType binding, XMLStreamReader reader) { return addressibleElement(reader, binding); } @Override - public boolean portElements(WSDLPort port, XMLStreamReader reader) { + public boolean portElements(EditableWSDLPort port, XMLStreamReader reader) { return addressibleElement(reader, port); } @@ -68,12 +63,12 @@ public class MemberSubmissionAddressingWSDLParserExtension extends W3CAddressing } @Override - public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) { + public boolean bindingOperationElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) { return false; } @Override - protected void patchAnonymousDefault(WSDLBoundPortTypeImpl binding) { + protected void patchAnonymousDefault(EditableWSDLBoundPortType binding) { } @Override diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/RuntimeWSDLParser.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/RuntimeWSDLParser.java index ddaf8d695e7..2fb01c79cd6 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/RuntimeWSDLParser.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/RuntimeWSDLParser.java @@ -42,6 +42,20 @@ import com.sun.xml.internal.ws.api.addressing.AddressingVersion; import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; import com.sun.xml.internal.ws.api.model.ParameterBinding; import com.sun.xml.internal.ws.api.model.wsdl.WSDLDescriptorKind; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundFault; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLBoundPortType; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLFault; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLInput; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLMessage; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOperation; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLOutput; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPart; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPort; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLPortType; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLService; import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.api.server.ContainerResolver; import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory; @@ -60,6 +74,7 @@ import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil; import com.sun.xml.internal.ws.util.ServiceFinder; import com.sun.xml.internal.ws.util.xml.XmlUtil; import com.sun.xml.internal.ws.policy.jaxws.PolicyWSDLParserExtension; + import org.xml.sax.EntityResolver; import org.xml.sax.SAXException; @@ -70,6 +85,7 @@ import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; import javax.xml.ws.Service; import javax.xml.ws.WebServiceException; + import java.io.IOException; import java.io.InputStream; import java.io.FilterInputStream; @@ -86,7 +102,7 @@ import java.util.logging.Logger; */ public class RuntimeWSDLParser { - private final WSDLModelImpl wsdlDoc; + private final EditableWSDLModel wsdlDoc; /** * Target namespace URI of the WSDL that we are currently parsing. */ @@ -126,7 +142,7 @@ public class RuntimeWSDLParser { * Either this or wsdl parameter must be given. * Null location means the system won't be able to resolve relative references in the WSDL, */ - public static WSDLModelImpl parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver, + public static WSDLModel parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver, boolean isClientSide, Container container, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException { return parse(wsdlLoc, wsdlSource, resolver, isClientSide, container, Service.class, PolicyResolverFactory.create(),extensions); @@ -141,7 +157,7 @@ public class RuntimeWSDLParser { * Either this or wsdl parameter must be given. * Null location means the system won't be able to resolve relative references in the WSDL, */ - public static WSDLModelImpl parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver, + public static WSDLModel parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver, boolean isClientSide, Container container, Class serviceClass, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException { return parse(wsdlLoc, wsdlSource, resolver, isClientSide, container, serviceClass, PolicyResolverFactory.create(),extensions); @@ -156,7 +172,7 @@ public class RuntimeWSDLParser { * Either this or wsdl parameter must be given. * Null location means the system won't be able to resolve relative references in the WSDL, */ - public static WSDLModelImpl parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver, + public static WSDLModel parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver, boolean isClientSide, Container container, @NotNull PolicyResolver policyResolver, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException { return parse(wsdlLoc, wsdlSource, resolver, isClientSide, container, Service.class, policyResolver, extensions); @@ -171,7 +187,7 @@ public class RuntimeWSDLParser { * Either this or wsdl parameter must be given. * Null location means the system won't be able to resolve relative references in the WSDL, */ - public static WSDLModelImpl parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver, + public static WSDLModel parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver, boolean isClientSide, Container container, Class serviceClass, @NotNull PolicyResolver policyResolver, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException { @@ -187,7 +203,7 @@ public class RuntimeWSDLParser { * Either this or wsdl parameter must be given. * Null location means the system won't be able to resolve relative references in the WSDL, */ - public static WSDLModelImpl parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver, + public static WSDLModel parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver, boolean isClientSide, Container container, Class serviceClass, @NotNull PolicyResolver policyResolver, boolean isUseStreamFromEntityResolverWrapper, @@ -226,10 +242,10 @@ public class RuntimeWSDLParser { return wsdlParser.wsdlDoc; } - private static WSDLModelImpl tryWithMex(@NotNull RuntimeWSDLParser wsdlParser, @NotNull URL wsdlLoc, @NotNull EntityResolver resolver, boolean isClientSide, Container container, Throwable e, Class serviceClass, PolicyResolver policyResolver, WSDLParserExtension... extensions) throws SAXException, XMLStreamException { + private static WSDLModel tryWithMex(@NotNull RuntimeWSDLParser wsdlParser, @NotNull URL wsdlLoc, @NotNull EntityResolver resolver, boolean isClientSide, Container container, Throwable e, Class serviceClass, PolicyResolver policyResolver, WSDLParserExtension... extensions) throws SAXException, XMLStreamException { ArrayList exceptions = new ArrayList(); try { - WSDLModelImpl wsdlModel = wsdlParser.parseUsingMex(wsdlLoc, resolver, isClientSide, container, serviceClass, policyResolver,extensions); + WSDLModel wsdlModel = wsdlParser.parseUsingMex(wsdlLoc, resolver, isClientSide, container, serviceClass, policyResolver,extensions); if(wsdlModel == null){ throw new WebServiceException(ClientMessages.FAILED_TO_PARSE(wsdlLoc.toExternalForm(), e.getMessage()), e); } @@ -244,7 +260,7 @@ public class RuntimeWSDLParser { throw new InaccessibleWSDLException(exceptions); } - private WSDLModelImpl parseUsingMex(@NotNull URL wsdlLoc, @NotNull EntityResolver resolver, boolean isClientSide, Container container, Class serviceClass, PolicyResolver policyResolver, WSDLParserExtension[] extensions) throws IOException, SAXException, XMLStreamException, URISyntaxException { + private WSDLModel parseUsingMex(@NotNull URL wsdlLoc, @NotNull EntityResolver resolver, boolean isClientSide, Container container, Class serviceClass, PolicyResolver policyResolver, WSDLParserExtension[] extensions) throws IOException, SAXException, XMLStreamException, URISyntaxException { //try MEX MetaDataResolver mdResolver = null; ServiceDescriptor serviceDescriptor = null; @@ -295,7 +311,7 @@ public class RuntimeWSDLParser { return reader.getName().equals(WSDLConstants.QNAME_DEFINITIONS); } - public static WSDLModelImpl parse(XMLEntityResolver.Parser wsdl, XMLEntityResolver resolver, boolean isClientSide, Container container, PolicyResolver policyResolver, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException { + public static WSDLModel parse(XMLEntityResolver.Parser wsdl, XMLEntityResolver resolver, boolean isClientSide, Container container, PolicyResolver policyResolver, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException { assert resolver != null; RuntimeWSDLParser parser = new RuntimeWSDLParser( wsdl.systemId.toExternalForm(), resolver, isClientSide, container, policyResolver, extensions); parser.extensionFacade.start(parser.context); @@ -306,7 +322,7 @@ public class RuntimeWSDLParser { return parser.wsdlDoc; } - public static WSDLModelImpl parse(XMLEntityResolver.Parser wsdl, XMLEntityResolver resolver, boolean isClientSide, Container container, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException { + public static WSDLModel parse(XMLEntityResolver.Parser wsdl, XMLEntityResolver resolver, boolean isClientSide, Container container, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException { assert resolver != null; RuntimeWSDLParser parser = new RuntimeWSDLParser( wsdl.systemId.toExternalForm(), resolver, isClientSide, container, PolicyResolverFactory.create(), extensions); parser.extensionFacade.start(parser.context); @@ -460,7 +476,7 @@ public class RuntimeWSDLParser { readNSDecl(service_nsdecl,reader); String serviceName = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME); - WSDLServiceImpl service = new WSDLServiceImpl(reader,wsdlDoc,new QName(targetNamespace, serviceName)); + EditableWSDLService service = new WSDLServiceImpl(reader,wsdlDoc,new QName(targetNamespace, serviceName)); extensionFacade.serviceAttributes(service, reader); while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { QName name = reader.getName(); @@ -477,7 +493,7 @@ public class RuntimeWSDLParser { service_nsdecl = new HashMap(); } - private void parsePort(XMLStreamReader reader, WSDLServiceImpl service) { + private void parsePort(XMLStreamReader reader, EditableWSDLService service) { port_nsdecl.putAll(service_nsdecl); readNSDecl(port_nsdecl,reader); @@ -486,7 +502,7 @@ public class RuntimeWSDLParser { QName bindingName = ParserUtil.getQName(reader, binding); QName portQName = new QName(service.getName().getNamespaceURI(), portName); - WSDLPortImpl port = new WSDLPortImpl(reader,service, portQName, bindingName); + EditableWSDLPort port = new WSDLPortImpl(reader,service, portQName, bindingName); extensionFacade.portAttributes(port, reader); @@ -551,7 +567,7 @@ public class RuntimeWSDLParser { XMLStreamReaderUtil.skipElement(reader); return; } - WSDLBoundPortTypeImpl binding = new WSDLBoundPortTypeImpl(reader,wsdlDoc, new QName(targetNamespace, bindingName), + EditableWSDLBoundPortType binding = new WSDLBoundPortTypeImpl(reader,wsdlDoc, new QName(targetNamespace, bindingName), ParserUtil.getQName(reader, portTypeName)); extensionFacade.bindingAttributes(binding, reader); @@ -601,7 +617,7 @@ public class RuntimeWSDLParser { } - private void parseBindingOperation(XMLStreamReader reader, WSDLBoundPortTypeImpl binding) { + private void parseBindingOperation(XMLStreamReader reader, EditableWSDLBoundPortType binding) { String bindingOpName = ParserUtil.getMandatoryNonEmptyAttribute(reader, "name"); if (bindingOpName == null) { //TODO: throw exception? @@ -611,7 +627,7 @@ public class RuntimeWSDLParser { } QName opName = new QName(binding.getPortTypeName().getNamespaceURI(), bindingOpName); - WSDLBoundOperationImpl bindingOp = new WSDLBoundOperationImpl(reader,binding, opName); + EditableWSDLBoundOperation bindingOp = new WSDLBoundOperationImpl(reader,binding, opName); binding.put(opName, bindingOp); extensionFacade.bindingOperationAttributes(bindingOp, reader); @@ -651,7 +667,7 @@ public class RuntimeWSDLParser { } } - private void parseInputBinding(XMLStreamReader reader, WSDLBoundOperationImpl bindingOp) { + private void parseInputBinding(XMLStreamReader reader, EditableWSDLBoundOperation bindingOp) { boolean bodyFound = false; extensionFacade.bindingOperationInputAttributes(bindingOp, reader); while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { @@ -670,7 +686,7 @@ public class RuntimeWSDLParser { } } - private void parseOutputBinding(XMLStreamReader reader, WSDLBoundOperationImpl bindingOp) { + private void parseOutputBinding(XMLStreamReader reader, EditableWSDLBoundOperation bindingOp) { boolean bodyFound = false; extensionFacade.bindingOperationOutputAttributes(bindingOp, reader); while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { @@ -689,9 +705,9 @@ public class RuntimeWSDLParser { } } - private void parseFaultBinding(XMLStreamReader reader, WSDLBoundOperationImpl bindingOp) { + private void parseFaultBinding(XMLStreamReader reader, EditableWSDLBoundOperation bindingOp) { String faultName = ParserUtil.getMandatoryNonEmptyAttribute(reader, "name"); - WSDLBoundFaultImpl wsdlBoundFault = new WSDLBoundFaultImpl(reader, faultName, bindingOp); + EditableWSDLBoundFault wsdlBoundFault = new WSDLBoundFaultImpl(reader, faultName, bindingOp); bindingOp.addFault(wsdlBoundFault); extensionFacade.bindingOperationFaultAttributes(wsdlBoundFault, reader); @@ -704,7 +720,7 @@ public class RuntimeWSDLParser { private enum BindingMode { INPUT, OUTPUT, FAULT} - private static boolean parseSOAPBodyBinding(XMLStreamReader reader, WSDLBoundOperationImpl op, BindingMode mode) { + private static boolean parseSOAPBodyBinding(XMLStreamReader reader, EditableWSDLBoundOperation op, BindingMode mode) { String namespace = reader.getAttributeValue(null, "namespace"); if (mode == BindingMode.INPUT) { op.setRequestNamespace(namespace); @@ -749,7 +765,7 @@ public class RuntimeWSDLParser { } - private static void parseMimeMultipartBinding(XMLStreamReader reader, WSDLBoundOperationImpl op, BindingMode mode) { + private static void parseMimeMultipartBinding(XMLStreamReader reader, EditableWSDLBoundOperation op, BindingMode mode) { while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { QName name = reader.getName(); if (MIMEConstants.QNAME_PART.equals(name)) { @@ -760,7 +776,7 @@ public class RuntimeWSDLParser { } } - private static void parseMIMEPart(XMLStreamReader reader, WSDLBoundOperationImpl op, BindingMode mode) { + private static void parseMIMEPart(XMLStreamReader reader, EditableWSDLBoundOperation op, BindingMode mode) { boolean bodyFound = false; Map parts = null; if (mode == BindingMode.INPUT) { @@ -820,7 +836,7 @@ public class RuntimeWSDLParser { XMLStreamReaderUtil.skipElement(reader); return; } - WSDLPortTypeImpl portType = new WSDLPortTypeImpl(reader,wsdlDoc, new QName(targetNamespace, portTypeName)); + EditableWSDLPortType portType = new WSDLPortTypeImpl(reader,wsdlDoc, new QName(targetNamespace, portTypeName)); extensionFacade.portTypeAttributes(portType, reader); wsdlDoc.addPortType(portType); while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { @@ -834,7 +850,7 @@ public class RuntimeWSDLParser { } - private void parsePortTypeOperation(XMLStreamReader reader, WSDLPortTypeImpl portType) { + private void parsePortTypeOperation(XMLStreamReader reader, EditableWSDLPortType portType) { String operationName = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME); if (operationName == null) { //TODO: throw exception? @@ -844,7 +860,7 @@ public class RuntimeWSDLParser { } QName operationQName = new QName(portType.getName().getNamespaceURI(), operationName); - WSDLOperationImpl operation = new WSDLOperationImpl(reader,portType, operationQName); + EditableWSDLOperation operation = new WSDLOperationImpl(reader,portType, operationQName); extensionFacade.portTypeOperationAttributes(operation, reader); String parameterOrder = ParserUtil.getAttribute(reader, "parameterOrder"); operation.setParameterOrder(parameterOrder); @@ -864,11 +880,11 @@ public class RuntimeWSDLParser { } - private void parsePortTypeOperationFault(XMLStreamReader reader, WSDLOperationImpl operation) { + private void parsePortTypeOperationFault(XMLStreamReader reader, EditableWSDLOperation operation) { String msg = ParserUtil.getMandatoryNonEmptyAttribute(reader, "message"); QName msgName = ParserUtil.getQName(reader, msg); String name = ParserUtil.getMandatoryNonEmptyAttribute(reader, "name"); - WSDLFaultImpl fault = new WSDLFaultImpl(reader,name, msgName, operation); + EditableWSDLFault fault = new WSDLFaultImpl(reader,name, msgName, operation); operation.addFault(fault); extensionFacade.portTypeOperationFaultAttributes(fault, reader); extensionFacade.portTypeOperationFault(operation, reader); @@ -877,11 +893,11 @@ public class RuntimeWSDLParser { } } - private void parsePortTypeOperationInput(XMLStreamReader reader, WSDLOperationImpl operation) { + private void parsePortTypeOperationInput(XMLStreamReader reader, EditableWSDLOperation operation) { String msg = ParserUtil.getMandatoryNonEmptyAttribute(reader, "message"); QName msgName = ParserUtil.getQName(reader, msg); String name = ParserUtil.getAttribute(reader, "name"); - WSDLInputImpl input = new WSDLInputImpl(reader, name, msgName, operation); + EditableWSDLInput input = new WSDLInputImpl(reader, name, msgName, operation); operation.setInput(input); extensionFacade.portTypeOperationInputAttributes(input, reader); extensionFacade.portTypeOperationInput(operation, reader); @@ -890,11 +906,11 @@ public class RuntimeWSDLParser { } } - private void parsePortTypeOperationOutput(XMLStreamReader reader, WSDLOperationImpl operation) { + private void parsePortTypeOperationOutput(XMLStreamReader reader, EditableWSDLOperation operation) { String msg = ParserUtil.getAttribute(reader, "message"); QName msgName = ParserUtil.getQName(reader, msg); String name = ParserUtil.getAttribute(reader, "name"); - WSDLOutputImpl output = new WSDLOutputImpl(reader,name, msgName, operation); + EditableWSDLOutput output = new WSDLOutputImpl(reader,name, msgName, operation); operation.setOutput(output); extensionFacade.portTypeOperationOutputAttributes(output, reader); extensionFacade.portTypeOperationOutput(operation, reader); @@ -905,7 +921,7 @@ public class RuntimeWSDLParser { private void parseMessage(XMLStreamReader reader) { String msgName = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME); - WSDLMessageImpl msg = new WSDLMessageImpl(reader,new QName(targetNamespace, msgName)); + EditableWSDLMessage msg = new WSDLMessageImpl(reader,new QName(targetNamespace, msgName)); extensionFacade.messageAttributes(msg, reader); int partIndex = 0; while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { @@ -928,7 +944,7 @@ public class RuntimeWSDLParser { } } if (desc != null) { - WSDLPartImpl wsdlPart = new WSDLPartImpl(reader, part, partIndex, new WSDLPartDescriptorImpl(reader,ParserUtil.getQName(reader, desc), kind)); + EditableWSDLPart wsdlPart = new WSDLPartImpl(reader, part, partIndex, new WSDLPartDescriptorImpl(reader,ParserUtil.getQName(reader, desc), kind)); msg.add(wsdlPart); } if (reader.getEventType() != XMLStreamConstants.END_ELEMENT) diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingMetadataWSDLParserExtension.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingMetadataWSDLParserExtension.java index f1ccd79b427..e995a3718b3 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingMetadataWSDLParserExtension.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingMetadataWSDLParserExtension.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,7 @@ package com.sun.xml.internal.ws.wsdl.parser; -import com.sun.xml.internal.ws.api.model.wsdl.*; -import com.sun.xml.internal.ws.model.wsdl.WSDLOperationImpl; -import com.sun.xml.internal.ws.model.wsdl.WSDLBoundPortTypeImpl; +import com.sun.xml.internal.ws.api.model.wsdl.editable.*; import javax.xml.stream.XMLStreamReader; import javax.xml.namespace.QName; @@ -43,22 +41,22 @@ public class W3CAddressingMetadataWSDLParserExtension extends W3CAddressingWSDLP String METADATA_WSDL_EXTN_NS = "http://www.w3.org/2007/05/addressing/metadata"; QName METADATA_WSDL_ACTION_TAG = new QName(METADATA_WSDL_EXTN_NS, "Action", "wsam"); @Override - public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader) { + public boolean bindingElements(EditableWSDLBoundPortType binding, XMLStreamReader reader) { return false; } @Override - public boolean portElements(WSDLPort port, XMLStreamReader reader) { + public boolean portElements(EditableWSDLPort port, XMLStreamReader reader) { return false; } @Override - public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) { + public boolean bindingOperationElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) { return false; } @Override - protected void patchAnonymousDefault(WSDLBoundPortTypeImpl binding) { + protected void patchAnonymousDefault(EditableWSDLBoundPortType binding) { } @Override diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingWSDLParserExtension.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingWSDLParserExtension.java index f7de58d7a12..0d2de0af932 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingWSDLParserExtension.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingWSDLParserExtension.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,19 +26,18 @@ package com.sun.xml.internal.ws.wsdl.parser; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; -import com.sun.xml.internal.ws.api.model.wsdl.*; +import com.sun.xml.internal.ws.api.model.wsdl.WSDLFeaturedObject; +import static com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation.ANONYMOUS; +import com.sun.xml.internal.ws.api.model.wsdl.editable.*; import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension; import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtensionContext; -import com.sun.xml.internal.ws.model.wsdl.*; import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil; -import com.sun.xml.internal.ws.resources.AddressingMessages; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.ws.WebServiceException; import javax.xml.ws.soap.AddressingFeature; -import java.util.Map; /** * W3C WS-Addressing Runtime WSDL parser extension @@ -47,12 +46,12 @@ import java.util.Map; */ public class W3CAddressingWSDLParserExtension extends WSDLParserExtension { @Override - public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader) { + public boolean bindingElements(EditableWSDLBoundPortType binding, XMLStreamReader reader) { return addressibleElement(reader, binding); } @Override - public boolean portElements(WSDLPort port, XMLStreamReader reader) { + public boolean portElements(EditableWSDLPort port, XMLStreamReader reader) { return addressibleElement(reader, port); } @@ -69,8 +68,8 @@ public class W3CAddressingWSDLParserExtension extends WSDLParserExtension { } @Override - public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) { - WSDLBoundOperationImpl impl = (WSDLBoundOperationImpl)operation; + public boolean bindingOperationElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) { + EditableWSDLBoundOperation edit = (EditableWSDLBoundOperation) operation; QName anon = reader.getName(); if (anon.equals(AddressingVersion.W3C.wsdlAnonymousTag)) { @@ -81,11 +80,11 @@ public class W3CAddressingWSDLParserExtension extends WSDLParserExtension { // TODO: throw exception only if wsdl:required=true // TODO: is this the right exception ? } else if (value.equals("optional")) { - impl.setAnonymous(WSDLBoundOperation.ANONYMOUS.optional); + edit.setAnonymous(ANONYMOUS.optional); } else if (value.equals("required")) { - impl.setAnonymous(WSDLBoundOperation.ANONYMOUS.required); + edit.setAnonymous(ANONYMOUS.required); } else if (value.equals("prohibited")) { - impl.setAnonymous(WSDLBoundOperation.ANONYMOUS.prohibited); + edit.setAnonymous(ANONYMOUS.prohibited); } else { throw new WebServiceException("wsaw:Anonymous value \"" + value + "\" not understood."); // TODO: throw exception only if wsdl:required=true @@ -101,29 +100,29 @@ public class W3CAddressingWSDLParserExtension extends WSDLParserExtension { return false; } - public void portTypeOperationInputAttributes(WSDLInput input, XMLStreamReader reader) { + public void portTypeOperationInputAttributes(EditableWSDLInput input, XMLStreamReader reader) { String action = ParserUtil.getAttribute(reader, getWsdlActionTag()); if (action != null) { - ((WSDLInputImpl)input).setAction(action); - ((WSDLInputImpl)input).setDefaultAction(false); + input.setAction(action); + input.setDefaultAction(false); } } - public void portTypeOperationOutputAttributes(WSDLOutput output, XMLStreamReader reader) { + public void portTypeOperationOutputAttributes(EditableWSDLOutput output, XMLStreamReader reader) { String action = ParserUtil.getAttribute(reader, getWsdlActionTag()); if (action != null) { - ((WSDLOutputImpl)output).setAction(action); - ((WSDLOutputImpl)output).setDefaultAction(false); + output.setAction(action); + output.setDefaultAction(false); } } - public void portTypeOperationFaultAttributes(WSDLFault fault, XMLStreamReader reader) { + public void portTypeOperationFaultAttributes(EditableWSDLFault fault, XMLStreamReader reader) { String action = ParserUtil.getAttribute(reader, getWsdlActionTag()); if (action != null) { - ((WSDLFaultImpl) fault).setAction(action); - ((WSDLFaultImpl) fault).setDefaultAction(false); + fault.setAction(action); + fault.setDefaultAction(false); } } @@ -139,11 +138,10 @@ public class W3CAddressingWSDLParserExtension extends WSDLParserExtension { */ @Override public void finished(WSDLParserExtensionContext context) { - WSDLModel model = context.getWSDLModel(); - for (WSDLService service : model.getServices().values()) { - for (WSDLPort wp : service.getPorts()) { - WSDLPortImpl port = (WSDLPortImpl)wp; - WSDLBoundPortTypeImpl binding = port.getBinding(); + EditableWSDLModel model = context.getWSDLModel(); + for (EditableWSDLService service : model.getServices().values()) { + for (EditableWSDLPort port : service.getPorts()) { + EditableWSDLBoundPortType binding = port.getBinding(); // populate actions for the messages that do not have an explicit wsaw:Action populateActions(binding); @@ -166,12 +164,12 @@ public class W3CAddressingWSDLParserExtension extends WSDLParserExtension { * * @param binding soapbinding:operation */ - private void populateActions(WSDLBoundPortTypeImpl binding) { - WSDLPortTypeImpl porttype = binding.getPortType(); - for (WSDLOperationImpl o : porttype.getOperations()) { + private void populateActions(EditableWSDLBoundPortType binding) { + EditableWSDLPortType porttype = binding.getPortType(); + for (EditableWSDLOperation o : porttype.getOperations()) { // TODO: this may be performance intensive. Alternatively default action // TODO: can be calculated when the operation is actually invoked. - WSDLBoundOperationImpl wboi = binding.get(o.getName()); + EditableWSDLBoundOperation wboi = binding.get(o.getName()); if (wboi == null) { //If this operation is unbound set the action to default @@ -202,9 +200,9 @@ public class W3CAddressingWSDLParserExtension extends WSDLParserExtension { if (o.getFaults() == null || !o.getFaults().iterator().hasNext()) continue; - for (WSDLFault f : o.getFaults()) { + for (EditableWSDLFault f : o.getFaults()) { if (f.getAction() == null || f.getAction().equals("")) { - ((WSDLFaultImpl)f).setAction(defaultFaultAction(f.getName(), o)); + f.setAction(defaultFaultAction(f.getName(), o)); } } @@ -216,26 +214,26 @@ public class W3CAddressingWSDLParserExtension extends WSDLParserExtension { * * @param binding WSDLBoundPortTypeImpl */ - protected void patchAnonymousDefault(WSDLBoundPortTypeImpl binding) { - for (WSDLBoundOperationImpl wbo : binding.getBindingOperations()) { + protected void patchAnonymousDefault(EditableWSDLBoundPortType binding) { + for (EditableWSDLBoundOperation wbo : binding.getBindingOperations()) { if (wbo.getAnonymous() == null) - wbo.setAnonymous(WSDLBoundOperation.ANONYMOUS.optional); + wbo.setAnonymous(ANONYMOUS.optional); } } - private String defaultInputAction(WSDLOperation o) { + private String defaultInputAction(EditableWSDLOperation o) { return buildAction(o.getInput().getName(), o, false); } - private String defaultOutputAction(WSDLOperation o) { + private String defaultOutputAction(EditableWSDLOperation o) { return buildAction(o.getOutput().getName(), o, false); } - private String defaultFaultAction(String name, WSDLOperation o) { + private String defaultFaultAction(String name, EditableWSDLOperation o) { return buildAction(name, o, true); } - protected static final String buildAction(String name, WSDLOperation o, boolean isFault) { + protected static final String buildAction(String name, EditableWSDLOperation o, boolean isFault) { String tns = o.getName().getNamespaceURI(); String delim = SLASH_DELIMITER; diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionContextImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionContextImpl.java index a8b2550e867..57a84db8482 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionContextImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionContextImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ package com.sun.xml.internal.ws.wsdl.parser; -import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel; +import com.sun.xml.internal.ws.api.model.wsdl.editable.EditableWSDLModel; import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtensionContext; import com.sun.xml.internal.ws.api.policy.PolicyResolver; @@ -38,7 +38,7 @@ import com.sun.xml.internal.ws.api.policy.PolicyResolver; */ final class WSDLParserExtensionContextImpl implements WSDLParserExtensionContext { private final boolean isClientSide; - private final WSDLModel wsdlModel; + private final EditableWSDLModel wsdlModel; private final Container container; private final PolicyResolver policyResolver; @@ -46,7 +46,7 @@ final class WSDLParserExtensionContextImpl implements WSDLParserExtensionContext * Construct {@link WSDLParserExtensionContextImpl} with information that whether its on client side * or server side. */ - protected WSDLParserExtensionContextImpl(WSDLModel model, boolean isClientSide, Container container, PolicyResolver policyResolver) { + protected WSDLParserExtensionContextImpl(EditableWSDLModel model, boolean isClientSide, Container container, PolicyResolver policyResolver) { this.wsdlModel = model; this.isClientSide = isClientSide; this.container = container; @@ -57,7 +57,7 @@ final class WSDLParserExtensionContextImpl implements WSDLParserExtensionContext return isClientSide; } - public WSDLModel getWSDLModel() { + public EditableWSDLModel getWSDLModel() { return wsdlModel; } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionFacade.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionFacade.java index d55bf52761c..a3e453bbd3e 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionFacade.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionFacade.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,10 +27,8 @@ package com.sun.xml.internal.ws.wsdl.parser; import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension; import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtensionContext; -import com.sun.xml.internal.ws.api.model.wsdl.*; +import com.sun.xml.internal.ws.api.model.wsdl.editable.*; import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil; -import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl; -import com.sun.xml.internal.ws.model.wsdl.WSDLBoundPortTypeImpl; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.Location; @@ -66,7 +64,7 @@ final class WSDLParserExtensionFacade extends WSDLParserExtension { } } - public boolean serviceElements(WSDLService service, XMLStreamReader reader) { + public boolean serviceElements(EditableWSDLService service, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { if(e.serviceElements(service,reader)) return true; @@ -75,12 +73,12 @@ final class WSDLParserExtensionFacade extends WSDLParserExtension { return true; } - public void serviceAttributes(WSDLService service, XMLStreamReader reader) { + public void serviceAttributes(EditableWSDLService service, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) e.serviceAttributes(service,reader); } - public boolean portElements(WSDLPort port, XMLStreamReader reader) { + public boolean portElements(EditableWSDLPort port, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { if(e.portElements(port,reader)) return true; @@ -88,34 +86,34 @@ final class WSDLParserExtensionFacade extends WSDLParserExtension { //extension is not understood by any WSDlParserExtension //Check if it must be understood. if(isRequiredExtension(reader)) { - ((WSDLPortImpl)port).addNotUnderstoodExtension(reader.getName(),getLocator(reader)); + port.addNotUnderstoodExtension(reader.getName(),getLocator(reader)); } XMLStreamReaderUtil.skipElement(reader); return true; } - public boolean portTypeOperationInput(WSDLOperation op, XMLStreamReader reader) { + public boolean portTypeOperationInput(EditableWSDLOperation op, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) e.portTypeOperationInput(op,reader); return false; } - public boolean portTypeOperationOutput(WSDLOperation op, XMLStreamReader reader) { + public boolean portTypeOperationOutput(EditableWSDLOperation op, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) e.portTypeOperationOutput(op,reader); return false; } - public boolean portTypeOperationFault(WSDLOperation op, XMLStreamReader reader) { + public boolean portTypeOperationFault(EditableWSDLOperation op, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) e.portTypeOperationFault(op,reader); return false; } - public void portAttributes(WSDLPort port, XMLStreamReader reader) { + public void portAttributes(EditableWSDLPort port, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) e.portAttributes(port,reader); } @@ -130,7 +128,7 @@ final class WSDLParserExtensionFacade extends WSDLParserExtension { return true; } - public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader){ + public boolean bindingElements(EditableWSDLBoundPortType binding, XMLStreamReader reader){ for (WSDLParserExtension e : extensions) { if (e.bindingElements(binding, reader)) { return true; @@ -139,20 +137,20 @@ final class WSDLParserExtensionFacade extends WSDLParserExtension { //extension is not understood by any WSDlParserExtension //Check if it must be understood. if (isRequiredExtension(reader)) { - ((WSDLBoundPortTypeImpl) binding).addNotUnderstoodExtension( + binding.addNotUnderstoodExtension( reader.getName(), getLocator(reader)); } XMLStreamReaderUtil.skipElement(reader); return true; } - public void bindingAttributes(WSDLBoundPortType binding, XMLStreamReader reader){ + public void bindingAttributes(EditableWSDLBoundPortType binding, XMLStreamReader reader){ for (WSDLParserExtension e : extensions) { e.bindingAttributes(binding, reader); } } - public boolean portTypeElements(WSDLPortType portType, XMLStreamReader reader) { + public boolean portTypeElements(EditableWSDLPortType portType, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { if (e.portTypeElements(portType, reader)) { return true; @@ -162,13 +160,13 @@ final class WSDLParserExtensionFacade extends WSDLParserExtension { return true; } - public void portTypeAttributes(WSDLPortType portType, XMLStreamReader reader) { + public void portTypeAttributes(EditableWSDLPortType portType, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { e.portTypeAttributes(portType, reader); } } - public boolean portTypeOperationElements(WSDLOperation operation, XMLStreamReader reader) { + public boolean portTypeOperationElements(EditableWSDLOperation operation, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { if (e.portTypeOperationElements(operation, reader)) { return true; @@ -178,13 +176,13 @@ final class WSDLParserExtensionFacade extends WSDLParserExtension { return true; } - public void portTypeOperationAttributes(WSDLOperation operation, XMLStreamReader reader) { + public void portTypeOperationAttributes(EditableWSDLOperation operation, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { e.portTypeOperationAttributes(operation, reader); } } - public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) { + public boolean bindingOperationElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { if (e.bindingOperationElements(operation, reader)) { return true; @@ -194,13 +192,13 @@ final class WSDLParserExtensionFacade extends WSDLParserExtension { return true; } - public void bindingOperationAttributes(WSDLBoundOperation operation, XMLStreamReader reader) { + public void bindingOperationAttributes(EditableWSDLBoundOperation operation, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { e.bindingOperationAttributes(operation, reader); } } - public boolean messageElements(WSDLMessage msg, XMLStreamReader reader) { + public boolean messageElements(EditableWSDLMessage msg, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { if (e.messageElements(msg, reader)) { return true; @@ -210,13 +208,13 @@ final class WSDLParserExtensionFacade extends WSDLParserExtension { return true; } - public void messageAttributes(WSDLMessage msg, XMLStreamReader reader) { + public void messageAttributes(EditableWSDLMessage msg, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { e.messageAttributes(msg, reader); } } - public boolean portTypeOperationInputElements(WSDLInput input, XMLStreamReader reader) { + public boolean portTypeOperationInputElements(EditableWSDLInput input, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { if (e.portTypeOperationInputElements(input, reader)) { return true; @@ -226,13 +224,13 @@ final class WSDLParserExtensionFacade extends WSDLParserExtension { return true; } - public void portTypeOperationInputAttributes(WSDLInput input, XMLStreamReader reader) { + public void portTypeOperationInputAttributes(EditableWSDLInput input, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { e.portTypeOperationInputAttributes(input, reader); } } - public boolean portTypeOperationOutputElements(WSDLOutput output, XMLStreamReader reader) { + public boolean portTypeOperationOutputElements(EditableWSDLOutput output, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { if (e.portTypeOperationOutputElements(output, reader)) { return true; @@ -242,13 +240,13 @@ final class WSDLParserExtensionFacade extends WSDLParserExtension { return true; } - public void portTypeOperationOutputAttributes(WSDLOutput output, XMLStreamReader reader) { + public void portTypeOperationOutputAttributes(EditableWSDLOutput output, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { e.portTypeOperationOutputAttributes(output, reader); } } - public boolean portTypeOperationFaultElements(WSDLFault fault, XMLStreamReader reader) { + public boolean portTypeOperationFaultElements(EditableWSDLFault fault, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { if (e.portTypeOperationFaultElements(fault, reader)) { return true; @@ -258,13 +256,13 @@ final class WSDLParserExtensionFacade extends WSDLParserExtension { return true; } - public void portTypeOperationFaultAttributes(WSDLFault fault, XMLStreamReader reader) { + public void portTypeOperationFaultAttributes(EditableWSDLFault fault, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { e.portTypeOperationFaultAttributes(fault, reader); } } - public boolean bindingOperationInputElements(WSDLBoundOperation operation, XMLStreamReader reader) { + public boolean bindingOperationInputElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { if (e.bindingOperationInputElements(operation, reader)) { return true; @@ -274,13 +272,13 @@ final class WSDLParserExtensionFacade extends WSDLParserExtension { return true; } - public void bindingOperationInputAttributes(WSDLBoundOperation operation, XMLStreamReader reader) { + public void bindingOperationInputAttributes(EditableWSDLBoundOperation operation, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { e.bindingOperationInputAttributes(operation, reader); } } - public boolean bindingOperationOutputElements(WSDLBoundOperation operation, XMLStreamReader reader) { + public boolean bindingOperationOutputElements(EditableWSDLBoundOperation operation, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { if (e.bindingOperationOutputElements(operation, reader)) { return true; @@ -290,13 +288,13 @@ final class WSDLParserExtensionFacade extends WSDLParserExtension { return true; } - public void bindingOperationOutputAttributes(WSDLBoundOperation operation, XMLStreamReader reader) { + public void bindingOperationOutputAttributes(EditableWSDLBoundOperation operation, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { e.bindingOperationOutputAttributes(operation, reader); } } - public boolean bindingOperationFaultElements(WSDLBoundFault fault, XMLStreamReader reader) { + public boolean bindingOperationFaultElements(EditableWSDLBoundFault fault, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { if (e.bindingOperationFaultElements(fault, reader)) { return true; @@ -306,7 +304,7 @@ final class WSDLParserExtensionFacade extends WSDLParserExtension { return true; } - public void bindingOperationFaultAttributes(WSDLBoundFault fault, XMLStreamReader reader) { + public void bindingOperationFaultAttributes(EditableWSDLBoundFault fault, XMLStreamReader reader) { for (WSDLParserExtension e : extensions) { e.bindingOperationFaultAttributes(fault, reader); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java index 136c9808ce3..c954b6fcd29 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java @@ -209,7 +209,7 @@ public class WSDLGenerator { private final Class implType; private boolean inlineSchemas; // TODO - private final boolean disableSecureXmlProcessing; + private final boolean disableXmlSecurity; /** * Creates the WSDLGenerator @@ -229,12 +229,12 @@ public class WSDLGenerator { * @param model The {@link AbstractSEIModelImpl} used to generate the WSDL * @param wsdlResolver The {@link WSDLResolver} to use resovle names while generating the WSDL * @param binding specifies which {@link javax.xml.ws.BindingType} to generate - * @param disableSecureXmlProcessing specifies whether to disable the secure xml processing feature + * @param disableXmlSecurity specifies whether to disable the secure xml processing feature * @param extensions an array {@link WSDLGeneratorExtension} that will * be invoked to generate WSDL extensions */ public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container, - Class implType, boolean inlineSchemas, boolean disableSecureXmlProcessing, + Class implType, boolean inlineSchemas, boolean disableXmlSecurity, WSDLGeneratorExtension... extensions) { this.model = model; @@ -245,7 +245,7 @@ public class WSDLGenerator { this.implType = implType; extensionHandlers = new ArrayList(); this.inlineSchemas = inlineSchemas; - this.disableSecureXmlProcessing = disableSecureXmlProcessing; + this.disableXmlSecurity = disableXmlSecurity; // register handlers for default extensions register(new W3CAddressingWSDLGeneratorExtension()); @@ -463,7 +463,7 @@ public class WSDLGenerator { } } if (resolver.nonGlassfishSchemas != null) { - TransformerFactory tf = XmlUtil.newTransformerFactory(!disableSecureXmlProcessing); + TransformerFactory tf = XmlUtil.newTransformerFactory(!disableXmlSecurity); try { Transformer t = tf.newTransformer(); for (DOMResult xsd : resolver.nonGlassfishSchemas) { diff --git a/jaxws/src/share/jaxws_classes/javax/annotation/PostConstruct.java b/jaxws/src/share/jaxws_classes/javax/annotation/PostConstruct.java index 7478d2adc87..4f2976ca617 100644 --- a/jaxws/src/share/jaxws_classes/javax/annotation/PostConstruct.java +++ b/jaxws/src/share/jaxws_classes/javax/annotation/PostConstruct.java @@ -38,12 +38,31 @@ import static java.lang.annotation.RetentionPolicy.*; * if the class does not request any resources to be injected. Only one * method can be annotated with this annotation. The method on which the * PostConstruct annotation is applied MUST fulfill all of the following - * criteria:
      - *
    • The method MUST NOT have any parameters except in the case of EJB + * criteria: + *

      + *

        + *
      • The method MUST NOT have any parameters except in the case of * interceptors in which case it takes an InvocationContext object as - * defined by the EJB specification.
      • - *
      • The return type of the method MUST be void.
      • - *
      • The method MUST NOT throw a checked exception.
      • + * defined by the Interceptors specification. + *
      • The method defined on an interceptor class MUST HAVE one of the + * following signatures: + *

        + * void <METHOD>(InvocationContext) + *

        + * Object <METHOD>(InvocationContext) throws Exception + *

        + * Note: A PostConstruct interceptor method must not throw application + * exceptions, but it may be declared to throw checked exceptions including + * the java.lang.Exception if the same interceptor method interposes on + * business or timeout methods in addition to lifecycle events. If a + * PostConstruct interceptor method returns a value, it is ignored by + * the container. + *

      • + *
      • The method defined on a non-interceptor class MUST HAVE the + * following signature: + *

        + * void <METHOD>() + *

      • *
      • The method on which PostConstruct is applied MAY be public, protected, * package private or private.
      • *
      • The method MUST NOT be static except for the application client.
      • diff --git a/jaxws/src/share/jaxws_classes/javax/annotation/PreDestroy.java b/jaxws/src/share/jaxws_classes/javax/annotation/PreDestroy.java index 1c5c4df6e47..d24cd3f70ad 100644 --- a/jaxws/src/share/jaxws_classes/javax/annotation/PreDestroy.java +++ b/jaxws/src/share/jaxws_classes/javax/annotation/PreDestroy.java @@ -37,18 +37,38 @@ import static java.lang.annotation.RetentionPolicy.*; * supported by all container managed objects that support PostConstruct * except the application client container in Java EE 5. The method on which * the PreDestroy annotation is applied MUST fulfill all of the following - * criteria:
          - *
        • The method MUST NOT have any parameters except in the case of EJB - * interceptors in which case it takes an InvocationContext object as defined - * by the EJB specification.
        • - *
        • The return type of the method MUST be void.
        • - *
        • The method MUST NOT throw a checked exception.
        • + * criteria: + *

          + *

            + *
          • The method MUST NOT have any parameters except in the case of + * interceptors in which case it takes an InvocationContext object as + * defined by the Interceptors specification.
          • + *
          • The method defined on an interceptor class MUST HAVE one of the + * following signatures: + *

            + * void <METHOD>(InvocationContext) + *

            + * Object <METHOD>(InvocationContext) throws Exception + *

            + * Note: A PreDestroy interceptor method must not throw application + * exceptions, but it may be declared to throw checked exceptions including + * the java.lang.Exception if the same interceptor method interposes on + * business or timeout methods in addition to lifecycle events. If a + * PreDestroy interceptor method returns a value, it is ignored by + * the container. + *

          • + *
          • The method defined on a non-interceptor class MUST HAVE the + * following signature: + *

            + * void <METHOD>() + *

          • *
          • The method on which PreDestroy is applied MAY be public, protected, * package private or private.
          • *
          • The method MUST NOT be static.
          • *
          • The method MAY be final.
          • *
          • If the method throws an unchecked exception it is ignored except in the * case of EJBs where the EJB can handle exceptions.
          • + *
          * * @see javax.annotation.PostConstruct * @see javax.annotation.Resource diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBException.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBException.java index ff79b118c29..c6b94d64920 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBException.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBException.java @@ -48,7 +48,7 @@ public class JAXBException extends Exception { * Exception reference * */ - private Throwable linkedException; + private volatile Throwable linkedException; static final long serialVersionUID = -5621384651494307979L; @@ -133,7 +133,7 @@ public class JAXBException extends Exception { * indicates that the linked exception does not exist or * is unknown). */ - public synchronized void setLinkedException( Throwable exception ) { + public void setLinkedException( Throwable exception ) { this.linkedException = exception; } diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/Marshaller.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/Marshaller.java index a37fa3cd754..6a469039a06 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/Marshaller.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/Marshaller.java @@ -175,9 +175,7 @@ import java.io.File; * encoding used during these marshal operations. Client applications are * expected to supply a valid character encoding name as defined in the * W3C XML 1.0 - * Recommendation and supported by your - * - * Java Platform. + * Recommendation and supported by your Java Platform. *
  • * *

    @@ -292,7 +290,7 @@ import java.io.File; * boolean beforeMarshal(Marshaller); * * // Invoked by Marshaller after it has marshalled all properties of this object. - * void afterMmarshal(Marshaller); + * void afterMarshal(Marshaller); * * * The class defined event callback methods should be used when the callback method requires diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/TypeConstraintException.java b/jaxws/src/share/jaxws_classes/javax/xml/bind/TypeConstraintException.java index a1118b1ab6f..b441bd0c15b 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/TypeConstraintException.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/TypeConstraintException.java @@ -57,7 +57,7 @@ public class TypeConstraintException extends java.lang.RuntimeException { * Exception reference * */ - private Throwable linkedException; + private volatile Throwable linkedException; /** @@ -141,7 +141,7 @@ public class TypeConstraintException extends java.lang.RuntimeException { * indicates that the linked exception does not exist or * is unknown). */ - public synchronized void setLinkedException( Throwable exception ) { + public void setLinkedException( Throwable exception ) { this.linkedException = exception; } diff --git a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/package.html b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/package.html index 9174944302a..02dbd93639d 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/package.html +++ b/jaxws/src/share/jaxws_classes/javax/xml/bind/annotation/adapters/package.html @@ -38,8 +38,7 @@

    Package Specification

    Related Documentation

    @@ -47,8 +46,7 @@ For overviews, tutorials, examples, guides, and tool documentation, please see: diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/MessageFactory.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/MessageFactory.java index 074c7207604..8501297f3dc 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/MessageFactory.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/MessageFactory.java @@ -104,8 +104,6 @@ public abstract class MessageFactory { MESSAGE_FACTORY_PROPERTY, DEFAULT_MESSAGE_FACTORY, false); - FactoryFinder.find(MESSAGE_FACTORY_PROPERTY, - DEFAULT_MESSAGE_FACTORY, false); if (factory != null) { return factory; diff --git a/jdk/.hgtags b/jdk/.hgtags index 6eef7251ea8..0804e08a7d0 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -230,3 +230,10 @@ f1d8d15bfcb5ada858a942f8a31f6598f23214d1 jdk8-b104 c817276bd870dfe1dcc3a3dbbc092436b6907f75 jdk8-b106 eea685b9ccaa1980e0a7e07d6a3a84bcc7e9ab82 jdk8-b107 006aaa5f069e7dd98fccdc696866c9f8582c087c jdk8-b108 +946f3fd5f8bf0ccd180c258d25e5837fa1bf004c jdk8-b109 +54e099776f08430d3a7f4feabd9f2ba886b55320 jdk8-b110 +719befd87c7b96ae103c05730ca555227bfc0116 jdk8-b111 +f002f5f3a16cca62e139cb8eed05ffaeb373587d jdk8-b112 +5b4261b4b72af53e8e178933ef6bc6c7f8cdbc60 jdk8-b113 +f26a0c8071bde1e3b923713c75156e4a58955623 jdk8-b114 +f82b730c798b6bf38946baaba8a7d80fd5efaa70 jdk8-b115 diff --git a/jdk/make/bridge/AccessBridgeJava/Makefile b/jdk/make/bridge/AccessBridgeJava/Makefile index c5bebd02cea..bbba630996b 100644 --- a/jdk/make/bridge/AccessBridgeJava/Makefile +++ b/jdk/make/bridge/AccessBridgeJava/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ endif # # Java files to compile. # -FILES_java = com/sun/java/accessibility/AccessBridge.java +FILES_java = com/sun/java/accessibility/AccessBridgeLoader.java com/sun/java/accessibility/AccessBridge.java # # Location for the newly built classfiles. @@ -61,14 +61,13 @@ CLASSDESTDIR = $(TEMPDIR)/classes # # Rules # -CLASSDESTDIR = $(TEMPDIR)/classes FILES_class = $(FILES_java:%.java=$(CLASSDESTDIR)/%.class) build: prebuild prebuild: - $(CP) $(CLOSED_PLATFORM_SRC)/classes/com/sun/java/accessibility/$(ABPLATFORM)/AccessBridge.java \ + $(CP) $(CLOSED_PLATFORM_SRC)/classes/com/sun/java/accessibility/$(ABPLATFORM)/AccessBridgeLoader.java \ $(CLOSED_PLATFORM_SRC)/classes/com/sun/java/accessibility all : build $(JARFILE) diff --git a/jdk/make/com/sun/jmx/Makefile b/jdk/make/com/sun/jmx/Makefile index 62435751673..02ef6b07998 100644 --- a/jdk/make/com/sun/jmx/Makefile +++ b/jdk/make/com/sun/jmx/Makefile @@ -130,11 +130,13 @@ $(CLASSDESTDIR)/%_Stub.class: $(CLASSDESTDIR)/%.class $(RMIC) -classpath "$(CLASSDESTDIR)" \ -d $(CLASSDESTDIR) \ -iiop -v1.2 \ + -emitPermissionCheck \ $(subst /,.,$(<:$(CLASSDESTDIR)/%.class=%)) $(RMIC) $(HOTSPOT_INTERPRETER_FLAG) -classpath "$(CLASSDESTDIR)" \ -d $(CLASSDESTDIR) \ -iiop -v1.2 \ -standardPackage \ + -emitPermissionCheck \ $(subst /,.,$(<:$(CLASSDESTDIR)/%.class=%)) @$(java-vm-cleanup) diff --git a/jdk/make/common/Defs-macosx.gmk b/jdk/make/common/Defs-macosx.gmk index befd2cfed5b..83ccf604ac0 100644 --- a/jdk/make/common/Defs-macosx.gmk +++ b/jdk/make/common/Defs-macosx.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -85,6 +85,100 @@ SCRIPT_SUFFIX = CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required! CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required! +# The Full Debug Symbols (FDS) default for VARIANT == OPT builds is +# enabled with debug info files ZIP'ed to save space. For VARIANT != +# OPT builds, FDS is always enabled, after all a debug build without +# debug info isn't very useful. The ZIP_DEBUGINFO_FILES option only has +# meaning when FDS is enabled. +# +# If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be +# disabled for a VARIANT == OPT build. +# +# Note: Use of a different variable name for the FDS override option +# versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS +# versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass +# in options via environment variables, use of distinct variables +# prevents strange behaviours. For example, in a VARIANT != OPT build, +# the FULL_DEBUG_SYMBOLS environment variable will be 0, but the +# ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If the same +# variable name is used, then different values can be picked up by +# different parts of the build. Just to be clear, we only need two +# variable names because the incoming option value can be overridden +# in some situations, e.g., a VARIANT != OPT build. + +ifeq ($(VARIANT), OPT) + FULL_DEBUG_SYMBOLS ?= 1 + ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS) +else + # debug variants always get Full Debug Symbols (if available) + ENABLE_FULL_DEBUG_SYMBOLS = 1 +endif +_JUNK_ := $(shell \ + echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") +# since objcopy is optional, we set ZIP_DEBUGINFO_FILES later + +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(OS_NAME),darwin) + # MacOS X doesn't use OBJCOPY or STRIP_POLICY + OBJCOPY= + STRIP_POLICY= + ZIP_DEBUGINFO_FILES ?= 1 + else + ifndef CROSS_COMPILE_ARCH + # Default OBJCOPY comes from GNU Binutils on Linux: + DEF_OBJCOPY=/usr/bin/objcopy + else + # Assume objcopy is part of the cross-compilation toolkit + DEF_OBJCOPY=$(COMPILER_PATH)/objcopy + endif + OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) + ifneq ($(ALT_OBJCOPY),) + _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") + # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path + OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) + endif + + # Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the + # JDK build to import .debuginfo or .diz files from the HotSpot build. + # However, adding FDS support to the JDK build will occur in phases + # so a different make variable (LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS + # and PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS) is used to indicate that a + # particular library or program supports FDS. + + ifeq ($(OBJCOPY),) + _JUNK_ := $(shell \ + echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo" \ + "files. You may need to set ALT_OBJCOPY.") + ENABLE_FULL_DEBUG_SYMBOLS=0 + else + _JUNK_ := $(shell \ + echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") + + # Library stripping policies for .debuginfo configs: + # all_strip - strips everything from the library + # min_strip - strips most stuff from the library; leaves + # minimum symbols + # no_strip - does not strip the library at all + # + # Oracle security policy requires "all_strip". A waiver was granted + # on 2011.09.01 that permits using "min_strip" in the Java JDK and + # Java JRE. + # + # Currently, STRIP_POLICY is only used when Full Debug Symbols + # is enabled. + STRIP_POLICY ?= min_strip + + _JUNK_ := $(shell \ + echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)") + + ZIP_DEBUGINFO_FILES ?= 1 + endif + endif + + _JUNK_ := $(shell \ + echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)") +endif + # # Default optimization # diff --git a/jdk/make/common/Defs.gmk b/jdk/make/common/Defs.gmk index fe2bc94506f..5403664ff60 100644 --- a/jdk/make/common/Defs.gmk +++ b/jdk/make/common/Defs.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -508,12 +508,18 @@ endef # Convenient macros # -# Prepare $@ target, remove old one and making sure directory exists +# Prepare $@ target, remove old one and making sure containing dir exists define prep-target $(MKDIR) -p $(@D) $(RM) $@ endef +# Prepare $@ target dir, remove old one and making sure containing dir exists +define prep-target-dir +$(MKDIR) -p $(@D) +$(RM) -r $@ +endef + # Simple install of $< file to $@ define install-file $(prep-target) @@ -616,6 +622,26 @@ $(CP) $< $@ fi endef +# MacOS X strongly discourages 'cp -r' and provides 'cp -R' instead. +# May need to have a MacOS X specific definition of install-import-dir +# sometime in the future. +define install-import-dir +@$(ECHO) "ASSEMBLY_IMPORT: $@" +$(prep-target-dir) +$(CP) -r $< $@ +endef + +ifeq ($(PLATFORM), macosx) +# On MacOS X, debug info is in .dSYM directories +define install-import-debuginfo +$(install-import-dir) +endef +else +define install-import-debuginfo +$(install-import-file) +endef +endif + define install-import-file $(install-importonly-file) endef diff --git a/jdk/make/common/shared/Compiler-msvc.gmk b/jdk/make/common/shared/Compiler-msvc.gmk index af7dd101f7c..d6d7416bc15 100644 --- a/jdk/make/common/shared/Compiler-msvc.gmk +++ b/jdk/make/common/shared/Compiler-msvc.gmk @@ -53,7 +53,7 @@ ifndef CONFIGURE_BUILD # The VS2010 compiler is the same one used on both 32bit and 64bit ifeq ($(CC_MAJORVER), 16) - COMPILER_NAME=Microsoft Visual Studio 10 (16.00.30319.01) + COMPILER_NAME=Microsoft Visual Studio 10 (16.00.40219.01) COMPILER_VERSION=VS2010 ifeq ($(WINDOWSSDKDIR),) WINDOWSSDKDIR := $(error WINDOWSSDKDIR cannot be empty here) diff --git a/jdk/make/common/shared/Defs-versions.gmk b/jdk/make/common/shared/Defs-versions.gmk index a3a53c5c048..31d09f08866 100644 --- a/jdk/make/common/shared/Defs-versions.gmk +++ b/jdk/make/common/shared/Defs-versions.gmk @@ -86,19 +86,17 @@ endif # REQUIRED_MAKE_VER # The minimum version of GNU make. # -# REQUIRED_MKS_VER -# Windows only: If MKS used instead of CYGWIN, the minimum version of MKS. -# # REQUIRED_OS_VARIANT_NAME # The OS variation name required. # Solaris: Solaris or OpenSolaris -# Windows: Windows2000, WindowsXP, Windows2003, etc. +# Windows: Windows2000, WindowsXP, Windows2003, Windows2008R2, etc. # Linux: Fedora, RedHat, SuSE, Ubuntu, etc. # # REQUIRED_OS_VARIANT_VERSION # The version number associated with the above OS variant name. # Solaris: output of uname -r -# Windows: 5.0 for Windows2000, 5.1 for WindowsXP, 5.2 for Windows2003, etc. +# Windows: 5.0 for Windows2000, 5.1 for WindowsXP, +# 5.2 for Windows2003, 6.1 for Windows2008R2, etc. # Linux: number for the variant, e.g. 9 for Fedora 9 # # REQUIRED_OS_VERSION @@ -180,21 +178,15 @@ endif # Windows specific ifeq ($(PLATFORM), windows) REQUIRED_OS_NAME = Windows - ifeq ($(ARCH_DATA_MODEL),64) - REQUIRED_OS_VERSION = 5.2 - REQUIRED_OS_VARIANT_NAME = Windows2003 - else - REQUIRED_OS_VERSION = 5.1 - REQUIRED_OS_VARIANT_NAME = WindowsXP - endif + REQUIRED_OS_VERSION = 6.1 + REQUIRED_OS_VARIANT_NAME = Windows2008R2 REQUIRED_OS_VARIANT_VERSION = $(REQUIRED_OS_VERSION) REQUIRED_CYGWIN_VER = 4.0 - REQUIRED_MKS_VER = 6.1 ifeq ($(CC_VERSION),msvc) REQUIRED_COMPILER_NAME = Visual Studio 10 REQUIRED_COMPILER_VERSION = VS2010 - REQUIRED_CC_VER = 16.00.30319.01 - REQUIRED_LINK_VER = 10.00.30319.01 + REQUIRED_CC_VER = 16.00.40219.01 + REQUIRED_LINK_VER = 10.00.40219.01 endif ifeq ($(CC_VERSION),gcc) REQUIRED_CC_VER = 3.4.3 diff --git a/jdk/make/common/shared/Sanity.gmk b/jdk/make/common/shared/Sanity.gmk index a9f4692064a..66fab3524d3 100644 --- a/jdk/make/common/shared/Sanity.gmk +++ b/jdk/make/common/shared/Sanity.gmk @@ -121,11 +121,13 @@ ifeq ($(PLATFORM), macosx) endif ifeq ($(PLATFORM), windows) - # Windows 2000 is 5.0, Windows XP is 5.1, Windows 2003 is 5.2 + # Windows 2000 is 5.0, Windows XP is 5.1, + # Windows 2003 is 5.2, Windows 7 and 2008R2 are 6.1 # Assume 5.0 (Windows 2000) if systeminfo does not help WINDOWS_MAPPING-5.0 := Windows2000 WINDOWS_MAPPING-5.1 := WindowsXP WINDOWS_MAPPING-5.2 := Windows2003 + WINDOWS_MAPPING-6.1 := Windows2008R2 # What kind of system we are using (Variation is the common name) _OS_VERSION := \ $(shell systeminfo 2> $(DEV_NULL) | \ @@ -180,7 +182,6 @@ include $(JDK_MAKE_SHARED_DIR)/Sanity-Settings.gmk sane-linux \ sane-cygwin \ sane-cygwin-shell \ - sane-mks \ sane-arch_data_model \ sane-os_patch_level \ sane-classpath \ @@ -317,7 +318,7 @@ ifndef OPENJDK endif # OPENJDK ifeq ($(PLATFORM), windows) - sane-os_version:: sane-cygwin sane-mks sane-cygwin-shell + sane-os_version:: sane-cygwin sane-cygwin-shell endif ###################################################### @@ -386,22 +387,6 @@ sane-cygwin-shell: endif endif -###################################################### -# Check the Windows mks version -###################################################### -ifeq ($(PLATFORM), windows) - MKS_CHECK :=$(call CheckVersions,$(MKS_VER),$(REQUIRED_MKS_VER)) -sane-mks: - ifdef USING_MKS - ifeq ($(MKS_CHECK),missing) - @$(call OfficialErrorMessage,MKS version,$(MKS_VER),$(REQUIRED_MKS_VER)) - endif - ifeq ($(MKS_CHECK),older) - @$(call OfficialErrorMessage,MKS version,$(MKS_VER),$(REQUIRED_MKS_VER)) - endif - endif -endif - ###################################################### # Get list of installed patches (this file has a particular format) ###################################################### diff --git a/jdk/make/docs/Makefile b/jdk/make/docs/Makefile index 66810971f72..ad9a2c55be5 100644 --- a/jdk/make/docs/Makefile +++ b/jdk/make/docs/Makefile @@ -50,6 +50,7 @@ BUG_SUBMIT_LINE = Submit a bug or feature DEV_DOCS_URL-5 = http://java.sun.com/j2se/1.5.0/docs/index.html DEV_DOCS_URL-6 = http://download.oracle.com/javase/6/docs/index.html DEV_DOCS_URL-7 = http://download.oracle.com/javase/7/docs/index.html +DEV_DOCS_URL-8 = http://download.oracle.com/javase/8/docs/index.html DEV_DOCS_URL = $(DEV_DOCS_URL-$(JDK_MINOR_VERSION)) DOCS_BASE_URL = http://download.oracle.com/javase/7/docs diff --git a/jdk/make/java/java/FILES_c.gmk b/jdk/make/java/java/FILES_c.gmk index d01b0c29563..29bb7e3b94a 100644 --- a/jdk/make/java/java/FILES_c.gmk +++ b/jdk/make/java/java/FILES_c.gmk @@ -33,6 +33,7 @@ FILES_c = \ Console_md.c \ Double.c \ Executable.c \ + Field.c \ FileDescriptor_md.c \ FileInputStream.c \ FileInputStream_md.c \ diff --git a/jdk/make/java/java/mapfile-vers b/jdk/make/java/java/mapfile-vers index bb06a3d6036..29ce7eb26df 100644 --- a/jdk/make/java/java/mapfile-vers +++ b/jdk/make/java/java/mapfile-vers @@ -190,6 +190,8 @@ SUNWprivate_1.1 { Java_java_lang_reflect_Array_setLong; Java_java_lang_reflect_Array_setShort; Java_java_lang_reflect_Executable_getParameters0; + Java_java_lang_reflect_Executable_getTypeAnnotationBytes0; + Java_java_lang_reflect_Field_getTypeAnnotationBytes0; Java_java_lang_Runtime_freeMemory; Java_java_lang_Runtime_maxMemory; Java_java_lang_Runtime_gc; diff --git a/jdk/make/java/management/mapfile-vers b/jdk/make/java/management/mapfile-vers index 63c4fbf03cc..0ea2ab4eb06 100644 --- a/jdk/make/java/management/mapfile-vers +++ b/jdk/make/java/management/mapfile-vers @@ -57,7 +57,7 @@ SUNWprivate_1.1 { Java_sun_management_GcInfoBuilder_fillGcAttributeInfo; Java_sun_management_GcInfoBuilder_getLastGcInfo0; Java_sun_management_GcInfoBuilder_getNumGcExtAttributes; - Java_sun_management_HotSpotDiagnostic_dumpHeap; + Java_sun_management_HotSpotDiagnostic_dumpHeap0; Java_sun_management_HotspotThread_getInternalThreadCount; Java_sun_management_HotspotThread_getInternalThreadTimes0; Java_sun_management_MemoryImpl_getMemoryManagers0; diff --git a/jdk/make/java/redist/Makefile b/jdk/make/java/redist/Makefile index fb257f5c354..f06e5d1cedb 100644 --- a/jdk/make/java/redist/Makefile +++ b/jdk/make/java/redist/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -60,15 +60,24 @@ LIBJSIG_NAME = $(LIB_PREFIX)jsig.$(LIBRARY_SUFFIX) JVMDB_NAME = $(LIB_PREFIX)jvm$(DB_SUFFIX).$(LIBRARY_SUFFIX) JVMDTRACE_NAME = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).$(LIBRARY_SUFFIX) -JVM_DEBUGINFO_NAME = $(LIB_PREFIX)jvm.debuginfo JVM_DIZ_NAME = $(LIB_PREFIX)jvm.diz -LIBJSIG_DEBUGINFO_NAME = $(LIB_PREFIX)jsig.debuginfo LIBJSIG_DIZ_NAME = $(LIB_PREFIX)jsig.diz -JVMDB_DEBUGINFO_NAME = $(LIB_PREFIX)jvm$(DB_SUFFIX).debuginfo JVMDB_DIZ_NAME = $(LIB_PREFIX)jvm$(DB_SUFFIX).diz -JVMDTRACE_DEBUGINFO_NAME = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).debuginfo JVMDTRACE_DIZ_NAME = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).diz +ifeq ($(PLATFORM), macosx) + # Note: *.dSYM is a directory + JVM_DEBUGINFO_NAME = $(LIB_PREFIX)jvm.dSYM + LIBJSIG_DEBUGINFO_NAME = $(LIB_PREFIX)jsig.dSYM + JVMDB_DEBUGINFO_NAME = $(LIB_PREFIX)jvm$(DB_SUFFIX).dSYM + JVMDTRACE_DEBUGINFO_NAME = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).dSYM +else + JVM_DEBUGINFO_NAME = $(LIB_PREFIX)jvm.debuginfo + LIBJSIG_DEBUGINFO_NAME = $(LIB_PREFIX)jsig.debuginfo + JVMDB_DEBUGINFO_NAME = $(LIB_PREFIX)jvm$(DB_SUFFIX).debuginfo + JVMDTRACE_DEBUGINFO_NAME = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).debuginfo +endif + CLASSSHARINGDATA_DIR = $(BUILDDIR)/tools/sharing # Needed to do file copy @@ -441,7 +450,7 @@ $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_DIZ_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM $(install-import-file) else $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) endif endif @@ -459,7 +468,7 @@ $(LIB_LOCATION)/$(LIBJSIG_DIZ_NAME): $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$( $(install-import-file) else $(LIB_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME): $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) endif endif @@ -471,8 +480,8 @@ $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME): ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) # We don't create a symlink to a libjsig.diz file, but we do put -# the libjsig.debuginfo symlink into a libjsig.diz file. The aurora -# system does not like dangling symlinks. +# the $(LIBJSIG_DEBUGINFO_NAME) symlink into a libjsig.diz file. +# The aurora system does not like dangling symlinks. ifeq ($(ZIP_DEBUGINFO_FILES),1) $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DIZ_NAME) \ $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_DIZ_NAME): @@ -496,8 +505,8 @@ $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME): ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) # We don't create a symlink to a libjsig.diz file, but we do put -# the libjsig.debuginfo symlink into a libjsig.diz file. The aurora -# system does not like dangling symlinks. +# the $(LIBJSIG_DEBUGINFO_NAME) symlink into a libjsig.diz file. +# The aurora system does not like dangling symlinks. ifeq ($(ZIP_DEBUGINFO_FILES),1) $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DIZ_NAME): @$(prep-target) @@ -531,10 +540,10 @@ $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_DIZ_NAME): $(HOTSPOT_CLIENT_PATH)/ $(install-import-file) else $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDB_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) endif endif @@ -556,10 +565,10 @@ $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_DIZ_NAME): $(HOTSPOT_SERVER_PATH)/ $(install-import-file) else $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) endif endif endif @@ -581,10 +590,10 @@ $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_DIZ_NAME): $(HOTSPOT_CLIENT_PA $(install-import-file) else $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDTRACE_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) endif endif @@ -613,13 +622,13 @@ $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_DIZ_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM $(install-import-file) else $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) endif endif diff --git a/jdk/make/java/security/Makefile b/jdk/make/java/security/Makefile index bbb0ca4f757..813597347bf 100644 --- a/jdk/make/java/security/Makefile +++ b/jdk/make/java/security/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -70,11 +70,18 @@ POLICY_BUILD = $(LIBDIR)/security/java.policy CACERTS_SRC = $(CACERTS_FILE) CACERTS_BUILD = $(LIBDIR)/security/cacerts +BLACKLISTED_CERTS_SRC = $(TOPDIR)/src/share/lib/security/blacklisted.certs +BLACKLISTED_CERTS_BUILD = $(LIBDIR)/security/blacklisted.certs + ifndef OPENJDK BLACKLIST_SRC = $(CLOSED_SHARE_SRC)/lib/security/blacklist BLACKLIST_BUILD = $(LIBDIR)/security/blacklist + BLACKLISTED_CERTS_SRC += $(wildcard $(CLOSED_SHARE_SRC)/lib/security/blacklisted.certs) TRUSTEDLIBS_SRC = $(CLOSED_SHARE_SRC)/lib/security/trusted.libraries TRUSTEDLIBS_BUILD = $(LIBDIR)/security/trusted.libraries + RESTRICTED_PKGS_SRC = $(CLOSED_SHARE_SRC)/lib/security/restricted.pkgs + RESTRICTED_PKGS := $(shell $(CAT) $(RESTRICTED_PKGS_SRC) | $(TR) "\n" " ") + ADDTORESTRICTEDPKGS_JARFILE = $(BUILDTOOLJARDIR)/addtorestrictedpkgs.jar endif FILES_class = $(FILES_java:%.java=$(CLASSBINDIR)/%.class) @@ -85,9 +92,9 @@ FILES_class = $(FILES_java:%.java=$(CLASSBINDIR)/%.class) include $(BUILDDIR)/common/Rules.gmk ifdef OPENJDK -build: properties policy cacerts +build: properties policy cacerts blacklisted-certs else -build: properties policy cacerts blacklist trustedlibs +build: properties policy cacerts blacklist blacklisted-certs trustedlibs endif install: all @@ -100,10 +107,19 @@ cacerts: classes $(CACERTS_BUILD) blacklist: classes $(BLACKLIST_BUILD) +blacklisted-certs: classes $(BLACKLISTED_CERTS_BUILD) + trustedlibs: classes $(TRUSTEDLIBS_BUILD) +ifdef OPENJDK $(PROPS_BUILD): $(PROPS_SRC) $(install-file) +else +$(PROPS_BUILD): $(PROPS_SRC) + $(MKDIR) -p $(@D) + $(BOOT_JAVA_CMD) -jar $(ADDTORESTRICTEDPKGS_JARFILE) $^ $@.tmp $(RESTRICTED_PKGS) + $(MV) $@.tmp $@ +endif $(POLICY_BUILD): $(POLICY_SRC) $(install-file) @@ -114,12 +130,25 @@ $(CACERTS_BUILD): $(CACERTS_SRC) $(BLACKLIST_BUILD): $(BLACKLIST_SRC) $(install-file) +$(BLACKLISTED_CERTS_BUILD): $(BLACKLISTED_CERTS_SRC) + $(MKDIR) -p $(@D) + $(CAT) $^ | $(SED) '/^$$/d' | $(SORT) | $(UNIQ) > $@.tmp + $(GREP) -i Algorithm $@.tmp > $@ + if [ `$(SED) -n -e "$$=" $@` != 1 ]; then \ + $(ECHO) "Different algorithms defined in $^"; \ + $(RM) $@ $@.tmp; \ + false; \ + fi + $(GREP) -iv Algorithm $@.tmp >> $@ + $(RM) $@.tmp + $(TRUSTEDLIBS_BUILD): $(TRUSTEDLIBS_SRC) $(install-file) clean clobber:: .delete.classlist $(RM) -r $(CLASSBINDIR)/java/security - $(RM) $(PROPS_BUILD) $(POLICY_BUILD) $(CACERTS_BUILD) $(BLACKLIST_BUILD) $(TRUSTEDLIBS_BUILD) + $(RM) $(PROPS_BUILD) $(POLICY_BUILD) $(CACERTS_BUILD) $(BLACKLIST_BUILD) \ + $(BLACKLISTED_CERTS_BUILD) $(TRUSTEDLIBS_BUILD) # Additional Rule for building sun.security.util $(CLASSBINDIR)/%.class: $(SHARE_SRC)/sun/%.java diff --git a/jdk/make/jprt.properties b/jdk/make/jprt.properties index eb6ff3ff2f0..c34540ee1f7 100644 --- a/jdk/make/jprt.properties +++ b/jdk/make/jprt.properties @@ -33,9 +33,7 @@ jprt.build.flavors=product,fastdebug # Standard list of jprt build targets for this source tree jprt.build.targets= \ - solaris_sparc_5.10-{product|fastdebug}, \ solaris_sparcv9_5.10-{product|fastdebug}, \ - solaris_i586_5.10-{product|fastdebug}, \ solaris_x64_5.10-{product|fastdebug}, \ linux_i586_2.6-{product|fastdebug}, \ linux_x64_2.6-{product|fastdebug}, \ @@ -48,9 +46,7 @@ jprt.my.test.set=${jprt.test.set} # Test target list (no fastdebug & limited c2 testing) jprt.my.test.target.set= \ - solaris_sparc_5.10-product-c1-TESTNAME, \ solaris_sparcv9_5.10-product-c2-TESTNAME, \ - solaris_i586_5.10-product-c1-TESTNAME, \ solaris_x64_5.10-product-c2-TESTNAME, \ linux_i586_2.6-product-{c1|c2}-TESTNAME, \ linux_x64_2.6-product-c2-TESTNAME, \ @@ -112,9 +108,7 @@ jprt.make.rule.all.test.targets= \ # JCK test targets in test/Makefile (no windows) jprt.my.jck.test.target.set= \ - solaris_sparc_5.10-product-c1-JCK7TESTRULE, \ solaris_sparcv9_5.10-product-c2-JCK7TESTRULE, \ - solaris_i586_5.10-product-c1-JCK7TESTRULE, \ solaris_x64_5.10-product-c2-JCK7TESTRULE, \ linux_i586_2.6-product-c1-JCK7TESTRULE, \ linux_x64_2.6-product-c2-JCK7TESTRULE diff --git a/jdk/make/netbeans/common/java-data-native.ent b/jdk/make/netbeans/common/java-data-native.ent index 54c7486aafb..b50ea59afe7 100644 --- a/jdk/make/netbeans/common/java-data-native.ent +++ b/jdk/make/netbeans/common/java-data-native.ent @@ -31,14 +31,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> - + ${root}/src/share/classes ${root}/src/macosx/classes ${root}/src/solaris/classes ${root}/src/windows/classes ${bootstrap.jdk}/jre/lib/rt.jar - ${root}/build/${platform}-${arch}/classes + ${root}/../build/${platform}-${arch}/jdk/classes ${root}/build/${platform}-${arch}/docs/api 1.8 diff --git a/jdk/make/netbeans/common/java-data-no-native.ent b/jdk/make/netbeans/common/java-data-no-native.ent index 8e06c66c348..882072e0e9c 100644 --- a/jdk/make/netbeans/common/java-data-no-native.ent +++ b/jdk/make/netbeans/common/java-data-no-native.ent @@ -31,11 +31,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> - + ${root}/src/share/classes ${bootstrap.jdk}/jre/lib/rt.jar - ${root}/build/${platform}-${arch}/classes + ${root}/../build/${platform}-${arch}/jdk/classes ${root}/build/${platform}-${arch}/docs/api 1.8 diff --git a/jdk/make/sun/awt/Makefile b/jdk/make/sun/awt/Makefile index 8b7612e416a..9f11638a69e 100644 --- a/jdk/make/sun/awt/Makefile +++ b/jdk/make/sun/awt/Makefile @@ -145,8 +145,6 @@ ifeq ($(PLATFORM), macosx) # # Files # -include FILES_c_macosx.gmk -include FILES_export_macosx.gmk FILES_objc = $(FILES_AWT_objc) OTHER_LDLIBS = -lmlib_image $(JVMLIB) $(LIBM) \ diff --git a/jdk/make/sun/javazic/tzdata/VERSION b/jdk/make/sun/javazic/tzdata/VERSION index e50b6f37dcc..ea1c49a6f83 100644 --- a/jdk/make/sun/javazic/tzdata/VERSION +++ b/jdk/make/sun/javazic/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2013d +tzdata2013g diff --git a/jdk/make/sun/javazic/tzdata/africa b/jdk/make/sun/javazic/tzdata/africa index 6b19b982c6b..19bc98afe16 100644 --- a/jdk/make/sun/javazic/tzdata/africa +++ b/jdk/make/sun/javazic/tzdata/africa @@ -881,13 +881,23 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou # transitions would be 2013-07-07 and 2013-08-10; see: # http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10 -# From Paul Eggert (2013-07-03): +# From Steffen Thorsen (2013-09-28): +# Morocco extends DST by one month, on very short notice, just 1 day +# before it was going to end. There is a new decree (2.13.781) for +# this, where DST from now on goes from last Sunday of March at 02:00 +# to last Sunday of October at 03:00, similar to EU rules. Official +# source (French): +# http://www.maroc.gov.ma/fr/actualites/lhoraire-dete-gmt1-maintenu-jusquau-27-octobre-2013 +# Another source (specifying the time for start and end in the decree): +# http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html + +# From Paul Eggert (2013-09-30): # To estimate what the Moroccan government will do in future years, -# transition dates for 2014 through 2021 were determined by running +# transition dates for 2014 through 2037 were determined by running # the following program under GNU Emacs 24.3: # # (let ((islamic-year 1435)) -# (while (< islamic-year 1444) +# (while (< islamic-year 1460) # (let ((a # (calendar-gregorian-from-absolute # (calendar-islamic-to-absolute (list 9 1 islamic-year)))) @@ -902,13 +912,14 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou # (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) # (setq islamic-year (+ 1 islamic-year)))) # -# with the results hand-edited for 2020-2022, when the normal spring-forward -# date falls during the estimated Ramadan. -# -# From 2023 through 2038 Ramadan is not predicted to overlap with -# daylight saving time. Starting in 2039 there will be overlap again, +# with spring-forward transitions removed for 2023-2025, when the +# normal spring-forward date falls during the estimated Ramadan; with +# all transitions removed for 2026-2035, where the estimated Ramadan +# falls entirely outside daylight-saving time; and with fall-back +# transitions removed for 2036-2037, where the normal fall-back +# date falls during the estimated Ramadan. Problems continue after that, # but 32-bit time_t values roll around in 2038 so for now do not worry -# about dates after 2038. +# about dates after 2037. # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -935,12 +946,14 @@ Rule Morocco 2010 only - May 2 0:00 1:00 S Rule Morocco 2010 only - Aug 8 0:00 0 - Rule Morocco 2011 only - Apr 3 0:00 1:00 S Rule Morocco 2011 only - Jul 31 0 0 - -Rule Morocco 2012 2019 - Apr lastSun 2:00 1:00 S -Rule Morocco 2012 max - Sep lastSun 3:00 0 - +Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 S +Rule Morocco 2012 only - Sep 30 3:00 0 - Rule Morocco 2012 only - Jul 20 3:00 0 - Rule Morocco 2012 only - Aug 20 2:00 1:00 S Rule Morocco 2013 only - Jul 7 3:00 0 - Rule Morocco 2013 only - Aug 10 2:00 1:00 S +Rule Morocco 2013 2035 - Oct lastSun 3:00 0 - +Rule Morocco 2014 2022 - Mar lastSun 2:00 1:00 S Rule Morocco 2014 only - Jun 29 3:00 0 - Rule Morocco 2014 only - Jul 29 2:00 1:00 S Rule Morocco 2015 only - Jun 18 3:00 0 - @@ -953,10 +966,21 @@ Rule Morocco 2018 only - May 16 3:00 0 - Rule Morocco 2018 only - Jun 15 2:00 1:00 S Rule Morocco 2019 only - May 6 3:00 0 - Rule Morocco 2019 only - Jun 5 2:00 1:00 S +Rule Morocco 2020 only - Apr 24 3:00 0 - Rule Morocco 2020 only - May 24 2:00 1:00 S +Rule Morocco 2021 only - Apr 13 3:00 0 - Rule Morocco 2021 only - May 13 2:00 1:00 S +Rule Morocco 2022 only - Apr 3 3:00 0 - Rule Morocco 2022 only - May 3 2:00 1:00 S -Rule Morocco 2023 max - Apr lastSun 2:00 1:00 S +Rule Morocco 2023 only - Apr 22 2:00 1:00 S +Rule Morocco 2024 only - Apr 10 2:00 1:00 S +Rule Morocco 2025 only - Mar 31 2:00 1:00 S +Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S +Rule Morocco 2036 only - Oct 21 3:00 0 - +Rule Morocco 2037 only - Oct 11 3:00 0 - +Rule Morocco 2038 only - Sep 30 3:00 0 - +Rule Morocco 2038 only - Oct 30 2:00 1:00 S +Rule Morocco 2038 max - Oct lastSun 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 @@ -1123,9 +1147,7 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931 3:00 - EAT # South Sudan -Zone Africa/Juba 2:06:24 - LMT 1931 - 2:00 Sudan CA%sT 2000 Jan 15 12:00 - 3:00 - EAT +Link Africa/Khartoum Africa/Juba # Swaziland # Zone NAME GMTOFF RULES FORMAT [UNTIL] diff --git a/jdk/make/sun/javazic/tzdata/antarctica b/jdk/make/sun/javazic/tzdata/antarctica index 434432611ca..f30cf747f10 100644 --- a/jdk/make/sun/javazic/tzdata/antarctica +++ b/jdk/make/sun/javazic/tzdata/antarctica @@ -39,9 +39,9 @@ # # Except for the French entries, # I made up all time zone abbreviations mentioned here; corrections welcome! -# FORMAT is `zzz' and GMTOFF is 0 for locations while uninhabited. +# FORMAT is 'zzz' and GMTOFF is 0 for locations while uninhabited. -# These rules are stolen from the `southamerica' file. +# These rules are stolen from the 'southamerica' file. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule ArgAQ 1964 1966 - Mar 1 0:00 0 - Rule ArgAQ 1964 1966 - Oct 15 0:00 1:00 S @@ -251,9 +251,10 @@ Zone Antarctica/Syowa 0 - zzz 1957 Jan 29 # Scott Island (never inhabited) # # year-round base -# Scott, Ross Island, since 1957-01, is like Antarctica/McMurdo. +# Scott Base, Ross Island, since 1957-01. +# See Pacific/Auckland. # -# These rules for New Zealand are stolen from the `australasia' file. +# These rules for New Zealand are stolen from the 'australasia' file. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule NZAQ 1974 only - Nov 3 2:00s 1:00 D Rule NZAQ 1975 1988 - Oct lastSun 2:00s 1:00 D @@ -291,11 +292,11 @@ Rule NZAQ 2008 max - Apr Sun>=1 2:00s 0 S # From Lee Hotz (2001-03-08): # I queried the folks at Columbia who spent the summer at Vostok and this is # what they had to say about time there: -# ``in the US Camp (East Camp) we have been on New Zealand (McMurdo) +# "in the US Camp (East Camp) we have been on New Zealand (McMurdo) # time, which is 12 hours ahead of GMT. The Russian Station Vostok was # 6 hours behind that (although only 2 miles away, i.e. 6 hours ahead # of GMT). This is a time zone I think two hours east of Moscow. The -# natural time zone is in between the two: 8 hours ahead of GMT.'' +# natural time zone is in between the two: 8 hours ahead of GMT." # # From Paul Eggert (2001-05-04): # This seems to be hopelessly confusing, so I asked Lee Hotz about it @@ -360,16 +361,8 @@ Zone Antarctica/Palmer 0 - zzz 1965 -4:00 ChileAQ CL%sT # # -# McMurdo, Ross Island, since 1955-12 -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Antarctica/McMurdo 0 - zzz 1956 - 12:00 NZAQ NZ%sT -# -# Amundsen-Scott, South Pole, continuously occupied since 1956-11-20 -# -# From Paul Eggert (1996-09-03): -# Normally it wouldn't have a separate entry, since it's like the -# larger Antarctica/McMurdo since 1970, but it's too famous to omit. +# McMurdo Station, Ross Island, since 1955-12 +# Amundsen-Scott South Pole Station, continuously occupied since 1956-11-20 # # From Chris Carrier (1996-06-27): # Siple, the first commander of the South Pole station, @@ -391,4 +384,4 @@ Zone Antarctica/McMurdo 0 - zzz 1956 # we have to go around and set them back 5 minutes or so. # Maybe if we let them run fast all of the time, we'd get to leave here sooner!! # -Link Antarctica/McMurdo Antarctica/South_Pole +# See 'australasia' for Antarctica/McMurdo. diff --git a/jdk/make/sun/javazic/tzdata/asia b/jdk/make/sun/javazic/tzdata/asia index f0931b3264d..fd278e5c8a8 100644 --- a/jdk/make/sun/javazic/tzdata/asia +++ b/jdk/make/sun/javazic/tzdata/asia @@ -29,7 +29,7 @@ # go ahead and edit the file (and please send any changes to # tz@iana.org for general use in the future). -# From Paul Eggert (2013-02-21): +# From Paul Eggert (2013-08-11): # # A good source for time zone historical data outside the U.S. is # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), @@ -67,11 +67,11 @@ # 4:00 GST Gulf* # 5:30 IST India # 7:00 ICT Indochina* -# 7:00 WIT west Indonesia -# 8:00 CIT central Indonesia +# 7:00 WIB west Indonesia (Waktu Indonesia Barat) +# 8:00 WITA central Indonesia (Waktu Indonesia Tengah) # 8:00 CST China # 9:00 CJT Central Japanese Time (1896/1937)* -# 9:00 EIT east Indonesia +# 9:00 WIT east Indonesia (Waktu Indonesia Timur) # 9:00 JST JDT Japan # 9:00 KST KDT Korea # 9:30 CST (Australian) Central Standard Time @@ -779,7 +779,7 @@ Zone Asia/Dili 8:22:20 - LMT 1912 8:00 - TLT 1942 Feb 21 23:00 # E Timor Time 9:00 - JST 1945 Sep 23 9:00 - TLT 1976 May 3 - 8:00 - CIT 2000 Sep 17 00:00 + 8:00 - WITA 2000 Sep 17 00:00 9:00 - TLT # India @@ -816,36 +816,53 @@ Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata # (Hollandia). For now, assume all Indonesian locations other than Jayapura # switched on 1945-09-23. # +# From Paul Eggert (2013-08-11): +# Normally the tz database uses English-language abbreviations, but in +# Indonesia it's typical to use Indonesian-language abbreviations even +# when writing in English. For example, see the English-language +# summary published by the Time and Frequency Laboratory of the +# Research Center for Calibration, Instrumentation and Metrology, +# Indonesia, (2006-09-29). +# The abbreviations are: +# +# WIB - UTC+7 - Waktu Indonesia Barat (Indonesia western time) +# WITA - UTC+8 - Waktu Indonesia Tengah (Indonesia central time) +# WIT - UTC+9 - Waktu Indonesia Timur (Indonesia eastern time) +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Java, Sumatra Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug 10 # Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13, # but this must be a typo. - 7:07:12 - JMT 1923 Dec 31 23:47:12 # Jakarta + 7:07:12 - BMT 1923 Dec 31 23:47:12 # Batavia 7:20 - JAVT 1932 Nov # Java Time - 7:30 - WIT 1942 Mar 23 + 7:30 - WIB 1942 Mar 23 9:00 - JST 1945 Sep 23 - 7:30 - WIT 1948 May - 8:00 - WIT 1950 May - 7:30 - WIT 1964 - 7:00 - WIT + 7:30 - WIB 1948 May + 8:00 - WIB 1950 May + 7:30 - WIB 1964 + 7:00 - WIB +# west and central Borneo Zone Asia/Pontianak 7:17:20 - LMT 1908 May 7:17:20 - PMT 1932 Nov # Pontianak MT - 7:30 - WIT 1942 Jan 29 + 7:30 - WIB 1942 Jan 29 9:00 - JST 1945 Sep 23 - 7:30 - WIT 1948 May - 8:00 - WIT 1950 May - 7:30 - WIT 1964 - 8:00 - CIT 1988 Jan 1 - 7:00 - WIT + 7:30 - WIB 1948 May + 8:00 - WIB 1950 May + 7:30 - WIB 1964 + 8:00 - WITA 1988 Jan 1 + 7:00 - WIB +# Sulawesi, Lesser Sundas, east and south Borneo Zone Asia/Makassar 7:57:36 - LMT 1920 7:57:36 - MMT 1932 Nov # Macassar MT - 8:00 - CIT 1942 Feb 9 + 8:00 - WITA 1942 Feb 9 9:00 - JST 1945 Sep 23 - 8:00 - CIT + 8:00 - WITA +# Maluku Islands, West Papua, Papua Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov - 9:00 - EIT 1944 Sep 1 + 9:00 - WIT 1944 Sep 1 9:30 - CST 1964 - 9:00 - EIT + 9:00 - WIT # Iran @@ -1387,9 +1404,11 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u # until about the same time next year (at least). # http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?NewsID=88950 # -# From Paul Eggert (2012-10-25): -# For now, assume this is just a one-year measure. If it becomes -# permanent, we should move Jordan from EET to AST effective tomorrow. +# From Paul Eggert (2013-09-21): +# It's looking like this change will be permanent; see +# Petra News Agency, Cancelling winter saved Jordan $7 million (2013-02-20) +# . +# So move Jordan to UTC+3 as of the abovementioned date. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Jordan 1973 only - Jun 6 0:00 1:00 S @@ -1415,15 +1434,15 @@ Rule Jordan 1995 1998 - Sep Fri>=15 0:00s 0 - Rule Jordan 1999 only - Jul 1 0:00s 1:00 S Rule Jordan 1999 2002 - Sep lastFri 0:00s 0 - Rule Jordan 2000 2001 - Mar lastThu 0:00s 1:00 S -Rule Jordan 2002 max - Mar lastThu 24:00 1:00 S +Rule Jordan 2002 2012 - Mar lastThu 24:00 1:00 S Rule Jordan 2003 only - Oct 24 0:00s 0 - Rule Jordan 2004 only - Oct 15 0:00s 0 - Rule Jordan 2005 only - Sep lastFri 0:00s 0 - -Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 - -Rule Jordan 2013 max - Oct lastFri 0:00s 0 - +Rule Jordan 2006 2012 - Oct lastFri 0:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Amman 2:23:44 - LMT 1931 - 2:00 Jordan EE%sT + 2:00 Jordan EE%sT 2012 Oct 26 0:00s + 3:00 - AST # Kazakhstan @@ -2303,9 +2322,18 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # http://www.samanews.com/index.php?act=Show&id=154120 # http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html -# From Paul Eggert (2013-04-15): +# From Steffen Thorsen (2013-09-24): +# The Gaza and West Bank are ending DST Thursday at midnight +# (2013-09-27 00:00:00) (one hour earlier than last year...). +# This source in English, says "that winter time will go into effect +# at midnight on Thursday in the West Bank and Gaza Strip": +# http://english.wafa.ps/index.php?action=detail&id=23246 +# official source...: +# http://www.palestinecabinet.gov.ps/ar/Views/ViewDetails.aspx?pid=1252 + +# From Paul Eggert (2013-09-24): # For future dates, guess the last Thursday in March at 24:00 through -# the first Friday on or after September 21 at 01:00. This is consistent with +# the first Friday on or after September 21 at 00:00. This is consistent with # the predictions in today's editions of the following URLs, # which are for Gaza and Hebron respectively: # http://www.timeanddate.com/worldclock/timezone.html?n=702 @@ -2336,7 +2364,8 @@ Rule Palestine 2011 only - Aug 1 0:00 0 - Rule Palestine 2011 only - Aug 30 0:00 1:00 S Rule Palestine 2011 only - Sep 30 0:00 0 - Rule Palestine 2012 max - Mar lastThu 24:00 1:00 S -Rule Palestine 2012 max - Sep Fri>=21 1:00 0 - +Rule Palestine 2012 only - Sep 21 1:00 0 - +Rule Palestine 2013 max - Sep Fri>=21 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct diff --git a/jdk/make/sun/javazic/tzdata/australasia b/jdk/make/sun/javazic/tzdata/australasia index 11a3cb97fee..cd6b724859d 100644 --- a/jdk/make/sun/javazic/tzdata/australasia +++ b/jdk/make/sun/javazic/tzdata/australasia @@ -375,16 +375,25 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # today confirmed that Fiji will start daylight savings at 2 am on Sunday 21st # October 2012 and end at 3 am on Sunday 20th January 2013. # http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=6702&catid=71&Itemid=155 + +# From the Fijian Government Media Center (2013-08-30) via David Wheeler: +# Fiji will start daylight savings on Sunday 27th October, 2013 and end at 3am +# on Sunday 19th January, 2014.... move clocks forward by one hour from 2am +# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-27th-OCTOBER-201.aspx # -# From Paul Eggert (2012-08-31): -# For now, guess a pattern of the penultimate Sundays in October and January. +# From Paul Eggert (2013-09-09): +# For now, guess that Fiji springs forward the Sunday before the fourth +# Monday in October. This matches both recent practice and +# timeanddate.com's current spring-forward prediction. +# For the January 2014 transition we guessed right while timeanddate.com +# guessed wrong, so leave the fall-back prediction alone. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 S Rule Fiji 1999 2000 - Feb lastSun 3:00 0 - Rule Fiji 2009 only - Nov 29 2:00 1:00 S Rule Fiji 2010 only - Mar lastSun 3:00 0 - -Rule Fiji 2010 max - Oct Sun>=18 2:00 1:00 S +Rule Fiji 2010 max - Oct Sun>=21 2:00 1:00 S Rule Fiji 2011 only - Mar Sun>=1 3:00 0 - Rule Fiji 2012 max - Jan Sun>=18 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -510,6 +519,7 @@ Zone Pacific/Auckland 11:39:04 - LMT 1868 Nov 2 Zone Pacific/Chatham 12:13:48 - LMT 1957 Jan 1 12:45 Chatham CHA%sT +Link Pacific/Auckland Antarctica/McMurdo # Auckland Is # uninhabited; Maori and Moriori, colonial settlers, pastoralists, sealers, @@ -759,7 +769,7 @@ Zone Pacific/Funafuti 11:56:52 - LMT 1901 # 1886-1891; Baker was similar but exact dates are not known. # Inhabited by civilians 1935-1942; U.S. military bases 1943-1944; # uninhabited thereafter. -# Howland observed Hawaii Standard Time (UTC-10:30) in 1937; +# Howland observed Hawaii Standard Time (UT-10:30) in 1937; # see page 206 of Elgen M. Long and Marie K. Long, # Amelia Earhart: the Mystery Solved, Simon & Schuster (2000). # So most likely Howland and Baker observed Hawaii Time from 1935 @@ -772,8 +782,17 @@ Zone Pacific/Funafuti 11:56:52 - LMT 1901 # no information; was probably like Pacific/Kiritimati # Johnston -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Johnston -10:00 - HST +# +# From Paul Eggert (2013-09-03): +# In his memoirs of June 6th to October 4, 1945 +# (2005), Herbert C. Bach writes, +# "We started our letdown to Kwajalein Atoll and landed there at 5:00 AM +# Johnston time, 1:30 AM Kwajalein time." This was in June 1945, and +# confirms that Johnston kept the same time as Honolulu in summer 1945. +# We have no better information, so for now, assume this has been true +# indefinitely into the past. +# +# See 'northamerica' for Pacific/Johnston. # Kingman # uninhabited diff --git a/jdk/make/sun/javazic/tzdata/backward b/jdk/make/sun/javazic/tzdata/backward index ca4c437a150..5afe9a317ff 100644 --- a/jdk/make/sun/javazic/tzdata/backward +++ b/jdk/make/sun/javazic/tzdata/backward @@ -45,15 +45,17 @@ Link America/Kentucky/Louisville America/Louisville Link America/Argentina/Mendoza America/Mendoza Link America/Rio_Branco America/Porto_Acre Link America/Argentina/Cordoba America/Rosario -Link America/St_Thomas America/Virgin +Link America/Denver America/Shiprock +Link America/Port_of_Spain America/Virgin +Link Pacific/Auckland Antarctica/South_Pole Link Asia/Ashgabat Asia/Ashkhabad +Link Asia/Kolkata Asia/Calcutta Link Asia/Chongqing Asia/Chungking Link Asia/Dhaka Asia/Dacca Link Asia/Kathmandu Asia/Katmandu -Link Asia/Kolkata Asia/Calcutta Link Asia/Macau Asia/Macao -Link Asia/Jerusalem Asia/Tel_Aviv Link Asia/Ho_Chi_Minh Asia/Saigon +Link Asia/Jerusalem Asia/Tel_Aviv Link Asia/Thimphu Asia/Thimbu Link Asia/Makassar Asia/Ujung_Pandang Link Asia/Ulaanbaatar Asia/Ulan_Bator @@ -111,10 +113,10 @@ Link Pacific/Auckland NZ Link Pacific/Chatham NZ-CHAT Link America/Denver Navajo Link Asia/Shanghai PRC -Link Pacific/Pago_Pago Pacific/Samoa -Link Pacific/Chuuk Pacific/Yap -Link Pacific/Chuuk Pacific/Truk Link Pacific/Pohnpei Pacific/Ponape +Link Pacific/Pago_Pago Pacific/Samoa +Link Pacific/Chuuk Pacific/Truk +Link Pacific/Chuuk Pacific/Yap Link Europe/Warsaw Poland Link Europe/Lisbon Portugal Link Asia/Taipei ROC diff --git a/jdk/make/sun/javazic/tzdata/etcetera b/jdk/make/sun/javazic/tzdata/etcetera index d557e3033fb..ebaa5fdfc04 100644 --- a/jdk/make/sun/javazic/tzdata/etcetera +++ b/jdk/make/sun/javazic/tzdata/etcetera @@ -54,9 +54,9 @@ Link Etc/GMT Etc/GMT0 # even though this is the opposite of what many people expect. # POSIX has positive signs west of Greenwich, but many people expect # positive signs east of Greenwich. For example, TZ='Etc/GMT+4' uses -# the abbreviation "GMT+4" and corresponds to 4 hours behind UTC +# the abbreviation "GMT+4" and corresponds to 4 hours behind UT # (i.e. west of Greenwich) even though many people would expect it to -# mean 4 hours ahead of UTC (i.e. east of Greenwich). +# mean 4 hours ahead of UT (i.e. east of Greenwich). # # In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for # TZ='+4'; if you want time zone abbreviations conforming to diff --git a/jdk/make/sun/javazic/tzdata/europe b/jdk/make/sun/javazic/tzdata/europe index 688136c8016..9f574a3b2b6 100644 --- a/jdk/make/sun/javazic/tzdata/europe +++ b/jdk/make/sun/javazic/tzdata/europe @@ -65,7 +65,7 @@ # (1998-09-21, in Portuguese) # -# I invented the abbreviations marked `*' in the following table; +# I invented the abbreviations marked '*' in the following table; # the rest are from earlier versions of this file, or from other sources. # Corrections are welcome! # std dst 2dst @@ -119,7 +119,7 @@ # and a sketch map showing some of the sightlines involved. One paragraph # of the text said: # -# `An old stone obelisk marking a forgotten terrestrial meridian stands +# 'An old stone obelisk marking a forgotten terrestrial meridian stands # beside the river at Kew. In the 18th century, before time and longitude # was standardised by the Royal Observatory in Greenwich, scholars observed # this stone and the movement of stars from Kew Observatory nearby. They @@ -163,7 +163,7 @@ # From Paul Eggert (2003-09-27): # Summer Time was first seriously proposed by William Willett (1857-1915), # a London builder and member of the Royal Astronomical Society -# who circulated a pamphlet ``The Waste of Daylight'' (1907) +# who circulated a pamphlet "The Waste of Daylight" (1907) # that proposed advancing clocks 20 minutes on each of four Sundays in April, # and retarding them by the same amount on four Sundays in September. # A bill was drafted in 1909 and introduced in Parliament several times, @@ -188,10 +188,10 @@ # # From Paul Eggert (1996-09-03): -# The OED Supplement says that the English originally said ``Daylight Saving'' +# The OED Supplement says that the English originally said "Daylight Saving" # when they were debating the adoption of DST in 1908; but by 1916 this # term appears only in quotes taken from DST's opponents, whereas the -# proponents (who eventually won the argument) are quoted as using ``Summer''. +# proponents (who eventually won the argument) are quoted as using "Summer". # From Arthur David Olson (1989-01-19): # @@ -231,9 +231,9 @@ # which could not be said to run counter to any official description. # From Paul Eggert (2000-10-02): -# Howse writes (p 157) `DBST' too, but `BDST' seems to have been common +# Howse writes (p 157) 'DBST' too, but 'BDST' seems to have been common # and follows the more usual convention of putting the location name first, -# so we use `BDST'. +# so we use 'BDST'. # Peter Ilieve (1998-04-19) described at length # the history of summer time legislation in the United Kingdom. @@ -454,6 +454,8 @@ Rule GB-Eire 1981 1989 - Oct Sun>=23 1:00u 0 GMT Rule GB-Eire 1990 1995 - Oct Sun>=22 1:00u 0 GMT # Summer Time Order 1997 (S.I. 1997/2982) # See EU for rules starting in 1996. +# +# Use Europe/London for Jersey, Guernsey, and the Isle of Man. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Europe/London -0:01:15 - LMT 1847 Dec 1 0:00s @@ -820,7 +822,7 @@ Zone Europe/Brussels 0:17:30 - LMT 1880 1:00 EU CE%sT # Bosnia and Herzegovina -# see Serbia +# See Europe/Belgrade. # Bulgaria # @@ -848,10 +850,10 @@ Zone Europe/Sofia 1:33:16 - LMT 1880 2:00 EU EE%sT # Croatia -# see Serbia +# See Europe/Belgrade. # Cyprus -# Please see the `asia' file for Asia/Nicosia. +# Please see the 'asia' file for Asia/Nicosia. # Czech Republic # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -868,6 +870,7 @@ Zone Europe/Prague 0:57:44 - LMT 1850 1:00 C-Eur CE%sT 1944 Sep 17 2:00s 1:00 Czech CE%sT 1979 1:00 EU CE%sT +# Use Europe/Prague also for Slovakia. # Denmark, Faroe Islands, and Greenland @@ -1031,12 +1034,12 @@ Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik air base # From Peter Ilieve (1996-10-28): # [IATA SSIM (1992/1996) claims that the Baltic republics switch at 01:00s, # but a relative confirms that Estonia still switches at 02:00s, writing:] -# ``I do not [know] exactly but there are some little different +# "I do not [know] exactly but there are some little different # (confusing) rules for International Air and Railway Transport Schedules # conversion in Sunday connected with end of summer time in Estonia.... # A discussion is running about the summer time efficiency and effect on # human physiology. It seems that Estonia maybe will not change to -# summer time next spring.'' +# summer time next spring." # From Peter Ilieve (1998-11-04), heavily edited: # @@ -1091,7 +1094,7 @@ Zone Europe/Tallinn 1:39:00 - LMT 1880 # Well, here in Helsinki we're just changing from summer time to regular one, # and it's supposed to change at 4am... -# From Janne Snabb (2010-0715): +# From Janne Snabb (2010-07-15): # # I noticed that the Finland data is not accurate for years 1981 and 1982. # During these two first trial years the DST adjustment was made one hour @@ -1148,7 +1151,7 @@ Link Europe/Helsinki Europe/Mariehamn # -# Shank & Pottenger seem to use `24:00' ambiguously; resolve it with Whitman. +# Shank & Pottenger seem to use '24:00' ambiguously; resolve it with Whitman. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule France 1916 only - Jun 14 23:00s 1:00 S Rule France 1916 1919 - Oct Sun>=1 23:00s 0 - @@ -1438,7 +1441,7 @@ Zone Atlantic/Reykjavik -1:27:24 - LMT 1837 # # Day-light Saving Time in Italy (2006-02-03) # -# (`FP' below), taken from an Italian National Electrotechnical Institute +# ('FP' below), taken from an Italian National Electrotechnical Institute # publication. When the three sources disagree, guess who's right, as follows: # # year FP Shanks&P. (S) Whitman (W) Go with: @@ -1584,10 +1587,22 @@ Zone Europe/Riga 1:36:24 - LMT 1880 2:00 EU EE%sT # Liechtenstein -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Europe/Vaduz 0:38:04 - LMT 1894 Jun - 1:00 - CET 1981 - 1:00 EU CE%sT + +# From Paul Eggert (2013-09-09): +# Shanks & Pottenger say Vaduz is like Zurich. + +# From Alois Treindl (2013-09-18): +# http://www.eliechtensteinensia.li/LIJ/1978/1938-1978/1941.pdf +# ... confirms on p. 6 that Liechtenstein followed Switzerland in 1941 and 1942. +# I ... translate only the last two paragraphs: +# ... during second world war, in the years 1941 and 1942, Liechtenstein +# introduced daylight saving time, adapting to Switzerland. From 1943 on +# central European time was in force throughout the year. +# From a report of the duke's government to the high council, +# regarding the introduction of a time law, of 31 May 1977. + +Link Europe/Zurich Europe/Vaduz + # Lithuania @@ -1675,7 +1690,7 @@ Zone Europe/Luxembourg 0:24:36 - LMT 1904 Jun 1:00 EU CE%sT # Macedonia -# see Serbia +# See Europe/Belgrade. # Malta # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -1768,7 +1783,7 @@ Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15 1:00 EU CE%sT # Montenegro -# see Serbia +# See Europe/Belgrade. # Netherlands @@ -1883,7 +1898,7 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1 # before 1895, and therefore probably changed the local time somewhere # between 1895 and 1925 (inclusive). -# From Paul Eggert (2001-05-01): +# From Paul Eggert (2013-09-04): # # Actually, Jan Mayen was never occupied by Germany during World War II, # so it must have diverged from Oslo time during the war, as Oslo was @@ -1894,7 +1909,7 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1 # 1941 with a small Norwegian garrison and continued operations despite # frequent air ttacks from Germans. In 1943 the Americans established a # radiolocating station on the island, called "Atlantic City". Possibly -# the UTC offset changed during the war, but I think it unlikely that +# the UT offset changed during the war, but I think it unlikely that # Jan Mayen used German daylight-saving rules. # # Svalbard is more complicated, as it was raided in August 1941 by an @@ -1907,9 +1922,8 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1 # the German armed forces at the Svalbard weather station code-named # Haudegen did not surrender to the Allies until September 1945. # -# All these events predate our cutoff date of 1970. Unless we can -# come up with more definitive info about the timekeeping during the -# war years it's probably best just do...the following for now: +# All these events predate our cutoff date of 1970, so use Europe/Oslo +# for these regions. Link Europe/Oslo Arctic/Longyearbyen # Poland @@ -2167,7 +2181,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct # so we (Novosibirsk) simply did not switch. # # From Andrey A. Chernov (1996-10-04): -# `MSK' and `MSD' were born and used initially on Moscow computers with +# 'MSK' and 'MSD' were born and used initially on Moscow computers with # UNIX-like OSes by several developer groups (e.g. Demos group, Kiae group).... # The next step was the UUCP network, the Relcom predecessor # (used mainly for mail), and MSK/MSD was actively used there. @@ -2466,6 +2480,9 @@ Zone Asia/Anadyr 11:49:56 - LMT 1924 May 2 11:00 Russia ANA%sT 2011 Mar 27 2:00s 12:00 - ANAT +# San Marino +# See Europe/Rome. + # Serbia # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Europe/Belgrade 1:22:00 - LMT 1884 @@ -2488,7 +2505,7 @@ Link Europe/Belgrade Europe/Zagreb # Croatia Link Europe/Prague Europe/Bratislava # Slovenia -# see Serbia +# See Europe/Belgrade. # Spain # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -2622,7 +2639,7 @@ Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1 # and their performance improved enormously. Communities began to keep # mean time in preference to apparent time -- Geneva from 1780 .... # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -# From Whitman (who writes ``Midnight?''): +# From Whitman (who writes "Midnight?"): # Rule Swiss 1940 only - Nov 2 0:00 1:00 S # Rule Swiss 1940 only - Dec 31 0:00 0 - # From Shanks & Pottenger: @@ -2667,23 +2684,53 @@ Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1 # The 1940 rules must be deleted. # # One further detail for Switzerland, which is probably out of scope for -# most users of tzdata: -# The zone file -# Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12 -# 0:29:44 - BMT 1894 Jun #Bern Mean Time -# 1:00 Swiss CE%sT 1981 -# 1:00 EU CE%sT +# most users of tzdata: The [Europe/Zurich zone] ... # describes all of Switzerland correctly, with the exception of # the Cantone Geneve (Geneva, Genf). Between 1848 and 1894 Geneve did not # follow Bern Mean Time but kept its own local mean time. # To represent this, an extra zone would be needed. +# +# From Alois Treindl (2013-09-11): +# The Federal regulations say +# http://www.admin.ch/opc/de/classified-compilation/20071096/index.html +# ... the meridian for Bern mean time ... is 7 degrees 26'22.50". +# Expressed in time, it is 0h29m45.5s. + +# From Pierre-Yves Berger (2013-09-11): +# the "Circulaire du conseil federal" (December 11 1893) +# ... +# clearly states that the [1894-06-01] change should be done at midnight +# but if no one is present after 11 at night, could be postponed until one +# hour before the beginning of service. + +# From Paul Eggert (2013-09-11): +# Round BMT to the nearest even second, 0:29:46. +# +# We can find no reliable source for Shanks's assertion that all of Switzerland +# except Geneva switched to Bern Mean Time at 00:00 on 1848-09-12. This book: +# +# Jakob Messerli. Gleichmassig, punktlich, schnell: Zeiteinteilung und +# Zeitgebrauch in der Schweiz im 19. Jahrhundert. Chronos, Zurich 1995, +# ISBN 3-905311-68-2, OCLC 717570797. +# +# suggests that the transition was more gradual, and that the Swiss did not +# agree about civil time during the transition. The timekeeping it gives the +# most detail for is postal and telegraph time: here, federal legislation (the +# "Bundesgesetz uber die Erstellung von elektrischen Telegraphen") passed on +# 1851-11-23, and an official implementation notice was published 1853-07-16 +# (Bundesblatt 1853, Bd. II, S. 859). On p 72 Messerli writes that in +# practice since July 1853 Bernese time was used in "all postal and telegraph +# offices in Switzerland from Geneva to St. Gallen and Basel to Chiasso" +# (Google translation). For now, model this transition as occurring on +# 1853-07-16, though it probably occurred at some other date in Zurich, and +# legal civil time probably changed at still some other transition date. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Swiss 1941 1942 - May Mon>=1 1:00 1:00 S Rule Swiss 1941 1942 - Oct Mon>=1 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12 - 0:29:44 - BMT 1894 Jun # Bern Mean Time +Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment. + 0:29:46 - BMT 1894 Jun # Bern Mean Time 1:00 Swiss CE%sT 1981 1:00 EU CE%sT @@ -2907,7 +2954,7 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880 # From Paul Eggert (2006-03-22): # The _Economist_ (1994-05-28, p 45) reports that central Crimea switched # from Kiev to Moscow time sometime after the January 1994 elections. -# Shanks (1999) says ``date of change uncertain'', but implies that it happened +# Shanks (1999) says "date of change uncertain", but implies that it happened # sometime between the 1994 DST switches. Shanks & Pottenger simply say # 1994-09-25 03:00, but that can't be right. For now, guess it # changed in May. @@ -2921,6 +2968,9 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880 3:00 - MSK 1997 Mar lastSun 1:00u 2:00 EU EE%sT +# Vatican City +# See Europe/Rome. + ############################################################################### # One source shows that Bulgaria, Cyprus, Finland, and Greece observe DST from diff --git a/jdk/make/sun/javazic/tzdata/iso3166.tab b/jdk/make/sun/javazic/tzdata/iso3166.tab index c6b2d0af3f1..28fb64b647e 100644 --- a/jdk/make/sun/javazic/tzdata/iso3166.tab +++ b/jdk/make/sun/javazic/tzdata/iso3166.tab @@ -32,7 +32,7 @@ # 1. ISO 3166-1 alpha-2 country code, current as of # ISO 3166-1 Newsletter VI-15 (2013-05-10). See: Updates on ISO 3166 # http://www.iso.org/iso/home/standards/country_codes/updates_on_iso_3166.htm -# 2. The usual English name for the country, +# 2. The usual English name for the coded region, # chosen so that alphabetic sorting of subsets produces helpful lists. # This is not the same as the English name in the ISO 3166 tables. # @@ -46,7 +46,7 @@ # to take or endorse any position on legal or territorial claims. # #country- -#code country name +#code name of country, territory, area, or subdivision AD Andorra AE United Arab Emirates AF Afghanistan @@ -76,7 +76,7 @@ BL St Barthelemy BM Bermuda BN Brunei BO Bolivia -BQ Bonaire, St Eustatius & Saba +BQ Caribbean Netherlands BR Brazil BS Bahamas BT Bhutan diff --git a/jdk/make/sun/javazic/tzdata/leapseconds b/jdk/make/sun/javazic/tzdata/leapseconds index 912801227a2..faf5319d408 100644 --- a/jdk/make/sun/javazic/tzdata/leapseconds +++ b/jdk/make/sun/javazic/tzdata/leapseconds @@ -20,18 +20,24 @@ # 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. -# -#
    -# This file is in the public domain, so clarified as of
    -# 2009-05-17 by Arthur David Olson.
     
     # Allowance for leapseconds added to each timezone file.
     
    +# This file is in the public domain.
    +
    +# This file is generated automatically from the data in the public-domain
    +# leap-seconds.list file available from most NIST time servers.
    +# If the URL  does not work,
    +# you should be able to pick up leap-seconds.list from a secondary NIST server.
    +# For more about leap-seconds.list, please see
    +# The NTP Timescale and Leap Seconds
    +# .
    +
     # The International Earth Rotation Service periodically uses leap seconds
     # to keep UTC to within 0.9 s of UT1
     # (which measures the true angular orientation of the earth in space); see
     # Terry J Quinn, The BIPM and the accurate measure of time,
    -# Proc IEEE 79, 7 (July 1991), 894-905.
    +# Proc IEEE 79, 7 (July 1991), 894-905 .
     # There were no leap seconds before 1972, because the official mechanism
     # accounting for the discrepancy between atomic time and the earth's rotation
     # did not exist until the early 1970s.
    @@ -42,8 +48,8 @@
     # or
     #	Leap	YEAR	MON	DAY	23:59:59	-	R/S
     
    -# If the leapsecond is Rolling (R) the given time is local time
    -# If the leapsecond is Stationary (S) the given time is UTC
    +# If the leapsecond is Rolling (R) the given time is local time.
    +# If the leapsecond is Stationary (S) the given time is UTC.
     
     # Leap	YEAR	MONTH	DAY	HH:MM:SS	CORR	R/S
     Leap	1972	Jun	30	23:59:60	+	S
    @@ -71,53 +77,3 @@ Leap	1998	Dec	31	23:59:60	+	S
     Leap	2005	Dec	31	23:59:60	+	S
     Leap	2008	Dec	31	23:59:60	+	S
     Leap	2012	Jun	30	23:59:60	+	S
    -
    -# INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)
    -#
    -# SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE
    -#
    -#
    -# SERVICE DE LA ROTATION TERRESTRE
    -# OBSERVATOIRE DE PARIS
    -# 61, Av. de l'Observatoire 75014 PARIS (France)
    -# Tel.      : 33 (0) 1 40 51 22 26
    -# FAX       : 33 (0) 1 40 51 22 91
    -# e-mail    : (E-Mail Removed)
    -# http://hpiers.obspm.fr/eop-pc
    -#
    -# Paris, 5 January 2012
    -#
    -#
    -# Bulletin C 43
    -#
    -# To authorities responsible
    -# for the measurement and
    -# distribution of time
    -#
    -#
    -# UTC TIME STEP
    -# on the 1st of July 2012
    -#
    -#
    -# A positive leap second will be introduced at the end of June 2012.
    -# The sequence of dates of the UTC second markers will be:
    -#
    -#                          2012 June 30,     23h 59m 59s
    -#                          2012 June 30,     23h 59m 60s
    -#                          2012 July  1,      0h  0m  0s
    -#
    -# The difference between UTC and the International Atomic Time TAI is:
    -#
    -# from 2009 January 1, 0h UTC, to 2012 July 1  0h UTC  : UTC-TAI = - 34s
    -# from 2012 July 1,    0h UTC, until further notice    : UTC-TAI = - 35s
    -#
    -# Leap seconds can be introduced in UTC at the end of the months of December
    -# or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every
    -# six months, either to announce a time step in UTC or to confirm that there
    -# will be no time step at the next possible date.
    -#
    -#
    -# Daniel GAMBIS
    -# Head
    -# Earth Orientation Center of IERS
    -# Observatoire de Paris, France
    diff --git a/jdk/make/sun/javazic/tzdata/northamerica b/jdk/make/sun/javazic/tzdata/northamerica
    index 43a0b22504b..b8caf6d019b 100644
    --- a/jdk/make/sun/javazic/tzdata/northamerica
    +++ b/jdk/make/sun/javazic/tzdata/northamerica
    @@ -43,7 +43,7 @@
     # Howse writes (pp 121-125) that time zones were invented by
     # Professor Charles Ferdinand Dowd (1825-1904),
     # Principal of Temple Grove Ladies' Seminary (Saratoga Springs, NY).
    -# His pamphlet ``A System of National Time for Railroads'' (1870)
    +# His pamphlet "A System of National Time for Railroads" (1870)
     # was the result of his proposals at the Convention of Railroad Trunk Lines
     # in New York City (1869-10).  His 1870 proposal was based on Washington, DC,
     # but in 1872-05 he moved the proposed origin to Greenwich.
    @@ -63,8 +63,8 @@
     
     # From Paul Eggert (2001-03-06):
     # Daylight Saving Time was first suggested as a joke by Benjamin Franklin
    -# in his whimsical essay ``An Economical Project for Diminishing the Cost
    -# of Light'' published in the Journal de Paris (1784-04-26).
    +# in his whimsical essay "An Economical Project for Diminishing the Cost
    +# of Light" published in the Journal de Paris (1784-04-26).
     # Not everyone is happy with the results:
     #
     #	I don't really care how time is reckoned so long as there is some
    @@ -190,8 +190,8 @@ Zone	PST8PDT		 -8:00	US	P%sT
     #    of the Aleutian islands.   No DST.
     
     # From Paul Eggert (1995-12-19):
    -# The tables below use `NST', not `NT', for Nome Standard Time.
    -# I invented `CAWT' for Central Alaska War Time.
    +# The tables below use 'NST', not 'NT', for Nome Standard Time.
    +# I invented 'CAWT' for Central Alaska War Time.
     
     # From U. S. Naval Observatory (1989-01-19):
     # USA  EASTERN       5 H  BEHIND UTC    NEW YORK, WASHINGTON
    @@ -260,9 +260,9 @@ Zone	PST8PDT		 -8:00	US	P%sT
     # H.R. 6, Energy Policy Act of 2005, SEC. 110. DAYLIGHT SAVINGS.
     #   (a) Amendment- Section 3(a) of the Uniform Time Act of 1966 (15
     #   U.S.C. 260a(a)) is amended--
    -#     (1) by striking `first Sunday of April' and inserting `second
    +#     (1) by striking 'first Sunday of April' and inserting 'second
     #     Sunday of March'; and
    -#     (2) by striking `last Sunday of October' and inserting `first
    +#     (2) by striking 'last Sunday of October' and inserting 'first
     #     Sunday of November'.
     #   (b) Effective Date- Subsection (a) shall take effect 1 year after the
     #   date of enactment of this Act or March 1, 2007, whichever is later.
    @@ -623,6 +623,8 @@ Zone Pacific/Honolulu	-10:31:26 -	LMT	1896 Jan 13 12:00 #Schmitt&Cox
     			-10:30	-	HST	1947 Jun  8 2:00 #Schmitt&Cox+2
     			-10:00	-	HST
     
    +Link Pacific/Honolulu Pacific/Johnston
    +
     # Now we turn to US areas that have diverged from the consensus since 1970.
     
     # Arizona mostly uses MST.
    @@ -659,8 +661,9 @@ Zone America/Phoenix	-7:28:18 -	LMT	1883 Nov 18 11:31:42
     # Navajo Nation participates in the Daylight Saving Time policy, due to its
     # large size and location in three states."  (The "only" means that other
     # tribal nations don't use DST.)
    -
    -Link America/Denver America/Shiprock
    +#
    +# From Paul Eggert (2013-08-26):
    +# See America/Denver for a zone appropriate for the Navajo Nation.
     
     # Southern Idaho (Ada, Adams, Bannock, Bear Lake, Bingham, Blaine,
     # Boise, Bonneville, Butte, Camas, Canyon, Caribou, Cassia, Clark,
    @@ -700,13 +703,13 @@ Zone America/Boise	-7:44:49 -	LMT	1883 Nov 18 12:15:11
     #   and Switzerland counties have their own time zone histories as noted below.
     #
     # Shanks partitioned Indiana into 345 regions, each with its own time history,
    -# and wrote ``Even newspaper reports present contradictory information.''
    +# and wrote "Even newspaper reports present contradictory information."
     # Those Hoosiers!  Such a flighty and changeable people!
     # Fortunately, most of the complexity occurred before our cutoff date of 1970.
     #
     # Other than Indianapolis, the Indiana place names are so nondescript
    -# that they would be ambiguous if we left them at the `America' level.
    -# So we reluctantly put them all in a subdirectory `America/Indiana'.
    +# that they would be ambiguous if we left them at the 'America' level.
    +# So we reluctantly put them all in a subdirectory 'America/Indiana'.
     
     # From Paul Eggert (2005-08-16):
     # http://www.mccsc.edu/time.html says that Indiana will use DST starting 2006.
    @@ -970,8 +973,8 @@ Zone America/Kentucky/Monticello -5:39:24 - LMT	1883 Nov 18 12:20:36
     # This story is too entertaining to be false, so go with Howse over Shanks.
     #
     # From Paul Eggert (2001-03-06):
    -# Garland (1927) writes ``Cleveland and Detroit advanced their clocks
    -# one hour in 1914.''  This change is not in Shanks.  We have no more
    +# Garland (1927) writes "Cleveland and Detroit advanced their clocks
    +# one hour in 1914."  This change is not in Shanks.  We have no more
     # info, so omit this for now.
     #
     # Most of Michigan observed DST from 1973 on, but was a bit late in 1975.
    @@ -1011,7 +1014,7 @@ Zone America/Menominee	-5:50:27 -	LMT	1885 Sep 18 12:00
     # occupied 1857/1900 by the Navassa Phosphate Co
     # US lighthouse 1917/1996-09
     # currently uninhabited
    -# see Mark Fineman, ``An Isle Rich in Guano and Discord'',
    +# see Mark Fineman, "An Isle Rich in Guano and Discord",
     # _Los Angeles Times_ (1998-11-10), A1, A10; it cites
     # Jimmy Skaggs, _The Great Guano Rush_ (1994).
     
    @@ -1045,7 +1048,7 @@ Zone America/Menominee	-5:50:27 -	LMT	1885 Sep 18 12:00
     #	Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
     #	.
     #
    -# See the `europe' file for Greenland.
    +# See the 'europe' file for Greenland.
     
     # Canada
     
    @@ -1246,7 +1249,7 @@ Zone America/St_Johns	-3:30:52 -	LMT	1884
     
     # most of east Labrador
     
    -# The name `Happy Valley-Goose Bay' is too long; use `Goose Bay'.
    +# The name 'Happy Valley-Goose Bay' is too long; use 'Goose Bay'.
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Goose_Bay	-4:01:40 -	LMT	1884 # Happy Valley-Goose Bay
     			-3:30:52 -	NST	1918
    @@ -1363,25 +1366,27 @@ Zone America/Moncton	-4:19:08 -	LMT	1883 Dec  9
     
     # Quebec
     
    -# From Paul Eggert (2006-07-09):
    -# Shanks & Pottenger write that since 1970 most of Quebec has been
    -# like Montreal.
    +# From Paul Eggert (2013-08-30):
    +# Since 1970 most of Quebec has been like Toronto.
    +# However, because earlier versions of the tz database mistakenly relied on data
    +# from Shanks & Pottenger saying that Quebec differed from Ontario after 1970,
    +# a separate entry was created for most of Quebec.  We're loath to lose
    +# its pre-1970 info, even though the tz database is normally limited to
    +# zones that differ after 1970, so keep this otherwise out-of-scope entry.
     
    -# From Paul Eggert (2006-06-27):
     # Matthews and Vincent (1998) also write that Quebec east of the -63
     # meridian is supposed to observe AST, but residents as far east as
     # Natashquan use EST/EDT, and residents east of Natashquan use AST.
    -# In "Official time in Quebec" the Quebec department of justice writes in
    -# http://www.justice.gouv.qc.ca/english/publications/generale/temps-regl-1-a.htm
    -# that "The residents of the Municipality of the
    -# Cote-Nord-du-Golfe-Saint-Laurent and the municipalities of Saint-Augustin,
    -# Bonne-Esperance and Blanc-Sablon apply the Official Time Act as it is
    -# written and use Atlantic standard time all year round. The same applies to
    -# the residents of the Native facilities along the lower North Shore."
    -# 
    +# The Quebec department of justice writes in
    +# "The situation in Minganie and Basse-Cote-Nord"
    +# http://www.justice.gouv.qc.ca/english/publications/generale/temps-minganie-a.htm
    +# that the coastal strip from just east of Natashquan to Blanc-Sablon
    +# observes Atlantic standard time all year round.
    +# http://www.assnat.qc.ca/Media/Process.aspx?MediaId=ANQ.Vigie.Bll.DocumentGenerique_8845en
     # says this common practice was codified into law as of 2007.
     # For lack of better info, guess this practice began around 1970, contra to
     # Shanks & Pottenger who have this region observing AST/ADT.
    +# for post-1970 data America/Puerto_Rico.
     
     # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
     Rule	Mont	1917	only	-	Mar	25	2:00	1:00	D
    @@ -1425,7 +1430,6 @@ Zone America/Montreal	-4:54:16 -	LMT	1884
     			-5:00	Mont	E%sT	1974
     			-5:00	Canada	E%sT
     
    -
     # Ontario
     
     # From Paul Eggert (2006-07-09):
    @@ -1644,7 +1648,7 @@ Zone America/Thunder_Bay -5:57:00 -	LMT	1895
     			-6:00	-	CST	1910
     			-5:00	-	EST	1942
     			-5:00	Canada	E%sT	1970
    -			-5:00	Mont	E%sT	1973
    +			-5:00	Toronto	E%sT	1973
     			-5:00	-	EST	1974
     			-5:00	Canada	E%sT
     Zone America/Nipigon	-5:53:04 -	LMT	1895
    @@ -2231,7 +2235,7 @@ Zone America/Dawson	-9:17:40 -	LMT	1900 Aug 20
     # From Paul Eggert (1996-06-12):
     # For an English translation of the decree, see
     # 
    -# ``Diario Oficial: Time Zone Changeover'' (1996-01-04).
    +# "Diario Oficial: Time Zone Changeover" (1996-01-04).
     # 
     
     # From Rives McDow (1998-10-08):
    @@ -2568,9 +2572,7 @@ Zone America/Santa_Isabel	-7:39:28 -	LMT	1922 Jan  1  0:20:32
     ###############################################################################
     
     # Anguilla
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/Anguilla	-4:12:16 -	LMT	1912 Mar 2
    -			-4:00	-	AST
    +# See 'southamerica'.
     
     # Antigua and Barbuda
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    @@ -2639,13 +2641,13 @@ Zone	America/Belize	-5:52:48 -	LMT	1912 Apr
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Atlantic/Bermuda	-4:19:18 -	LMT	1930 Jan  1 2:00    # Hamilton
     			-4:00	-	AST	1974 Apr 28 2:00
    -			-4:00	Bahamas	A%sT	1976
    +			-4:00	Canada	A%sT	1976
     			-4:00	US	A%sT
     
     # Cayman Is
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	America/Cayman	-5:25:32 -	LMT	1890		# Georgetown
    -			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
    +			-5:07:11 -	KMT	1912 Feb    # Kingston Mean Time
     			-5:00	-	EST
     
     # Costa Rica
    @@ -2660,7 +2662,7 @@ Rule	CR	1991	1992	-	Jan	Sat>=15	0:00	1:00	D
     # go with Shanks & Pottenger.
     Rule	CR	1991	only	-	Jul	 1	0:00	0	S
     Rule	CR	1992	only	-	Mar	15	0:00	0	S
    -# There are too many San Joses elsewhere, so we'll use `Costa Rica'.
    +# There are too many San Joses elsewhere, so we'll use 'Costa Rica'.
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Costa_Rica	-5:36:13 -	LMT	1890		# San Jose
     			-5:36:13 -	SJMT	1921 Jan 15 # San Jose Mean Time
    @@ -2892,9 +2894,7 @@ Zone	America/Havana	-5:29:28 -	LMT	1890
     			-5:00	Cuba	C%sT
     
     # Dominica
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/Dominica	-4:05:36 -	LMT	1911 Jul 1 0:01		# Roseau
    -			-4:00	-	AST
    +# See 'southamerica'.
     
     # Dominican Republic
     
    @@ -2943,18 +2943,10 @@ Zone America/El_Salvador -5:56:48 -	LMT	1921		# San Salvador
     			-6:00	Salv	C%sT
     
     # Grenada
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone	America/Grenada	-4:07:00 -	LMT	1911 Jul	# St George's
    -			-4:00	-	AST
    -
     # Guadeloupe
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/Guadeloupe	-4:06:08 -	LMT	1911 Jun 8	# Pointe a Pitre
    -			-4:00	-	AST
     # St Barthelemy
    -Link America/Guadeloupe	America/St_Barthelemy
     # St Martin (French part)
    -Link America/Guadeloupe	America/Marigot
    +# See 'southamerica'.
     
     # Guatemala
     #
    @@ -3097,17 +3089,12 @@ Zone America/Tegucigalpa -5:48:52 -	LMT	1921 Apr
     # Great Swan I ceded by US to Honduras in 1972
     
     # Jamaica
    -
    -# From Bob Devine (1988-01-28):
    -# Follows US rules.
    -
    -# From U. S. Naval Observatory (1989-01-19):
    -# JAMAICA             5 H  BEHIND UTC
    -
    -# From Shanks & Pottenger:
    +# Shanks & Pottenger give -5:07:12, but Milne records -5:07:10.41 from an
    +# unspecified official document, and says "This time is used throughout the
    +# island".  Go with Milne.  Round to the nearest second as required by zic.
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone	America/Jamaica	-5:07:12 -	LMT	1890		# Kingston
    -			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
    +Zone	America/Jamaica	-5:07:11 -	LMT	1890		# Kingston
    +			-5:07:11 -	KMT	1912 Feb    # Kingston Mean Time
     			-5:00	-	EST	1974 Apr 28 2:00
     			-5:00	US	E%sT	1984
     			-5:00	-	EST
    @@ -3121,12 +3108,7 @@ Zone America/Martinique	-4:04:20 -      LMT	1890		# Fort-de-France
     			-4:00	-	AST
     
     # Montserrat
    -# From Paul Eggert (2006-03-22):
    -# In 1995 volcanic eruptions forced evacuation of Plymouth, the capital.
    -# world.gazetteer.com says Cork Hill is the most populous location now.
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/Montserrat	-4:08:52 -	LMT	1911 Jul 1 0:01   # Cork Hill
    -			-4:00	-	AST
    +# See 'southamerica'.
     
     # Nicaragua
     #
    @@ -3200,7 +3182,7 @@ Zone	America/Panama	-5:18:08 -	LMT	1890
     			-5:00	-	EST
     
     # Puerto Rico
    -# There are too many San Juans elsewhere, so we'll use `Puerto_Rico'.
    +# There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'.
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Puerto_Rico -4:24:25 -	LMT	1899 Mar 28 12:00    # San Juan
     			-4:00	-	AST	1942 May  3
    @@ -3208,18 +3190,11 @@ Zone America/Puerto_Rico -4:24:25 -	LMT	1899 Mar 28 12:00    # San Juan
     			-4:00	-	AST
     
     # St Kitts-Nevis
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/St_Kitts	-4:10:52 -	LMT	1912 Mar 2	# Basseterre
    -			-4:00	-	AST
    -
     # St Lucia
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/St_Lucia	-4:04:00 -	LMT	1890		# Castries
    -			-4:04:00 -	CMT	1912	    # Castries Mean Time
    -			-4:00	-	AST
    +# See 'southamerica'.
     
     # St Pierre and Miquelon
    -# There are too many St Pierres elsewhere, so we'll use `Miquelon'.
    +# There are too many St Pierres elsewhere, so we'll use 'Miquelon'.
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Miquelon	-3:44:40 -	LMT	1911 May 15	# St Pierre
     			-4:00	-	AST	1980 May
    @@ -3227,10 +3202,7 @@ Zone America/Miquelon	-3:44:40 -	LMT	1911 May 15	# St Pierre
     			-3:00	Canada	PM%sT
     
     # St Vincent and the Grenadines
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/St_Vincent	-4:04:56 -	LMT	1890		# Kingstown
    -			-4:04:56 -	KMT	1912	   # Kingstown Mean Time
    -			-4:00	-	AST
    +# See 'southamerica'.
     
     # Turks and Caicos
     #
    @@ -3260,15 +3232,9 @@ Rule	TC	2007	max	-	Mar	Sun>=8	2:00	1:00	D
     Rule	TC	2007	max	-	Nov	Sun>=1	2:00	0	S
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Grand_Turk	-4:44:32 -	LMT	1890
    -			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
    +			-5:07:11 -	KMT	1912 Feb    # Kingston Mean Time
     			-5:00	TC	E%sT
     
     # British Virgin Is
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/Tortola	-4:18:28 -	LMT	1911 Jul    # Road Town
    -			-4:00	-	AST
    -
     # Virgin Is
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/St_Thomas	-4:19:44 -	LMT	1911 Jul    # Charlotte Amalie
    -			-4:00	-	AST
    +# See 'southamerica'.
    diff --git a/jdk/make/sun/javazic/tzdata/southamerica b/jdk/make/sun/javazic/tzdata/southamerica
    index e7df18ad2c3..2230d066661 100644
    --- a/jdk/make/sun/javazic/tzdata/southamerica
    +++ b/jdk/make/sun/javazic/tzdata/southamerica
    @@ -474,6 +474,17 @@ Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:00	S
     # rules...San Luis is still using "Western ARgentina Time" and it got
     # stuck on Summer daylight savings time even though the summer is over.
     
    +# From Paul Eggert (2013-09-05):
    +# Perhaps San Luis operates on the legal fiction that it is at UTC-4
    +# with perpetual summer time, but ordinary usage typically seems to
    +# just say it's at UTC-3; see, for example,
    +# .
    +# We've documented similar situations as being plain changes to
    +# standard time, so let's do that here too.  This does not change UTC
    +# offsets, only tm_isdst and the time zone abbreviations.  One minor
    +# plus is that this silences a zic complaint that there's no POSIX TZ
    +# setting for time stamps past 2038.
    +
     # From Paul Eggert (2013-02-21):
     # Milne says Cordoba time was -4:16:48.2.  Round to the nearest second.
     
    @@ -611,7 +622,7 @@ Zone America/Argentina/Mendoza -4:35:16 - LMT	1894 Oct 31
     # San Luis (SL)
     
     Rule	SanLuis	2008	2009	-	Mar	Sun>=8	0:00	0	-
    -Rule	SanLuis	2007	2009	-	Oct	Sun>=8	0:00	1:00	S
    +Rule	SanLuis	2007	2008	-	Oct	Sun>=8	0:00	1:00	S
     
     Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
     			-4:16:48 -	CMT	1920 May
    @@ -627,7 +638,8 @@ Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
     			-3:00	-	ART	2004 May 31
     			-4:00	-	WART	2004 Jul 25
     			-3:00	Arg	AR%sT	2008 Jan 21
    -			-4:00	SanLuis	WAR%sT
    +			-4:00	SanLuis	WAR%sT	2009 Oct 11
    +			-3:00	-	ART
     #
     # Santa Cruz (SC)
     Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31
    @@ -654,10 +666,7 @@ Zone America/Argentina/Ushuaia -4:33:12 - LMT 1894 Oct 31
     			-3:00	-	ART
     
     # Aruba
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone	America/Aruba	-4:40:24 -	LMT	1912 Feb 12	# Oranjestad
    -			-4:30	-	ANT	1965 # Netherlands Antilles Time
    -			-4:00	-	AST
    +Link America/Curacao America/Aruba
     
     # Bolivia
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    @@ -859,6 +868,12 @@ Zone	America/La_Paz	-4:32:36 -	LMT	1890
     # Tocantins state will have DST.
     # http://noticias.terra.com.br/brasil/noticias/0,,OI6232536-EI306.html
     
    +# From Steffen Thorsen (2013-09-20):
    +# Tocantins in Brazil is very likely not to observe DST from October....
    +# http://conexaoto.com.br/2013/09/18/ministerio-confirma-que-tocantins-esta-fora-do-horario-de-verao-em-2013-mas-falta-publicacao-de-decreto
    +# We will keep this article updated when this is confirmed:
    +# http://www.timeanddate.com/news/time/brazil-starts-dst-2013.html
    +
     # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
     # Decree 20,466 (1931-10-01)
     # Decree 21,896 (1932-01-10)
    @@ -1078,7 +1093,8 @@ Zone America/Araguaina	-3:12:48 -	LMT	1914
     			-3:00	-	BRT	1995 Sep 14
     			-3:00	Brazil	BR%sT	2003 Sep 24
     			-3:00	-	BRT	2012 Oct 21
    -			-3:00	Brazil	BR%sT
    +			-3:00	Brazil	BR%sT	2013 Sep
    +			-3:00	-	BRT
     #
     # Alagoas (AL), Sergipe (SE)
     Zone America/Maceio	-2:22:52 -	LMT	1914
    @@ -1373,12 +1389,12 @@ Zone	America/Curacao	-4:35:47 -	LMT	1912 Feb 12	# Willemstad
     			-4:00	-	AST
     
     # From Arthur David Olson (2011-06-15):
    -# At least for now, use links for places with new iso3166 codes.
    +# use links for places with new iso3166 codes.
     # The name "Lower Prince's Quarter" is both longer than fourteen charaters
     # and contains an apostrophe; use "Lower_Princes" below.
     
    -Link	America/Curacao	America/Lower_Princes # Sint Maarten
    -Link	America/Curacao	America/Kralendijk # Bonaire, Sint Estatius and Saba
    +Link	America/Curacao	America/Lower_Princes	# Sint Maarten
    +Link	America/Curacao	America/Kralendijk	# Caribbean Netherlands
     
     # Ecuador
     #
    @@ -1519,10 +1535,16 @@ Zone	America/Guyana	-3:52:40 -	LMT	1915 Mar	# Georgetown
     			-4:00	-	GYT
     
     # Paraguay
    +#
     # From Paul Eggert (2006-03-22):
     # Shanks & Pottenger say that spring transitions are from 01:00 -> 02:00,
     # and autumn transitions are from 00:00 -> 23:00.  Go with pre-1999
     # editions of Shanks, and with the IATA, who say transitions occur at 00:00.
    +#
    +# From Waldemar Villamayor-Venialbo (2013-09-20):
    +# No time of the day is established for the adjustment, so people normally
    +# adjust their clocks at 0 hour of the given dates.
    +#
     # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
     Rule	Para	1975	1988	-	Oct	 1	0:00	1:00	S
     Rule	Para	1975	1978	-	Mar	 1	0:00	0	-
    @@ -1656,6 +1678,19 @@ Zone America/Paramaribo	-3:40:40 -	LMT	1911
     Zone America/Port_of_Spain -4:06:04 -	LMT	1912 Mar 2
     			-4:00	-	AST
     
    +Link America/Port_of_Spain America/Anguilla
    +Link America/Port_of_Spain America/Dominica
    +Link America/Port_of_Spain America/Grenada
    +Link America/Port_of_Spain America/Guadeloupe
    +Link America/Port_of_Spain America/Marigot
    +Link America/Port_of_Spain America/Montserrat
    +Link America/Port_of_Spain America/St_Barthelemy
    +Link America/Port_of_Spain America/St_Kitts
    +Link America/Port_of_Spain America/St_Lucia
    +Link America/Port_of_Spain America/St_Thomas
    +Link America/Port_of_Spain America/St_Vincent
    +Link America/Port_of_Spain America/Tortola
    +
     # Uruguay
     # From Paul Eggert (1993-11-18):
     # Uruguay wins the prize for the strangest peacetime manipulation of the rules.
    @@ -1673,7 +1708,7 @@ Rule	Uruguay	1937	1941	-	Mar	lastSun	 0:00	0	-
     # Whitman gives 1937 Oct 3; go with Shanks & Pottenger.
     Rule	Uruguay	1937	1940	-	Oct	lastSun	 0:00	0:30	HS
     # Whitman gives 1941 Oct 24 - 1942 Mar 27, 1942 Dec 14 - 1943 Apr 13,
    -# and 1943 Apr 13 ``to present time''; go with Shanks & Pottenger.
    +# and 1943 Apr 13 "to present time"; go with Shanks & Pottenger.
     Rule	Uruguay	1941	only	-	Aug	 1	 0:00	0:30	HS
     Rule	Uruguay	1942	only	-	Jan	 1	 0:00	0	-
     Rule	Uruguay	1942	only	-	Dec	14	 0:00	1:00	S
    diff --git a/jdk/make/sun/javazic/tzdata/zone.tab b/jdk/make/sun/javazic/tzdata/zone.tab
    index aa247c26df8..b34cdb0dc7d 100644
    --- a/jdk/make/sun/javazic/tzdata/zone.tab
    +++ b/jdk/make/sun/javazic/tzdata/zone.tab
    @@ -26,27 +26,30 @@
     # This file is in the public domain, so clarified as of
     # 2009-05-17 by Arthur David Olson.
     #
    -# From Paul Eggert (2013-05-27):
    +# From Paul Eggert (2013-08-14):
     #
    -# This file contains a table with the following columns:
    -# 1.  ISO 3166 2-character country code.  See the file `iso3166.tab'.
    -#     This identifies a country that overlaps the zone.  The country may
    -#     overlap other zones and the zone may overlap other countries.
    -# 2.  Latitude and longitude of the zone's principal location
    +# This file contains a table where each row stands for an area that is
    +# the intersection of a region identified by a country code and of a
    +# zone where civil clocks have agreed since 1970.  The columns of the
    +# table are as follows:
    +#
    +# 1.  ISO 3166 2-character country code.  See the file 'iso3166.tab'.
    +# 2.  Latitude and longitude of the area's principal location
     #     in ISO 6709 sign-degrees-minutes-seconds format,
     #     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
     #     first latitude (+ is north), then longitude (+ is east).
    -#     This location need not lie within the column-1 country.
     # 3.  Zone name used in value of TZ environment variable.
     #     Please see the 'Theory' file for how zone names are chosen.
    +#     If multiple zones overlap a country, each has a row in the
    +#     table, with column 1 being duplicated.
     # 4.  Comments; present if and only if the country has multiple rows.
     #
     # Columns are separated by a single tab.
     # The table is sorted first by country, then an order within the country that
     # (1) makes some geographical sense, and
    -# (2) puts the most populous zones first, where that does not contradict (1).
    +# (2) puts the most populous areas first, where that does not contradict (1).
     #
    -# Lines beginning with `#' are comments.
    +# Lines beginning with '#' are comments.
     #
     # This table is intended as an aid for users, to help them select time
     # zone data appropriate for their practical needs.  It is not intended
    @@ -62,8 +65,7 @@ AI	+1812-06304	America/Anguilla
     AL	+4120+01950	Europe/Tirane
     AM	+4011+04430	Asia/Yerevan
     AO	-0848+01314	Africa/Luanda
    -AQ	-7750+16636	Antarctica/McMurdo	McMurdo Station, Ross Island
    -AQ	-9000+00000	Antarctica/South_Pole	Amundsen-Scott Station, South Pole
    +AQ	-7750+16636	Antarctica/McMurdo	McMurdo, South Pole, Scott (New Zealand time)
     AQ	-6734-06808	Antarctica/Rothera	Rothera Station, Adelaide Island
     AQ	-6448-06406	Antarctica/Palmer	Palmer Station, Anvers Island
     AQ	-6736+06253	Antarctica/Mawson	Mawson Station, Holme Bay
    @@ -143,8 +145,7 @@ CA	+4612-05957	America/Glace_Bay	Atlantic Time - Nova Scotia - places that did n
     CA	+4606-06447	America/Moncton	Atlantic Time - New Brunswick
     CA	+5320-06025	America/Goose_Bay	Atlantic Time - Labrador - most locations
     CA	+5125-05707	America/Blanc-Sablon	Atlantic Standard Time - Quebec - Lower North Shore
    -CA	+4531-07334	America/Montreal	Eastern Time - Quebec - most locations
    -CA	+4339-07923	America/Toronto	Eastern Time - Ontario - most locations
    +CA	+4339-07923	America/Toronto	Eastern Time - Ontario & Quebec - most locations
     CA	+4901-08816	America/Nipigon	Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973
     CA	+4823-08915	America/Thunder_Bay	Eastern Time - Thunder Bay, Ontario
     CA	+6344-06828	America/Iqaluit	Eastern Time - east Nunavut - most locations
    @@ -255,7 +256,7 @@ IR	+3540+05126	Asia/Tehran
     IS	+6409-02151	Atlantic/Reykjavik
     IT	+4154+01229	Europe/Rome
     JE	+4912-00207	Europe/Jersey
    -JM	+1800-07648	America/Jamaica
    +JM	+175805-0764736	America/Jamaica
     JO	+3157+03556	Asia/Amman
     JP	+353916+1394441	Asia/Tokyo
     KE	-0117+03649	Africa/Nairobi
    @@ -444,8 +445,7 @@ US	+465042-1012439	America/North_Dakota/New_Salem	Central Time - North Dakota -
     US	+471551-1014640	America/North_Dakota/Beulah	Central Time - North Dakota - Mercer County
     US	+394421-1045903	America/Denver	Mountain Time
     US	+433649-1161209	America/Boise	Mountain Time - south Idaho & east Oregon
    -US	+364708-1084111	America/Shiprock	Mountain Time - Navajo
    -US	+332654-1120424	America/Phoenix	Mountain Standard Time - Arizona
    +US	+332654-1120424	America/Phoenix	Mountain Standard Time - Arizona (except Navajo)
     US	+340308-1181434	America/Los_Angeles	Pacific Time
     US	+611305-1495401	America/Anchorage	Alaska Time
     US	+581807-1342511	America/Juneau	Alaska Time - Alaska panhandle
    diff --git a/jdk/make/sun/lwawt/FILES_export_macosx.gmk b/jdk/make/sun/lwawt/FILES_export_macosx.gmk
    index 5799b32c954..7b32f911c21 100644
    --- a/jdk/make/sun/lwawt/FILES_export_macosx.gmk
    +++ b/jdk/make/sun/lwawt/FILES_export_macosx.gmk
    @@ -110,7 +110,6 @@ FILES_export = \
             sun/lwawt/LWWindowPeer.java \
             sun/lwawt/PlatformWindow.java \
             sun/lwawt/SecurityWarningWindow.java \
    -        sun/lwawt/SelectionClearListener.java \
             sun/lwawt/macosx/CPrinterDevice.java \
             sun/lwawt/macosx/CPrinterDialog.java \
             sun/lwawt/macosx/CPrinterDialogPeer.java \
    @@ -141,7 +140,6 @@ FILES_export = \
             sun/lwawt/macosx/CMenuBar.java \
             sun/lwawt/macosx/CMenuComponent.java \
             sun/lwawt/macosx/CMenuItem.java \
    -        sun/lwawt/macosx/CMouseInfoPeer.java \
             sun/lwawt/macosx/CPlatformView.java \
             sun/lwawt/macosx/CPlatformWindow.java \
             sun/lwawt/macosx/CWarningWindow.java \
    diff --git a/jdk/make/sun/xawt/mapfile-vers b/jdk/make/sun/xawt/mapfile-vers
    index 5455530cbed..e75f0c1914b 100644
    --- a/jdk/make/sun/xawt/mapfile-vers
    +++ b/jdk/make/sun/xawt/mapfile-vers
    @@ -305,6 +305,7 @@ SUNWprivate_1.1 {
             Java_sun_awt_X11_XlibWrapper_XkbGetUpdatedMap;
             Java_sun_awt_X11_XlibWrapper_XkbFreeKeyboard;
             Java_sun_awt_X11_XlibWrapper_XkbTranslateKeyCode;
    +        Java_sun_awt_X11_XlibWrapper_XkbSetDetectableAutoRepeat;
             Java_sun_awt_X11_XlibWrapper_XGetModifierMapping;
             Java_sun_awt_X11_XlibWrapper_XFreeModifiermap;
             Java_sun_awt_X11_XlibWrapper_XRefreshKeyboardMapping;
    diff --git a/jdk/make/tools/Makefile b/jdk/make/tools/Makefile
    index e01f77ea03d..d6724f7b2d7 100644
    --- a/jdk/make/tools/Makefile
    +++ b/jdk/make/tools/Makefile
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     #
     # This code is free software; you can redistribute it and/or modify it
    @@ -35,6 +35,7 @@ include $(BUILDDIR)/common/Defs.gmk
     # Note: freetypecheck is built by Sanity.gmk if needed
     SUBDIRS =                   \
       addjsum                   \
    +  addtorestrictedpkgs       \
       buildmetaindex            \
       cldrconverter             \
       commentchecker            \
    diff --git a/jdk/make/sun/awt/FILES_export_macosx.gmk b/jdk/make/tools/addtorestrictedpkgs/Makefile
    similarity index 71%
    rename from jdk/make/sun/awt/FILES_export_macosx.gmk
    rename to jdk/make/tools/addtorestrictedpkgs/Makefile
    index c7f0e003cb9..53922d56519 100644
    --- a/jdk/make/sun/awt/FILES_export_macosx.gmk
    +++ b/jdk/make/tools/addtorestrictedpkgs/Makefile
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     #
     # This code is free software; you can redistribute it and/or modify it
    @@ -23,7 +23,21 @@
     # questions.
     #
     
    -# FILES_export definitions for Mac OS X
    +#
    +# Makefile for building the addtorestrictedpkgs tool
    +#
    +
    +BUILDDIR = ../..
    +PACKAGE = build.tools.addtorestrictedpkgs
    +PRODUCT = tools
    +PROGRAM = addtorestrictedpkgs
    +include $(BUILDDIR)/common/Defs.gmk
    +
    +BUILDTOOL_SOURCE_ROOT = $(BUILDDIR)/tools/src
    +BUILDTOOL_MAIN        = $(PKGDIR)/AddToRestrictedPkgs.java
    +
    +#
    +# Build tool jar rules.
    +#
    +include $(BUILDDIR)/common/BuildToolJar.gmk
     
    -FILES_export += \
    -	com/apple/resources/MacOSXResourceBundle.java
    diff --git a/jdk/make/tools/manifest.mf b/jdk/make/tools/manifest.mf
    index bbfd1c3cfb6..25b7a8b7e9c 100644
    --- a/jdk/make/tools/manifest.mf
    +++ b/jdk/make/tools/manifest.mf
    @@ -1,6 +1,6 @@
     Manifest-Version: 1.0
     Specification-Title: Java Platform API Specification
    -Specification-Version: 1.7
    +Specification-Version: 1.8
     Specification-Vendor: Oracle Corporation
     Implementation-Title: Java Runtime Environment
     Implementation-Version: @@RELEASE@@
    diff --git a/jdk/make/tools/src/build/tools/addtorestrictedpkgs/AddToRestrictedPkgs.java b/jdk/make/tools/src/build/tools/addtorestrictedpkgs/AddToRestrictedPkgs.java
    new file mode 100644
    index 00000000000..ee9deb4b75f
    --- /dev/null
    +++ b/jdk/make/tools/src/build/tools/addtorestrictedpkgs/AddToRestrictedPkgs.java
    @@ -0,0 +1,105 @@
    +/*
    + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    + *
    + * This code is free software; you can redistribute it and/or modify it
    + * under the terms of the GNU General Public License version 2 only, as
    + * published by the Free Software Foundation.  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 build.tools.addtorestrictedpkgs;
    +
    +import java.io.*;
    +
    +/**
    + * Adds additional packages to the package.access and package.definition
    + * security properties.
    + */
    +public class AddToRestrictedPkgs {
    +
    +    private static final String PKG_ACC = "package.access";
    +    private static final String PKG_DEF = "package.definition";
    +    private static final int PKG_ACC_INDENT = 15;
    +    private static final int PKG_DEF_INDENT = 19;
    +
    +    public static void main(String[] args) throws Exception {
    +
    +        if (args.length < 3) {
    +            System.err.println("Usage: java AddToRestrictedPkgs " +
    +                               "[input java.security file name] " +
    +                               "[output java.security file name] " +
    +                               "[packages ...]");
    +            System.exit(1);
    +        }
    +
    +        try (FileReader fr = new FileReader(args[0]);
    +             BufferedReader br = new BufferedReader(fr);
    +             FileWriter fw = new FileWriter(args[1]);
    +             BufferedWriter bw = new BufferedWriter(fw))
    +        {
    +            // parse the file line-by-line, looking for pkg access properties
    +            String line = br.readLine();
    +            while (line != null) {
    +                if (line.startsWith(PKG_ACC)) {
    +                    writePackages(br, bw, line, PKG_ACC_INDENT, args);
    +                } else if (line.startsWith(PKG_DEF)) {
    +                    writePackages(br, bw, line, PKG_DEF_INDENT, args);
    +                } else {
    +                    writeLine(bw, line);
    +                }
    +                line = br.readLine();
    +            }
    +            bw.flush();
    +        }
    +    }
    +
    +    private static void writePackages(BufferedReader br, BufferedWriter bw,
    +                                      String line, int numSpaces,
    +                                      String[] args) throws IOException {
    +        // parse property until EOL, not including line breaks
    +        while (line.endsWith("\\")) {
    +            writeLine(bw, line);
    +            line = br.readLine();
    +        }
    +        // append comma and line-break to last package
    +        writeLine(bw, line + ",\\");
    +        // add new packages, one per line
    +        for (int i = 2; i < args.length - 1; i++) {
    +            indent(bw, numSpaces);
    +            writeLine(bw, args[i] + ",\\");
    +        }
    +        indent(bw, numSpaces);
    +        writeLine(bw, args[args.length - 1]);
    +    }
    +
    +    private static void writeLine(BufferedWriter bw, String line)
    +        throws IOException
    +    {
    +        bw.write(line);
    +        bw.newLine();
    +    }
    +
    +    private static void indent(BufferedWriter bw, int numSpaces)
    +        throws IOException
    +    {
    +        for (int i = 0; i < numSpaces; i++) {
    +            bw.append(' ');
    +        }
    +    }
    +}
    diff --git a/jdk/make/tools/src/build/tools/buildmetaindex/BuildMetaIndex.java b/jdk/make/tools/src/build/tools/buildmetaindex/BuildMetaIndex.java
    index 73feec3d2bb..f08b115912e 100644
    --- a/jdk/make/tools/src/build/tools/buildmetaindex/BuildMetaIndex.java
    +++ b/jdk/make/tools/src/build/tools/buildmetaindex/BuildMetaIndex.java
    @@ -173,8 +173,52 @@ class JarMetaIndex {
          */
         private HashMap> knownPrefixMap = new HashMap<>();
     
    +    /**
    +     * Special value for the HashSet to indicate that there are classes in
    +     * the top-level package.
    +     */
    +    private static final String TOP_LEVEL = "TOP";
    +
         /*
    -     * We add maximum 5 second level entries to "sun", "java" and
    +     * A class for mapping package prefixes to the number of
    +     * levels of package elements to include.
    +     */
    +    static class ExtraLevel {
    +        public ExtraLevel(String prefix, int levels) {
    +            this.prefix = prefix;
    +            this.levels = levels;
    +        }
    +        String prefix;
    +        int levels;
    +    }
    +
    +    /*
    +     * A list of the special-cased package names.
    +     */
    +    private static ArrayList extraLevels = new ArrayList<>();
    +
    +    static {
    +        // The order of these statements is significant,
    +        // since we stop looking after the first match.
    +
    +        // Need more precise information to disambiguate
    +        // (illegal) references from applications to
    +        // obsolete backported collections classes in
    +        // com/sun/java/util
    +        extraLevels.add(new ExtraLevel("com/sun/java/util/", Integer.MAX_VALUE));
    +        extraLevels.add(new ExtraLevel("com/sun/java/", 4));
    +        // Need more information than just first two package
    +        // name elements to determine that classes in
    +        // deploy.jar are not in rt.jar
    +        extraLevels.add(new ExtraLevel("com/sun/", 3));
    +        // Need to make sure things in jfr.jar aren't
    +        // confused with other com/oracle/** packages
    +        extraLevels.add(new ExtraLevel("com/oracle/jrockit", 3));
    +    }
    +
    +
    +    /*
    +     * We add maximum 5 second level entries to "sun", "jdk", "java" and
          * "javax" entries. Tune this parameter to get a balance on the
          * cold start and footprint.
          */
    @@ -185,6 +229,7 @@ class JarMetaIndex {
         JarMetaIndex(String fileName) throws IOException {
             jar = new JarFile(fileName);
             knownPrefixMap.put("sun", new HashSet());
    +        knownPrefixMap.put("jdk", new HashSet());
             knownPrefixMap.put("java", new HashSet());
             knownPrefixMap.put("javax", new HashSet());
         }
    @@ -237,39 +282,25 @@ class JarMetaIndex {
                             String[] pkgElements = name.split("/");
                             // Last one is the class name; definitely ignoring that
                             if (pkgElements.length > 2) {
    -                            String meta = null;
    -                            // Need more information than just first two package
    -                            // name elements to determine that classes in
    -                            // deploy.jar are not in rt.jar
    -                            if (pkgElements.length > 3 &&
    -                                pkgElements[0].equals("com") &&
    -                                pkgElements[1].equals("sun")) {
    -                                // Need more precise information to disambiguate
    -                                // (illegal) references from applications to
    -                                // obsolete backported collections classes in
    -                                // com/sun/java/util
    -                                if (pkgElements.length > 4 &&
    -                                    pkgElements[2].equals("java")) {
    -                                    int bound = 0;
    -                                    if (pkgElements[3].equals("util")) {
    -                                        // Take all of the packages
    -                                        bound = pkgElements.length - 1;
    -                                    } else {
    -                                        // Trim it somewhat more
    -                                        bound = 4;
    -                                    }
    -                                    meta = "";
    -                                    for (int j = 0; j < bound; j++) {
    -                                        meta += pkgElements[j] + "/";
    -                                    }
    -                                } else {
    -                                    meta = pkgElements[0] + "/" + pkgElements[1]
    -                                        + "/" + pkgElements[2] + "/";
    +                            String meta = "";
    +
    +                            // Default is 2 levels of package elements
    +                            int levels = 2;
    +
    +                            // But for some packages we add more elements
    +                            for(ExtraLevel el : extraLevels) {
    +                                if (name.startsWith(el.prefix)) {
    +                                    levels = el.levels;
    +                                    break;
                                     }
    -                            } else {
    -                                meta = pkgElements[0] + "/" + pkgElements[1] + "/";
                                 }
    -                            indexSet.add(meta);
    +                            for (int i = 0; i < levels && i < pkgElements.length - 1; i++) {
    +                                meta += pkgElements[i] + "/";
    +                            }
    +
    +                            if (!meta.equals("")) {
    +                                indexSet.add(meta);
    +                            }
                             }
     
                         } // end of "while" loop;
    @@ -312,12 +343,12 @@ class JarMetaIndex {
                 return false;
             }
     
    -        String secondPkgElement = name.substring(firstSlashIndex + 1,
    -                                                 name.indexOf("/",
    -                                                              firstSlashIndex + 1));
    -
             /* Add the second level package name to the corresponding hashset. */
    -        if (secondPkgElement != null) {
    +        int secondSlashIndex = name.indexOf("/", firstSlashIndex+1);
    +        if (secondSlashIndex == -1) {
    +            pkgSet.add(TOP_LEVEL);
    +        } else {
    +            String secondPkgElement = name.substring(firstSlashIndex+1, secondSlashIndex);
                 pkgSet.add(secondPkgElement);
             }
     
    @@ -344,8 +375,9 @@ class JarMetaIndex {
                 if (setSize == 0) {
                     continue;
                 }
    -            else if (setSize > JarMetaIndex.MAX_PKGS_WITH_KNOWN_PREFIX) {
    -                indexSet.add(key + "/");
    +            if (setSize > JarMetaIndex.MAX_PKGS_WITH_KNOWN_PREFIX ||
    +                pkgSetStartsWithKey.contains(TOP_LEVEL)) {
    +                 indexSet.add(key + "/");
                 } else {
                     /* If the set contains less than MAX_PKGS_WITH_KNOWN_PREFIX, add
                      * them to the indexSet of the MetaIndex object.
    diff --git a/jdk/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java b/jdk/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java
    index be0204eeeef..9f1204ca7fe 100644
    --- a/jdk/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java
    +++ b/jdk/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java
    @@ -618,6 +618,11 @@ public final class TzdbZoneRulesCompiler {
             // remove ROC, which is not supported in j.u.tz
             builtZones.remove("ROC");
             links.remove("ROC");
    +        // remove EST, HST and MST. They are supported via
    +        // the short-id mapping
    +        builtZones.remove("EST");
    +        builtZones.remove("HST");
    +        builtZones.remove("MST");
         }
     
         /**
    diff --git a/jdk/makefiles/BuildJdk.gmk b/jdk/makefiles/BuildJdk.gmk
    index d6c1033df63..eeb4a533220 100644
    --- a/jdk/makefiles/BuildJdk.gmk
    +++ b/jdk/makefiles/BuildJdk.gmk
    @@ -47,13 +47,13 @@ include ProfileNames.gmk
     
     import: import-only
     import-only:
    -#       Import (corba jaxp jaxws langtools hotspot)
    +        # Import (corba jaxp jaxws langtools hotspot)
     	+$(MAKE) -f Import.gmk
     
     gensrc: import gensrc-only
     gensrc-only:
    -	+$(MAKE) -f GenerateJavaSources.gmk
    -#       Ok, now gensrc is fully populated.
    +	+$(MAKE) -f GenerateSources.gmk
    +        # Ok, now gensrc is fully populated.
     
     gendata: gensrc gendata-only
     gendata-only:
    @@ -62,8 +62,8 @@ gendata-only:
     classes: gendata classes-only
     classes-only:
     	+$(MAKE) -f CompileJavaClasses.gmk
    -#       The classes are now built and
    -#       any javah files have now been generated.
    +        # The classes are now built and
    +        # any javah files have now been generated.
     
     libs: classes libs-only
     libs-only:
    @@ -71,23 +71,27 @@ libs-only:
     
     launchers: libs launchers-only
     launchers-only:
    -#       Finally compile the launchers.
    +        # Finally compile the launchers.
     	+$(MAKE) -f CompileLaunchers.gmk
     
     genclasses: launchers genclasses-only
     genclasses-only:
    -#	Generate classes that have other sources. Needs
    -#       to execute launchers.
    +        # Generate classes that have other sources. Needs
    +        # to execute launchers.
     	+$(MAKE) -f GenerateClasses.gmk
     
    -jdk: genclasses
    -#       Now we have a complete jdk, which you can run.
    -#       It is not yet wrapped up as an installed image.
    +securityjars: genclasses securityjars-only
    +securityjars-only:
    +	+$(MAKE) -f CreateSecurityJars.gmk
    +
    +jdk: securityjars
    +        # Now we have a complete jdk, which you can run.
    +        # It is not yet wrapped up as an installed image.
     
     demos:
    -#       The demos are compiled against this jdk.
    +        # The demos are compiled against this jdk.
     	+$(MAKE) -f CompileDemos.gmk
    -#	Now copy the sample sources into the jdk.
    +        # Now copy the sample sources into the jdk.
     	+$(MAKE) -f CopySamples.gmk
     
     # Create the final jdk and jre images, to be wrapped up
    @@ -96,9 +100,9 @@ demos:
     images:
     	+$(MAKE) PROFILE="" -f CreateJars.gmk
     	+$(MAKE) PROFILE="" -f Images.gmk
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -	+$(MAKE) -f Bundles.gmk
    -endif
    +        ifeq ($(OPENJDK_TARGET_OS), macosx)
    +	  +$(MAKE) -f Bundles.gmk
    +        endif
     
     overlay-images:
     	+$(MAKE) -f CompileLaunchers.gmk OVERLAY_IMAGES=true
    @@ -114,8 +118,8 @@ profiles: $(ALL_PROFILES)
     sign-jars:
     	+$(MAKE) -f SignJars.gmk
     
    -BINARIES:=$(notdir $(wildcard $(JDK_IMAGE_DIR)/bin/*))
    -INSTALLDIR:=openjdk-$(RELEASE)
    +BINARIES := $(notdir $(wildcard $(JDK_IMAGE_DIR)/bin/*))
    +INSTALLDIR := openjdk-$(RELEASE)
     
     # Install the jdk image, in a very crude way. Not taking into
     # account, how to install properly on macosx or windows etc.
    @@ -126,8 +130,8 @@ install:
     	$(RM) -r $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)/*
     	$(CP) -rp $(JDK_IMAGE_DIR)/* $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)
     	$(MKDIR) -p $(INSTALL_PREFIX)/bin
    -	$(RM) $(addprefix $(INSTALL_PREFIX)/bin/,$(BINARIES))
    -	$(foreach b,$(BINARIES),$(LN) -s $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)/bin/$b $(INSTALL_PREFIX)/bin/$b &&) true
    +	$(RM) $(addprefix $(INSTALL_PREFIX)/bin/, $(BINARIES))
    +	$(foreach b, $(BINARIES), $(LN) -s $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)/bin/$b $(INSTALL_PREFIX)/bin/$b &&) true
     
     # The all target builds the JDK, but not the images
     all: jdk
    diff --git a/jdk/makefiles/Bundles.gmk b/jdk/makefiles/Bundles.gmk
    index 94b8a57a65c..6d0cbe5379b 100644
    --- a/jdk/makefiles/Bundles.gmk
    +++ b/jdk/makefiles/Bundles.gmk
    @@ -31,108 +31,108 @@ default: bundles
     # Only macosx has bundles defined.
     ifeq ($(OPENJDK_TARGET_OS), macosx)
     
    -bundles: jre-bundle jdk-bundle
    +  bundles: jre-bundle jdk-bundle
     
    -# JDK_BUNDLE_DIR and JRE_BUNDLE_DIR are defined in SPEC.
    +  # JDK_BUNDLE_DIR and JRE_BUNDLE_DIR are defined in SPEC.
     
    -MACOSX_SRC := $(JDK_TOPDIR)/src/macosx
    +  MACOSX_SRC := $(JDK_TOPDIR)/src/macosx
     
    -# All these OPENJDK checks are needed since there is no coherency between
    -# these values in open and closed. Should probably be fixed.
    -ifndef OPENJDK
    +  # All these OPENJDK checks are needed since there is no coherency between
    +  # these values in open and closed. Should probably be fixed.
    +  ifndef OPENJDK
         BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(JDK_MINOR_VERSION)u$(JDK_UPDATE_VERSION)
    -else
    +  else
         BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE)
    -endif
    -BUNDLE_ID_JRE := $(BUNDLE_ID).jre
    -BUNDLE_ID_JDK := $(BUNDLE_ID).jdk
    +  endif
    +  BUNDLE_ID_JRE := $(BUNDLE_ID).jre
    +  BUNDLE_ID_JDK := $(BUNDLE_ID).jdk
     
    -BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_MINOR_VERSION)
    -BUNDLE_NAME_JRE := $(BUNDLE_NAME)
    -BUNDLE_NAME_JDK := $(BUNDLE_NAME)
    +  BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_MINOR_VERSION)
    +  BUNDLE_NAME_JRE := $(BUNDLE_NAME)
    +  BUNDLE_NAME_JDK := $(BUNDLE_NAME)
     
    -ifndef OPENJDK
    +  ifndef OPENJDK
         BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_VERSION)
    -else
    +  else
         BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) ($(JDK_VERSION))
    -endif
    -BUNDLE_INFO_JRE := $(BUNDLE_INFO)
    -BUNDLE_INFO_JDK := $(BUNDLE_INFO)
    +  endif
    +  BUNDLE_INFO_JRE := $(BUNDLE_INFO)
    +  BUNDLE_INFO_JDK := $(BUNDLE_INFO)
     
    -BUNDLE_PLATFORM_VERSION := $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION)
    -BUNDLE_VERSION := $(JDK_VERSION)
    -ifeq ($(COMPANY_NAME),N/A)
    +  BUNDLE_PLATFORM_VERSION := $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION)
    +  BUNDLE_VERSION := $(JDK_VERSION)
    +  ifeq ($(COMPANY_NAME), N/A)
         BUNDLE_VENDOR := UNDEFINED
    -else
    +  else
         BUNDLE_VENDOR := $(COMPANY_NAME)
    -endif
    +  endif
     
     
    -JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR))
    -JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR))
    +  JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR))
    +  JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR))
     
    -JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_BUNDLE_DIR)/Home/,$(JDK_FILE_LIST))
    -JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_BUNDLE_DIR)/Home/,$(JRE_FILE_LIST))
    +  JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_BUNDLE_DIR)/Home/,$(JDK_FILE_LIST))
    +  JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_BUNDLE_DIR)/Home/,$(JRE_FILE_LIST))
     
    -# The old builds implementation of this did not preserve symlinks so
    -# make sure they are followed and the contents copied instead.
    -# To fix this, remove -L
    -# Copy empty directories (jre/lib/applet).
    -$(JDK_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
    +  # The old builds implementation of this did not preserve symlinks so
    +  # make sure they are followed and the contents copied instead.
    +  # To fix this, remove -L
    +  # Copy empty directories (jre/lib/applet).
    +  $(JDK_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
     	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
     	$(MKDIR) -p $(@D)
     	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -L '$<' '$@'; fi
     
    -$(JRE_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
    +  $(JRE_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
     	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
     	$(MKDIR) -p $(@D)
     	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -L '$<' '$@'; fi
     
    -$(JDK_BUNDLE_DIR)/MacOS/libjli.dylib:
    +  $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib:
     	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(LN) -s ../Home/jre/lib/jli/libjli.dylib $@
     
    -$(JRE_BUNDLE_DIR)/MacOS/libjli.dylib:
    +  $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib:
     	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(LN) -s ../Home/lib/jli/libjli.dylib $@
     
    -$(JDK_BUNDLE_DIR)/Info.plist: $(SPEC)
    +  $(JDK_BUNDLE_DIR)/Info.plist: $(SPEC)
     	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
     	$(MKDIR) -p $(@D)
    -	$(SED)  -e "s/@@ID@@/$(BUNDLE_ID_JDK)/g" \
    -		-e "s/@@NAME@@/$(BUNDLE_NAME_JDK)/g" \
    -		-e "s/@@INFO@@/$(BUNDLE_INFO_JDK)/g" \
    -		-e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
    -		-e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
    -		-e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
    -		< $(MACOSX_SRC)/bundle/JDK-Info.plist > $@
    +	$(SED) -e "s/@@ID@@/$(BUNDLE_ID_JDK)/g" \
    +	    -e "s/@@NAME@@/$(BUNDLE_NAME_JDK)/g" \
    +	    -e "s/@@INFO@@/$(BUNDLE_INFO_JDK)/g" \
    +	    -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
    +	    -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
    +	    -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
    +	    < $(MACOSX_SRC)/bundle/JDK-Info.plist > $@
     
    -$(JRE_BUNDLE_DIR)/Info.plist: $(SPEC)
    +  $(JRE_BUNDLE_DIR)/Info.plist: $(SPEC)
     	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
     	$(MKDIR) -p $(@D)
    -	$(SED)  -e "s/@@ID@@/$(BUNDLE_ID_JRE)/g" \
    -		-e "s/@@NAME@@/$(BUNDLE_NAME_JRE)/g" \
    -		-e "s/@@INFO@@/$(BUNDLE_INFO_JRE)/g" \
    -		-e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
    -		-e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
    -		-e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
    -		< $(MACOSX_SRC)/bundle/JRE-Info.plist > $@
    +	$(SED) -e "s/@@ID@@/$(BUNDLE_ID_JRE)/g" \
    +	    -e "s/@@NAME@@/$(BUNDLE_NAME_JRE)/g" \
    +	    -e "s/@@INFO@@/$(BUNDLE_INFO_JRE)/g" \
    +	    -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
    +	    -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
    +	    -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
    +	    < $(MACOSX_SRC)/bundle/JRE-Info.plist > $@
     
    -jdk-bundle: $(JDK_TARGET_LIST) $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib \
    -		$(JDK_BUNDLE_DIR)/Info.plist
    +  jdk-bundle: $(JDK_TARGET_LIST) $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib \
    +      $(JDK_BUNDLE_DIR)/Info.plist
     	$(SETFILE) -a B $(dir $(JDK_BUNDLE_DIR))
     
    -jre-bundle: $(JRE_TARGET_LIST) $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib \
    -		$(JRE_BUNDLE_DIR)/Info.plist
    +  jre-bundle: $(JRE_TARGET_LIST) $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib \
    +      $(JRE_BUNDLE_DIR)/Info.plist
     	$(SETFILE) -a B $(dir $(JRE_BUNDLE_DIR))
     
     else # Not macosx
     
    -bundles:
    +  bundles:
     	$(ECHO) "No bundles defined for $(OPENJDK_TARGET_OS)"
     
     endif # macosx
    diff --git a/jdk/makefiles/CompileDemos.gmk b/jdk/makefiles/CompileDemos.gmk
    index 0a093b586a9..beef573275c 100644
    --- a/jdk/makefiles/CompileDemos.gmk
    +++ b/jdk/makefiles/CompileDemos.gmk
    @@ -35,10 +35,10 @@ include NativeCompilation.gmk
     include Setup.gmk
     
     # Prepare the find cache. Only used if running on windows.
    -$(eval $(call FillCacheFind,$(JDK_TOPDIR)/src))
    +$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src))
     
     # Append demo goals to this variable.
    -BUILD_DEMOS=
    +BUILD_DEMOS =
     
     # The demo structure and contents should really be cleaned up.
     # Now every other demo has its own quirks where to put the
    @@ -47,13 +47,13 @@ BUILD_DEMOS=
     ##################################################################################################
     
     define SetupAppletDemo
    -     $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1,\
    -                SETUP:=GENERATE_USINGJDKBYTECODE,\
    -		SRC:=$(JDK_TOPDIR)/src/$3share/demo/applets/$1,\
    -		BIN:=$(JDK_OUTPUTDIR)/demo/applets/$1,\
    -		COPY:=.html .java .xyz .obj .au .gif,\
    -		DISABLE_SJAVAC:=$2))
    -     BUILD_DEMOS += $$(BUILD_DEMO_APPLET_$1)
    +  $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1, \
    +      SETUP := GENERATE_USINGJDKBYTECODE, \
    +      SRC := $(JDK_TOPDIR)/src/$3share/demo/applets/$1, \
    +      BIN := $(JDK_OUTPUTDIR)/demo/applets/$1, \
    +      COPY := .html .java .xyz .obj .au .gif, \
    +      DISABLE_SJAVAC := $2))
    +      BUILD_DEMOS += $$(BUILD_DEMO_APPLET_$1)
     endef
     
     $(eval $(call SetupAppletDemo,ArcTest))
    @@ -65,102 +65,100 @@ $(eval $(call SetupAppletDemo,DitherTest))
     $(eval $(call SetupAppletDemo,DrawTest))
     $(eval $(call SetupAppletDemo,Fractal))
     $(eval $(call SetupAppletDemo,GraphicsTest))
    -$(eval $(call SetupAppletDemo,MoleculeViewer))
     $(eval $(call SetupAppletDemo,NervousText))
     $(eval $(call SetupAppletDemo,SimpleGraph))
     $(eval $(call SetupAppletDemo,SortDemo))
     $(eval $(call SetupAppletDemo,SpreadSheet))
    -# Build WireFrame without a server since it
    -# has a class Matrix3D that also exists in MoleculeViewer.
    -$(eval $(call SetupAppletDemo,WireFrame,true))
     
     ifndef OPENJDK
    -    $(eval $(call SetupAppletDemo,Animator,,closed/))
    -    $(eval $(call SetupAppletDemo,GraphLayout,true,closed/))
    -    $(eval $(call SetupAppletDemo,JumpingBox,,closed/))
    -    $(eval $(call SetupAppletDemo,TicTacToe,,closed/))
    +  $(eval $(call SetupAppletDemo,Animator,,closed/))
    +  $(eval $(call SetupAppletDemo,GraphLayout,true,closed/))
    +  $(eval $(call SetupAppletDemo,JumpingBox,,closed/))
    +  $(eval $(call SetupAppletDemo,TicTacToe,,closed/))
     endif
     
     ##################################################################################################
     
    -PATTERNS_TO_COPY=.html .txt .properties .js .gif .jpg .theme .data .opt README .c .h .png .ttf
    +PATTERNS_TO_COPY = .html .txt .properties .js .gif .jpg .theme .data .opt README .c .h .png .ttf .xyz .obj
     
     define SetupDemo
    -    # Param 1 = Name of the demo
    -    # Param 2 = Subdirectory of the demo below the demo directory.
    -    # Param 3 = Additional javac flags.
    -    # Param 4 = The main class for the jar.
    -    # Param 5 = Additional source directory.
    -    # Param 6 = Extra dir below $(JDK_TOPDIR)/src (closed)
    -    # Param 7 = List of files to copy
    -    # Param 8 = Base name of jar file. Defaults to $1
    -    # Param 9 = Exclude list
    -    # Param 10 = Extra copy patterns
    -    # Param 11 = Extra manifest attribute
    -    # Param 12 = Suffix for compiler setup name
    +  # Param 1 = Name of the demo
    +  # Param 2 = Subdirectory of the demo below the demo directory.
    +  # Param 3 = Additional javac flags.
    +  # Param 4 = The main class for the jar.
    +  # Param 5 = Additional source directory.
    +  # Param 6 = Extra dir below $(JDK_TOPDIR)/src (closed)
    +  # Param 7 = List of files to copy
    +  # Param 8 = Base name of jar file. Defaults to $1
    +  # Param 9 = Exclude list
    +  # Param 10 = Extra copy patterns
    +  # Param 11 = Extra manifest attribute
    +  # Param 12 = Suffix for compiler setup name
     
    -    # In some demos the source is found in a subdir called src.
    -    $1_MAIN_SRC:=$$(wildcard $(JDK_TOPDIR)/src/$6share/demo/$2/$1/src)
    -    ifeq ($$($1_MAIN_SRC),)
    -        $1_MAIN_SRC:=$(JDK_TOPDIR)/src/$6share/demo/$2/$1
    -    endif
    +  # In some demos the source is found in a subdir called src.
    +  $1_MAIN_SRC := $$(wildcard $(JDK_TOPDIR)/src/$6share/demo/$2/$1/src)
    +  ifeq ($$($1_MAIN_SRC), )
    +    $1_MAIN_SRC := $(JDK_TOPDIR)/src/$6share/demo/$2/$1
    +  endif
     
    -    ifneq ($8,)
    -        $1_JARFILE := $8.jar
    -    else
    -        $1_JARFILE := $1.jar
    -    endif
    +  ifneq ($8, )
    +    $1_JARFILE := $8.jar
    +  else
    +    $1_JARFILE := $1.jar
    +  endif
     
    -    ifeq ($(findstring $1,Laffy SwingSet3),)
    -        $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_$1,\
    -                SETUP:=GENERATE_USINGJDKBYTECODE,\
    -                ADD_JAVAC_FLAGS:=$3,\
    -		SRC:=$$($1_MAIN_SRC) $5,\
    -		BIN:=$(JDK_OUTPUTDIR)/democlasses/$2/$1,\
    -		COPY:=$(PATTERNS_TO_COPY) $(10),\
    -		JAR:=$(JDK_OUTPUTDIR)/demo/$2/$1/$$($1_JARFILE),\
    -		JARMAIN:=$4,\
    -		MANIFEST:=$(JDK_TOPDIR)/make/tools/manifest.mf,\
    -		EXTRA_MANIFEST_ATTR:=$(11),\
    -		SRCZIP:=$(JDK_OUTPUTDIR)/demo/$2/$1/src.zip,\
    -		EXCLUDE_FILES:=$9,\
    -		DISABLE_SJAVAC:=$(12)))
    +  ifeq ($(findstring $1,Laffy SwingSet3), )
    +    $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_$1, \
    +        SETUP := GENERATE_USINGJDKBYTECODE, \
    +        ADD_JAVAC_FLAGS := $3, \
    +        SRC := $$($1_MAIN_SRC) $5, \
    +        BIN := $(JDK_OUTPUTDIR)/democlasses/$2/$1, \
    +        COPY := $(PATTERNS_TO_COPY) $(10), \
    +        JAR := $(JDK_OUTPUTDIR)/demo/$2/$1/$$($1_JARFILE), \
    +        JARMAIN := $4, \
    +        MANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf, \
    +        EXTRA_MANIFEST_ATTR := $(11), \
    +        SRCZIP := $(JDK_OUTPUTDIR)/demo/$2/$1/src.zip, \
    +        EXCLUDE_FILES := $9, \
    +        DISABLE_SJAVAC := $(12)))
     
    -        BUILD_DEMOS +=  $$(BUILD_DEMO_$1) \
    -			$(JDK_OUTPUTDIR)/demo/$2/$1/$$($1_JARFILE) \
    -			$(JDK_OUTPUTDIR)/demo/$2/$1/src.zip 
    -    endif
    +    BUILD_DEMOS += $$(BUILD_DEMO_$1) \
    +        $(JDK_OUTPUTDIR)/demo/$2/$1/$$($1_JARFILE) \
    +        $(JDK_OUTPUTDIR)/demo/$2/$1/src.zip
    +  endif
     
    -    # Copy files.
    -    $1_COPY_TARGETS :=  $$(patsubst $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%,\
    -			$(JDK_OUTPUTDIR)/demo/$2/$1/%,\
    -			$$(wildcard $$(addprefix $(JDK_TOPDIR)/src/$6share/demo/$2/$1/,$7)))
    -    ifneq ($7,)
    -        $(JDK_OUTPUTDIR)/demo/$2/$1/% : $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%
    -		$$(call install-file)
    -		$(CHMOD) -f ug+w $$@
    +  # Copy files.
    +  $1_COPY_TARGETS := $$(patsubst $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%, \
    +      $(JDK_OUTPUTDIR)/demo/$2/$1/%, \
    +      $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/$6share/demo/$2/$1/, $7)))
    +  ifneq ($7, )
    +    $(JDK_OUTPUTDIR)/demo/$2/$1/%: $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%
    +	$$(call install-file)
    +	$(CHMOD) -f ug+w $$@
     
    -        BUILD_DEMOS += $$($1_COPY_TARGETS)
    -    endif
    +    BUILD_DEMOS += $$($1_COPY_TARGETS)
    +  endif
     
     endef
     
     $(eval $(call SetupDemo,CodePointIM,jfc,,CodePointIM,,,*.html))
    -$(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services : \
    -			$(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar \
    -			$(JDK_TOPDIR)/src/share/demo/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor
    +$(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services: \
    +    $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar \
    +    $(JDK_TOPDIR)/src/share/demo/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor
     	(cd $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM && \
    -		$(MKDIR) -p _the.tmp/META-INF/services && \
    -		$(CP) $(JDK_TOPDIR)/src/share/demo/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor _the.tmp/META-INF/services && \
    -		cd _the.tmp && \
    -		$(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar META-INF/services/java.awt.im.spi.InputMethodDescriptor && \
    -		cd META-INF/services && \
    -		$(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor)
    +	$(MKDIR) -p _the.tmp/META-INF/services && \
    +	$(CP) $(JDK_TOPDIR)/src/share/demo/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor _the.tmp/META-INF/services && \
    +	cd _the.tmp && \
    +	$(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar META-INF/services/java.awt.im.spi.InputMethodDescriptor && \
    +	cd META-INF/services && \
    +	$(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor)
     	$(RM) -r $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.tmp
     	$(TOUCH) $@
     
    -BUILD_DEMOS+=$(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services
    +BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services
     
    +$(eval $(call SetupDemo,MoleculeViewer,applets,,XYZChemModel,,,example*.html *.java))
    +$(eval $(call SetupDemo,WireFrame,applets,,ThreeD,,,example*.html *.java))
     $(eval $(call SetupDemo,FileChooserDemo,jfc,,FileChooserDemo,,,README*))
     $(eval $(call SetupDemo,Font2DTest,jfc,,Font2DTest,,,*.html *.txt))
     $(eval $(call SetupDemo,Metalworks,jfc,,Metalworks,,,README*))
    @@ -177,193 +175,194 @@ $(eval $(call SetupDemo,VerboseGC,management,,VerboseGC,,,README*))
     $(eval $(call SetupDemo,zipfs,nio,,,,,README* *.java,,,,Main-Class: \n))
     
     ifndef OPENJDK
    -    $(eval $(call SetupDemo,Laffy,jfc,,,,closed/,*))
    -    $(eval $(call SetupDemo,SwingSet3,jfc,,,,closed/,*))
    +  $(eval $(call SetupDemo,Laffy,jfc,,,,closed/,*))
    +  $(eval $(call SetupDemo,SwingSet3,jfc,,,,closed/,*))
     
    -    $(eval $(call SetupDemo,Java2D,jfc,,java2d.Java2Demo,,closed/,*.html README*,Java2Demo))
    -    $(eval $(call SetupDemo,Stylepad,jfc,,Stylepad,\
    -		$(JDK_TOPDIR)/src/share/demo/jfc/Notepad,closed/,*.txt,,$(JDK_TOPDIR)/src/share/demo/jfc/Notepad/README.txt))
    -    $(eval $(call SetupDemo,SwingSet2,jfc,,SwingSet2,,closed/,README* *.html,,,.java COPYRIGHT,\
    -		SplashScreen-Image: resources/images/splash.png,true))
    +  $(eval $(call SetupDemo,Java2D,jfc,,java2d.Java2Demo,,closed/,*.html README*,Java2Demo))
    +  $(eval $(call SetupDemo,Stylepad,jfc,,Stylepad, \
    +      $(JDK_TOPDIR)/src/share/demo/jfc/Notepad,closed/,*.txt,,$(JDK_TOPDIR)/src/share/demo/jfc/Notepad/README.txt))
    +  $(eval $(call SetupDemo,SwingSet2,jfc,,SwingSet2,,closed/,README* *.html,,,.java COPYRIGHT, \
    +      SplashScreen-Image: resources/images/splash.png,true))
     
    -    BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%,\
    -			$(JDK_OUTPUTDIR)/demo/nbproject/%,\
    -			$(call CacheFind,$(JDK_TOPDIR)/src/closed/share/demo/nbproject))
    -    $(JDK_OUTPUTDIR)/demo/nbproject/% : $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%
    -		$(call install-file)
    -		$(CHMOD) -f ug+w $@
    +  BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%, \
    +      $(JDK_OUTPUTDIR)/demo/nbproject/%, \
    +      $(call CacheFind, $(JDK_TOPDIR)/src/closed/share/demo/nbproject))
    +
    +  $(JDK_OUTPUTDIR)/demo/nbproject/%: $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%
    +	$(call install-file)
    +	$(CHMOD) -f ug+w $@
     endif
     
     ##################################################################################################
     
    -# In the old makefiles, j2dbench was not compiled. 
    -#$(eval $(call SetupDemo,J2DBench,java2d,/src,,j2dbench/J2DBench))
    +# In the old makefiles, j2dbench was not compiled.
    +#$(eval $(call SetupDemo,J2DBench, java2d, /src, , j2dbench/J2DBench))
     
     # JVMTI demos are a bit strange and share some files, but be careful the
    -#    shared files are just the *.c and *.h files, not the README or sample
    -#    makefiles. So we always exclude the README.txt and sample.makefile.txt
    -#    from the extra sources.
    +# shared files are just the *.c and *.h files, not the README or sample
    +# makefiles. So we always exclude the README.txt and sample.makefile.txt
    +# from the extra sources.
     define SetupJVMTIDemo
    -     # Param 1 = Name of the demo
    -     # Param 2 = add these directories to the includes, default is agent_util
    -     # Param 3 = extra CFLAGS
    -     # Param 4 = C or C++ (defaults to C)
    -     # Param 5 = libs for posix
    -     # Param 6 = libs for windows
    -     # Param 7 = libs for solaris
    -     BUILD_DEMO_JVMTI_$1_EXTRA_SRC:= \
    -        $$(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/demo/jvmti/$1) \
    -	$$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/,$2))
    -     BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE:= \
    -	$$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/,$2)/README.txt) \
    -	$$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/,$2)/sample.makefile.txt)
    -     BUILD_DEMO_JVMTI_$1_EXTRA_INC:=$$(addprefix -I,$$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC))
    -     BUILD_DEMO_JVMTI_$1_LANG:=C
    -     ifneq (,$4)
    -         BUILD_DEMO_JVMTI_$1_LANG:=$4
    -     endif
    -     ifeq (C++,$4)
    -         $1_EXTRA_CXX:=$(LDFLAGS_CXX_JDK) $(LIBCXX)
    -     endif
    +  # Param 1 = Name of the demo
    +  # Param 2 = add these directories to the includes, default is agent_util
    +  # Param 3 = extra CFLAGS
    +  # Param 4 = C or C++ (defaults to C)
    +  # Param 5 = libs for posix
    +  # Param 6 = libs for windows
    +  # Param 7 = libs for solaris
    +  BUILD_DEMO_JVMTI_$1_EXTRA_SRC := \
    +      $$(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/demo/jvmti/$1) \
    +      $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2))
    +  BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE := \
    +      $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)/README.txt) \
    +      $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)/sample.makefile.txt)
    +  BUILD_DEMO_JVMTI_$1_EXTRA_INC := $$(addprefix -I, $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC))
    +  BUILD_DEMO_JVMTI_$1_LANG := C
    +  ifneq (, $4)
    +    BUILD_DEMO_JVMTI_$1_LANG := $4
    +  endif
    +  ifeq (C++, $4)
    +    $1_EXTRA_CXX := $(LDFLAGS_CXX_JDK) $(LIBCXX)
    +  endif
     
    -     $1_CXXFLAGS:=$(CXXFLAGS_JDKLIB) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 \
    -		  $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3 \
    -		  $(CXXFLAGS_DEBUG_SYMBOLS)
    -     ifeq ($1-$(OPENJDK_TARGET_CPU_ARCH),waiters-sparc)
    -         $1_FILTER:=-xregs=no%appl
    -         $1_CXXFLAGS:=$$(filter-out $$($1_FILTER),$$($1_CXXFLAGS))
    -     endif
    +  $1_CXXFLAGS := $(CXXFLAGS_JDKLIB) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 \
    +      $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3 \
    +      $(CXXFLAGS_DEBUG_SYMBOLS)
    +  ifeq ($1-$(OPENJDK_TARGET_CPU_ARCH), waiters-sparc)
    +    $1_FILTER := -xregs=no%appl
    +    $1_CXXFLAGS := $$(filter-out $$($1_FILTER), $$($1_CXXFLAGS))
    +  endif
     
    -     # Workaround for CFLAGS_JDKLIB containing ',' on solaris. If this is added as 'CFLAGS' to the
    -     # eval call below, the comma gets expanded too early.
    -     BUILD_DEMO_JVMTI_$1_CFLAGS:=$(CFLAGS_JDKLIB) $(CFLAGS_DEBUG_SYMBOLS) \
    -		-I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3
    +  # Workaround for CFLAGS_JDKLIB containing ',' on solaris. If this is added as 'CFLAGS' to the
    +  # eval call below, the comma gets expanded too early.
    +  BUILD_DEMO_JVMTI_$1_CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_DEBUG_SYMBOLS) \
    +      -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3
     
    -     # Remove the -incremental:no setting to get .ilk-files like in the old build.
    -     $$(eval $$(call SetupNativeCompilation,BUILD_DEMO_JVMTI_$1,\
    -		SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC),\
    -		LANG:=$$(BUILD_DEMO_JVMTI_$1_LANG),\
    -		OPTIMIZATION:=LOW,\
    -		CXXFLAGS:=$$($1_CXXFLAGS),\
    -		LDFLAGS:=$(filter-out -incremental:no -opt:ref,$(LDFLAGS_JDKLIB)),\
    -		LDFLAGS_macosx:=$(call SET_EXECUTABLE_ORIGIN),\
    -		LDFLAGS_SUFFIX:=$$($1_EXTRA_CXX),\
    -		LDFLAGS_SUFFIX_posix:=$5,\
    -		LDFLAGS_SUFFIX_windows:=$6,\
    -		LDFLAGS_SUFFIX_solaris:=$7 -lc,\
    -		LDFLAGS_SUFFIX_linux:=$8,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$$(RC_FLAGS) \
    -			  -D "JDK_FNAME=$1.dll" \
    -			  -D "JDK_INTERNAL_NAME=$1" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/demoobjs/jvmti/$1,\
    -		OUTPUT_DIR:=$(JDK_OUTPUTDIR)/demo/jvmti/$1/lib,\
    -		LIBRARY:=$1))
    +  # Remove the -incremental:no setting to get .ilk-files like in the old build.
    +  $$(eval $$(call SetupNativeCompilation,BUILD_DEMO_JVMTI_$1, \
    +      SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
    +      LANG := $$(BUILD_DEMO_JVMTI_$1_LANG), \
    +      OPTIMIZATION := LOW, \
    +      CXXFLAGS := $$($1_CXXFLAGS), \
    +      LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)), \
    +      LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \
    +      LDFLAGS_SUFFIX := $$($1_EXTRA_CXX), \
    +      LDFLAGS_SUFFIX_posix := $5, \
    +      LDFLAGS_SUFFIX_windows := $6, \
    +      LDFLAGS_SUFFIX_solaris := $7 -lc, \
    +      LDFLAGS_SUFFIX_linux := $8, \
    +      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +      RC_FLAGS := $$(RC_FLAGS) \
    +          -D "JDK_FNAME=$1.dll" \
    +          -D "JDK_INTERNAL_NAME=$1" \
    +          -D "JDK_FTYPE=0x2L", \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/demoobjs/jvmti/$1, \
    +      OUTPUT_DIR := $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib, \
    +      LIBRARY := $1))
     
    -    $$(eval $$(call SetupZipArchive,BUILD_DEMO_JVMTI_SRC_$1,\
    -		SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC),\
    -		EXCLUDE_FILES:=$$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE), \
    -		ZIP:=$(JDK_OUTPUTDIR)/demo/jvmti/$1/src.zip))
    +  $$(eval $$(call SetupZipArchive,BUILD_DEMO_JVMTI_SRC_$1, \
    +      SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
    +      EXCLUDE_FILES := $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE), \
    +      ZIP := $(JDK_OUTPUTDIR)/demo/jvmti/$1/src.zip))
     
    -     $(JDK_OUTPUTDIR)/demo/jvmti/$1/README.txt : $(JDK_TOPDIR)/src/share/demo/jvmti/$1/README.txt
    -		$$(call install-file)
    -		$(CHMOD) -f ug+w $$@
    +  $(JDK_OUTPUTDIR)/demo/jvmti/$1/README.txt: $(JDK_TOPDIR)/src/share/demo/jvmti/$1/README.txt
    +	$$(call install-file)
    +	$(CHMOD) -f ug+w $$@
     
    -     ifneq (,$$(wildcard $(JDK_TOPDIR)/src/share/demo/jvmti/$1/*.java))
    -         $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_JVMTI_$1_JAVA,\
    -                SETUP:=GENERATE_USINGJDKBYTECODE,\
    -		SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1,\
    -		BIN:=$(JDK_OUTPUTDIR)/democlasses/jvmti/$1,\
    -		COPY:=$(PATTERNS_TO_COPY),\
    -		JAR:=$(JDK_OUTPUTDIR)/demo/jvmti/$1/$1.jar,\
    -		EXTRA_MANIFEST_ATTR:=Main-Class: \n,\
    -		MANIFEST:=$(JDK_TOPDIR)/make/tools/manifest.mf))
    +  ifneq (, $$(wildcard $(JDK_TOPDIR)/src/share/demo/jvmti/$1/*.java))
    +    $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_JVMTI_$1_JAVA, \
    +        SETUP := GENERATE_USINGJDKBYTECODE, \
    +        SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/$1, \
    +        BIN := $(JDK_OUTPUTDIR)/democlasses/jvmti/$1, \
    +        COPY := $(PATTERNS_TO_COPY), \
    +        JAR := $(JDK_OUTPUTDIR)/demo/jvmti/$1/$1.jar, \
    +        EXTRA_MANIFEST_ATTR := Main-Class: \n, \
    +        MANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf))
     
    -         BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jvmti/$1/$1.jar
    -     endif
    +    BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jvmti/$1/$1.jar
    +  endif
     
    -     BUILD_DEMOS += 	$$(BUILD_DEMO_JVMTI_$1) \
    -			$(JDK_OUTPUTDIR)/demo/jvmti/$1/src.zip \
    -			$(JDK_OUTPUTDIR)/demo/jvmti/$1/README.txt
    +  BUILD_DEMOS += $$(BUILD_DEMO_JVMTI_$1) \
    +      $(JDK_OUTPUTDIR)/demo/jvmti/$1/src.zip \
    +      $(JDK_OUTPUTDIR)/demo/jvmti/$1/README.txt
     
    -     ifeq ($(OPENJDK_TARGET_OS),windows)
    -         # These files normally end up in OBJECT_DIR but for demos they
    -         # are supposed to be included in the distro.
    -         $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.lib: $$(BUILD_DEMO_JVMTI_$1)
    -		$(CP) $(JDK_OUTPUTDIR)/demoobjs/jvmti/$1/$1.lib $$@
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
    +    # These files normally end up in OBJECT_DIR but for demos they
    +    # are supposed to be included in the distro.
    +    $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.lib: $$(BUILD_DEMO_JVMTI_$1)
    +	$(CP) $(JDK_OUTPUTDIR)/demoobjs/jvmti/$1/$1.lib $$@
     
    -         $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.exp: $$(BUILD_DEMO_JVMTI_$1)
    -		$(CP) $(JDK_OUTPUTDIR)/demoobjs/jvmti/$1/$1.exp $$@
    +    $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.exp: $$(BUILD_DEMO_JVMTI_$1)
    +	$(CP) $(JDK_OUTPUTDIR)/demoobjs/jvmti/$1/$1.exp $$@
     
    -         BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.lib \
    -			$(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.exp
    -     endif
    +    BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.lib \
    +        $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.exp
    +  endif
     endef
     
    -$(eval $(call SetupJVMTIDemo,compiledMethodLoad,	agent_util))
    -$(eval $(call SetupJVMTIDemo,gctest,			agent_util))
    -$(eval $(call SetupJVMTIDemo,heapTracker,		agent_util java_crw_demo))
    -$(eval $(call SetupJVMTIDemo,heapViewer,		agent_util))
    -$(eval $(call SetupJVMTIDemo,hprof,			java_crw_demo,\
    -		-I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt,C,\
    -		-ldl,ws2_32.lib winmm.lib,-lsocket -lnsl,-lpthread))
    +$(eval $(call SetupJVMTIDemo,compiledMethodLoad, agent_util))
    +$(eval $(call SetupJVMTIDemo,gctest, agent_util))
    +$(eval $(call SetupJVMTIDemo,heapTracker, agent_util java_crw_demo))
    +$(eval $(call SetupJVMTIDemo,heapViewer, agent_util))
    +$(eval $(call SetupJVMTIDemo,hprof, java_crw_demo, \
    +    -I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, C, \
    +    -ldl, ws2_32.lib winmm.lib, -lsocket -lnsl, -lpthread))
     
    -$(eval $(call SetupJVMTIDemo,minst,			agent_util java_crw_demo))
    -$(eval $(call SetupJVMTIDemo,mtrace,			agent_util java_crw_demo))
    -$(eval $(call SetupJVMTIDemo,waiters,			agent_util,,C++))
    -$(eval $(call SetupJVMTIDemo,versionCheck,		agent_util))
    +$(eval $(call SetupJVMTIDemo,minst, agent_util java_crw_demo))
    +$(eval $(call SetupJVMTIDemo,mtrace, agent_util java_crw_demo))
    +$(eval $(call SetupJVMTIDemo,waiters, agent_util, , C++))
    +$(eval $(call SetupJVMTIDemo,versionCheck, agent_util))
     
     ##################################################################################################
     
     # The jpda demo (com/sun/tools/example) is oddly enough stored in src/share/classes.
     # At least, we do not need to compile the jpda demo, just jar/zip up the sources.
    -JPDA_SOURCES:=$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/tools/example)
    +JPDA_SOURCES := $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example)
     # The number of files are few enough so that we can use echo safely below to list them.
    -JPDA_FILES:=$(subst $(JDK_TOPDIR)/src/share/classes/,,$(JPDA_SOURCES))
    +JPDA_FILES := $(subst $(JDK_TOPDIR)/src/share/classes/,,$(JPDA_SOURCES))
     
    -$(JDK_OUTPUTDIR)/demo/jpda/src.zip : $(JPDA_SOURCES)
    +$(JDK_OUTPUTDIR)/demo/jpda/src.zip: $(JPDA_SOURCES)
     	$(MKDIR) -p $(@D)
     	(cd $(JDK_TOPDIR)/src/share/classes && $(ZIP) -qru $@ com -i "com/sun/tools/example/*")
     
    -$(JDK_OUTPUTDIR)/demo/jpda/examples.jar : $(JPDA_SOURCES)
    +$(JDK_OUTPUTDIR)/demo/jpda/examples.jar: $(JPDA_SOURCES)
     	$(MKDIR) -p $(@D)
     	$(RM) $(@D)/_the.sources
     	$(call ListPathsSafely,JPDA_FILES,\n, >> $(@D)/_the.sources)
    -	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" 		\
    -	       -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $(JDK_TOPDIR)/make/tools/manifest.mf > $(@D)/_the.manifest
    +	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
    +	    -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $(JDK_TOPDIR)/make/tools/manifest.mf > $(@D)/_the.manifest
     	$(ECHO) "Main-Class: " >> $(@D)/_the.manifest
    -	(cd $(JDK_TOPDIR)/src/share/classes && $(JAR) cfm  $@ $(@D)/_the.manifest @$(@D)/_the.sources)
    +	(cd $(JDK_TOPDIR)/src/share/classes && $(JAR) cfm $@ $(@D)/_the.manifest @$(@D)/_the.sources)
     	(cd $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example && $(JAR) uf $@ README)
     
    -$(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README : $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example/README
    +$(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README: $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example/README
     	$(call install-file)
     	$(CHMOD) -f ug+w $@
     
     BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jpda/src.zip $(JDK_OUTPUTDIR)/demo/jpda/examples.jar \
    -		$(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README
    +    $(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README
     
     ##################################################################################################
     
    -$(JDK_OUTPUTDIR)/demo/management/index.html : $(JDK_TOPDIR)/src/share/demo/management/index.html
    +$(JDK_OUTPUTDIR)/demo/management/index.html: $(JDK_TOPDIR)/src/share/demo/management/index.html
     	$(call install-file)
     	$(CHMOD) -f ug+w $@
     
    -$(JDK_OUTPUTDIR)/demo/jvmti/index.html : $(JDK_TOPDIR)/src/share/demo/jvmti/index.html
    +$(JDK_OUTPUTDIR)/demo/jvmti/index.html: $(JDK_TOPDIR)/src/share/demo/jvmti/index.html
     	$(call install-file)
     	$(CHMOD) -f ug+w $@
     
     BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/management/index.html \
    -		$(JDK_OUTPUTDIR)/demo/jvmti/index.html
    +    $(JDK_OUTPUTDIR)/demo/jvmti/index.html
     
     ##################################################################################################
     
     # The netbeans project files are copied into the demo directory.
    -BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/share/demo/nbproject/%,\
    -		$(JDK_OUTPUTDIR)/demo/nbproject/%,\
    -		$(call CacheFind,$(JDK_TOPDIR)/src/share/demo/nbproject))
    +BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/share/demo/nbproject/%, \
    +    $(JDK_OUTPUTDIR)/demo/nbproject/%, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/demo/nbproject))
     
    -$(JDK_OUTPUTDIR)/demo/nbproject/% : $(JDK_TOPDIR)/src/share/demo/nbproject/%
    +$(JDK_OUTPUTDIR)/demo/nbproject/%: $(JDK_TOPDIR)/src/share/demo/nbproject/%
     	$(call install-file)
     	$(CHMOD) -f ug+w $@
     
    @@ -378,64 +377,64 @@ BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/README
     
     ifeq ($(OPENJDK_TARGET_OS), solaris)
     
    -$(JDK_OUTPUTDIR)/democlasses/jni/Poller/% : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/%
    +  $(JDK_OUTPUTDIR)/democlasses/jni/Poller/%: $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/%
     	$(call install-file)
     	$(CHMOD) -f ug+w $@
     
    -$(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/README.txt
    +  $(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt: $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/README.txt
     	$(call install-file)
     	$(CHMOD) -f ug+w $@
     
    -$(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar : \
    -  $(JDK_OUTPUTDIR)/democlasses/jni/Poller/README.txt $(JDK_OUTPUTDIR)/democlasses/jni/Poller/Poller.c
    +  $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar: \
    +      $(JDK_OUTPUTDIR)/democlasses/jni/Poller/README.txt $(JDK_OUTPUTDIR)/democlasses/jni/Poller/Poller.c
     
    -$(eval $(call SetupJavaCompilation,BUILD_DEMO_POLLER_JAR,\
    -		SETUP:=GENERATE_USINGJDKBYTECODE, \
    -		SRC:=$(JDK_TOPDIR)/src/solaris/demo/jni/Poller, \
    -		BIN:=$(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
    -		HEADERS:=$(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
    -		JAR:=$(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar, \
    -		MANIFEST:=$(JDK_TOPDIR)/make/tools/manifest.mf, \
    -		SRCZIP:=$(JDK_OUTPUTDIR)/demo/jni/Poller/src.zip, \
    -		COPY:=README.txt Poller.c, \
    -		JARMAIN:=Client))
    +  $(eval $(call SetupJavaCompilation,BUILD_DEMO_POLLER_JAR, \
    +      SETUP := GENERATE_USINGJDKBYTECODE, \
    +      SRC := $(JDK_TOPDIR)/src/solaris/demo/jni/Poller, \
    +      BIN := $(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
    +      HEADERS := $(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
    +      JAR := $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar, \
    +      MANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf, \
    +      SRCZIP := $(JDK_OUTPUTDIR)/demo/jni/Poller/src.zip, \
    +      COPY := README.txt Poller.c, \
    +      JARMAIN := Client))
     
     
     
    -BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar $(JDK_OUTPUTDIR)/demo/jni/Poller/src.zip \
    -               $(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt
    +  BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar $(JDK_OUTPUTDIR)/demo/jni/Poller/src.zip \
    +      $(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt
     
    -$(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER,\
    -		SRC:=$(JDK_TOPDIR)/src/solaris/demo/jni/Poller, \
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW,\
    -		CFLAGS:=$(CFLAGS_JDKLIB) $(SHARED_LIBRARY_FLAGS) \
    -                        -I$(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB), \
    -		LDFLAGS_SUFFIX_solaris:=-lc,\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/demoobjs/jni/Poller,\
    -                OUTPUT_DIR:=$(JDK_OUTPUTDIR)/demoobjs, \
    -		LIBRARY:=Poller))
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER, \
    +      SRC := $(JDK_TOPDIR)/src/solaris/demo/jni/Poller, \
    +      LANG := C, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CFLAGS_JDKLIB) $(SHARED_LIBRARY_FLAGS) \
    +          -I$(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB), \
    +      LDFLAGS_SUFFIX_solaris := -lc, \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/demoobjs/jni/Poller, \
    +      OUTPUT_DIR := $(JDK_OUTPUTDIR)/demoobjs, \
    +      LIBRARY := Poller))
     
    -#
    -# We can only compile native code after jar has been build (since we depend on generated .h files)
    -#
    -$(JDK_OUTPUTDIR)/demoobjs/jni/Poller/Poller.o : $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar
    +  #
    +  # We can only compile native code after jar has been build (since we depend on generated .h files)
    +  #
    +  $(JDK_OUTPUTDIR)/demoobjs/jni/Poller/Poller.o: $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar
     
    -$(JDK_OUTPUTDIR)/demo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX) : \
    -  $(JDK_OUTPUTDIR)/demoobjs/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
    +  $(JDK_OUTPUTDIR)/demo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX): \
    +      $(JDK_OUTPUTDIR)/demoobjs/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
     	$(call install-file)
     
    -BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
    +  BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
     
     endif
     
     ##################################################################################################
     
     ifndef OPENJDK
    -    DB_DEMO_ZIPFILE := $(wildcard $(JDK_TOPDIR)/src/closed/share/db/*.zip)
    +  DB_DEMO_ZIPFILE := $(wildcard $(JDK_TOPDIR)/src/closed/share/db/*.zip)
     
    -    $(JDK_OUTPUTDIR)/demo/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
    +  $(JDK_OUTPUTDIR)/demo/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
     	$(MKDIR) -p $(@D)
     	$(RM) -r $(JDK_OUTPUTDIR)/demo/db $(JDK_OUTPUTDIR)/demo/demo
     	$(CD) $(JDK_OUTPUTDIR)/demo && $(UNZIP) -q -o $<
    @@ -443,14 +442,14 @@ ifndef OPENJDK
     	$(CD) $(JDK_OUTPUTDIR)/demo && $(RM) -r db-derby-*-bin
     	$(TOUCH) $@
     
    -#    Copy this after the unzip above to avoid race with directory creation and mv command.
    -     $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html: \
    -		$(JDK_TOPDIR)/src/closed/share/db/README-JDK-DEMOS.html \
    -		| $(JDK_OUTPUTDIR)/demo/_the.db.unzipped
    +  # Copy this after the unzip above to avoid race with directory creation and mv command.
    +  $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html: \
    +      $(JDK_TOPDIR)/src/closed/share/db/README-JDK-DEMOS.html \
    +      | $(JDK_OUTPUTDIR)/demo/_the.db.unzipped
     	$(MKDIR) -p $(@D)
     	$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > $@
     
    -     BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/_the.db.unzipped $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html
    +  BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/_the.db.unzipped $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html
     endif
     
     ##################################################################################################
    diff --git a/jdk/makefiles/CompileJavaClasses.gmk b/jdk/makefiles/CompileJavaClasses.gmk
    index 0b3e70dd914..740222661b3 100644
    --- a/jdk/makefiles/CompileJavaClasses.gmk
    +++ b/jdk/makefiles/CompileJavaClasses.gmk
    @@ -38,245 +38,262 @@ EXCLUDES :=
     
     ##########################################################################################
     
    -EXCLUDES +=	com/sun/pept \
    -		com/sun/tools/example/trace\
    -		com/sun/tools/example/debug/bdi\
    -		com/sun/tools/example/debug/event\
    -		com/sun/tools/example/debug/gui
    +EXCLUDES += com/sun/pept \
    +    com/sun/tools/example/trace \
    +    com/sun/tools/example/debug/bdi \
    +    com/sun/tools/example/debug/event \
    +    com/sun/tools/example/debug/gui
     
     ifdef OPENJDK
    -    EXCLUDES+=	sun/dc \
    -		com/sun/jmx/snmp \
    -		sun/management/snmp \
    -		com/sun/script
    +  EXCLUDES += sun/dc \
    +      com/sun/jmx/snmp \
    +      sun/management/snmp \
    +      com/sun/script
     endif
     
     ifndef OPENJDK
    -   # There exists two versions of this file...
    -   EXFILES := $(JDK_TOPDIR)/src/share/classes/javax/crypto/JarVerifier.java
    +  # There exists two versions of this file...
    +  EXFILES := $(JDK_TOPDIR)/src/share/classes/javax/crypto/JarVerifier.java
     
    -   ifeq ($(OPENJDK_TARGET_OS),windows)
    -      # This gets built on unix platforms implicitly in the old build even though
    -      # it's excluded in the closed build.
    -      EXCLUDES+=sun/java2d/pisces
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
    +    # This gets built on unix platforms implicitly in the old build even though
    +    # it's excluded in the closed build.
    +    EXCLUDES += sun/java2d/pisces
     
    -      # AccessBridge is compiled separately below.
    -      EXFILES += AccessBridge.java \
    -		 com/sun/java/accessibility/util/java/awt/ChoiceTranslator.java
    -      # This seems to never be built
    -      EXCLUDES += com/sun/java/accessibility/extensions
    -   endif
    +    # AccessBridge is compiled separately below.
    +    EXFILES += AccessBridge.java \
    +        AccessBridgeLoader.java \
    +        com/sun/java/accessibility/util/java/awt/ChoiceTranslator.java
    +    # This seems to never be built
    +    EXCLUDES += com/sun/java/accessibility/extensions
    +  endif
     
     endif
     
    -ifneq ($(OPENJDK_TARGET_OS),solaris)
    -   # Exclude Solaris nio and two security related files in src/share/classes
    -   EXFILES += SolarisAclFileAttributeView.java \
    -	SolarisFileStore.java \
    -	SolarisFileSystem.java \
    -	SolarisFileSystemProvider.java \
    -	SolarisNativeDispatcher.java \
    -	SolarisUserDefinedFileAttributeView.java \
    -	SolarisWatchService.java \
    -	SolarisAclFileAttributeView.java \
    -	SolarisLoginModule.java \
    -	SolarisSystem.java \
    -        sun/nio/ch/DevPollArrayWrapper.java \
    -        sun/nio/ch/DevPollSelectorImpl.java \
    -        sun/nio/ch/DevPollSelectorProvider.java \
    -	sun/nio/ch/EventPortSelectorImpl.java \
    -	sun/nio/ch/EventPortSelectorProvider.java \
    -	sun/nio/ch/EventPortWrapper.java \
    -        sun/nio/ch/SolarisAsynchronousChannelProvider.java \
    -        sun/nio/ch/SolarisEventPort.java \
    -	sun/tools/attach/SolarisAttachProvider.java \
    -	sun/tools/attach/SolarisVirtualMachine.java
    +ifneq ($(OPENJDK_TARGET_OS), solaris)
    +  # Exclude Solaris nio and two security related files in src/share/classes
    +  EXFILES += SolarisAclFileAttributeView.java \
    +      SolarisFileStore.java \
    +      SolarisFileSystem.java \
    +      SolarisFileSystemProvider.java \
    +      SolarisNativeDispatcher.java \
    +      SolarisUserDefinedFileAttributeView.java \
    +      SolarisWatchService.java \
    +      SolarisAclFileAttributeView.java \
    +      SolarisLoginModule.java \
    +      SolarisSystem.java \
    +      sun/nio/ch/DevPollArrayWrapper.java \
    +      sun/nio/ch/DevPollSelectorImpl.java \
    +      sun/nio/ch/DevPollSelectorProvider.java \
    +      sun/nio/ch/EventPortSelectorImpl.java \
    +      sun/nio/ch/EventPortSelectorProvider.java \
    +      sun/nio/ch/EventPortWrapper.java \
    +      sun/nio/ch/SolarisAsynchronousChannelProvider.java \
    +      sun/nio/ch/SolarisEventPort.java \
    +      sun/tools/attach/SolarisAttachProvider.java \
    +      sun/tools/attach/SolarisVirtualMachine.java
     
    -   EXCLUDES += com/oracle/security
    +  EXCLUDES += com/oracle/security
     endif
     
    -# In the old build, this isn't excluded on macosx, even though it probably
    -# should be.
    -ifneq ($(OPENJDK_TARGET_OS),macosx)
    -	EXFILES+=WrapperGenerator.java
    -endif
    +EXFILES += WrapperGenerator.java
     
    -ifneq ($(OPENJDK_TARGET_OS),windows)
    -    # Exclude Window security related files in src/share/classes
    -    EXFILES+=NTLoginModule.java \
    -             NTSystem.java
    +ifneq ($(OPENJDK_TARGET_OS), windows)
    +  # Exclude Window security related files in src/share/classes
    +  EXFILES += NTLoginModule.java \
    +      NTSystem.java
     else
    -    EXFILES+=UnixLoginModule.java \
    -	     UnixSystem.java
    +  EXFILES += UnixLoginModule.java \
    +      UnixSystem.java
     endif
     
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -    # Don't build GTK L&F on Windows
    -    EXCLUDES+=com/sun/java/swing/plaf/gtk
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  # Don't build GTK L&F on Windows
    +  EXCLUDES += com/sun/java/swing/plaf/gtk
     endif
     
    -ifneq ($(OPENJDK_TARGET_OS),linux)
    -    EXFILES+=sun/tools/attach/LinuxAttachProvider.java \
    -	     sun/tools/attach/LinuxVirtualMachine.java \
    -             sun/nio/ch/EPoll.java \
    -             sun/nio/ch/EPollArrayWrapper.java \
    -             sun/nio/ch/EPollPort.java \
    -             sun/nio/ch/EPollSelectorImpl.java \
    -             sun/nio/ch/EPollSelectorProvider.java \
    -             sun/nio/ch/LinuxAsynchronousChannelProvider.java \
    -	     sun/nio/fs/LinuxDosFileAttributeView.java \
    -	     sun/nio/fs/LinuxFileStore.java \
    -	     sun/nio/fs/LinuxFileSystem.java \
    -	     sun/nio/fs/LinuxFileSystemProvider.java \
    -	     sun/nio/fs/MagicFileTypeDetector.java \
    -	     sun/nio/fs/LinuxNativeDispatcher.java \
    -	     sun/nio/fs/LinuxUserDefinedFileAttributeView.java \
    -	     sun/nio/fs/LinuxWatchService.java
    +ifneq ($(OPENJDK_TARGET_OS), linux)
    +  EXFILES += sun/tools/attach/LinuxAttachProvider.java \
    +      sun/tools/attach/LinuxVirtualMachine.java \
    +      sun/nio/ch/EPoll.java \
    +      sun/nio/ch/EPollArrayWrapper.java \
    +      sun/nio/ch/EPollPort.java \
    +      sun/nio/ch/EPollSelectorImpl.java \
    +      sun/nio/ch/EPollSelectorProvider.java \
    +      sun/nio/ch/LinuxAsynchronousChannelProvider.java \
    +      sun/nio/fs/LinuxDosFileAttributeView.java \
    +      sun/nio/fs/LinuxFileStore.java \
    +      sun/nio/fs/LinuxFileSystem.java \
    +      sun/nio/fs/LinuxFileSystemProvider.java \
    +      sun/nio/fs/MagicFileTypeDetector.java \
    +      sun/nio/fs/LinuxNativeDispatcher.java \
    +      sun/nio/fs/LinuxUserDefinedFileAttributeView.java \
    +      sun/nio/fs/LinuxWatchService.java
     endif
     
    -ifneq ($(OPENJDK_TARGET_OS),macosx)
    -    EXFILES+=sun/nio/ch/BsdAsynchronousChannelProvider.java \
    -             sun/nio/ch/KQueue.java \
    -             sun/nio/ch/KQueuePort.java \
    -             sun/nio/fs/BsdFileStore.java \
    -	     sun/nio/fs/BsdFileSystem.java \
    -             sun/nio/fs/BsdFileSystemProvider.java \
    -             sun/nio/fs/BsdNativeDispatcher.java \
    -             sun/nio/fs/MacOSXFileSystemProvider.java \
    -             sun/nio/fs/MacOSXFileSystem.java \
    -             sun/nio/fs/MacOSXNativeDispatcher.java \
    -             sun/tools/attach/BsdAttachProvider.java \
    -             sun/tools/attach/BsdVirtualMachine.java
    +ifneq ($(OPENJDK_TARGET_OS), macosx)
    +  EXFILES += sun/nio/ch/BsdAsynchronousChannelProvider.java \
    +      sun/nio/ch/KQueue.java \
    +      sun/nio/ch/KQueuePort.java \
    +      sun/nio/fs/BsdFileStore.java \
    +      sun/nio/fs/BsdFileSystem.java \
    +      sun/nio/fs/BsdFileSystemProvider.java \
    +      sun/nio/fs/BsdNativeDispatcher.java \
    +      sun/nio/fs/MacOSXFileSystemProvider.java \
    +      sun/nio/fs/MacOSXFileSystem.java \
    +      sun/nio/fs/MacOSXNativeDispatcher.java \
    +      sun/tools/attach/BsdAttachProvider.java \
    +      sun/tools/attach/BsdVirtualMachine.java
     endif
     
     # Exclude BreakIterator classes that are just used in compile process to generate
     # data files and shouldn't go in the product
    -EXFILES+=sun/text/resources/BreakIteratorRules.java \
    -	 sun/text/resources/BreakIteratorRules_th.java
    +EXFILES += sun/text/resources/BreakIteratorRules.java \
    +    sun/text/resources/BreakIteratorRules_th.java
     
     # TODO: Add BUILD_HEADLESS_ONLY to configure?
     ifdef BUILD_HEADLESS_ONLY
    -    EXCLUDES+=sun/applet
    +  EXCLUDES += sun/applet
     endif
     
     ifdef OPENJDK
    -    EXCLUDES+=sun/java2d/cmm/kcms
    +  EXCLUDES += sun/java2d/cmm/kcms
     endif
     
     # Used on windows and macosx
    -ifeq (,$(filter $(OPENJDK_TARGET_OS), windows macosx))
    -    EXFILES+=sun/awt/AWTCharset.java
    +ifeq (, $(filter $(OPENJDK_TARGET_OS), windows macosx))
    +  EXFILES += sun/awt/AWTCharset.java
     endif
     
    -ifneq ($(OPENJDK_TARGET_OS), macosx)
    -    EXFILES+=sun/awt/X11/ScreenFormat.java \
    -             sun/awt/X11/XArc.java \
    -             sun/awt/X11/XChar2b.java \
    -             sun/awt/X11/XCharStruct.java \
    -             sun/awt/X11/XClassHint.java \
    -             sun/awt/X11/XComposeStatus.java \
    -             sun/awt/X11/XExtCodes.java \
    -             sun/awt/X11/XFontProp.java \
    -             sun/awt/X11/XFontSetExtents.java \
    -             sun/awt/X11/XFontStruct.java \
    -             sun/awt/X11/XGCValues.java \
    -             sun/awt/X11/XHostAddress.java \
    -             sun/awt/X11/XIMCallback.java \
    -             sun/awt/X11/XIMHotKeyTrigger.java \
    -             sun/awt/X11/XIMHotKeyTriggers.java \
    -             sun/awt/X11/XIMPreeditCaretCallbackStruct.java \
    -             sun/awt/X11/XIMPreeditDrawCallbackStruct.java \
    -             sun/awt/X11/XIMPreeditStateNotifyCallbackStruct.java \
    -             sun/awt/X11/XIMStatusDrawCallbackStruct.java \
    -             sun/awt/X11/XIMStringConversionCallbackStruct.java \
    -             sun/awt/X11/XIMStringConversionText.java \
    -             sun/awt/X11/XIMStyles.java \
    -             sun/awt/X11/XIMText.java \
    -             sun/awt/X11/XIMValuesList.java \
    -             sun/awt/X11/XImage.java \
    -             sun/awt/X11/XKeyboardControl.java \
    -             sun/awt/X11/XKeyboardState.java \
    -             sun/awt/X11/XOMCharSetList.java \
    -             sun/awt/X11/XOMFontInfo.java \
    -             sun/awt/X11/XOMOrientation.java \
    -             sun/awt/X11/XPoint.java \
    -             sun/awt/X11/XRectangle.java \
    -             sun/awt/X11/XSegment.java \
    -             sun/awt/X11/XStandardColormap.java \
    -             sun/awt/X11/XTextItem.java \
    -             sun/awt/X11/XTextItem16.java \
    -             sun/awt/X11/XTextProperty.java \
    -             sun/awt/X11/XTimeCoord.java \
    -             sun/awt/X11/XWindowChanges.java \
    -             sun/awt/X11/XdbeSwapInfo.java \
    -             sun/awt/X11/XmbTextItem.java \
    -             sun/awt/X11/XwcTextItem.java
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  # exclude all X11 on Mac, we can't exclude some like below or we'll have compilation errors
    +  EXCLUDES += sun/awt/X11
    +else
    +  # TBD: figure out how to eliminate this long list
    +  EXFILES += sun/awt/X11/ScreenFormat.java \
    +      sun/awt/X11/XArc.java \
    +      sun/awt/X11/XChar2b.java \
    +      sun/awt/X11/XCharStruct.java \
    +      sun/awt/X11/XClassHint.java \
    +      sun/awt/X11/XComposeStatus.java \
    +      sun/awt/X11/XExtCodes.java \
    +      sun/awt/X11/XFontProp.java \
    +      sun/awt/X11/XFontSetExtents.java \
    +      sun/awt/X11/XFontStruct.java \
    +      sun/awt/X11/XGCValues.java \
    +      sun/awt/X11/XHostAddress.java \
    +      sun/awt/X11/XIMCallback.java \
    +      sun/awt/X11/XIMHotKeyTrigger.java \
    +      sun/awt/X11/XIMHotKeyTriggers.java \
    +      sun/awt/X11/XIMPreeditCaretCallbackStruct.java \
    +      sun/awt/X11/XIMPreeditDrawCallbackStruct.java \
    +      sun/awt/X11/XIMPreeditStateNotifyCallbackStruct.java \
    +      sun/awt/X11/XIMStatusDrawCallbackStruct.java \
    +      sun/awt/X11/XIMStringConversionCallbackStruct.java \
    +      sun/awt/X11/XIMStringConversionText.java \
    +      sun/awt/X11/XIMStyles.java \
    +      sun/awt/X11/XIMText.java \
    +      sun/awt/X11/XIMValuesList.java \
    +      sun/awt/X11/XImage.java \
    +      sun/awt/X11/XKeyboardControl.java \
    +      sun/awt/X11/XKeyboardState.java \
    +      sun/awt/X11/XOMCharSetList.java \
    +      sun/awt/X11/XOMFontInfo.java \
    +      sun/awt/X11/XOMOrientation.java \
    +      sun/awt/X11/XPoint.java \
    +      sun/awt/X11/XRectangle.java \
    +      sun/awt/X11/XSegment.java \
    +      sun/awt/X11/XStandardColormap.java \
    +      sun/awt/X11/XTextItem.java \
    +      sun/awt/X11/XTextItem16.java \
    +      sun/awt/X11/XTextProperty.java \
    +      sun/awt/X11/XTimeCoord.java \
    +      sun/awt/X11/XWindowChanges.java \
    +      sun/awt/X11/XdbeSwapInfo.java \
    +      sun/awt/X11/XmbTextItem.java \
    +      sun/awt/X11/XwcTextItem.java
     endif
     
     # Exclude another implicitly not included file.
    -EXFILES+=sun/util/locale/AsciiUtil.java
    +EXFILES += sun/util/locale/AsciiUtil.java
     
    -ifeq (,$(filter $(OPENJDK_TARGET_OS), solaris macosx))
    -#
    -# only solaris and macosx
    -#
    -    EXFILES+=sun/nio/fs/PollingWatchService.java
    +ifeq (, $(filter $(OPENJDK_TARGET_OS), solaris macosx))
    +  #
    +  # only solaris and macosx
    +  #
    +  EXFILES += sun/nio/fs/PollingWatchService.java
     endif
     
     # TODO: Fix when converting NIO
     # Exclude *-linux-arm.java and *-linux-ppc.java from closed.
    -EXFILES+=-linux-arm.java \
    -	 -linux-ppc.java
    +EXFILES += -linux-arm.java \
    +    -linux-ppc.java
     
     ifeq ($(OPENJDK_TARGET_OS), windows)
    -    EXFILES+=sun/nio/ch/AbstractPollSelectorImpl.java \
    -        sun/nio/ch/PollSelectorProvider.java \
    -	sun/nio/ch/SimpleAsynchronousFileChannelImpl.java
    +  EXFILES += sun/nio/ch/AbstractPollSelectorImpl.java \
    +      sun/nio/ch/PollSelectorProvider.java \
    +      sun/nio/ch/SimpleAsynchronousFileChannelImpl.java
     endif
     
     # These files do not appear in the build result of the old build. This
     # is because they are generated sources, but the AUTO_JAVA_FILES won't
    -# pick them up since they aren't generated when the source dirs are 
    +# pick them up since they aren't generated when the source dirs are
     # searched and they aren't referenced by any other classes so they won't
     # be picked up by implicit compilation. On a rebuild, they are picked up
    -# and compiled. Exclude them here to produce the same rt.jar as the old 
    +# and compiled. Exclude them here to produce the same rt.jar as the old
     # build does when building just once.
    -EXFILES+=javax/swing/plaf/nimbus/InternalFrameTitlePanePainter.java \
    -	 javax/swing/plaf/nimbus/OptionPaneMessageAreaPainter.java \
    -	 javax/swing/plaf/nimbus/ScrollBarPainter.java \
    -	 javax/swing/plaf/nimbus/SliderPainter.java \
    -	 javax/swing/plaf/nimbus/SpinnerPainter.java \
    -	 javax/swing/plaf/nimbus/SplitPanePainter.java \
    -	 javax/swing/plaf/nimbus/TabbedPanePainter.java
    +EXFILES += javax/swing/plaf/nimbus/InternalFrameTitlePanePainter.java \
    +    javax/swing/plaf/nimbus/OptionPaneMessageAreaPainter.java \
    +    javax/swing/plaf/nimbus/ScrollBarPainter.java \
    +    javax/swing/plaf/nimbus/SliderPainter.java \
    +    javax/swing/plaf/nimbus/SpinnerPainter.java \
    +    javax/swing/plaf/nimbus/SplitPanePainter.java \
    +    javax/swing/plaf/nimbus/TabbedPanePainter.java
     
     # Acquire a list of files that should be copied straight over to the classes.
     include CopyIntoClasses.gmk
     # Now we have COPY_PATTERNS, COPY_FILES and COPY_EXTRA
     
     ifndef OPENJDK
    -    CLOSED_SRC_DIRS:=$(JDK_TOPDIR)/src/closed/share/classes \
    -		     $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS_API_DIR)/classes
    +  CLOSED_SRC_DIRS := $(JDK_TOPDIR)/src/closed/share/classes \
    +      $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS_API_DIR)/classes
     endif
     
     MACOSX_SRC_DIRS :=
    -ifeq ($(OPENJDK_TARGET_OS),macosx)
    -     MACOSX_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/classes
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  MACOSX_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/classes
     
    -     # this files are duplicated in MACOSX_SRC_DIRS
    -     EXFILES+= $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java \
    -               $(JDK_TOPDIR)/src/solaris/classes/sun/java2d/BackBufferCapsProvider.java \
    -               $(JDK_TOPDIR)/src/solaris/classes/java/net/DefaultInterface.java \
    -               $(JDK_TOPDIR)/src/solaris/classes/java/lang/ClassLoaderHelper.java \
    -               $(JDK_TOPDIR)/src/solaris/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java \
    -               $(JDK_TOPDIR)/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java
    +  # this files are duplicated in MACOSX_SRC_DIRS
    +  EXFILES += $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java \
    +      $(JDK_TOPDIR)/src/solaris/classes/sun/java2d/BackBufferCapsProvider.java \
    +      $(JDK_TOPDIR)/src/solaris/classes/java/net/DefaultInterface.java \
    +      $(JDK_TOPDIR)/src/solaris/classes/java/lang/ClassLoaderHelper.java \
    +      $(JDK_TOPDIR)/src/solaris/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java \
    +      $(JDK_TOPDIR)/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java \
    +      $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java \
    +      $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java \
    +      $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java
     
    -     # JObjC.jar contains 1.5 byte-code...so skip it here :-(
    -     # MACOSX_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/jobjc/src
    -     # EXCLUDES+= tests/java/com/apple/jobjc
    +  # JObjC.jar contains 1.5 byte-code...so skip it here :-(
    +  # MACOSX_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/jobjc/src
    +  # EXCLUDES += tests/java/com/apple/jobjc
     
    -     EXCLUDES+= com/apple/jobjc
    +  EXCLUDES += com/apple/jobjc
     endif
     
    +# The security classes should not end up in the classes directory as that will prevent them
    +# from working when running the exploded jdk image. Compile them separately to a different
    +# directory from where the jars can be created.
    +SECURITY_PKGS := \
    +    com/oracle/security/ucrypto \
    +    com/sun/crypto/provider \
    +    javax/crypto \
    +    sun/security/ec \
    +    sun/security/internal \
    +    sun/security/mscapi \
    +    sun/security/pkcs11 \
    +    #
    +
     # The exception handling of swing beaninfo
     # These resources violates the convention of having code and resources together under
     # $(JDK_TOPDIR)/src/.../classes directories
    @@ -287,36 +304,47 @@ $(JDK_OUTPUTDIR)/classes/javax/swing/beaninfo/images/%.gif: $(JDK_TOPDIR)/make/t
     # JDK_FILTER at the make command line, only a subset of the JDK java files will
     # be recompiled. If multiple paths are separated by comma, convert that into a
     # space separated list.
    -JDK_USER_DEFINED_FILTER:=$(strip $(subst $(COMMA),$(SPACE),$(JDK_FILTER)))
    +JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER)))
    +
    +ifeq ($(ENABLE_SJAVAC),yes)
    +  # With sjavac enabled, excluded sources are not even considered for linking. 
    +  # Explicitly add the security sources to sourcepath for linking.
    +  BUILD_JDK_SOURCEPATH:=$(patsubst %,-i$(SPACE)%.*,$(subst /,.,$(SECURITY_PKGS))) \
    +      -sourcepath $(JDK_TOPDIR)/src/share/classes
    +endif
     
     $(eval $(call SetupJavaCompilation,BUILD_JDK,\
    -                SETUP:=GENERATE_JDKBYTECODE,\
    -		SRC:=$(JDK_TOPDIR)/src/share/classes \
    -		     $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \
    -		     $(MACOSX_SRC_DIRS) \
    -		     $(JDK_OUTPUTDIR)/gensrc \
    -		     $(JDK_OUTPUTDIR)/gensrc_no_srczip \
    -		     $(CLOSED_SRC_DIRS),\
    -		INCLUDES:=$(JDK_USER_DEFINED_FILTER),\
    -		EXCLUDES:=$(EXCLUDES),\
    -		EXCLUDE_FILES:=$(EXFILES),\
    -		BIN:=$(JDK_OUTPUTDIR)/classes,\
    -		COPY:=$(COPY_PATTERNS),\
    -		COPY_FILES:=$(COPY_FILES),\
    -		HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers))
    +    SETUP:=GENERATE_JDKBYTECODE,\
    +    SRC:=$(JDK_TOPDIR)/src/share/classes \
    +        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \
    +        $(MACOSX_SRC_DIRS) \
    +        $(JDK_OUTPUTDIR)/gensrc \
    +        $(JDK_OUTPUTDIR)/gensrc_no_srczip \
    +        $(CLOSED_SRC_DIRS),\
    +    INCLUDES:=$(JDK_USER_DEFINED_FILTER),\
    +    EXCLUDES:=$(EXCLUDES) $(SECURITY_PKGS),\
    +    EXCLUDE_FILES:=$(EXFILES),\
    +    BIN:=$(JDK_OUTPUTDIR)/classes,\
    +    COPY:=$(COPY_PATTERNS),\
    +    COPY_FILES:=$(COPY_FILES),\
    +    HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers,\
    +    ADD_JAVAC_FLAGS:=$(BUILD_JDK_SOURCEPATH)))
     
     ##########################################################################################
     
    -ifndef OPENJDK
    +$(eval $(call SetupJavaCompilation,BUILD_SECURITY, \
    +    SETUP := GENERATE_JDKBYTECODE, \
    +    SRC := $(JDK_TOPDIR)/src/share/classes \
    +        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \
    +        $(MACOSX_SRC_DIRS) \
    +        $(CLOSED_SRC_DIRS), \
    +    INCLUDES := $(SECURITY_PKGS), \
    +    EXCLUDES := $(EXCLUDES), \
    +    EXCLUDE_FILES := $(EXFILES), \
    +    BIN := $(JDK_OUTPUTDIR)/classes_security, \
    +    HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers))
     
    -    $(eval $(call SetupJavaCompilation,BUILD_ALTCLASSES,\
    -		SETUP:=GENERATE_JDKBYTECODE,\
    -		SRC:=$(JDK_TOPDIR)/src/closed/share/altclasses, \
    -		BIN:=$(JDK_OUTPUTDIR)/altclasses_classes))
    -
    -    $(BUILD_ALTCLASSES): $(BUILD_JDK)
    -
    -endif
    +$(BUILD_SECURITY): $(BUILD_JDK)
     
     ##########################################################################################
     
    @@ -326,85 +354,85 @@ $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin:
     
     ##########################################################################################
     
    -ifeq ($(OPENJDK_TARGET_OS),macosx)
    -#
    -# JObjC.jar is compiled with BOOT_JAVAC which (may) not support the "-h" flag.
    -#   so we first compile classes with BOOT_JAVAC and then with JDK_JAVAC :-(
    -#
    -$(eval $(call SetupJavaCompiler,GENERATE_15BYTECODE,\
    -     JAVAC:=$(JAVAC),\
    -     FLAGS:=-source 1.5 -target 1.5 -g -bootclasspath $(BOOT_RTJAR) -cp $(JDK_OUTPUTDIR)/../langtools/dist/lib/classes.jar $(DISABLE_WARNINGS),\
    -     SERVER_DIR:=$(SJAVAC_SERVER_DIR),\
    -     SERVER_JVM:=$(SJAVAC_SERVER_JAVA)))
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  #
    +  # JObjC.jar is compiled with BOOT_JAVAC which (may) not support the "-h" flag.
    +  # so we first compile classes with BOOT_JAVAC and then with JDK_JAVAC :-(
    +  #
    +  $(eval $(call SetupJavaCompiler,GENERATE_15BYTECODE, \
    +      JAVAC := $(JAVAC), \
    +      FLAGS := -source 1.5 -target 1.5 -g -bootclasspath $(BOOT_RTJAR) -cp $(JDK_OUTPUTDIR)/../langtools/dist/lib/classes.jar $(DISABLE_WARNINGS), \
    +      SERVER_DIR := $(SJAVAC_SERVER_DIR), \
    +      SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
     
    -$(eval $(call SetupJavaCompilation,BUILD_JOBJC,\
    -		SETUP:=GENERATE_15BYTECODE,\
    -		DISABLE_SJAVAC:=true,\
    -		SRC:=$(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/java \
    -		     $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/java \
    -		     $(JDK_OUTPUTDIR)/gensrc_jobjc/src, \
    -		INCLUDES := com/apple/jobjc,\
    -                EXCLUDES := tests/java/com/apple/jobjc,\
    -		BIN:=$(JDK_OUTPUTDIR)/jobjc_classes,\
    -		JAR:=$(JDK_OUTPUTDIR)/lib/JObjC.jar, \
    -		JARINDEX := true))
    +  $(eval $(call SetupJavaCompilation,BUILD_JOBJC, \
    +      SETUP := GENERATE_15BYTECODE, \
    +      DISABLE_SJAVAC := true, \
    +      SRC := $(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/java \
    +          $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/java \
    +          $(JDK_OUTPUTDIR)/gensrc_jobjc/src, \
    +      INCLUDES := com/apple/jobjc, \
    +      EXCLUDES := tests/java/com/apple/jobjc, \
    +      BIN := $(JDK_OUTPUTDIR)/jobjc_classes, \
    +      JAR := $(JDK_OUTPUTDIR)/lib/JObjC.jar, \
    +      JARINDEX := true))
     
    -$(BUILD_JOBJC) : $(BUILD_JDK)
    +  $(BUILD_JOBJC): $(BUILD_JDK)
     
    -$(eval $(call SetupJavaCompilation,BUILD_JOBJC_HEADERS,\
    -		SETUP:=GENERATE_JDKBYTECODE,\
    -		SRC:=$(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/java \
    -		     $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/java \
    -		     $(JDK_OUTPUTDIR)/gensrc_jobjc/src, \
    -		INCLUDES := com/apple/jobjc,\
    -                EXCLUDES := tests/java/com/apple/jobjc,\
    -		BIN:=$(JDK_OUTPUTDIR)/jobjc_classes_headers,\
    -		HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers_jobjc))
    +  $(eval $(call SetupJavaCompilation,BUILD_JOBJC_HEADERS, \
    +      SETUP := GENERATE_JDKBYTECODE, \
    +      SRC := $(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/java \
    +          $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/java \
    +          $(JDK_OUTPUTDIR)/gensrc_jobjc/src, \
    +      INCLUDES := com/apple/jobjc, \
    +      EXCLUDES := tests/java/com/apple/jobjc, \
    +      BIN := $(JDK_OUTPUTDIR)/jobjc_classes_headers, \
    +      HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers_jobjc))
     
    -$(BUILD_JOBJC_HEADERS) : $(BUILD_JDK)
    +$(BUILD_JOBJC_HEADERS): $(BUILD_JDK)
     
     endif
     
     ##########################################################################################
     
     ifndef OPENJDK
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
    -    $(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_32,\
    -		SETUP:=GENERATE_JDKBYTECODE,\
    -		JAVAC_FLAGS:=-cp $(JDK_OUTPUTDIR)/classes,\
    -		SRC:=$(JDK_OUTPUTDIR)/gensrc_ab/32bit,\
    -		BIN:=$(JDK_OUTPUTDIR)/classes_ab/32bit))
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
    +    ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
    +      $(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_32, \
    +          SETUP := GENERATE_JDKBYTECODE, \
    +          JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
    +          SRC := $(JDK_OUTPUTDIR)/gensrc_ab/32bit, \
    +          BIN := $(JDK_OUTPUTDIR)/classes_ab/32bit))
     
    -    $(BUILD_ACCESSBRIDGE_32): $(BUILD_JDK)
    +      $(BUILD_ACCESSBRIDGE_32): $(BUILD_JDK)
     
    -    $(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_LEGACY,\
    -		SETUP:=GENERATE_JDKBYTECODE,\
    -		JAVAC_FLAGS:=-cp $(JDK_OUTPUTDIR)/classes,\
    -		SRC:=$(JDK_OUTPUTDIR)/gensrc_ab/legacy,\
    -		BIN:=$(JDK_OUTPUTDIR)/classes_ab/legacy))
    +      $(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_LEGACY, \
    +          SETUP := GENERATE_JDKBYTECODE, \
    +          JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
    +          SRC := $(JDK_OUTPUTDIR)/gensrc_ab/legacy, \
    +          BIN := $(JDK_OUTPUTDIR)/classes_ab/legacy))
     
    -    $(BUILD_ACCESSBRIDGE_LEGACY): $(BUILD_JDK)
    +      $(BUILD_ACCESSBRIDGE_LEGACY): $(BUILD_JDK)
     
    -else
    +    else
     
    -    $(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_64,\
    -		SETUP:=GENERATE_JDKBYTECODE,\
    -		JAVAC_FLAGS:=-cp $(JDK_OUTPUTDIR)/classes,\
    -		SRC:=$(JDK_OUTPUTDIR)/gensrc_ab/64bit,\
    -		BIN:=$(JDK_OUTPUTDIR)/classes_ab/64bit))
    +      $(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_64, \
    +          SETUP := GENERATE_JDKBYTECODE, \
    +          JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
    +          SRC := $(JDK_OUTPUTDIR)/gensrc_ab/64bit, \
    +          BIN := $(JDK_OUTPUTDIR)/classes_ab/64bit))
     
    -    $(BUILD_ACCESSBRIDGE_64): $(BUILD_JDK)
    +      $(BUILD_ACCESSBRIDGE_64): $(BUILD_JDK)
     
    -endif
    -endif
    +    endif
    +  endif
     endif
     
     ##########################################################################################
     
    -all: $(BUILD_JDK) $(BUILD_ALTCLASSES) $(BUILD_JOBJC) $(BUILD_JOBJC_HEADERS) $(COPY_EXTRA) \
    -	$(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin \
    -	$(BUILD_ACCESSBRIDGE_32) $(BUILD_ACCESSBRIDGE_64) \
    -	$(BUILD_ACCESSBRIDGE_LEGACY)
    +all: $(BUILD_JDK) $(BUILD_SECURITY) $(BUILD_JOBJC) $(BUILD_JOBJC_HEADERS) $(COPY_EXTRA) \
    +    $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin \
    +    $(BUILD_ACCESSBRIDGE_32) $(BUILD_ACCESSBRIDGE_64) \
    +    $(BUILD_ACCESSBRIDGE_LEGACY)
     
     .PHONY: all
    diff --git a/jdk/makefiles/CompileLaunchers.gmk b/jdk/makefiles/CompileLaunchers.gmk
    index ec96b53a83c..af5b3583758 100644
    --- a/jdk/makefiles/CompileLaunchers.gmk
    +++ b/jdk/makefiles/CompileLaunchers.gmk
    @@ -23,7 +23,7 @@
     # questions.
     #
     
    -defalt: all
    +default: all
     
     include $(SPEC)
     include MakeBase.gmk
    @@ -33,27 +33,26 @@ include NativeCompilation.gmk
     include Setup.gmk
     
     # Prepare the find cache. Only used on windows.
    -$(eval $(call FillCacheFind,$(JDK_TOPDIR)/src/share/bin))
    +$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src/share/bin))
     
     # Build tools
     include Tools.gmk
     
    -BUILD_LAUNCHERS=
    +BUILD_LAUNCHERS =
     
     # When building a legacy overlay image (on solaris 64 bit), the launchers
     # need to be built with a different rpath and a different output dir.
    -ifeq ($(OVERLAY_IMAGES),true)
    -    ORIGIN_ROOT:=/../..
    -    OUTPUT_SUBDIR:=$(OPENJDK_TARGET_CPU_ISADIR)
    +ifeq ($(OVERLAY_IMAGES), true)
    +  ORIGIN_ROOT := /../..
    +  OUTPUT_SUBDIR := $(OPENJDK_TARGET_CPU_ISADIR)
     else
    -    ORIGIN_ROOT:=/..
    +  ORIGIN_ROOT := /..
     endif
     
     ifeq ($(OPENJDK_TARGET_OS), macosx)
    -    ORIGIN_ARG:=$(call SET_EXECUTABLE_ORIGIN)
    +  ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN)
     else
    -    ORIGIN_ARG:=$(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli) \
    -                $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli)
    +  ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli)
     endif
     
     #
    @@ -61,158 +60,157 @@ endif
     # System.loadLibrary("jawt") first. This was the behaviour described in the
     # devloper documentation of JAWT and what worked with OpenJDK6.
     #
    -ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris),)
    -    ORIGIN_ARG+=$(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)) \
    -                $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR))
    +ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
    +  ORIGIN_ARG += $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR))
     endif
     
     define SetupLauncher
    -    # TODO: Fix mapfile on solaris. Won't work with ld as linker.
    -    # Parameter 1 is the name of the launcher (java,javac,jar...)
    -    # Parameter 2 is extra CFLAGS
    -    # Parameter 3 is extra LDFLAGS
    -    # Parameter 4 is extra LDFLAGS_SUFFIX_posix
    -    # Parameter 5 is extra LDFLAGS_SUFFIX_windows
    -    # Parameter 6 is optional Windows JLI library (full path)
    -    # Parameter 7 is optional Windows resource (RC) flags
    -    # Parameter 8 is optional Windows version resource file (.rc)
    -    # Parameter 9  is different output dir
    -    # Parameter 10 if set, link statically with c runtime on windows.
    -    # Parameter 11 if set, override plist file on macosx.
    +  # TODO: Fix mapfile on solaris. Won't work with ld as linker.
    +  # Parameter 1 is the name of the launcher (java, javac, jar...)
    +  # Parameter 2 is extra CFLAGS
    +  # Parameter 3 is extra LDFLAGS
    +  # Parameter 4 is extra LDFLAGS_SUFFIX_posix
    +  # Parameter 5 is extra LDFLAGS_SUFFIX_windows
    +  # Parameter 6 is optional Windows JLI library (full path)
    +  # Parameter 7 is optional Windows resource (RC) flags
    +  # Parameter 8 is optional Windows version resource file (.rc)
    +  # Parameter 9 is different output dir
    +  # Parameter 10 if set, link statically with c runtime on windows.
    +  # Parameter 11 if set, override plist file on macosx.
     
    -    $1_WINDOWS_JLI_LIB:=$(JDK_OUTPUTDIR)/objs/libjli/jli.lib
    -    ifneq ($6,)
    -        $1_WINDOWS_JLI_LIB:=$6
    -    endif
    -    $1_VERSION_INFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc
    -    ifneq ($8,)
    -        $1_VERSION_INFO_RESOURCE:=$8
    +  $1_WINDOWS_JLI_LIB := $(JDK_OUTPUTDIR)/objs/libjli/jli.lib
    +  ifneq ($6, )
    +    $1_WINDOWS_JLI_LIB := $6
    +  endif
    +  $1_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc
    +  ifneq ($8, )
    +    $1_VERSION_INFO_RESOURCE := $8
    +  endif
    +
    +  $1_LDFLAGS := $3
    +  $1_LDFLAGS_SUFFIX :=
    +  ifeq ($(OPENJDK_TARGET_OS), macosx)
    +    $1_PLIST_FILE := Info-cmdline.plist
    +    ifneq ($(11), )
    +      $1_PLIST_FILE := $(11)
    +      ifneq ($$(findstring privileged, $$($1_PLIST_FILE)), )
    +        $1_CODESIGN := true
    +      endif
         endif
     
    -    $1_LDFLAGS := $3
    -    $1_LDFLAGS_SUFFIX :=
    -    ifeq ($(OPENJDK_TARGET_OS), macosx)
    -        $1_PLIST_FILE:=Info-cmdline.plist
    -        ifneq ($(11),)
    -            $1_PLIST_FILE:=$(11)
    -            ifneq ($$(findstring privileged,$$($1_PLIST_FILE)),)
    -                $1_CODESIGN:=true
    -            endif
    -        endif
    -
    -        $1_LDFLAGS += -Wl,-all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \
    -                      -framework Cocoa -framework Security -framework ApplicationServices \
    -                      -sectcreate __TEXT __info_plist $(JDK_TOPDIR)/src/macosx/lib/$$($1_PLIST_FILE)
    +    $1_LDFLAGS += -Wl,-all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \
    +        -framework Cocoa -framework Security -framework ApplicationServices \
    +        -sectcreate __TEXT __info_plist $(JDK_TOPDIR)/src/macosx/lib/$$($1_PLIST_FILE)
             $1_LDFLAGS_SUFFIX += -pthread
    -    endif
    +  endif
     
    -    ifeq ($(USE_EXTERNAL_LIBZ), true)
    -        $1_LDFLAGS_SUFFIX += -lz
    -    endif
    +  ifeq ($(USE_EXTERNAL_LIBZ), true)
    +    $1_LDFLAGS_SUFFIX += -lz
    +  endif
     
    -    $1_OUTPUT_DIR_ARG:=$9
    -    ifeq (,$$($1_OUTPUT_DIR_ARG))
    -        $1_OUTPUT_DIR_ARG:=$(JDK_OUTPUTDIR)/bin
    -    endif
    +  $1_OUTPUT_DIR_ARG := $9
    +  ifeq (, $$($1_OUTPUT_DIR_ARG))
    +    $1_OUTPUT_DIR_ARG := $(JDK_OUTPUTDIR)/bin
    +  endif
     
    -    # TODO: maybe it's better to move this if-statement out of this function
    -    ifeq ($1,java)
    -        $1_OPTIMIZATION_ARG:=HIGH
    -	$1_LDFLAGS_solaris:=-R$(OPENWIN_HOME)/lib$(OPENJDK_TARGET_CPU_ISADIR)
    -    else
    -        $1_OPTIMIZATION_ARG:=LOW
    -    endif
    +  # TODO: maybe it's better to move this if-statement out of this function
    +  ifeq ($1, java)
    +    $1_OPTIMIZATION_ARG := HIGH
    +    $1_LDFLAGS_solaris := -R$(OPENWIN_HOME)/lib$(OPENJDK_TARGET_CPU_ISADIR)
    +  else
    +  $1_OPTIMIZATION_ARG := LOW
    +  endif
     
    -    $1_CFLAGS:=$(CFLAGS_JDKEXE)
    -    ifeq ($(10),true)
    -        $1_CFLAGS:=$(filter-out -MD,$(CFLAGS_JDKEXE))
    -    endif
    +  $1_CFLAGS := $(CFLAGS_JDKEXE)
    +  ifeq ($(10), true)
    +    $1_CFLAGS := $(filter-out -MD, $(CFLAGS_JDKEXE))
    +  endif
     
    -    ifneq ($(wildcard $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)),)
    -        $1_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)
    -    else
    -        $1_MAPFILE:=
    -    endif
    +  ifneq ($(wildcard $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)), )
    +    $1_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)
    +  else
    +    $1_MAPFILE :=
    +  endif
     
    -    $(call SetupNativeCompilation,BUILD_LAUNCHER_$1,\
    -	SRC:=$(JDK_TOPDIR)/src/share/bin,\
    -	INCLUDE_FILES:=main.c,\
    -	LANG:=C,\
    -	OPTIMIZATION:=$$($1_OPTIMIZATION_ARG), \
    -	CFLAGS:=$$($1_CFLAGS) \
    -		-I$(JDK_TOPDIR)/src/share/bin \
    -		-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin \
    -		-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS)/bin \
    -                -DFULL_VERSION='"$(FULL_VERSION)"' \
    -                -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
    -                -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
    -		-DLIBARCHNAME='"$(OPENJDK_TARGET_CPU_LEGACY)"' \
    -		-DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' \
    -		-DPROGNAME='"$1"' $(DPACKAGEPATH) \
    -		$2,\
    -	CFLAGS_linux:=-fPIC,\
    -        CFLAGS_solaris:=-KPIC -DHAVE_GETHRTIME,\
    -	LDFLAGS:=$(LDFLAGS_JDKEXE) \
    -                 $(ORIGIN_ARG) \
    -		 $$($1_LDFLAGS),\
    -	LDFLAGS_macosx:=$(call SET_SHARED_LIBRARY_NAME,$1),\
    -	LDFLAGS_linux:=-lpthread \
    -                       $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)),\
    -	LDFLAGS_solaris:=$$($1_LDFLAGS_solaris) \
    -                       $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)),\
    -	MAPFILE := $$($1_MAPFILE), \
    -        LDFLAGS_SUFFIX:=$(LDFLAGS_JDKEXE_SUFFIX) $$($1_LDFLAGS_SUFFIX),\
    -	LDFLAGS_SUFFIX_posix:=$4,\
    -	LDFLAGS_SUFFIX_windows:=$$($1_WINDOWS_JLI_LIB) \
    -			       $(JDK_OUTPUTDIR)/objs/libjava/java.lib advapi32.lib $5,\
    -	LDFLAGS_SUFFIX_linux:=-L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli $(LIBDL) -lc, \
    -	LDFLAGS_SUFFIX_solaris:=-L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli -lthread $(LIBDL) -lc, \
    -	OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/$1_objs$(OUTPUT_SUBDIR),\
    -	OUTPUT_DIR:=$$($1_OUTPUT_DIR_ARG)$(OUTPUT_SUBDIR),\
    -	PROGRAM:=$1,\
    -	DEBUG_SYMBOLS:=true,\
    -	VERSIONINFO_RESOURCE:=$$($1_VERSION_INFO_RESOURCE),\
    -	RC_FLAGS:=$(RC_FLAGS)\
    -		  -D "JDK_FNAME=$1$(EXE_SUFFIX)" \
    -		  -D "JDK_INTERNAL_NAME=$1" \
    -		  -D "JDK_FTYPE=0x1L" \
    -		  $7,\
    -	MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/java.manifest,\
    -	CODESIGN:=$$($1_CODESIGN))
    +  $(call SetupNativeCompilation,BUILD_LAUNCHER_$1, \
    +      SRC := $(JDK_TOPDIR)/src/share/bin, \
    +      INCLUDE_FILES := main.c, \
    +      LANG := C, \
    +      OPTIMIZATION := $$($1_OPTIMIZATION_ARG), \
    +      CFLAGS := $$($1_CFLAGS) \
    +          -I$(JDK_TOPDIR)/src/share/bin \
    +          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin \
    +          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS)/bin \
    +          -DFULL_VERSION='"$(FULL_VERSION)"' \
    +          -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
    +          -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
    +          -DLIBARCHNAME='"$(OPENJDK_TARGET_CPU_LEGACY)"' \
    +          -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' \
    +          -DPROGNAME='"$1"' $(DPACKAGEPATH) \
    +          $2, \
    +      CFLAGS_linux := -fPIC, \
    +      CFLAGS_solaris := -KPIC -DHAVE_GETHRTIME, \
    +      LDFLAGS := $(LDFLAGS_JDKEXE) \
    +          $(ORIGIN_ARG) \
    +          $$($1_LDFLAGS), \
    +      LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_NAME,$1), \
    +      LDFLAGS_linux := -lpthread \
    +          $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
    +      LDFLAGS_solaris := $$($1_LDFLAGS_solaris) \
    +          $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
    +      MAPFILE := $$($1_MAPFILE), \
    +      LDFLAGS_SUFFIX := $(LDFLAGS_JDKEXE_SUFFIX) $$($1_LDFLAGS_SUFFIX), \
    +      LDFLAGS_SUFFIX_posix := $4, \
    +      LDFLAGS_SUFFIX_windows := $$($1_WINDOWS_JLI_LIB) \
    +          $(JDK_OUTPUTDIR)/objs/libjava/java.lib advapi32.lib $5, \
    +      LDFLAGS_SUFFIX_linux := -L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli $(LIBDL) -lc, \
    +      LDFLAGS_SUFFIX_solaris := -L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli -lthread $(LIBDL) -lc, \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/$1_objs$(OUTPUT_SUBDIR), \
    +      OUTPUT_DIR := $$($1_OUTPUT_DIR_ARG)$(OUTPUT_SUBDIR), \
    +      PROGRAM := $1, \
    +      DEBUG_SYMBOLS := true, \
    +      VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
    +      RC_FLAGS := $(RC_FLAGS) \
    +          -D "JDK_FNAME=$1$(EXE_SUFFIX)" \
    +          -D "JDK_INTERNAL_NAME=$1" \
    +          -D "JDK_FTYPE=0x1L" \
    +          $7, \
    +      MANIFEST := $(JDK_TOPDIR)/src/windows/resource/java.manifest, \
    +      CODESIGN := $$($1_CODESIGN))
     
    -    BUILD_LAUNCHERS += $$(BUILD_LAUNCHER_$1)
    +  BUILD_LAUNCHERS += $$(BUILD_LAUNCHER_$1)
     
    -    ifeq ($(OPENJDK_TARGET_OS),macosx)
    -        $$(BUILD_LAUNCHER_$1) : $(JDK_OUTPUTDIR)/objs/libjli_static.a
    -    endif
    +  ifeq ($(OPENJDK_TARGET_OS), macosx)
    +    $$(BUILD_LAUNCHER_$1): $(JDK_OUTPUTDIR)/objs/libjli_static.a
    +  endif
     
    -    ifeq ($(OPENJDK_TARGET_OS),windows)
    -        $$(BUILD_LAUNCHER_$1) : $(JDK_OUTPUTDIR)/objs/libjava/java.lib \
    -				$$($1_WINDOWS_JLI_LIB)
    -    endif
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
    +    $$(BUILD_LAUNCHER_$1): $(JDK_OUTPUTDIR)/objs/libjava/java.lib \
    +        $$($1_WINDOWS_JLI_LIB)
    +  endif
     endef
     
     ##########################################################################################
     
    -XLIBS:=$(X_LIBS) -lX11
    -ifeq ($(OPENJDK_TARGET_OS),macosx)
    -    DPACKAGEPATH:=-DPACKAGE_PATH='"$(PACKAGE_PATH)"'
    -    XLIBS:=
    +XLIBS := $(X_LIBS) -lX11
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  DPACKAGEPATH := -DPACKAGE_PATH='"$(PACKAGE_PATH)"'
    +  XLIBS :=
     endif
     
     ifdef OPENJDK
    -    JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/windows/resource/icons"
    +  JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/windows/resource/icons"
     else
    -    JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/closed/windows/native/sun/windows"
    +  JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/closed/windows/native/sun/windows"
     endif
     
     # On windows, the debuginfo files get the same name as for java.dll. Build
     # into another dir and copy selectively so debuginfo for java.dll isn't
     # overwritten.
    -$(eval $(call SetupLauncher,java,\
    -    -DEXPAND_CLASSPATH_WILDCARDS,,,user32.lib comctl32.lib,\
    -    $(JDK_OUTPUTDIR)/objs/jli_static.lib,$(JAVA_RC_FLAGS),\
    -    $(JDK_TOPDIR)/src/windows/resource/java.rc,$(JDK_OUTPUTDIR)/objs/java_objs,true))
    +$(eval $(call SetupLauncher,java, \
    +    -DEXPAND_CLASSPATH_WILDCARDS,,,user32.lib comctl32.lib, \
    +    $(JDK_OUTPUTDIR)/objs/jli_static.lib, $(JAVA_RC_FLAGS), \
    +    $(JDK_TOPDIR)/src/windows/resource/java.rc, $(JDK_OUTPUTDIR)/objs/java_objs,true))
     
     $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/java$(EXE_SUFFIX): $(BUILD_LAUNCHER_java)
     	$(MKDIR) -p $(@D)
    @@ -221,271 +219,271 @@ $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/java$(EXE_SUFFIX): $(BUILD_LAUNCHER_java)
     
     BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/java$(EXE_SUFFIX)
     
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -    $(eval $(call SetupLauncher,javaw,\
    -        -DJAVAW -DEXPAND_CLASSPATH_WILDCARDS,,,user32.lib comctl32.lib,\
    -        $(JDK_OUTPUTDIR)/objs/jli_static.lib,$(JAVA_RC_FLAGS),\
    -        $(JDK_TOPDIR)/src/windows/resource/java.rc,,true))
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  $(eval $(call SetupLauncher,javaw, \
    +      -DJAVAW -DEXPAND_CLASSPATH_WILDCARDS,,,user32.lib comctl32.lib, \
    +      $(JDK_OUTPUTDIR)/objs/jli_static.lib, $(JAVA_RC_FLAGS), \
    +      $(JDK_TOPDIR)/src/windows/resource/java.rc,,true))
     endif
     
     
     ifndef BUILD_HEADLESS_ONLY
    -$(eval $(call SetupLauncher,appletviewer,\
    -    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.applet.Main"$(COMMA) }',,\
    -    $(XLIBS)))
    +  $(eval $(call SetupLauncher,appletviewer, \
    +      -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.applet.Main"$(COMMA) }',, \
    +      $(XLIBS)))
     endif
     
    -$(eval $(call SetupLauncher,extcheck,\
    +$(eval $(call SetupLauncher,extcheck, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.extcheck.Main"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,idlj,\
    +$(eval $(call SetupLauncher,idlj, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.corba.se.idl.toJavaPortable.Compile"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,jar,\
    +$(eval $(call SetupLauncher,jar, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jar.Main"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,jarsigner,\
    +$(eval $(call SetupLauncher,jarsigner, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.jarsigner.Main"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,javac,\
    +$(eval $(call SetupLauncher,javac, \
         -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javac.Main"$(COMMA) }'))
     
    -ifeq ($(ENABLE_SJAVAC),yes)
    -$(eval $(call SetupLauncher,sjavac,\
    -    -DEXPAND_CLASSPATH_WILDCARDS \
    -    -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
    -    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.sjavac.Main"$(COMMA) }'))
    +ifeq ($(ENABLE_SJAVAC), yes)
    +  $(eval $(call SetupLauncher,sjavac, \
    +      -DEXPAND_CLASSPATH_WILDCARDS \
    +      -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
    +      -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.sjavac.Main"$(COMMA) }'))
     endif
     
    -$(eval $(call SetupLauncher,javadoc,\
    +$(eval $(call SetupLauncher,javadoc, \
         -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javadoc.Main"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,javah,\
    +$(eval $(call SetupLauncher,javah, \
         -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javah.Main"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,javap,\
    +$(eval $(call SetupLauncher,javap, \
         -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javap.Main"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,jdeps,\
    +$(eval $(call SetupLauncher,jdeps, \
         -DEXPAND_CLASSPATH_WILDCARDS \
         -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.jdeps.Main"$(COMMA) }'))
     
    -BUILD_LAUNCHER_jconsole_CFLAGS_windows:=-DJAVAW
    -BUILD_LAUNCHER_jconsole_LDFLAGS_windows:=user32.lib
    +BUILD_LAUNCHER_jconsole_CFLAGS_windows := -DJAVAW
    +BUILD_LAUNCHER_jconsole_LDFLAGS_windows := user32.lib
     
    -$(eval $(call SetupLauncher,jconsole,\
    +$(eval $(call SetupLauncher,jconsole, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "-J-Djconsole.showOutputViewer"$(COMMA) "sun.tools.jconsole.JConsole"$(COMMA) }' \
         -DAPP_CLASSPATH='{ "/lib/jconsole.jar"$(COMMA) "/lib/tools.jar"$(COMMA) "/classes" }'))
     
    -$(eval $(call SetupLauncher,jdb,\
    +$(eval $(call SetupLauncher,jdb, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.example.debug.tty.TTY"$(COMMA) }' \
         -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }'))
     
    -$(eval $(call SetupLauncher,jhat,\
    +$(eval $(call SetupLauncher,jhat, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.hat.Main"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,jinfo,\
    +$(eval $(call SetupLauncher,jinfo, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
    -		   "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
    -		   "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
    -		   "sun.tools.jinfo.JInfo"$(COMMA) }' \
    +        "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
    +        "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
    +        "sun.tools.jinfo.JInfo"$(COMMA) }' \
         -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
         ,,,,,,,,,Info-privileged.plist))
     
    -$(eval $(call SetupLauncher,jmap,\
    +$(eval $(call SetupLauncher,jmap, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
    -		   "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
    -		   "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
    -		   "sun.tools.jmap.JMap"$(COMMA) }' \
    +        "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
    +        "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
    +        "sun.tools.jmap.JMap"$(COMMA) }' \
         -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
         ,,,,,,,,,Info-privileged.plist))
     
    -$(eval $(call SetupLauncher,jps,\
    +$(eval $(call SetupLauncher,jps, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jps.Jps"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,jrunscript,\
    +$(eval $(call SetupLauncher,jrunscript, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.script.shell.Main"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,jjs,\
    -    -DJAVA_ARGS='{  "-J-ms8m"$(COMMA) "jdk.nashorn.tools.Shell"$(COMMA) }'))
    +$(eval $(call SetupLauncher,jjs, \
    +    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "jdk.nashorn.tools.Shell"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,jsadebugd,\
    +$(eval $(call SetupLauncher,jsadebugd, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.jvm.hotspot.jdi.SADebugServer"$(COMMA) }' \
         -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
         ,,,,,,,,,Info-privileged.plist))
     
    -$(eval $(call SetupLauncher,jstack,\
    +$(eval $(call SetupLauncher,jstack, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
    -		   "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
    -		   "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
    -		   "sun.tools.jstack.JStack"$(COMMA) }' \
    +        "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
    +        "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
    +        "sun.tools.jstack.JStack"$(COMMA) }' \
         -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
         ,,,,,,,,,Info-privileged.plist))
     
    -$(eval $(call SetupLauncher,jstat,\
    +$(eval $(call SetupLauncher,jstat, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jstat.Jstat"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,jstatd,\
    +$(eval $(call SetupLauncher,jstatd, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jstatd.Jstatd"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,keytool,\
    +$(eval $(call SetupLauncher,keytool, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.keytool.Main"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,native2ascii,\
    +$(eval $(call SetupLauncher,native2ascii, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.native2ascii.Main"$(COMMA) }'))
     
     ifndef BUILD_HEADLESS_ONLY
    -$(eval $(call SetupLauncher,policytool,\
    -    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',,\
    -    $(XLIBS)))
    +  $(eval $(call SetupLauncher,policytool, \
    +      -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',, \
    +      $(XLIBS)))
     endif
     
    -$(eval $(call SetupLauncher,rmic,\
    +$(eval $(call SetupLauncher,rmic, \
         -DEXPAND_CLASSPATH_WILDCARDS \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.rmi.rmic.Main"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,schemagen,\
    +$(eval $(call SetupLauncher,schemagen, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.jxc.SchemaGenerator"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,serialver,\
    +$(eval $(call SetupLauncher,serialver, \
         -DEXPAND_CLASSPATH_WILDCARDS \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.serialver.SerialVer"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,xjc,\
    +$(eval $(call SetupLauncher,xjc, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.xjc.Driver"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,wsgen,\
    +$(eval $(call SetupLauncher,wsgen, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.ws.WsGen"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,wsimport,\
    +$(eval $(call SetupLauncher,wsimport, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.ws.WsImport"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,orbd,\
    -    -DJAVA_ARGS='{ 	"-J-ms8m"$(COMMA) \
    -			"-J-Dcom.sun.CORBA.activation.DbDir=./orb.db"$(COMMA) \
    -			"-J-Dcom.sun.CORBA.activation.Port=1049"$(COMMA) \
    -			"-J-Dcom.sun.CORBA.POA.ORBServerId=1"$(COMMA) \
    -			"com.sun.corba.se.impl.activation.ORBD"$(COMMA) }'))
    +$(eval $(call SetupLauncher,orbd, \
    +    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
    +        "-J-Dcom.sun.CORBA.activation.DbDir=./orb.db"$(COMMA) \
    +        "-J-Dcom.sun.CORBA.activation.Port=1049"$(COMMA) \
    +        "-J-Dcom.sun.CORBA.POA.ORBServerId=1"$(COMMA) \
    +        "com.sun.corba.se.impl.activation.ORBD"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,servertool,\
    +$(eval $(call SetupLauncher,servertool, \
         -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.corba.se.impl.activation.ServerTool"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,tnameserv,\
    -    -DJAVA_ARGS='{ 	"-J-ms8m"$(COMMA) \
    -			"-J-Dcom.sun.CORBA.activation.DbDir=./orb.db"$(COMMA) \
    -			"-J-Djava.util.logging.LoggingPermission=contol"$(COMMA) \
    -			"-J-Dcom.sun.CORBA.POA.ORBServerId=1"$(COMMA) \
    -			"com.sun.corba.se.impl.naming.cosnaming.TransientNameServer"$(COMMA) }'))
    +$(eval $(call SetupLauncher,tnameserv, \
    +    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
    +        "-J-Dcom.sun.CORBA.activation.DbDir=./orb.db"$(COMMA) \
    +        "-J-Djava.util.logging.LoggingPermission=contol"$(COMMA) \
    +        "-J-Dcom.sun.CORBA.POA.ORBServerId=1"$(COMMA) \
    +        "com.sun.corba.se.impl.naming.cosnaming.TransientNameServer"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,pack200,\
    -    -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "com.sun.java.util.jar.pack.Driver"$(COMMA) "--pack" }'))
    +$(eval $(call SetupLauncher,pack200, \
    +    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.java.util.jar.pack.Driver"$(COMMA) "--pack" }'))
     
    -$(eval $(call SetupLauncher,rmid,\
    -    -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "sun.rmi.server.Activation"$(COMMA) }'))
    +$(eval $(call SetupLauncher,rmid, \
    +    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.rmi.server.Activation"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,rmiregistry,\
    -    -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "sun.rmi.registry.RegistryImpl"$(COMMA) }'))
    +$(eval $(call SetupLauncher,rmiregistry, \
    +    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.rmi.registry.RegistryImpl"$(COMMA) }'))
     
    -$(eval $(call SetupLauncher,jcmd,\
    -    -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "sun.tools.jcmd.JCmd"$(COMMA) }'))
    +$(eval $(call SetupLauncher,jcmd, \
    +    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jcmd.JCmd"$(COMMA) }'))
     
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -    $(eval $(call SetupLauncher,kinit,\
    -        -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Kinit"$(COMMA) }'))
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  $(eval $(call SetupLauncher,kinit, \
    +      -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Kinit"$(COMMA) }'))
     
    -    $(eval $(call SetupLauncher,klist,\
    -        -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Klist"$(COMMA) }'))
    +  $(eval $(call SetupLauncher,klist, \
    +      -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Klist"$(COMMA) }'))
     
    -    $(eval $(call SetupLauncher,ktab,\
    -        -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Ktab"$(COMMA) }'))
    +  $(eval $(call SetupLauncher,ktab, \
    +      -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Ktab"$(COMMA) }'))
     endif
     
     ##########################################################################################
     # The order of the object files on the link command line affects the size of the resulting
     # binary (at least on linux) which causes the size to differ between old and new build.
     ifeq ($(USE_EXTERNAL_LIBZ), true)
    -UNPACKEXE_CFLAGS := -DSYSTEM_ZLIB
    -UNPACKEXE_ZIPOBJS := -lz
    +  UNPACKEXE_CFLAGS := -DSYSTEM_ZLIB
    +  UNPACKEXE_ZIPOBJS := -lz
     else
    -UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
    -UNPACKEXE_ZIPOBJS := 	$(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \
    -		     	$(JDK_OUTPUTDIR)/objs/libzip/deflate$(OBJ_SUFFIX) \
    -			$(JDK_OUTPUTDIR)/objs/libzip/trees$(OBJ_SUFFIX) \
    -			$(JDK_OUTPUTDIR)/objs/libzip/zadler32$(OBJ_SUFFIX) \
    -			$(JDK_OUTPUTDIR)/objs/libzip/compress$(OBJ_SUFFIX) \
    -			$(JDK_OUTPUTDIR)/objs/libzip/zutil$(OBJ_SUFFIX) \
    -			$(JDK_OUTPUTDIR)/objs/libzip/inflate$(OBJ_SUFFIX) \
    -			$(JDK_OUTPUTDIR)/objs/libzip/infback$(OBJ_SUFFIX) \
    -			$(JDK_OUTPUTDIR)/objs/libzip/inftrees$(OBJ_SUFFIX) \
    -			$(JDK_OUTPUTDIR)/objs/libzip/inffast$(OBJ_SUFFIX)
    +  UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
    +  UNPACKEXE_ZIPOBJS := $(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \
    +      $(JDK_OUTPUTDIR)/objs/libzip/deflate$(OBJ_SUFFIX) \
    +      $(JDK_OUTPUTDIR)/objs/libzip/trees$(OBJ_SUFFIX) \
    +      $(JDK_OUTPUTDIR)/objs/libzip/zadler32$(OBJ_SUFFIX) \
    +      $(JDK_OUTPUTDIR)/objs/libzip/compress$(OBJ_SUFFIX) \
    +      $(JDK_OUTPUTDIR)/objs/libzip/zutil$(OBJ_SUFFIX) \
    +      $(JDK_OUTPUTDIR)/objs/libzip/inflate$(OBJ_SUFFIX) \
    +      $(JDK_OUTPUTDIR)/objs/libzip/infback$(OBJ_SUFFIX) \
    +      $(JDK_OUTPUTDIR)/objs/libzip/inftrees$(OBJ_SUFFIX) \
    +      $(JDK_OUTPUTDIR)/objs/libzip/inffast$(OBJ_SUFFIX)
     
     endif
     
     ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
    -    UNPACKEXE_CFLAGS += -xregs=no%appl
    -    UNPACKEXE_LDFLAGS_solaris += -xmemalign=4s
    +  UNPACKEXE_CFLAGS += -xregs=no%appl
    +  UNPACKEXE_LDFLAGS_solaris += -xmemalign=4s
     endif
     
    -UNPACKEXE_LANG:=C
    -ifeq ($(OPENJDK_TARGET_OS),solaris)
    -    UNPACKEXE_LANG:=C++
    +UNPACKEXE_LANG := C
    +ifeq ($(OPENJDK_TARGET_OS), solaris)
    +  UNPACKEXE_LANG := C++
     endif
     # On windows, unpack200 is linked completely differently to all other
     # executables, using the compiler with the compiler arguments.
     # It's also linked incrementally, producing a .ilk file that needs to
     # be kept away.
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -    BUILD_UNPACKEXE_LDEXE:=$(CC)
    -    EXE_OUT_OPTION_save:=$(EXE_OUT_OPTION)
    -    EXE_OUT_OPTION:=-Fe
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  BUILD_UNPACKEXE_LDEXE := $(CC)
    +  EXE_OUT_OPTION_save := $(EXE_OUT_OPTION)
    +  EXE_OUT_OPTION := -Fe
     endif
    -$(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\
    -                SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\
    -		EXCLUDE_FILES:=jni.cpp,\
    -		LANG:=$(UNPACKEXE_LANG),\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE)\
    -                        -DFULL, \
    -		CFLAGS_release:=-DPRODUCT,\
    -		CFLAGS_linux:=-fPIC,\
    -		CFLAGS_solaris:=-KPIC, \
    -		CFLAGS_macosx:=-fPIC, \
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers-unpack200,\
    -		LDFLAGS:=$(UNPACKEXE_ZIPOBJS),\
    -		LDFLAGS_windows:=$(CXXFLAGS_JDKEXE),\
    -		LDFLAGS_posix:=$(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
    -			 $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_linux:=-lc,\
    -		LDFLAGS_solaris:=$(UNPACKEXE_LDFLAGS_solaris) -lc,\
    -		LDFLAGS_SUFFIX:=$(LIBCXX),\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR),\
    -		OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR),\
    -		PROGRAM:=unpack200,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=unpack200.exe" \
    -			  -D "JDK_INTERNAL_NAME=unpack200" \
    -			  -D "JDK_FTYPE=0x1L",\
    -	        DEBUG_SYMBOLS:=true,\
    -		MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest))
    +$(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \
    +    SRC := $(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack, \
    +    EXCLUDE_FILES := jni.cpp, \
    +    LANG := $(UNPACKEXE_LANG), \
    +    OPTIMIZATION := LOW, \
    +    CFLAGS := $(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE) \
    +        -DFULL, \
    +    CFLAGS_release := -DPRODUCT, \
    +    CFLAGS_linux := -fPIC, \
    +    CFLAGS_solaris := -KPIC, \
    +    CFLAGS_macosx := -fPIC, \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers-unpack200, \
    +    LDFLAGS := $(UNPACKEXE_ZIPOBJS), \
    +    LDFLAGS_windows := $(CXXFLAGS_JDKEXE), \
    +    LDFLAGS_posix := $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
    +        $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_linux := -lc, \
    +    LDFLAGS_solaris := $(UNPACKEXE_LDFLAGS_solaris) -lc, \
    +    LDFLAGS_SUFFIX := $(LIBCXX), \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR), \
    +    OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR), \
    +    PROGRAM := unpack200, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=unpack200.exe" \
    +        -D "JDK_INTERNAL_NAME=unpack200" \
    +        -D "JDK_FTYPE=0x1L", \
    +    DEBUG_SYMBOLS := true, \
    +    MANIFEST := $(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest))
     
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -    EXE_OUT_OPTION:=$(EXE_OUT_OPTION_save)
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  EXE_OUT_OPTION := $(EXE_OUT_OPTION_save)
     endif
     
     ifneq ($(USE_EXTERNAL_LIBZ), true)
     
    -$(BUILD_UNPACKEXE) : $(UNPACKEXE_ZIPOBJS)
    +  $(BUILD_UNPACKEXE): $(UNPACKEXE_ZIPOBJS)
     
     endif
     
    @@ -515,13 +513,13 @@ BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
     # jdk/make/java/Makefile
     #
     ifeq ($(OPENJDK_TARGET_OS), solaris)
    -	ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
    -		BUILD_JEXEC := 1
    -	endif
    +  ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
    +    BUILD_JEXEC := 1
    +  endif
     endif
     
     ifeq ($(OPENJDK_TARGET_OS), linux)
    -	BUILD_JEXEC := 1
    +  BUILD_JEXEC := 1
     endif # OPENJDK_TARGET_OS
     
     #
    @@ -529,41 +527,41 @@ endif # OPENJDK_TARGET_OS
     #
     ifeq ($(BUILD_JEXEC), 1)
     
    -	ifeq ($(OPENJDK_TARGET_OS),windows)
    -	else ifeq ($(OPENJDK_TARGET_OS),macosx)
    -		BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/macosx/bin
    -	else
    -		BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/solaris/bin
    -	endif
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
    +  else ifeq ($(OPENJDK_TARGET_OS), macosx)
    +    BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/macosx/bin
    +  else
    +    BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/solaris/bin
    +  endif
     
    -	ifeq ($(OPENJDK_TARGET_OS), linux)
    -                BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib
    -		BUILD_JEXEC_INC += -I$(JDK_TOPDIR)/src/share/bin
    -	endif
    +  ifeq ($(OPENJDK_TARGET_OS), linux)
    +    BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib
    +    BUILD_JEXEC_INC += -I$(JDK_TOPDIR)/src/share/bin
    +  endif
     endif
     
     #
     # Note that the two Makefile's seems to contradict each other,
    -#   and that src/macosx/bin/jexec.c seems unused
    +# and that src/macosx/bin/jexec.c seems unused
     #
    -ifneq ($(BUILD_JEXEC_SRC),)
    -        $(eval $(call SetupNativeCompilation,BUILD_JEXEC,\
    -		SRC:=$(BUILD_JEXEC_SRC),\
    -		INCLUDE_FILES:=jexec.c,\
    -		LANG:=C,\
    -		OPTIMIZATION := LOW, \
    -		CFLAGS:=$(CFLAGS_JDKEXE)\
    -                        $(BUILD_JEXEC_INC), \
    -		CFLAGS_linux:=-fPIC,\
    -		CFLAGS_solaris:=-KPIC,\
    -		LDFLAGS:=$(LDFLAGS_JDKEXE) \
    -			 $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/jexec_obj,\
    -		OUTPUT_DIR:=$(BUILD_JEXEC_DST_DIR),\
    -		DEBUG_SYMBOLS:=true,\
    -		PROGRAM:=jexec))
    +ifneq ($(BUILD_JEXEC_SRC), )
    +  $(eval $(call SetupNativeCompilation,BUILD_JEXEC, \
    +      SRC := $(BUILD_JEXEC_SRC), \
    +      INCLUDE_FILES := jexec.c, \
    +      LANG := C, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CFLAGS_JDKEXE) \
    +          $(BUILD_JEXEC_INC), \
    +      CFLAGS_linux := -fPIC, \
    +      CFLAGS_solaris := -KPIC, \
    +      LDFLAGS := $(LDFLAGS_JDKEXE) \
    +          $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/jexec_obj, \
    +      OUTPUT_DIR := $(BUILD_JEXEC_DST_DIR), \
    +      DEBUG_SYMBOLS := true, \
    +      PROGRAM := jexec))
     
    -	BUILD_LAUNCHERS += $(BUILD_JEXEC)
    +  BUILD_LAUNCHERS += $(BUILD_JEXEC)
     endif
     
     ##########################################################################################
    @@ -571,14 +569,12 @@ endif
     #
     # The java-rmi.cgi script in bin/ only gets delivered in certain situations
     #
    -JAVA_RMI_CGI:=$(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/java-rmi.cgi
    +JAVA_RMI_CGI := $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/java-rmi.cgi
     ifeq ($(OPENJDK_TARGET_OS), linux)
       BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
     endif
     ifeq ($(OPENJDK_TARGET_OS), solaris)
    -  ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
    -    BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
    -  endif
    +  BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
     endif
     
     # TODO:
    @@ -588,11 +584,11 @@ endif
     # the final images bin dir. This weird behavior is mimicked here in the converted
     # makefiles for now. Should probably just be deleted.
     # http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6512052
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -    $(eval $(call SetupLauncher,java-rmi,,\
    -        $(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/makefiles/java/main/java/mapfile-$(OPENJDK_TARGET_CPU))))
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  $(eval $(call SetupLauncher,java-rmi, , \
    +      $(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/makefiles/java/main/java/mapfile-$(OPENJDK_TARGET_CPU))))
     else
    -    $(JAVA_RMI_CGI): $(JDK_TOPDIR)/src/solaris/bin/java-rmi.cgi.sh
    +  $(JAVA_RMI_CGI): $(JDK_TOPDIR)/src/solaris/bin/java-rmi.cgi.sh
     	$(call install-file)
     	$(CHMOD) a+x $@
     endif
    @@ -605,67 +601,67 @@ BUILD_JSPAWNHELPER_DST_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
     LINK_JSPAWNHELPER_OBJECTS := $(JDK_OUTPUTDIR)/objs/libjava/childproc.o
     LINK_JSPAWNHELPER_FLAGS :=
     
    -ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx solaris),)
    -    BUILD_JSPAWNHELPER := 1
    +ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx solaris), )
    +  BUILD_JSPAWNHELPER := 1
     endif
     
     ifeq ($(OPENJDK_TARGET_OS), macosx)
    -    BUILD_JSPAWNHELPER_DST_DIR := $(JDK_OUTPUTDIR)/lib
    +  BUILD_JSPAWNHELPER_DST_DIR := $(JDK_OUTPUTDIR)/lib
     endif
     
     ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
    -    LINK_JSPAWNHELPER_FLAGS += -m64
    +  LINK_JSPAWNHELPER_FLAGS += -m64
     endif
     
     ifeq ($(BUILD_JSPAWNHELPER), 1)
    -    $(eval $(call SetupNativeCompilation,BUILD_JSPAWNHELPER,\
    -        SRC:=$(BUILD_JSPAWNHELPER_SRC),\
    -        INCLUDE_FILES:=jspawnhelper.c,\
    -        LANG:=C,\
    -        OPTIMIZATION := LOW, \
    -        CFLAGS:=$(CFLAGS_JDKEXE), \
    -        LDFLAGS:=$(LDFLAGS_JDKEXE) $(LINK_JSPAWNHELPER_FLAGS), \
    -        LDFLAGS_SUFFIX:= $(LINK_JSPAWNHELPER_OBJECTS), \
    -        OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/jspawnhelper,\
    -        OUTPUT_DIR:=$(BUILD_JSPAWNHELPER_DST_DIR),\
    -        PROGRAM:=jspawnhelper))
    +  $(eval $(call SetupNativeCompilation,BUILD_JSPAWNHELPER, \
    +      SRC := $(BUILD_JSPAWNHELPER_SRC), \
    +      INCLUDE_FILES := jspawnhelper.c, \
    +      LANG := C, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CFLAGS_JDKEXE), \
    +      LDFLAGS := $(LDFLAGS_JDKEXE) $(LINK_JSPAWNHELPER_FLAGS), \
    +      LDFLAGS_SUFFIX := $(LINK_JSPAWNHELPER_OBJECTS), \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/jspawnhelper, \
    +      OUTPUT_DIR := $(BUILD_JSPAWNHELPER_DST_DIR), \
    +      PROGRAM := jspawnhelper))
     
    -    $(BUILD_JSPAWNHELPER): $(LINK_JSPAWNHELPER_OBJECTS)
    +  $(BUILD_JSPAWNHELPER): $(LINK_JSPAWNHELPER_OBJECTS)
     
    -    BUILD_LAUNCHERS += $(BUILD_JSPAWNHELPER)
    +  BUILD_LAUNCHERS += $(BUILD_JSPAWNHELPER)
     endif
     
     ##########################################################################################
     # jabswitch
     
     ifndef OPENJDK
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
     
    -    $(eval $(call SetupNativeCompilation,BUILD_JABSWITCH,\
    -		SRC:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge,\
    -		INCLUDE_FILES:=jabswitch.cpp,\
    -		LANG:=C++,\
    -		CFLAGS:=$(filter-out -Zc:wchar_t-,$(CFLAGS_JDKEXE)) -Zc:wchar_t \
    -			-analyze- -Od -Gd -D_WINDOWS \
    -			-D_UNICODE -DUNICODE -RTC1 -EHsc,\
    -		LDFLAGS:=$(LDFLAGS_JDKEXE) \
    -			 Advapi32.lib Version.lib User32.lib,\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/jabswitch,\
    -		OUTPUT_DIR:=$(JDK_OUTPUTDIR)/bin,\
    -		PROGRAM:=jabswitch,\
    -		DEBUG_SYMBOLS:=true,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/AccessBridgeStatusWindow.rc,\
    -		RC_FLAGS:=$(RC_FLAGS),\
    -		MANIFEST:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/jabswitch.manifest))
    +    $(eval $(call SetupNativeCompilation,BUILD_JABSWITCH, \
    +        SRC := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge, \
    +        INCLUDE_FILES := jabswitch.cpp, \
    +        LANG := C++, \
    +        CFLAGS := $(filter-out -Zc:wchar_t-, $(CFLAGS_JDKEXE)) -Zc:wchar_t \
    +            -analyze- -Od -Gd -D_WINDOWS \
    +            -D_UNICODE -DUNICODE -RTC1 -EHsc, \
    +        LDFLAGS := $(LDFLAGS_JDKEXE) \
    +            Advapi32.lib Version.lib User32.lib, \
    +        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/jabswitch, \
    +        OUTPUT_DIR := $(JDK_OUTPUTDIR)/bin, \
    +        PROGRAM := jabswitch, \
    +        DEBUG_SYMBOLS := true, \
    +        VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/AccessBridgeStatusWindow.rc, \
    +        RC_FLAGS := $(RC_FLAGS), \
    +        MANIFEST := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/jabswitch.manifest))
     
         BUILD_LAUNCHERS += $(BUILD_JABSWITCH)
     
    -endif
    +  endif
     endif
     
     ##########################################################################################
     
    -$(BUILD_LAUNCHERS) : $(JDK_TOPDIR)/makefiles/CompileLaunchers.gmk
    +$(BUILD_LAUNCHERS): $(JDK_TOPDIR)/makefiles/CompileLaunchers.gmk
     
     all: $(BUILD_LAUNCHERS)
     
    diff --git a/jdk/makefiles/CompileNativeLibraries.gmk b/jdk/makefiles/CompileNativeLibraries.gmk
    index 8c59cecc4f7..57ef12e32cb 100644
    --- a/jdk/makefiles/CompileNativeLibraries.gmk
    +++ b/jdk/makefiles/CompileNativeLibraries.gmk
    @@ -23,7 +23,7 @@
     # questions.
     #
     
    -defalt: all
    +default: all
     
     include $(SPEC)
     include MakeBase.gmk
    @@ -36,7 +36,7 @@ include Setup.gmk
     include CopyFiles.gmk
     
     # Prepare the find cache. Only used if running on windows.
    -$(eval $(call FillCacheFind,$(JDK_TOPDIR)/src))
    +$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src))
     
     # Build tools
     include Tools.gmk
    @@ -46,3409 +46,46 @@ CFLAGS_JDKLIB += -I$(JDK_OUTPUTDIR)/gensrc_headers
     CXXFLAGS_JDKLIB += -I$(JDK_OUTPUTDIR)/gensrc_headers
     
     # Put the libraries here. Different locations for different target apis.
    -ifeq ($(OPENJDK_TARGET_OS_API),posix)
    -    INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
    +ifeq ($(OPENJDK_TARGET_OS_API), posix)
    +  INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
     else
    -    INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/bin
    +  INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/bin
     endif
     
    -BUILD_LIBRARIES=
    +BUILD_LIBRARIES =
     
     # Absolute paths to lib files on windows for use in LDFLAGS. Should figure out a more
     # elegant solution to this.
    -WIN_VERIFY_LIB := $(JDK_OUTPUTDIR)/objs/libverify/verify.lib
     WIN_JAVA_LIB := $(JDK_OUTPUTDIR)/objs/libjava/java.lib
    -WIN_AWT_LIB := $(JDK_OUTPUTDIR)/objs/libawt/awt.lib
     
     # Use this variable to set DEBUG_SYMBOLS true on windows for all libraries, but
     # not on other platforms.
     ifeq ($(OPENJDK_TARGET_OS), windows)
    -    DEBUG_ALL_BINARIES := true
    +  DEBUG_ALL_BINARIES := true
     endif
     
     # Build everything with debugging on OpenJDK
     ifdef OPENJDK
    -    DEBUG_ALL_BINARIES := true
    -endif
    -
    -#
    -# TODO replace with X_FLAGS / X_LIBS
    -#   and add them to configure
    -#
    -OPENWIN_LIB:=$(OPENWIN_HOME)/lib
    -
    -##########################################################################################
    -
    -BUILD_LIBFDLIBM_OPTIMIZATION:=HIGH
    -
    -ifneq ($(OPENJDK_TARGET_OS), solaris)
    -      BUILD_LIBFDLIBM_OPTIMIZATION:=NONE
    -endif
    -
    -ifneq ($(OPENJDK_TARGET_OS),macosx)
    -$(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM,\
    -                STATIC_LIBRARY:=fdlibm,\
    -                OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs,\
    -                SRC:=$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src,\
    -		LANG:=C,\
    -		OPTIMIZATION:=$(BUILD_LIBFDLIBM_OPTIMIZATION), \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -			-I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include,\
    -		CFLAGS_windows_debug:=-DLOGGING,\
    -		ARFLAGS:=$(ARFLAGS),\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libfdlibm,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -else
    -
    -# 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,\
    -		LANG:=C,\
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -			-I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include,\
    -		LDFLAGS:=-nostdlib -r -arch x86_64,\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libfdlibm,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBFDLIBM := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
    -$(BUILD_LIBFDLIBM) : $(BUILD_LIBFDLIBM_MAC)
    -	$(call install-file)
    -
    -endif
    -BUILD_LIBRARIES += $(BUILD_LIBFDLIBM)
    -
    -##########################################################################################
    -
    -BUILD_LIBVERIFY_SRC:=check_code.c check_format.c
    -
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -	ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    -		BUILD_LIBVERIFY_REORDER:=$(JDK_TOPDIR)/makefiles/mapfiles/libverify/reorder-$(OPENJDK_TARGET_CPU)
    -	endif
    -endif
    -
    -LIBVERIFY_OPTIMIZATION:=HIGH
    -ifneq ($(findstring $(OPENJDK_TARGET_OS),solaris linux),)
    -    ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
    -        LIBVERIFY_OPTIMIZATION:=LOW
    -    endif
    -endif
    -
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY,\
    -		LIBRARY:=verify, \
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(JDK_TOPDIR)/src/share/native/common,\
    -		INCLUDE_FILES:=$(BUILD_LIBVERIFY_SRC),\
    -		LANG:=C,\
    -		OPTIMIZATION:=$(LIBVERIFY_OPTIMIZATION), \
    -		CFLAGS:=$(CFLAGS_JDKLIB),\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libverify/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN), \
    -		LDFLAGS_SUFFIX_posix:=-ljvm -lc,\
    -		LDFLAGS_SUFFIX_windows:=jvm.lib,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS) \
    -			  -D "JDK_FNAME=verify.dll" \
    -			  -D "JDK_INTERNAL_NAME=verify" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		REORDER:=$(BUILD_LIBVERIFY_REORDER),\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libverify,\
    -		DEBUG_SYMBOLS:=true))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBVERIFY)
    -
    -##########################################################################################
    -
    -LIBJAVA_SRC_DIRS:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/lang \
    -		$(JDK_TOPDIR)/src/share/native/java/lang \
    -		$(JDK_TOPDIR)/src/share/native/java/lang/ref \
    -		$(JDK_TOPDIR)/src/share/native/java/lang/reflect \
    -		$(JDK_TOPDIR)/src/share/native/java/io \
    -		$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io \
    -		$(JDK_TOPDIR)/src/share/native/java/nio \
    -		$(JDK_TOPDIR)/src/share/native/java/security \
    -		$(JDK_TOPDIR)/src/share/native/common \
    -		$(JDK_TOPDIR)/src/share/native/sun/misc \
    -		$(JDK_TOPDIR)/src/share/native/sun/reflect \
    -		$(JDK_TOPDIR)/src/share/native/java/util \
    -		$(JDK_TOPDIR)/src/share/native/java/util/concurrent/atomic \
    -		$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \
    -		$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/util
    -
    -ifneq ($(OPENJDK_TARGET_OS),macosx)
    -    LIBJAVA_SRC_DIRS+=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/util/locale/provider
    -else
    -    LIBJAVA_SRC_DIRS+=$(JDK_TOPDIR)/src/macosx/native/sun/util/locale/provider
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -    LIBJAVA_SRC_DIRS+=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/provider \
    -		$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/io
    -endif
    -
    -LIBJAVA_CFLAGS:=$(foreach dir,$(LIBJAVA_SRC_DIRS),-I$(dir)) \
    -		  -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include \
    -                  -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
    -
    -LIBJAVA_CFLAGS += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
    -                  -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
    -                  -DJDK_MICRO_VERSION='"$(JDK_MICRO_VERSION)"' \
    -                  -DJDK_BUILD_NUMBER='"$(JDK_BUILD_NUMBER)"'
    -
    -ifneq (,$(JDK_UPDATE_VERSION))
    -	LIBJAVA_CFLAGS += -DJDK_UPDATE_VERSION='"$(JDK_UPDATE_VERSION)"'
    -endif
    -
    -LIBJAVA_EXCLUDE_FILES:=check_code.c check_format.c jspawnhelper.c
    -
    -ifneq ($(OPENJDK_TARGET_OS),macosx)
    -	LIBJAVA_EXCLUDE_FILES += java_props_macosx.c
    -else
    -	BUILD_LIBJAVA_java_props_md.c_CFLAGS:=-x objective-c
    -        BUILD_LIBJAVA_java_props_macosx.c_CFLAGS:=-x objective-c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -        LIBJAVA_EXCLUDE_FILES += \
    -		UNIXProcess_md.c \
    -		UnixFileSystem_md.c \
    -		FileSystemPreferences.c
    -else
    -	LIBJAVA_EXCLUDE_FILES += \
    -		ProcessImpl_md.c \
    -		WinNTFileSystem_md.c \
    -		dirent_md.c \
    -		WindowsPreferences.c \
    -		sun/security/provider/WinCAPISeedGenerator.c \
    -		sun/io/Win32ErrorMode.c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -    ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    -        LIBJAVA_REORDER:=$(JDK_TOPDIR)/makefiles/mapfiles/libjava/reorder-$(OPENJDK_TARGET_CPU)
    -    endif
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA,\
    -		LIBRARY:=java,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(LIBJAVA_SRC_DIRS),\
    -		EXCLUDES:=fdlibm/src zip, \
    -		EXCLUDE_FILES:=$(LIBJAVA_EXCLUDE_FILES), \
    -		LANG:=C,\
    -		OPTIMIZATION:=HIGH, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -                        $(LIBJAVA_CFLAGS),\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjava/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN), \
    -		LDFLAGS_SUFFIX_posix:=-ljvm -lverify, \
    -		LDFLAGS_SUFFIX_solaris:=-lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc,\
    -		LDFLAGS_SUFFIX_linux:=$(LIBDL) $(BUILD_LIBFDLIBM),\
    -		LDFLAGS_SUFFIX_macosx:=-L$(JDK_OUTPUTDIR)/objs/ -lfdlibm \
    -                                         -framework CoreFoundation \
    -                                         -framework Foundation \
    -                                         -framework Security -framework SystemConfiguration, \
    -		LDFLAGS_SUFFIX_windows:=-export:winFileHandleOpen -export:handleLseek \
    -					jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \
    -					shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \
    -					advapi32.lib,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=java.dll" \
    -			  -D "JDK_INTERNAL_NAME=java" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		REORDER:=$(LIBJAVA_REORDER), \
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjava,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJAVA)
    -
    -$(BUILD_LIBJAVA) : $(LIBJLI_BINARY)
    -
    -$(BUILD_LIBJAVA) : $(BUILD_LIBVERIFY)
    -
    -$(BUILD_LIBJAVA) : $(BUILD_LIBFDLIBM)
    -
    -##########################################################################################
    -
    -BUILD_LIBMLIB_SRC:=$(JDK_TOPDIR)/src/share/native/sun/awt/medialib
    -BUILD_LIBMLIB_CFLAGS:=-D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
    -			-I$(BUILD_LIBMLIB_SRC) \
    -			-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/medialib
    -
    -BUILD_LIBMLIB_LDLIBS:=
    -BUILD_LIBMLIB_IMAGE_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libmlib_image/mapfile-vers
    -
    -BUILD_LIBMLIB_CFLAGS += -DMLIB_NO_LIBSUNMATH
    -
    -ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
    -	BUILD_LIBMLIB_CFLAGS += -DMLIB_OS64BIT
    -endif
    -
    -ifneq ($(OPENJDK_TARGET_OS), windows)
    -	BUILD_LIBMLIB_LDLIBS += $(LIBM) $(LIBDL)
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE,\
    -		LIBRARY:=mlib_image,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(BUILD_LIBMLIB_SRC),\
    -		EXCLUDE_FILES:=awt_ImagingLib.c mlib_c_ImageBlendTable.c,\
    -		LANG:=C,\
    -		OPTIMIZATION:=HIGHEST, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -                        $(BUILD_LIBMLIB_CFLAGS),\
    -		MAPFILE:=$(BUILD_LIBMLIB_IMAGE_MAPFILE), \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX:=$(BUILD_LIBMLIB_LDLIBS) \
    -				$(LDFLAGS_JDKLIB_SUFFIX),\
    -		LDFLAGS_SUFFIX_solaris:=-lc, \
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=mlib_image.dll" \
    -			  -D "JDK_INTERNAL_NAME=mlib_image" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libmlib_image,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBMLIB_IMAGE) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE)
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH),solaris-sparc)
    -
    -BUILD_LIBMLIB_IMAGE_V_FILES:=\
    -        mlib_v_ImageLookUp.c \
    -        mlib_ImageCreate.c \
    -        mlib_ImageAffine.c \
    -        mlib_ImageConvMxN.c \
    -        mlib_ImageConvKernelConvert.c \
    -        mlib_sys.c \
    -        mlib_ImageLookUp_64.c \
    -        mlib_ImageLookUp_Bit.c \
    -        mlib_ImageColorTrue2Index.c \
    -        mlib_c_ImageThresh1_U8.c \
    -        mlib_v_ImageLookUpS16S16Func.c \
    -        mlib_v_ImageLookUpS16S32Func.c \
    -        mlib_v_ImageLookUpS16U16Func.c \
    -        mlib_v_ImageLookUpS16U8Func.c \
    -        mlib_v_ImageLookUpS32S16Func.c \
    -        mlib_v_ImageLookUpS32S32Func.c \
    -        mlib_v_ImageLookUpS32U16Func.c \
    -        mlib_v_ImageLookUpS32U8Func.c \
    -        mlib_v_ImageLookUpSIS16S16Func.c \
    -        mlib_v_ImageLookUpSIS16S32Func.c \
    -        mlib_v_ImageLookUpSIS16U16Func.c \
    -        mlib_v_ImageLookUpSIS16U8Func.c \
    -        mlib_v_ImageLookUpSIS32S16Func.c \
    -        mlib_v_ImageLookUpSIS32S32Func.c \
    -        mlib_v_ImageLookUpSIS32U16Func.c \
    -        mlib_v_ImageLookUpSIS32U8Func.c \
    -        mlib_v_ImageLookUpSIU16S16Func.c \
    -        mlib_v_ImageLookUpSIU16S32Func.c \
    -        mlib_v_ImageLookUpSIU16U16Func.c \
    -        mlib_v_ImageLookUpSIU16U8Func.c \
    -        mlib_v_ImageLookUpSIU8S16Func.c \
    -        mlib_v_ImageLookUpSIU8S32Func.c \
    -        mlib_v_ImageLookUpSIU8U16Func.c \
    -        mlib_v_ImageLookUpSIU8U8Func.c \
    -        mlib_v_ImageLookUpU16S16Func.c \
    -        mlib_v_ImageLookUpU16S32Func.c \
    -        mlib_v_ImageLookUpU16U16Func.c \
    -        mlib_v_ImageLookUpU16U8Func.c \
    -        mlib_v_ImageLookUpU8S16Func.c \
    -        mlib_v_ImageLookUpU8S32Func.c \
    -        mlib_v_ImageLookUpU8U16Func.c \
    -        mlib_v_ImageLookUpU8U8Func.c \
    -        mlib_v_ImageAffineIndex_BC.c \
    -        mlib_v_ImageAffine_BC.c \
    -        mlib_v_ImageAffine_BC_S16.c \
    -        mlib_v_ImageAffine_BC_U16.c \
    -        mlib_v_ImageAffine_BL.c \
    -        mlib_v_ImageAffine_BL_S16.c \
    -        mlib_v_ImageAffine_BL_U16.c \
    -        mlib_v_ImageAffine_NN.c \
    -        mlib_v_ImageFilters.c \
    -        mlib_ImageAffineEdge.c \
    -        mlib_ImageAffine_BC_D64.c \
    -        mlib_ImageAffine_BC_F32.c \
    -        mlib_ImageAffine_BC_S32.c \
    -        mlib_ImageAffine_BL_D64.c \
    -        mlib_ImageAffine_BL_F32.c \
    -        mlib_ImageAffine_BL_S32.c \
    -        mlib_ImageAffine_NN.c \
    -        mlib_ImageAffine_NN_Bit.c \
    -        mlib_ImageFilters.c \
    -        mlib_ImageScanPoly.c \
    -        mlib_ImageConv_8nw.c \
    -        mlib_ImageConv_8ext.c \
    -        mlib_ImageConv_16nw.c \
    -        mlib_ImageConv_16ext.c \
    -        mlib_ImageConv_u16nw.c \
    -        mlib_ImageConv_u16ext.c \
    -        mlib_ImageConv_32nw.c \
    -        mlib_ImageConv_F32nw.c \
    -        mlib_ImageConvMxN_Fp.c \
    -        mlib_ImageConvMxN_ext.c \
    -        mlib_ImageConv_D64nw.c \
    -        mlib_ImageClipping.c \
    -        mlib_ImageConvCopyEdge_Bit.c \
    -        mlib_ImageConvClearEdge_Bit.c \
    -        mlib_ImageConv2x2_f.c \
    -        mlib_ImageConvClearEdge_Fp.c \
    -        mlib_v_ImageConvMxN_8.c \
    -        mlib_v_ImageConvClearEdge.c \
    -        mlib_v_ImageConvCopyEdge.c \
    -        mlib_v_ImageConvMxN_8ext.c \
    -        mlib_v_ImageConvVersion.c \
    -        mlib_v_ImageConv_8nw.c \
    -        mlib_ImageConvCopyEdge_Fp.c \
    -        mlib_v_ImageChannelInsert_1.c \
    -        mlib_v_ImageChannelExtract_43.c \
    -        mlib_v_ImageChannelExtract_1.c \
    -        mlib_ImageCopy_Bit.c \
    -        mlib_v_ImageCopy_f.c \
    -        mlib_ImageUtils.c \
    -        mlib_ImageDivTables.c
    -
    -BUILD_LIBMLIB_V_CFLAGS := $(filter-out -DMLIB_NO_LIBSUNMATH,$(BUILD_LIBMLIB_CFLAGS))
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE_V,\
    -		LIBRARY:=mlib_image_v, \
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(JDK_TOPDIR)/src/share/native/sun/awt/medialib \
    -		     $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib,\
    -		LANG:=C,\
    -		INCLUDE_FILES:=$(BUILD_LIBMLIB_IMAGE_V_FILES),\
    -		OPTIMIZATION:=HIGHEST, \
    -		CFLAGS:=-xarch=sparcvis \
    -                      $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(OPENJDK_TARGET_CPU_BITS).il\
    -                      $(BUILD_LIBMLIB_V_CFLAGS) \
    -                      $(CFLAGS_JDKLIB), \
    -		MAPFILE:=$(BUILD_LIBMLIB_IMAGE_MAPFILE), \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -                         $(BUILD_LIBMLIB_LDLIBS) -ljava -ljvm \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX_solaris:=-lc,\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libmlib_image_v,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBMLIB_IMAGE_V): $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE_V)
    -
    +  DEBUG_ALL_BINARIES := true
     endif
     
     ##########################################################################################
     
    -LIBAWT_DIRS:=\
    -	$(JDK_TOPDIR)/src/share/native/sun/awt \
    -	$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
    -	$(JDK_TOPDIR)/src/share/native/sun/awt/image \
    -	$(JDK_TOPDIR)/src/share/native/sun/awt/image/gif \
    -	$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    -	$(JDK_TOPDIR)/src/share/native/sun/awt/medialib \
    -	$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -	$(JDK_TOPDIR)/src/share/native/sun/awt/utility \
    -	$(JDK_TOPDIR)/src/share/native/sun/java2d \
    -	$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    -	$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    -	$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    -	$(JDK_TOPDIR)/src/share/native/sun/awt/image \
    -	$(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
    -	$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/opengl \
    -	$(JDK_TOPDIR)/src/share/native/sun/font
    +include lib/CoreLibraries.gmk
     
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -    LIBAWT_DIRS+=\
    -	$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
    -	$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows \
    -	$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/d3d
    -else
    -    LIBAWT_DIRS+=\
    -	$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11
    -endif
    +include lib/PlatformLibraries.gmk
     
    -LIBAWT_CFLAGS+=-D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES \
    -	$(X_CFLAGS) \
    -	$(foreach dir,$(LIBAWT_DIRS),-I$(dir))
    +include lib/NetworkingLibraries.gmk
     
    -LIBAWT_FILES:=\
    -	gifdecoder.c \
    -	imageInitIDs.c \
    -	img_globals.c \
    -	SurfaceData.c \
    -	Region.c \
    -	BufImgSurfaceData.c \
    -	Disposer.c \
    -	Trace.c \
    -	GraphicsPrimitiveMgr.c \
    -	Blit.c \
    -	BlitBg.c \
    -	ScaledBlit.c \
    -	FillRect.c \
    -	FillSpans.c \
    -	FillParallelogram.c \
    -	DrawParallelogram.c \
    -	DrawLine.c \
    -	DrawRect.c \
    -	DrawPolygons.c \
    -	DrawPath.c \
    -	FillPath.c \
    -	ProcessPath.c \
    -	MaskBlit.c \
    -	MaskFill.c \
    -	TransformHelper.c \
    -	AlphaMath.c \
    -	AlphaMacros.c \
    -	AnyByte.c \
    -	ByteBinary1Bit.c \
    -	ByteBinary2Bit.c \
    -	ByteBinary4Bit.c \
    -	ByteIndexed.c \
    -	ByteGray.c \
    -	Index8Gray.c \
    -	Index12Gray.c \
    -	AnyShort.c \
    -	Ushort555Rgb.c \
    -	Ushort565Rgb.c \
    -	Ushort4444Argb.c \
    -	Ushort555Rgbx.c \
    -	UshortGray.c \
    -	UshortIndexed.c \
    -	Any3Byte.c \
    -	ThreeByteBgr.c \
    -	AnyInt.c \
    -	IntArgb.c \
    -	IntArgbPre.c \
    -	IntArgbBm.c \
    -	IntRgb.c \
    -	IntBgr.c \
    -	IntRgbx.c \
    -	Any4Byte.c \
    -	FourByteAbgr.c \
    -	FourByteAbgrPre.c \
    -	BufferedMaskBlit.c \
    -	BufferedRenderPipe.c \
    -	ShapeSpanIterator.c \
    -	SpanClipRenderer.c \
    -	awt_ImageRep.c \
    -	awt_ImagingLib.c \
    -	awt_Mlib.c \
    -	awt_parseImage.c \
    -	DataBufferNative.c \
    -	dither.c \
    -	debug_assert.c \
    -	debug_mem.c \
    -	debug_trace.c \
    -	debug_util.c
    +include lib/NioLibraries.gmk
     
    -ifneq (,$(filter $(OPENJDK_TARGET_OS), solaris linux))
    -	LIBAWT_FILES += awt_LoadLibrary.c initIDs.c img_colors.c
    -endif
    +include lib/SecurityLibraries.gmk
     
    -ifeq ($(OPENJDK_TARGET_OS),macosx)
    -	LIBAWT_FILES += awt_LoadLibrary.c img_colors.c
    -	LIBAWT_DIRS += $(JDK_TOPDIR)/src/macosx/native/com/apple/resources
    -	LIBAWT_FILES += awt_LoadLibrary.c MacOSXResourceBundle.m
    -	LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks
    +include lib/ServiceabilityLibraries.gmk
     
    -	LIBAWT_MacOSXResourceBundle.m_CFLAGS:=-O0
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
    -        LIBAWT_CFLAGS += -DMLIB_ADD_SUFF
    -        LIBAWT_CFLAGS += -xarch=sparcvis
    -	LIBAWT_CFLAGS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(OPENJDK_TARGET_CPU_BITS).il
    -        LIBAWT_CFLAGS += \
    -            -I$(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \
    -            -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/medialib \
    -            -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops
    -
    -	LIBAWT_DIRS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \
    -                       $(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops
    -
    -	LIBAWT_FILES += \
    -                vis_FuncArray.c           \
    -                java2d_Mlib.c             \
    -                mlib_ImageCreate.c        \
    -                mlib_ImageZoom_NN.c       \
    -                mlib_ImageCopy_Bit.c      \
    -                mlib_sys.c                \
    -                mlib_v_ImageClear.c       \
    -                mlib_v_ImageClear_f.c     \
    -                mlib_v_ImageConstXor.c    \
    -                mlib_v_ImageCopy.c        \
    -                mlib_v_ImageCopy_f.c      \
    -                mlib_v_ImageXor.c         \
    -                mlib_v_ImageZoom_NN_f.c   \
    -                vis_Interp.c              \
    -                vis_AlphaMacros.c         \
    -                vis_AlphaMaskBlit.c       \
    -                vis_AlphaMaskFill.c       \
    -                vis_ByteGray.c            \
    -                vis_ByteGray_FromRgb.c    \
    -                vis_ByteGray_Mask.c       \
    -                vis_ByteIndexed.c         \
    -                vis_DrawLine.c            \
    -                vis_FourByteAbgr.c        \
    -                vis_IntArgb.c             \
    -                vis_IntArgbPre.c          \
    -                vis_IntArgbPre_Mask.c     \
    -                vis_IntBgr.c              \
    -                vis_IntRgb.c              \
    -                vis_IntRgbx.c             \
    -                vis_SrcMaskFill.c         \
    -                vis_SrcOverMaskBlit.c     \
    -                vis_SrcOverMaskFill.c     \
    -                vis_FourByteAbgrPre.c     \
    -                vis_GlyphList.c           \
    -                vis_GlyphListXor.c        \
    -                vis_IntArgbBm.c           \
    -                vis_ThreeByteBgr.c        \
    -                vis_UshortGray.c          \
    -                vis_UshortGray_FromRgb.c  \
    -                vis_XorBlit.c             \
    -                mlib_v_ImageCopy_blk.s
    -
    -	ifeq ($(OPENJDK_TARGET_CPU),sparcv9)
    -		LIBAWT_ASFLAGS=-P -xarch=v9a
    -	else
    -		LIBAWT_ASFLAGS=-P -xarch=v8plusa
    -	endif
    -else
    -	LIBAWT_FILES += MapAccelFunc.c
    -endif
    -
    -ifneq ($(OPENJDK_TARGET_OS),solaris)
    -	LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
    -endif
    -
    -LIBAWT_LANG:=C
    -
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -	LIBAWT_FILES += AccelGlyphCache.c \
    -			ShaderList.c \
    -			CmdIDList.cpp \
    -			Hashtable.cpp \
    -			GDIHashtable.cpp \
    -			Devices.cpp \
    -			ObjectList.cpp \
    -			GDIBlitLoops.cpp \
    -			GDIRenderer.cpp \
    -			GDIWindowSurfaceData.cpp \
    -			WindowsFlags.cpp \
    -			WPrinterJob.cpp \
    -			awt_%.cpp \
    -			D3DBlitLoops.cpp \
    -			D3DBufImgOps.cpp \
    -			D3DContext.cpp \
    -			D3DGlyphCache.cpp \
    -			D3DGraphicsDevice.cpp \
    -			D3DMaskBlit.cpp \
    -			D3DMaskCache.cpp \
    -			D3DMaskFill.cpp \
    -			D3DPipelineManager.cpp \
    -			D3DPaints.cpp \
    -			D3DRenderer.cpp \
    -			D3DRenderQueue.cpp \
    -			D3DResourceManager.cpp \
    -			D3DSurfaceData.cpp \
    -			D3DTextRenderer.cpp \
    -			D3DVertexCacher.cpp \
    -			ShellFolder2.cpp \
    -			ThemeReader.cpp \
    -			ComCtl32Util.cpp \
    -			DllUtil.cpp \
    -			initIDs.cpp \
    -			MouseInfo.cpp \
    -			rect.c \
    -			OGLBlitLoops.c \
    -			OGLBufImgOps.c \
    -		        OGLContext.c \
    -		        OGLFuncs.c \
    -		        OGLMaskBlit.c \
    -		        OGLMaskFill.c \
    -		        OGLPaints.c \
    -		        OGLRenderQueue.c \
    -		        OGLRenderer.c \
    -		        OGLSurfaceData.c \
    -		        OGLTextRenderer.c \
    -		        OGLVertexCache.c \
    -		        WGLGraphicsConfig.c \
    -		        WGLSurfaceData.c
    -	LIBAWT_LANG:=C++
    -	LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
    -	ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
    -		LIBAWT_CFLAGS += -DMLIB_OS64BIT
    -	endif
    -
    -	ifdef OPENJDK
    -		LIBAWT_RC_FLAGS:=-i "$(JDK_TOPDIR)/src/windows/resource/icons"
    -	else
    -		LIBAWT_RC_FLAGS:=-i "$(JDK_TOPDIR)/src/closed/windows/native/sun/windows"
    -	endif
    -	LIBAWT_VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/native/sun/windows/awt.rc
    -endif
    -
    -ifeq ($(MILESTONE), internal)
    -	LIBAWT_CFLAGS += -DINTERNAL_BUILD
    -endif
    -
    -LIBAWT_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libawt/mapfile-vers
    -ifeq ($(OPENJDK_TARGET_OS),linux)
    -	LIBAWT_MAPFILE:=
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBAWT,\
    -		LIBRARY:=awt,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(LIBAWT_DIRS),\
    -		INCLUDE_FILES:=$(LIBAWT_FILES),\
    -		LANG:=$(LIBAWT_LANG),\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS),\
    -		ASFLAGS:=$(LIBAWT_ASFLAGS),\
    -		MAPFILE:=$(LIBAWT_MAPFILE), \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_solaris:=-R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR),\
    -		LDFLAGS_SUFFIX_linux:=-ljvm $(LIBM) $(LIBDL) -ljava,\
    -		LDFLAGS_SUFFIX_solaris:=-ljvm $(LIBM) $(LIBDL) -ljava -lc,\
    -		LDFLAGS_SUFFIX_macosx:=-lmlib_image -ljvm $(LIBM) \
    -				       -framework Cocoa \
    -				       -framework OpenGL \
    -				       -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -				       -framework JavaNativeFoundation \
    -				       -framework JavaRuntimeSupport \
    -				       -framework ApplicationServices \
    -				       -framework AudioToolbox \
    -				       -ljava,\
    -		LDFLAGS_SUFFIX_windows:=kernel32.lib user32.lib gdi32.lib winspool.lib \
    -					imm32.lib ole32.lib uuid.lib shell32.lib \
    -					comdlg32.lib winmm.lib comctl32.lib shlwapi.lib \
    -					delayimp.lib jvm.lib $(WIN_JAVA_LIB) advapi32.lib \
    -					-DELAYLOAD:user32.dll -DELAYLOAD:gdi32.dll \
    -					-DELAYLOAD:shell32.dll -DELAYLOAD:winmm.dll \
    -					-DELAYLOAD:winspool.drv -DELAYLOAD:imm32.dll \
    -					-DELAYLOAD:ole32.dll -DELAYLOAD:comdlg32.dll \
    -					-DELAYLOAD:comctl32.dll -DELAYLOAD:shlwapi.dll,\
    -		VERSIONINFO_RESOURCE:=$(LIBAWT_VERSIONINFO_RESOURCE),\
    -		RC_FLAGS:=$(RC_FLAGS) $(LIBAWT_RC_FLAGS) \
    -			  -D "JDK_FNAME=awt.dll" \
    -			  -D "JDK_INTERNAL_NAME=awt" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libawt,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBAWT) : $(BUILD_LIBJAVA)
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -$(BUILD_LIBAWT) : $(BUILD_LIBMLIB_IMAGE)
    -endif
    -
    -BUILD_LIBRARIES += $(BUILD_LIBAWT)
    -
    -##########################################################################################
    -
    -# TODO!!
    -# Even though this variable as a general name, it is
    -# only used on macos, in fontpath.c, as prefix for where to find fonts.
    -#
    -# It's used for libawt_headless _and_ libawt_xawt
    -#
    -X11_PATH:=/usr/X11R6
    -
    -ifneq ($(OPENJDK_TARGET_OS), windows)
    -ifndef BUILD_HEADLESS_ONLY
    -
    -LIBAWT_XAWT_DIRS:=\
    -		$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -		$(JDK_TOPDIR)/src/share/native/sun/awt/utility \
    -		$(JDK_TOPDIR)/src/share/native/sun/font \
    -		$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font \
    -		$(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
    -		$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
    -		$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/opengl \
    -		$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11 \
    -		$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/xawt \
    -
    -LIBAWT_XAWT_CFLAGS:=-DXAWT -DXAWT_HACK \
    -        -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
    -	$(CUPS_CFLAGS) \
    -	$(foreach dir,$(LIBAWT_XAWT_DIRS),-I$(dir)) \
    -	-I$(JDK_TOPDIR)/src/share/native/sun/java2d \
    -	-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    -	-I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    -	-I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    -	-I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
    -	-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    -	-I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -	-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga
    -
    -ifeq ($(OPENJDK_TARGET_OS),solaris)
    -	LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS),linux)
    -ifndef OPENJDK
    -include $(JDK_TOPDIR)/make/closed/xawt.gmk
    -endif
    -
    -ifeq ($(DISABLE_XRENDER),true)
    -	LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
    -endif
    -endif
    -
    -ifeq ($(MILESTONE),internal)
    -	LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD
    -endif
    -
    -LIBAWT_XAWT_FILES:=\
    -	XlibWrapper.c \
    -	XWindow.c \
    -	XToolkit.c \
    -	X11Color.c \
    -	X11SurfaceData.c \
    -	awt_GraphicsEnv.c \
    -	awt_InputMethod.c \
    -	robot_common.c \
    -	awt_Robot.c \
    -        list.c \
    -        multiVis.c \
    -	initIDs.c \
    -	awt_util.c \
    -	awt_Desktop.c \
    -	awt_UNIXToolkit.c \
    -	X11FontScaler_md.c \
    -	X11TextRenderer_md.c \
    -	fontpath.c \
    -	awt_Insets.c \
    -	awt_Event.c \
    -	X11Renderer.c \
    -	X11PMBlitLoops.c \
    -	OGLBlitLoops.c \
    -	OGLBufImgOps.c \
    -	OGLContext.c \
    -	OGLFuncs.c \
    -	OGLMaskBlit.c \
    -	OGLMaskFill.c \
    -	OGLPaints.c \
    -	OGLRenderQueue.c \
    -	OGLRenderer.c \
    -	OGLSurfaceData.c \
    -	OGLTextRenderer.c \
    -	OGLVertexCache.c \
    -	GLXGraphicsConfig.c \
    -	GLXSurfaceData.c \
    -	AccelGlyphCache.c \
    -	awt_Font.c \
    -	multi_font.c \
    -	awt_AWTEvent.c \
    -	awt_DrawingSurface.c \
    -	jawt.c \
    -	CUPSfuncs.c \
    -	debug_assert.c \
    -	debug_mem.c \
    -	debug_trace.c \
    -	debug_util.c \
    -	awt_Plugin.c \
    -        gnome_interface.c \
    -	gtk2_interface.c \
    -        swing_GTKEngine.c \
    -        swing_GTKStyle.c \
    -        rect.c \
    -	sun_awt_X11_GtkFileDialogPeer.c \
    -	XRSurfaceData.c \
    -	XRBackendNative.c
    -
    -LIBAWT_XAWT_LDFLAGS_SUFFIX:=$(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi  -ljava -ljvm -lc
    -
    -ifeq ($(OPENJDK_TARGET_OS), linux)
    -        # To match old build, add this to LDFLAGS instead of suffix.
    -	LIBAWT_XAWT_LDFLAGS += -lpthread
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -	LIBAWT_XAWT_LDFLAGS_SUFFIX += -lpthread
    -endif
    -
    -# On macosx, the shared library origin is set twice for this lib.
    -$(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT,\
    -		LIBRARY:=awt_xawt,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(LIBAWT_XAWT_DIRS),\
    -		INCLUDE_FILES:=$(LIBAWT_XAWT_FILES),\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
    -                        $(X_CFLAGS),\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libawt_xawt/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(X_LIBS) $(LIBAWT_XAWT_LDFLAGS),\
    -		LDFLAGS_linux:=$(call SET_SHARED_LIBRARY_ORIGIN) \
    -			       $(call SET_SHARED_LIBRARY_ORIGIN,/..),\
    -		LDFLAGS_solaris:=-L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \
    -				 -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \
    -				 -R$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \
    -				 -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \
    -				 -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \
    -			 	 $(call SET_SHARED_LIBRARY_ORIGIN) \
    -			 	 $(call SET_SHARED_LIBRARY_ORIGIN,/..),\
    -		LDFLAGS_macosx:=$(call SET_SHARED_LIBRARY_ORIGIN) \
    -				$(call SET_SHARED_LIBRARY_ORIGIN). \
    -				$(call SET_SHARED_LIBRARY_ORIGIN) \
    -				$(call SET_SHARED_LIBRARY_ORIGIN).,\
    -		LDFLAGS_SUFFIX:=$(LIBAWT_XAWT_LDFLAGS_SUFFIX),\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=xawt.dll" \
    -			  -D "JDK_INTERNAL_NAME=xawt" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libawt_xawt,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBAWT_XAWT) : $(BUILD_LIBJAVA)
    -
    -$(BUILD_LIBAWT_XAWT) : $(BUILD_LIBAWT)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBAWT_XAWT)
    -
    -endif
    -endif
    -
    -##########################################################################################
    -
    -BUILD_LIBZIP_EXCLUDES :=
    -ifeq ($(USE_EXTERNAL_LIBZ),true)
    -    LIBZ := -lz
    -    LIBZIP_EXCLUDES += zlib-1.2.5
    -else
    -    ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
    -endif
    -
    -BUILD_LIBZIP_REORDER :=
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -    ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    -        BUILD_LIBZIP_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libzip/reorder-$(OPENJDK_TARGET_CPU)
    -    endif
    -endif
    -
    -ifeq ($(LIBZIP_CAN_USE_MMAP), true)
    -     BUILD_LIBZIP_MMAP := -DUSE_MMAP
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBZIP,\
    -                LIBRARY:=zip,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		SRC:=$(JDK_TOPDIR)/src/share/native/java/util/zip,\
    -		EXCLUDES:=$(LIBZIP_EXCLUDES),\
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -                        $(ZLIB_CPPFLAGS) \
    -		        -I$(JDK_TOPDIR)/src/share/native/java/io \
    -                        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io,\
    -		CFLAGS_posix:=$(BUILD_LIBZIP_MMAP) -UDEBUG,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libzip/mapfile-vers, \
    -		REORDER:=$(BUILD_LIBZIP_REORDER), \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN) \
    -			 $(EXPORT_ZIP_FUNCS), \
    -		LDFLAGS_windows:=-export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \
    -                                -export:ZIP_ReadEntry -export:ZIP_GetNextEntry jvm.lib \
    -                                $(WIN_JAVA_LIB),\
    -		LDFLAGS_SUFFIX_linux:=-ljvm -ljava $(LIBZ),\
    -		LDFLAGS_SUFFIX_solaris:=-ljvm -ljava $(LIBZ) -lc,\
    -		LDFLAGS_SUFFIX_macosx:=$(LIBZ) -ljava -ljvm,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=zip.dll" \
    -			  -D "JDK_INTERNAL_NAME=zip" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libzip,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBZIP) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBZIP)
    -
    -##########################################################################################
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK,\
    -		LIBRARY:=unpack, \
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\
    -		EXCLUDE_FILES:=main.cpp,\
    -		LANG:=C++,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CXXFLAGS_JDKLIB) \
    -			 -DNO_ZLIB -DUNPACK_JNI -DFULL,\
    -		CFLAGS_release:=-DPRODUCT,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_windows:=-map:$(JDK_OUTPUTDIR)/objs/unpack.map -debug \
    -				jvm.lib $(WIN_JAVA_LIB),\
    -		LDFLAGS_SUFFIX_posix:=-ljvm $(LIBCXX) -ljava -lc,\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libunpack,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=unpack.dll" \
    -			  -D "JDK_INTERNAL_NAME=unpack" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBUNPACK) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBUNPACK)
    -
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -    $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.map: $(BUILD_LIBUNPACK)
    -	$(ECHO) Copying $(@F)
    -	$(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX),%.map,$<) $@
    -
    -    $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.pdb: $(BUILD_LIBUNPACK)
    -	$(ECHO) Copying $(@F)
    -	$(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX),%.pdb,$<) $@
    -endif
    -
    -##########################################################################################
    -
    -LIBATTACH_EXCLUDE_FILES:=
    -ifneq ($(OPENJDK_TARGET_OS),solaris)
    -    LIBATTACH_EXCLUDE_FILES+=SolarisVirtualMachine.c
    -endif
    -ifneq ($(OPENJDK_TARGET_OS),linux)
    -    LIBATTACH_EXCLUDE_FILES+=LinuxVirtualMachine.c
    -endif
    -ifneq ($(OPENJDK_TARGET_OS),macosx)
    -    LIBATTACH_EXCLUDE_FILES+=BsdVirtualMachine.c
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBATTACH,\
    -		LIBRARY:=attach, \
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/tools/attach,\
    -		EXCLUDE_FILES:=$(LIBATTACH_EXCLUDE_FILES),\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB),\
    -		CFLAGS_windows:=/Gy,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libattach/mapfile-$(OPENJDK_TARGET_OS), \
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS) \
    -			  -D "JDK_FNAME=attach.dll" \
    -			  -D "JDK_INTERNAL_NAME=attach" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_solaris:=-ldoor,\
    -		LDFLAGS_windows:=/ORDER:@$(JDK_TOPDIR)/makefiles/mapfiles/libattach/reorder-windows-$(OPENJDK_TARGET_CPU),\
    -		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
    -		LDFLAGS_SUFFIX_windows:=$(WIN_JAVA_LIB) advapi32.lib psapi.lib,\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libattach,\
    -		DEBUG_SYMBOLS:=true))
    -
    -$(BUILD_LIBATTACH) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBATTACH)
    -
    -##########################################################################################
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBDT_SOCKET,\
    -		LIBRARY:=dt_socket,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(JDK_TOPDIR)/src/share/transport/socket \
    -			$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/socket,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) -DUSE_MMAP \
    -                        -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \
    -                        -I$(JDK_TOPDIR)/src/share/transport/socket \
    -		        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/socket \
    -                        -I$(JDK_TOPDIR)/src/share/back/export \
    -                        -I$(JDK_TOPDIR)/src/share/back,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libdt_socket/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN), \
    -		LDFLAGS_SUFFIX_linux:=-lpthread,\
    -		LDFLAGS_SUFFIX_solaris:=-lnsl -lsocket -lc,\
    -		LDFLAGS_SUFFIX_windows:=$(LDFLAGS_JDKLIB_SUFFIX) -export:jdwpTransport_OnLoad ws2_32.lib,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=dt_socket.dll" \
    -			  -D "JDK_INTERNAL_NAME=dt_socket" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libdt_socket,\
    -		DEBUG_SYMBOLS:=true))
    -
    -$(BUILD_LIBDT_SOCKET) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBDT_SOCKET)
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBDT_SHMEM,\
    -		LIBRARY:=dt_shmem,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/tools/jdi \
    -			$(JDK_TOPDIR)/src/share/transport/shmem \
    -			$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/shmem,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) -DUSE_MMAP\
    -                        -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \
    -                        -I$(JDK_TOPDIR)/src/share/transport/shmem \
    -		        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/shmem \
    -                        -I$(JDK_TOPDIR)/src/share/back/export, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB),\
    -		LDFLAGS_windows:=-export:jdwpTransport_OnLoad,\
    -		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=dt_shmem.dll" \
    -			  -D "JDK_INTERNAL_NAME=dt_shmem" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libdt_shmem,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBDT_SHMEM)
    -
    -endif # OPENJDK_TARGET_OS
    -
    -##########################################################################################
    -# JDWP_LOGGING causes log messages to be compiled into the library.
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJDWP,\
    -		LIBRARY:=jdwp, \
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(JDK_TOPDIR)/src/share/back $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/back,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) -DJDWP_LOGGING\
    -		 -I$(JDK_TOPDIR)/src/share/transport/export \
    -                 -I$(JDK_TOPDIR)/src/share/back/export \
    -                 -I$(JDK_TOPDIR)/src/share/npt \
    -                 -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \
    -                 -I$(JDK_TOPDIR)/src/share/back \
    -                 -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/back \
    -		 -I$(JDK_OUTPUTDIR)/gensrc_jdwp_headers,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjdwp/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX_linux:=$(LIBDL),\
    -		LDFLAGS_SUFFIX_solaris:=$(LIBDL) -lc,\
    -		LDFLAGS_SUFFIX_windows:=$(LDFLAGS_JDKLIB_SUFFIX),\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=jdwp.dll" \
    -			  -D "JDK_INTERNAL_NAME=jdwp" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjdwp,\
    -		DEBUG_SYMBOLS:=true))
    -
    -$(BUILD_LIBJDWP) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJDWP)
    -
    -##########################################################################################
    -
    -LIBJAAS_MAPFILE:=
    -ifneq ($(OPENJDK_TARGET_OS),solaris)
    -   LIBJAAS_EXCLUDE_FILES:=Solaris.c
    -else
    -   # only on solaris...wonder why
    -   LIBJAAS_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjaas/mapfile-vers
    -endif
    -
    -LIBJAAS_NAME:=jaas_unix
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -     LIBJAAS_NAME:=jaas_nt
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJAAS,\
    -		LIBRARY:=$(LIBJAAS_NAME),\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/security/auth/module,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB),\
    -		MAPFILE:=$(LIBJAAS_MAPFILE),\
    -		LDFLAGS:=$(filter-out -ljava,$(LDFLAGS_JDKLIB)) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_windows:=netapi32.lib user32.lib mpr.lib advapi32.lib,\
    -		LDFLAGS_SUFFIX_windows:=$(LDFLAGS_JDKLIB_SUFFIX),\
    -		LDFLAGS_SUFFIX_solaris:=-lc,\
    -		EXCLUDE_FILES:=$(LIBJAAS_EXCLUDE_FILES),\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS) \
    -			  -D "JDK_FNAME=$(LIBJAAS_NAME).dll" \
    -			  -D "JDK_INTERNAL_NAME=$(LIBJAAS_NAME)" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjaas,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBJAAS) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJAAS)
    -
    -##########################################################################################
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJSDT,\
    -		LIBRARY:=jsdt,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace\
    -			$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/tracing/dtrace,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB)\
    -			-I$(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjsdt/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX_linux:=$(LIBDL),\
    -		LDFLAGS_SUFFIX_windows:=$(LDFLAGS_JDKLIB_SUFFIX) $(LIBDL),\
    -		LDFLAGS_SUFFIX_macosx:=                         $(LIBDL),\
    -		LDFLAGS_SUFFIX_solaris:=-lc,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=jsdt.dll" \
    -			  -D "JDK_INTERNAL_NAME=jsdt" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjsdt, \
    -                DEBUG_SYMBOLS:=true))
    -
    -$(BUILD_LIBJSDT) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJSDT)
    -
    -##########################################################################################
    -
    -    # TODO: Update awt lib path when awt is converted
    -    $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS,\
    -                LIBRARY:=lcms,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms,\
    -		LANG:=C,\
    -		OPTIMIZATION:=HIGHEST, \
    -		CFLAGS:=$(filter-out -xc99=%none,$(CFLAGS_JDKLIB)) \
    -			$(SHARED_LIBRARY_FLAGS) \
    -			-I$(JDK_TOPDIR)/src/share/native/sun/java2d \
    -			-I$(JDK_TOPDIR)/src/share/native/sun/awt/debug,\
    -		CFLAGS_solaris:=-xc99=no_lib,\
    -		CFLAGS_windows:=-DCMS_IS_WINDOWS_,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/liblcms/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -                         $(call SET_SHARED_LIBRARY_ORIGIN), \
    -		LDFLAGS_solaris:=/usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2,\
    -		LDFLAGS_windows:=$(WIN_AWT_LIB) $(WIN_JAVA_LIB),\
    -		LDFLAGS_SUFFIX_solaris:=-lawt -ljava -ljvm -lc,\
    -		LDFLAGS_SUFFIX_macosx:=$(LIBM) -lawt -ljava -ljvm,\
    -		LDFLAGS_SUFFIX_linux:=-lm -lawt -ljava -ljvm,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=lcms.dll" \
    -			  -D "JDK_INTERNAL_NAME=lcms" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/liblcms,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -    BUILD_LIBRARIES += $(BUILD_LIBLCMS)
    -
    -    $(BUILD_LIBLCMS) : $(BUILD_LIBAWT)
    -
    -##########################################################################################
    -
    -ifdef OPENJDK
    -    BUILD_LIBJPEG_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/mapfile-vers
    -else
    -    BUILD_LIBJPEG_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/mapfile-vers-closed
    -    BUILD_LIBJPEG_CLOSED_SRC:=$(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg
    -    BUILD_LIBJPEG_CLOSED_INCLUDES:=-I$(BUILD_LIBJPEG_CLOSED_SRC)
    -endif
    -
    -BUILD_LIBJPEG_REORDER:=
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -    ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    -        BUILD_LIBJPEG_REORDER:=$(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
    -    endif
    -endif
    -
    -# Suppress gcc warnings like "variable might be clobbered by 'longjmp'
    -# or 'vfork'": this warning indicates that some variable is placed to
    -# a register by optimized compiler and it's value might be lost on longjmp().
    -# Recommended way to avoid such warning is to declare the variable as
    -# volatile to prevent the optimization. However, this approach does not
    -# work because we have to declare all variables as volatile in result.
    -#ifndef CROSS_COMPILE_ARCH
    -#    CC_43_OR_NEWER:=\
    -#        $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
    -#              \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
    -#    ifeq ($(CC_43_OR_NEWER),1)
    -#        BUILD_LIBJPEG_CFLAGS_linux += -Wno-clobbered
    -#    endif
    -#endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJPEG,\
    -                LIBRARY:=jpeg, \
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(BUILD_LIBJPEG_CLOSED_SRC) \
    -		     $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg,\
    -		LANG:=C,\
    -		OPTIMIZATION:=HIGHEST, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -			$(BUILD_LIBJPEG_CLOSED_INCLUDES) \
    -			-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg,\
    -		MAPFILE:=$(BUILD_LIBJPEG_MAPFILE), \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_windows:=$(WIN_JAVA_LIB) jvm.lib,\
    -		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=jpeg.dll" \
    -			  -D "JDK_INTERNAL_NAME=jpeg" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		REORDER:=$(BUILD_LIBJPEG_REORDER),\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjpeg,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBJPEG) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJPEG)
    -
    -##########################################################################################
    -
    -ifndef OPENJDK
    -    FONT_HEADERS:=-I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k
    -    BUILD_LIBFONTMANAGER_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers
    -    LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
    -else
    -    FONT_HEADERS:=$(FREETYPE2_CFLAGS)
    -    BUILD_LIBFONTMANAGER_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk
    -    BUILD_LIBFONTMANAGER_FONTLIB:=$(FREETYPE2_LIBS)
    -endif
    -
    -LIBFONTMANAGER_OPTIMIZATION:=HIGH
    -
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -    LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
    -				    X11TextRenderer.c
    -LIBFONTMANAGER_OPTIMIZATION:=HIGHEST
    -else
    -    LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
    -				    lcdglyph.c
    -endif
    -
    -BUILD_LIBFONTMANAGER_CFLAGS_COMMON:=\
    -			$(X_CFLAGS) \
    -			-DLE_STANDALONE -DHEADLESS \
    -			$(FONT_HEADERS) \
    -			-I$(JDK_TOPDIR)/src/share/native/sun/font \
    -			-I$(JDK_TOPDIR)/src/share/native/sun/font/layout \
    -			-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    -			-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
    -			-I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -			-I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    -			-I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    -			-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    -			-I$(JDK_TOPDIR)/src/share/native/sun/java2d
    -
    -# Turn off aliasing with GCC for ExtensionSubtables.cpp
    -ifeq ($(OPENJDK_TARGET_OS), linux)
    -    BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS:=-fno-strict-aliasing
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER,\
    -		LIBRARY:=fontmanager, \
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(JDK_TOPDIR)/src/share/native/sun/font\
    -		     $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font,\
    -		EXCLUDE_FILES:=$(LIBFONTMANAGER_EXCLUDE_FILES) \
    -			       AccelGlyphCache.c,\
    -		LANG:=C++,\
    -		CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON),\
    -		CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON),\
    -		OPTIMIZATION:=$(LIBFONTMANAGER_OPTIMIZATION), \
    -		CFLAGS_windows= -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
    -				-DCC_NOEX, \
    -		MAPFILE:=$(BUILD_LIBFONTMANAGER_MAPFILE), \
    -		LDFLAGS:=$(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX:=$(BUILD_LIBFONTMANAGER_FONTLIB),\
    -		LDFLAGS_SUFFIX_linux:=-lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc,\
    -		LDFLAGS_SUFFIX_solaris:=-lawt -lawt_xawt -lc $(LIBM) $(LIBCXX) -ljava -ljvm,\
    -		LDFLAGS_SUFFIX_macosx:=-lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \
    -				       -ljava -ljvm,\
    -		LDFLAGS_SUFFIX_windows:=$(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
    -					$(WIN_AWT_LIB),\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=fontmanager.dll" \
    -			  -D "JDK_INTERNAL_NAME=fontmanager" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libfontmanager,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBFONTMANAGER) : $(BUILD_LIBAWT)
    -
    -ifneq (,$(findstring $(OPENJDK_TARGET_OS),solaris macosx))
    -$(BUILD_LIBFONTMANAGER) : $(BUILD_LIBAWT_XAWT)
    -endif
    -
    -BUILD_LIBRARIES += $(BUILD_LIBFONTMANAGER)
    -
    -##########################################################################################
    -
    -ifndef OPENJDK
    -
    -#    ifeq ($(OPENJDK_TARGET_OS), linux)
    -#        ifeq ("$(CC_VER_MAJOR)", "3")
    -#            OTHER_LDLIBS  += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
    -#        endif
    -#    endif
    -#
    -# The resulting size of the t2k lib file is (at least on linux) dependant on the order of
    -# the input .o files. Because of this the new build will differ in size to the old build.
    -    BUILD_LIBT2K_CFLAGS_COMMON:=-I$(JDK_TOPDIR)/src/share/native/sun/font \
    -		            -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
    -		            -I$(JDK_TOPDIR)/src/closed/share/native/sun/font \
    -		            -I$(JDK_TOPDIR)/src/share/share/native/sun/font \
    -		            -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font \
    -		            -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    -		            -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    -		            -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    -		            -I$(JDK_TOPDIR)/src/share/native/sun/java2d
    -
    -    $(eval $(call SetupNativeCompilation,BUILD_LIBT2K,\
    -                LIBRARY:=t2k, \
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(JDK_TOPDIR)/src/closed/share/native/sun/font \
    -		     $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
    -		     $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k/ttHints,\
    -		EXCLUDE_FILES:=orion.c,\
    -		LANG:=C++,\
    -		OPTIMIZATION:=HIGH, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON),\
    -		CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON),\
    -		CFLAGS_windows=-DCC_NOEX, \
    -		CXXFLAGS_windows=-DCC_NOEX, \
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libt2k/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_windows:=user32.lib $(JDK_OUTPUTDIR)/objs/libfontmanager/fontmanager.lib,\
    -		LDFLAGS_SUFFIX_posix:=$(LIBM) $(LIBCXX) -lfontmanager -ljava -ljvm -lc,\
    -		LDFLAGS_SUFFIX_solaris:=-lawt -lawt_xawt,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=t2k.dll" \
    -			  -D "JDK_INTERNAL_NAME=t2k" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libt2k,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -    # t2k is linked against fontmanager
    -    $(BUILD_LIBT2K) : $(BUILD_LIBFONTMANAGER)
    -
    -    BUILD_LIBRARIES += $(BUILD_LIBT2K)
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -    ifeq ($(OPENJDK_TARGET_CPU), x86)
    -        KERNEL32_LIB:=kernel32.lib
    -    endif
    -    $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT,\
    -                LIBRARY:=jawt, \
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows,\
    -		INCLUDE_FILES:=jawt.cpp,\
    -		LANG:=C++,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CXXFLAGS_JDKLIB) \
    -			-EHsc -DUNICODE -D_UNICODE \
    -			-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
    -		        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -		        -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
    -			-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    -			-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) $(KERNEL32_LIB) $(LDFLAGS_CXX_JDK) \
    -			 advapi32.lib $(WIN_AWT_LIB),\
    -		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=jawt.dll" \
    -			  -D "JDK_INTERNAL_NAME=jawt" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjawt,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBJAWT) : $(BUILD_LIBAWT)
    -
    -$(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT)
    -	$(ECHO) Copying $(@F)
    -	$(CP) $(JDK_OUTPUTDIR)/objs/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@
    -
    -BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
    -
    -else # OPENJDK_TARGET_OS not windows
    -
    -    JAWT_LIBS:=
    -    ifneq ($(OPENJDK_TARGET_OS), solaris)
    -        JAWT_LIBS += -lawt
    -    endif
    -
    -    ifndef BUILD_HEADLESS_ONLY
    -        JAWT_LIBS += -lawt_xawt
    -    else
    -        JAWT_LIBS += -lawt_headless
    -        HEADLESS_CFLAG += -DHEADLESS
    -    endif
    -
    -    JAWT_FILES:=jawt.c
    -    ifeq ($(OPENJDK_TARGET_OS), macosx)
    -	JAWT_FILES:=jawt.m
    -	JAWT_LIBS:=-lawt_lwawt
    -    endif
    -
    -    $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT,\
    -                LIBRARY:=jawt, \
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
    -                     $(JDK_TOPDIR)/src/macosx/native/sun/awt,\
    -		INCLUDE_FILES:=$(JAWT_FILES),\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB), \
    -		CFLAGS_linux:=$(HEADLESS_CFLAG),\
    -		CFLAGS_macosx:=-I$(JDK_TOPDIR)/src/solaris/native/sun/awt ,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjawt/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_solaris:=-L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR),\
    -		LDFLAGS_SUFFIX_linux:=$(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX),\
    -		LDFLAGS_SUFFIX_solaris:=$(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX) -lXrender,\
    -		LDFLAGS_SUFFIX_macosx:=-Xlinker -rpath -Xlinker @loader_path $(JAWT_LIBS) \
    -				       -framework Cocoa $(LDFLAGS_JDKLIB_SUFFIX),\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjawt,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -ifndef BUILD_HEADLESS_ONLY
    -$(BUILD_LIBJAWT) : $(BUILD_LIBAWT_XAWT)
    -else
    -$(BUILD_LIBJAWT) : $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS),macosx)
    -$(BUILD_LIBJAWT) : $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)
    -endif
    -
    -endif # OPENJDK_TARGET_OS
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJAWT)
    -
    -##########################################################################################
    -
    -LIBINSTRUMENT_SRC   :=$(JDK_TOPDIR)/src/share/instrument \
    -                      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io \
    -                      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/instrument
    -
    -LIBINSTRUMENT_FILES :=\
    -	EncodingSupport.c \
    -	EncodingSupport_md.c \
    -	FileSystemSupport_md.c \
    -	InstrumentationImplNativeMethods.c \
    -	InvocationAdapter.c \
    -	JarFacade.c \
    -	JPLISAgent.c \
    -	JPLISAssert.c \
    -	JavaExceptions.c \
    -	PathCharsValidator.c \
    -	Reentrancy.c \
    -	Utilities.c \
    -	canonicalize_md.c
    -
    -LIBINSTRUMENT_DIR   :=$(JDK_OUTPUTDIR)/objs/libinstrument
    -LIBINSTRUMENT_CFLAGS:=$(CFLAGS_JDKLIB) \
    -                      -I$(JDK_TOPDIR)/src/share/instrument \
    -                      -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/instrument \
    -                      -I$(JDK_TOPDIR)/src/share/bin
    -
    -LIBINSTRUMENT_LDFLAGS:=
    -LIBINSTRUMENT_LDFLAGS_SUFFIX:=
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -    LIBINSTRUMENT_LDFLAGS += $(JDK_OUTPUTDIR)/objs/jli_static.lib $(WIN_JAVA_LIB) \
    -				 -export:Agent_OnAttach advapi32.lib
    -    # Statically link the C runtime so that there are not dependencies on modules
    -    # not on the search patch when invoked from the Windows system directory
    -    # (or elsewhere).
    -    LIBINSTRUMENT_CFLAGS := $(filter-out -MD,$(LIBINSTRUMENT_CFLAGS))
    -    # equivalent of strcasecmp is stricmp on Windows
    -    LIBINSTRUMENT_CFLAGS += -Dstrcasecmp=stricmp
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT,\
    -		LIBRARY:=instrument, \
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(LIBINSTRUMENT_SRC),\
    -		INCLUDE_FILES:=$(LIBINSTRUMENT_FILES),\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(LIBINSTRUMENT_CFLAGS),\
    -		CFLAGS_debug:=-DJPLIS_LOGGING,\
    -		CFLAGS_release:=-DNO_JPLIS_LOGGING,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libinstrument/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN) \
    -                         $(LIBINSTRUMENT_LDFLAGS),\
    -		LDFLAGS_linux:=$(call SET_SHARED_LIBRARY_ORIGIN,/jli),\
    -		LDFLAGS_solaris:= $(call SET_SHARED_LIBRARY_ORIGIN,/jli),\
    -		LDFLAGS_macosx:=-Xlinker -all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \
    -				-framework Cocoa -framework Security -framework ApplicationServices,\
    -		LDFLAGS_SUFFIX:=$(LIBINSTRUMENT_LDFLAGS_SUFFIX),\
    -		LDFLAGS_SUFFIX_macosx:=-liconv $(LIBZ),\
    -		LDFLAGS_SUFFIX_solaris:=$(LIBZ) -L $(INSTALL_LIBRARIES_HERE)/jli -ljli $(LIBDL) -lc,\
    -		LDFLAGS_SUFFIX_linux:=$(LIBZ) -L $(INSTALL_LIBRARIES_HERE)/jli -ljli $(LIBDL),\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=instrument.dll" \
    -			  -D "JDK_INTERNAL_NAME=instrument" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(LIBINSTRUMENT_DIR),\
    -		DEBUG_SYMBOLS:=true))
    -
    -ifneq (,$(findstring $(OPENJDK_TARGET_OS), macosx windows))
    -$(BUILD_LIBINSTRUMENT) : $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jli_static$(STATIC_LIBRARY_SUFFIX)
    -else
    -$(BUILD_LIBINSTRUMENT) : $(INSTALL_LIBRARIES_HERE)/jli/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX)
    -endif
    -$(BUILD_LIBINSTRUMENT) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBINSTRUMENT)
    -
    -##########################################################################################
    -
    -BUILD_LIBMANAGEMENT_SRC:=$(JDK_TOPDIR)/src/share/native/sun/management \
    -                           $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/management \
    -                           $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/management
    -
    -BUILD_LIBMANAGEMENT_EXCLUDES:=
    -
    -BUILD_LIBMANAGEMENT_CFLAGS:=-I$(JDK_TOPDIR)/src/share/native/sun/management
    -
    -ifneq ($(OPENJDK_TARGET_OS), windows)
    -	BUILD_LIBMANAGEMENT_EXCLUDES += OperatingSystem_md.c
    -else
    -	BUILD_LIBMANAGEMENT_EXCLUDES += UnixOperatingSystem_md.c
    -endif
    -
    -ifneq ($(OPENJDK_TARGET_OS),solaris)
    -	BUILD_LIBMANAGEMENT_EXCLUDES += SolarisOperatingSystem.c
    -endif
    -
    -ifneq ($(OPENJDK_TARGET_OS),linux)
    -	BUILD_LIBMANAGEMENT_EXCLUDES += LinuxOperatingSystem.c
    -endif
    -
    -ifneq ($(OPENJDK_TARGET_OS),macosx)
    -	BUILD_LIBMANAGEMENT_EXCLUDES += MacosxOperatingSystem.c
    -endif
    -
    -LIBMANAGEMENT_OPTIMIZATION:=HIGH
    -ifneq ($(findstring $(OPENJDK_TARGET_OS),solaris linux),)
    -    ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
    -        LIBMANAGEMENT_OPTIMIZATION:=LOW
    -    endif
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT,\
    -		LIBRARY:=management,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(BUILD_LIBMANAGEMENT_SRC),\
    -		EXCLUDE_FILES:=$(BUILD_LIBMANAGEMENT_EXCLUDES),\
    -		LANG:=C,\
    -		OPTIMIZATION:=$(LIBMANAGEMENT_OPTIMIZATION), \
    -		CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBMANAGEMENT_CFLAGS),\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libmanagement/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_solaris:=-lkstat,\
    -		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
    -		LDFLAGS_SUFFIX_windows:=jvm.lib psapi.lib $(WIN_JAVA_LIB) advapi32.lib,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=management.dll" \
    -			  -D "JDK_INTERNAL_NAME=management" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libmanagement,\
    -		DEBUG_SYMBOLS:=true))
    -
    -$(BUILD_LIBMANAGEMENT) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBMANAGEMENT)
    -
    -##########################################################################################
    -
    -BUILD_LIBHPROF_SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/hprof $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/demo/jvmti/hprof
    -BUILD_LIBHPROF_CFLAGS:=-I$(JDK_TOPDIR)/src/share/demo/jvmti/hprof \
    -                         -I$(JDK_TOPDIR)/src/share/npt \
    -                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \
    -                         -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo
    -
    -BUILD_LIBHPROF_LDFLAGS:=
    -
    -LIBHPROF_OPTIMIZATION:=HIGHEST
    -ifneq ($(findstring $(OPENJDK_TARGET_OS),solaris linux),)
    -    ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
    -        LIBHPROF_OPTIMIZATION:=LOW
    -    endif
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBHPROF,\
    -		LIBRARY:=hprof, \
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(BUILD_LIBHPROF_SRC),\
    -		LANG:=C,\
    -		OPTIMIZATION:=$(LIBHPROF_OPTIMIZATION), \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -                         $(BUILD_LIBHPROF_CFLAGS),\
    -		CFLAGS_debug:=-DHPROF_LOGGING,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libhprof/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_windows:=wsock32.lib winmm.lib advapi32.lib,\
    -		LDFLAGS_SUFFIX_linux:=$(LIBDL),\
    -		LDFLAGS_SUFFIX_macosx:=$(LIBDL),\
    -		LDFLAGS_SUFFIX_solaris:=-lsocket -lnsl $(LIBDL) -lc,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=hprof.dll" \
    -			  -D "JDK_INTERNAL_NAME=hprof" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libhprof_jvmti,\
    -		DEBUG_SYMBOLS:=true))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBHPROF)
    -
    -##########################################################################################
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA_CRW_DEMO,\
    -		LIBRARY:=java_crw_demo, \
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -                        -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjava_crw_demo/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX_solaris:=-lc,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=java_crw_demo.dll" \
    -			  -D "JDK_INTERNAL_NAME=java_crw_demo" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjava_crw_demo,\
    -		DEBUG_SYMBOLS:=true))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJAVA_CRW_DEMO)
    -
    -##########################################################################################
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBNPT,\
    -		LIBRARY:=npt, \
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(JDK_TOPDIR)/src/share/npt $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -                        -I$(JDK_TOPDIR)/src/share/npt \
    -                        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libnpt/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_macosx:=-liconv,\
    -		LDFLAGS_SUFFIX_windows:=-export:nptInitialize -export:nptTerminate,\
    -		LDFLAGS_SUFFIX_solaris:=-lc, \
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=npt.dll" \
    -			  -D "JDK_INTERNAL_NAME=npt" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libnpt,\
    -		DEBUG_SYMBOLS:=true))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBNPT)
    -
    -##########################################################################################
    -
    -LIBNET_SRC_DIRS:=$(JDK_TOPDIR)/src/share/native/java/net \
    -                   $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net \
    -                   $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/dns \
    -                   $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/spi
    -
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -    LIBNET_SRC_DIRS+=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/www/protocol/http/ntlm
    -else
    -    LIBNET_SRC_DIRS+=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/sdp
    -endif
    -
    -LIBNET_CFLAGS:=$(foreach dir,$(LIBNET_SRC_DIRS),-I$(dir))
    -
    -LIBNET_EXCLUDE_FILES:=
    -ifneq ($(OPENJDK_TARGET_OS),linux)
    -	LIBNET_EXCLUDE_FILES += linux_close.c
    -endif
    -
    -ifneq ($(OPENJDK_TARGET_OS),macosx)
    -	LIBNET_EXCLUDE_FILES += bsd_close.c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -	LIBNET_EXCLUDE_FILES += PlainSocketImpl.c PlainDatagramSocketImpl.c SdpSupport.c
    -else
    -	LIBNET_EXCLUDE_FILES += TwoStacksPlainSocketImpl.c DualStackPlainSocketImpl.c \
    -                                TwoStacksPlainDatagramSocketImpl.c DualStackPlainDatagramSocketImpl.c \
    -				NTLMAuthSequence.c NetworkInterface_winXP.c
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBNET,\
    -		LIBRARY:=net,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(LIBNET_SRC_DIRS),\
    -		EXCLUDE_FILES:=$(LIBNET_EXCLUDE_FILES), \
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -                        $(LIBNET_CFLAGS),\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libnet/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX_macosx:=-ljvm -ljava,\
    -		LDFLAGS_SUFFIX_solaris:=-ljvm -ljava -lnsl -lsocket $(LIBDL) -lc ,\
    -		LDFLAGS_SUFFIX_linux:=$(LIBDL) -ljvm -lpthread -ljava,\
    -		LDFLAGS_SUFFIX_windows:=ws2_32.lib jvm.lib secur32.lib iphlpapi.lib \
    -					delayimp.lib $(WIN_JAVA_LIB) advapi32.lib \
    -					-DELAYLOAD:secur32.dll -DELAYLOAD:iphlpapi.dll, \
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=net.dll" \
    -			  -D "JDK_INTERNAL_NAME=net" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libnet,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBNET) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBNET)
    -
    -$(JDK_OUTPUTDIR)/lib/net.properties: $(JDK_TOPDIR)/src/share/lib/net.properties
    -	$(ECHO) $(LOG_INFO) Copying $(@F)
    -	$(call install-file)
    -
    -COPY_FILES += $(JDK_OUTPUTDIR)/lib/net.properties
    -
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -$(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template : $(JDK_TOPDIR)/src/${OPENJDK_TARGET_OS_API_DIR}/lib/sdp/sdp.conf.template
    -	$(ECHO) $(LOG_INFO) Copying $(@F)
    -	$(call install-file)
    -
    -COPY_FILES += $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template
    -endif
    -
    -##########################################################################################
    -
    -BUILD_LIBNIO_SRC:=\
    -        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/nio \
    -	$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch \
    -	$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
    -
    -BUILD_LIBNIO_CFLAGS:=\
    -	-I$(JDK_TOPDIR)/src/share/native/sun/nio/ch \
    -	-I$(JDK_TOPDIR)/src/share/native/java/io \
    -	-I$(JDK_TOPDIR)/src/share/native/java/net \
    -        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net
    -
    -BUILD_LIBNIO_FILES:=\
    -        DatagramChannelImpl.c \
    -        DatagramDispatcher.c \
    -	FileChannelImpl.c \
    -	FileDispatcherImpl.c \
    -	FileKey.c \
    -	IOUtil.c \
    -        MappedByteBuffer.c \
    -	Net.c \
    -	ServerSocketChannelImpl.c \
    -	SocketChannelImpl.c \
    -	SocketDispatcher.c
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -	BUILD_LIBNIO_FILES += \
    -		Iocp.c \
    -		RegistryFileTypeDetector.c \
    -		WindowsAsynchronousFileChannelImpl.c \
    -		WindowsAsynchronousServerSocketChannelImpl.c \
    -		WindowsAsynchronousSocketChannelImpl.c \
    -		WindowsNativeDispatcher.c \
    -	        WindowsSelectorImpl.c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), linux)
    -	BUILD_LIBNIO_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
    -	BUILD_LIBNIO_FILES += \
    -		EPoll.c \
    -		EPollArrayWrapper.c \
    -		EPollPort.c \
    -		InheritedChannel.c \
    -		NativeThread.c \
    -		PollArrayWrapper.c \
    -		UnixAsynchronousServerSocketChannelImpl.c \
    -		UnixAsynchronousSocketChannelImpl.c \
    -		GnomeFileTypeDetector.c \
    -		MagicFileTypeDetector.c \
    -		LinuxNativeDispatcher.c \
    -		LinuxWatchService.c \
    -		UnixCopyFile.c \
    -		UnixNativeDispatcher.c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -	BUILD_LIBNIO_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
    -	BUILD_LIBNIO_SRC += $(JDK_TOPDIR)/src/macosx/native/sun/nio/ch
    -	BUILD_LIBNIO_FILES += \
    -		InheritedChannel.c \
    -		NativeThread.c \
    -	        PollArrayWrapper.c \
    -		UnixAsynchronousServerSocketChannelImpl.c \
    -		UnixAsynchronousSocketChannelImpl.c \
    -		BsdNativeDispatcher.c \
    -		MacOSXNativeDispatcher.c \
    -		UnixCopyFile.c \
    -		UnixNativeDispatcher.c \
    -		KQueue.c \
    -		KQueuePort.c \
    -		KQueueArrayWrapper.c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -	BUILD_LIBNIO_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
    -	BUILD_LIBNIO_FILES += \
    -		DevPollArrayWrapper.c \
    -		InheritedChannel.c \
    -		NativeThread.c \
    -		PollArrayWrapper.c \
    -		SolarisEventPort.c \
    -		UnixAsynchronousServerSocketChannelImpl.c \
    -		UnixAsynchronousSocketChannelImpl.c \
    -		GnomeFileTypeDetector.c \
    -		SolarisNativeDispatcher.c \
    -		SolarisWatchService.c \
    -		UnixCopyFile.c \
    -		UnixNativeDispatcher.c
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBNIO,\
    -		LIBRARY:=nio,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(BUILD_LIBNIO_SRC),\
    -		INCLUDE_FILES:=$(BUILD_LIBNIO_FILES), \
    -		LANG:=C,\
    -		OPTIMIZATION:=HIGH, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -                        $(BUILD_LIBNIO_CFLAGS),\
    -		MAPFILE:=$(BUILD_LIBNIO_MAPFILE), \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) $(BUILD_LIBNIO_LDFLAGS) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX_linux:=-ljava -lnet -lpthread $(LIBDL),\
    -		LDFLAGS_SUFFIX_solaris:=-ljvm -lsocket -lposix4 $(LIBDL) \
    -				        -lsendfile -ljava -lnet -lc,\
    -		LDFLAGS_SUFFIX_windows:=jvm.lib ws2_32.lib $(WIN_JAVA_LIB) \
    -					$(JDK_OUTPUTDIR)/objs/libnet/net.lib \
    -					advapi32.lib,\
    -		LDFLAGS_SUFFIX_macosx:=-ljava -lnet -pthread -framework CoreFoundation,\
    -		LDFLAGS_SUFFIX:=,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=nio.dll" \
    -			  -D "JDK_INTERNAL_NAME=nio" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libnio,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBNIO)
    -
    -$(BUILD_LIBNIO) : $(BUILD_LIBNET)
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS_API),posix)
    -
    -  ifneq ($(OPENJDK_TARGET_OS),macosx)
    -
    -    SCTP_WERROR := -Werror
    -    ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
    -      SCTP_WERROR :=
    -    endif
    -
    -    $(eval $(call SetupNativeCompilation,BUILD_LIBSCTP,\
    -                LIBRARY:=sctp,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -                SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch/sctp,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB)\
    -			-I$(JDK_TOPDIR)/src/share/native/sun/nio/ch \
    -			-I$(JDK_TOPDIR)/src/share/native/sun/nio/ch/sctp \
    -			-I$(JDK_TOPDIR)/src/share/native/java/net \
    -			-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch \
    -			-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net,\
    -		CFLAGS_linux:=$(SCTP_WERROR),\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libsctp/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX_linux:=-lpthread $(LIBDL) -ljava -ljvm,\
    -		LDFLAGS_SUFFIX_posix:=-lnio -lnet,\
    -		LDFLAGS_SUFFIX_solaris:=-lsocket -ljava -ljvm -lc,\
    -		LDFLAGS_SUFFIX_macosx:=-ljava -ljvm,\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsctp,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -    BUILD_LIBRARIES += $(BUILD_LIBSCTP)
    -
    -    $(BUILD_LIBSCTP) : $(BUILD_LIBNIO)
    -  endif
    -endif
    -
    -##########################################################################################
    -
    -BUILD_LIBJLI_SRC_DIRS:=$(JDK_TOPDIR)/src/share/bin $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin
    -LIBJLI_CFLAGS:=$(CFLAGS_JDKLIB) $(foreach dir,$(BUILD_LIBJLI_SRC_DIRS),-I$(dir))
    -
    -BUILD_LIBJLI_FILES:=\
    -	java.c \
    -	splashscreen_stubs.c \
    -	parse_manifest.c \
    -	version_comp.c \
    -	wildcard.c \
    -	jli_util.c
    -
    -ifeq ($(JVM_VARIANT_ZERO), true)
    -	ERGO_FAMILY:=zero
    -else
    -	ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86)
    -		ERGO_FAMILY:=i586
    -	else
    -		ERGO_FAMILY:=$(OPENJDK_TARGET_CPU_ARCH)
    -	endif
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -	LIBJLI_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/bin
    -	BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/bin
    -	BUILD_LIBJLI_FILES += java_md_common.c java_md_macosx.c
    -
    -	BUILD_LIBJLI_java_md_macosx.c_CFLAGS:=-x objective-c
    -	BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS:=-x objective-c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -	BUILD_LIBJLI_FILES += java_md.c \
    -			      cmdtoargs.c
    -        # Staticically link with c runtime on windows.
    -	LIBJLI_CFLAGS:=$(filter-out -MD,$(LIBJLI_CFLAGS))
    -else ifneq ($(OPENJDK_TARGET_OS), macosx)
    -
    -	BUILD_LIBJLI_FILES += java_md_common.c
    -	BUILD_LIBJLI_FILES += java_md_solinux.c ergo.c
    -
    -	ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c
    -
    -        # if the architecture specific ergo file exists then
    -        # use it, else use the generic definitions from ergo.c
    -	ifneq ($(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/$(ERGO_ARCH_FILE)),)
    -		BUILD_LIBJLI_FILES += $(ERGO_ARCH_FILE)
    -	else # !ERGO_ARCH_FILE
    -		LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO
    -	endif # ERGO_ARCH_FILE
    -endif #WINDOWS
    -
    -# Append defines depending on target platform
    -LIBJLI_CFLAGS += $(OPENJDK_TARGET_CPU_JLI_CFLAGS)
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -	LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
    -endif
    -
    -ifneq ($(USE_EXTERNAL_LIBZ),true)
    -	BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
    -	LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
    -	BUILD_LIBJLI_FILES += \
    -		inflate.c \
    -		inftrees.c \
    -		inffast.c \
    -		zadler32.c \
    -		zcrc32.c \
    -		zutil.c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -    LIBJLI_OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE)
    -else
    -    LIBJLI_OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE)/jli
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJLI,\
    -		LIBRARY:=jli,\
    -                OUTPUT_DIR:=$(LIBJLI_OUTPUT_DIR),\
    -		SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
    -		INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\
    -		LANG:=C,\
    -		OPTIMIZATION:=HIGH, \
    -		CFLAGS:=$(LIBJLI_CFLAGS),\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjli/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_linux:=$(call SET_SHARED_LIBRARY_ORIGIN,/..),\
    -		LDFLAGS_solaris:=$(call SET_SHARED_LIBRARY_ORIGIN,/..),\
    -		LDFLAGS_macosx:=-framework Cocoa -framework Security -framework ApplicationServices,\
    -		LDFLAGS_SUFFIX_solaris:=$(LIBZ) $(LIBDL) -lc,\
    -		LDFLAGS_SUFFIX_linux:=$(LIBZ) $(LIBDL) -lc -lpthread,\
    -		LDFLAGS_SUFFIX_macosx:=$(LIBZ),\
    -		LDFLAGS_SUFFIX_windows:=\
    -			-export:JLI_Launch \
    -			-export:JLI_ManifestIterate \
    -			-export:JLI_SetTraceLauncher \
    -			-export:JLI_ReportErrorMessage \
    -			-export:JLI_ReportErrorMessageSys \
    -			-export:JLI_ReportMessage \
    -			-export:JLI_ReportExceptionDescription \
    -			-export:JLI_MemAlloc \
    -			-export:JLI_CmdToArgs \
    -			-export:JLI_GetStdArgc \
    -			-export:JLI_GetStdArgs \
    -			advapi32.lib \
    -			comctl32.lib \
    -			user32.lib,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS) \
    -			  -D "JDK_FNAME=jli.dll" \
    -			  -D "JDK_INTERNAL_NAME=jli" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJLI)
    -
    -# On windows, the static library has the same suffix as the import library created by
    -# with the shared library, so the static library is given a different name. No harm
    -# in doing it for all platform to reduce complexity.
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -    $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC,\
    -		STATIC_LIBRARY:=jli_static,\
    -                OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs,\
    -		SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
    -		INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\
    -		LANG:=C,\
    -		OPTIMIZATION:=HIGH, \
    -		CFLAGS:=$(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS),\
    -		ARFLAGS:=$(ARFLAGS),\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli_static,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJLI_STATIC)
    -
    -else ifeq ($(OPENJDK_TARGET_OS),macosx)
    -    #
    -    # On macosx they do partial (incremental) linking of libjli_static.a
    -    #   code it here...rather than add support to NativeCompilation
    -    #   as this is first time I see it
    -    $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC,\
    -		LIBRARY:=jli_static, \
    -                OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs,\
    -		SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
    -		INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\
    -		LANG:=C,\
    -		OPTIMIZATION:=HIGH, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS),\
    -		LDFLAGS:=-nostdlib -r,\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli_static,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(JDK_OUTPUTDIR)/objs/libjli_static.a : $(BUILD_LIBJLI_STATIC)
    -	$(call install-file)
    -
    -BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a
    -endif
    -
    -##########################################################################################
    -
    -ifndef OPENJDK
    -ifeq ($(ENABLE_JFR), true)
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJFR,\
    -		LIBRARY:=jfr,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(JDK_TOPDIR)/src/closed/share/native/oracle/jfr,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -                        -I$(JDK_TOPDIR)/src/closed/share/javavm/export, \
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjfr/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX_solaris:=-lc,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=jfr.dll" \
    -			  -D "JDK_INTERNAL_NAME=jfr" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjfr,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJFR)
    -
    -endif
    -endif
    -
    -##########################################################################################
    -
    -ifndef OPENJDK
    -
    -BUILD_LIBKCMS_EXCLUDE_FILES:=
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -	BUILD_LIBKCMS_EXCLUDE_FILES += ukcpmgr.c unixmem.c
    -else
    -	BUILD_LIBKCMS_EXCLUDE_FILES += cmmdll.c registry.c spxffile.c sysinfo.c winmem.c wkcpmgr.c
    -endif
    -
    -BUILD_LIBKCMS_FLAGS:=$(CFLAGS_JDKLIB)
    -
    -ifeq ($(OPENJDK_TARGET_OS),solaris)
    -     # This particular library uses a feature called PIC_CODE_SMALL (on solaris)
    -     #   implement it like this...since it's only used here
    -     BUILD_LIBKCMS_FLAGS:=$(patsubst -KPIC,-Kpic,$(BUILD_LIBKCMS_FLAGS))
    -else ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
    -     BUILD_LIBKCMS_FLAGS:=$(patsubst -fPIC,-fpic,$(BUILD_LIBKCMS_FLAGS))
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBKCMS,\
    -		LIBRARY:=kcms,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms,\
    -		LANG:=C,\
    -		EXCLUDE_FILES:=$(BUILD_LIBKCMS_EXCLUDE_FILES),\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(BUILD_LIBKCMS_FLAGS) \
    -                        -DJAVACMM -DFUT_CALC_EX -DNO_FUT_GCONST,\
    -		CFLAGS_linux:=-Wno-missing-field-initializers,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libkcms/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX_linux:=-lc -lpthread,\
    -		LDFLAGS_SUFFIX_solaris:=-lc,\
    -		LDFLAGS_SUFFIX_windows:=$(WIN_JAVA_LIB) advapi32.lib user32.lib version.lib, \
    -		LDFLAGS_SUFFIX_posix:=-lm -ljava -ljvm,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=kcms.dll" \
    -			  -D "JDK_INTERNAL_NAME=kcms" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libkcms,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBKCMS) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBKCMS)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifndef OPENJDK
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    -
    -ifeq ($(shell if test "$(OS_VERSION_MAJOR)" -eq 5 -a "$(OS_VERSION_MINOR)" -le 10; then $(ECHO) ok; fi), ok)
    -
    -SUNWJDGA_MAPFILE:=
    -ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
    -	SUNWJDGA_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjdga/mapfile-vers
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBSUNWJDGA, \
    -		LIBRARY:=sunwjdga,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(JDK_TOPDIR)/src/solaris/native/sun/jdga, \
    -		LANG:=C, \
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -			-I$(JDK_TOPDIR)/src/share/javavm/export \
    -			-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export \
    -			-I$(OPENWIN_HOME)/include, \
    -		MAPFILE:=$(SUNWJDGA_MAPFILE), \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN), \
    -		LDFLAGS_SUFFIX:=-L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -ldga -lX11 $(LIBDL) -lc, \
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsunwjdga,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBSUNWJDGA)
    -
    -endif
    -endif
    -endif
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(BUILD_HEADLESS), true)
    -ifneq ($(OPENJDK_TARGET_OS), windows)
    -
    -LIBAWT_HEADLESS_DIRS:=$(JDK_TOPDIR)/src/share/native/sun/font \
    -                        $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
    -			$(JDK_TOPDIR)/src/solaris/native/sun/font \
    -			$(JDK_TOPDIR)/src/solaris/native/sun/awt \
    -			$(JDK_TOPDIR)/src/solaris/native/sun/java2d/opengl \
    -			$(JDK_TOPDIR)/src/solaris/native/sun/java2d/x11
    -
    -ifeq ($(OPENJDK_TARGET_OS),macosx)
    -	LIBAWT_HEADLESS_DIRS+=$(JDK_TOPDIR)/src/macosx/native/sun/font
    -endif
    -
    -LIBAWT_HEADLESS_CFLAGS:=-DHEADLESS=true \
    -                          -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
    -			  $(CUPS_CFLAGS) \
    -			  $(X_CFLAGS) \
    -			  -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
    -			  -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    -			  -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    -			  -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    -			  -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
    -			  -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    -			  -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -			  -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga \
    -                          $(foreach dir,$(LIBAWT_HEADLESS_DIRS),-I$(dir))
    -
    -ifeq ($(OPENJDK_TARGET_OS),macosx)
    -	LIBAWT_HEADLESS_CFLAGS+=\
    -		-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -		-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
    -endif
    -
    -LIBAWT_HEADLESS_FILES:=\
    -	awt_Font.c \
    -	HeadlessToolkit.c \
    -	fontpath.c \
    -	VDrawingArea.c \
    -	X11Color.c \
    -	X11Renderer.c \
    -	X11PMBlitLoops.c \
    -	X11SurfaceData.c \
    -	X11FontScaler_md.c \
    -	X11TextRenderer_md.c \
    -        OGLBlitLoops.c \
    -        OGLBufImgOps.c \
    -        OGLContext.c \
    -        OGLFuncs.c \
    -        OGLMaskBlit.c \
    -        OGLMaskFill.c \
    -        OGLPaints.c \
    -        OGLRenderQueue.c \
    -        OGLRenderer.c \
    -        OGLSurfaceData.c \
    -        OGLTextRenderer.c \
    -        OGLVertexCache.c \
    -        GLXGraphicsConfig.c \
    -        GLXSurfaceData.c \
    -        AccelGlyphCache.c \
    -	CUPSfuncs.c
    -
    -ifeq ($(OPENJDK_TARGET_OS),macosx)
    -	LIBAWT_HEADLESS_FILES+=\
    -		AWTFont.m \
    -		AWTStrike.m \
    -		CCharToGlyphMapper.m \
    -		CGGlyphImages.m \
    -		CGGlyphOutlines.m \
    -		CoreTextSupport.m
    -endif
    -
    -LIBAWT_HEADLESS_REORDER:=
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -	ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    -		LIBAWT_HEADLESS_REORDER:=$(JDK_TOPDIR)/makefiles/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
    -	endif
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS,\
    -		LIBRARY:=awt_headless,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(LIBAWT_HEADLESS_DIRS),\
    -		INCLUDE_FILES:=$(LIBAWT_HEADLESS_FILES),\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) $(LIBAWT_HEADLESS_CFLAGS),\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libawt_headless/mapfile-vers,\
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_linux:=$(call SET_SHARED_LIBRARY_ORIGIN,/..),\
    -		LDFLAGS_solaris:=$(call SET_SHARED_LIBRARY_ORIGIN,/..) \
    -				 -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \
    -				 -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR),\
    -		LDFLAGS_macosx:=$(call SET_SHARED_LIBRARY_ORIGIN).,\
    -		REORDER:=$(LIBAWT_HEADLESS_REORDER), \
    -		LDFLAGS_SUFFIX_linux:=-ljvm -lawt -lm $(LIBDL) -ljava,\
    -		LDFLAGS_SUFFIX_solaris:=$(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc,\
    -		LDFLAGS_SUFFIX_macosx:=-ljvm $(LIBCXX) -lawt $(LIBDL) -ljava \
    -				 -framework Accelerate \
    -				 -framework ApplicationServices \
    -				 -framework Cocoa \
    -				 -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -				 -framework JavaNativeFoundation \
    -				 -framework JavaRuntimeSupport,\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libawt_headless,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBAWT_HEADLESS) : $(BUILD_LIBAWT)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBAWT_HEADLESS)
    -
    -endif
    -endif
    -
    -##########################################################################################
    -
    -ifndef BUILD_HEADLESS_ONLY
    -LIBSPLASHSCREEN_DIRS:=\
    -	$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \
    -	$(JDK_TOPDIR)/src/share/native/sun/awt/libpng \
    -	$(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen
    -
    -ifeq ($(USE_EXTERNAL_LIBGIF),true)
    -    GIFLIB_LDFLAGS := -lgif
    -else
    -    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/giflib
    -    GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib
    -endif
    -
    -ifneq ($(OPENJDK_TARGET_OS), macosx)
    -    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
    -else
    -    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen
    -endif
    -
    -LIBSPLASHSCREEN_CFLAGS:=-DSPLASHSCREEN -DPNG_NO_MMX_CODE \
    -	$(foreach dir,$(LIBSPLASHSCREEN_DIRS),-I$(dir))
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -	LIBSPLASHSCREEN_CFLAGS:=-I$(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen \
    -                                  $(LIBSPLASHSCREEN_CFLAGS) \
    -                                  -F/System/Library/Frameworks/JavaVM.framework/Frameworks
    -	LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
    -	LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp
    -
    -	LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS:=-x objective-c -O0
    -	LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS:=-x objective-c -O0
    -	LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS:=-x objective-c -O0
    -	LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS:=-x objective-c -O0
    -	LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS:=-x objective-c -O0
    -	LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS:=-x objective-c -O0
    -	LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS:=-O0
    -
    -else ifneq ($(OPENJDK_TARGET_OS), windows)
    -	LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions
    -else
    -	LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
    -endif
    -
    -LIBSPLASHSCREEN_LDFLAGS_SUFFIX:=
    -
    -ifneq ($(USE_EXTERNAL_LIBZ),true)
    -	LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
    -	LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -	LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(LIBM) -lpthread -liconv -losxapp \
    -				  -framework ApplicationServices \
    -				  -framework Foundation \
    -				  -framework Cocoa \
    -                                  -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -				  -framework JavaNativeFoundation
    -else ifneq ($(OPENJDK_TARGET_OS), windows)
    -	LIBSPLASHSCREEN_LDFLAGS_SUFFIX += -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -lX11 -lXext $(LIBM) -lpthread
    -else # OPENJDK_TARGET_OS
    -	LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll
    -endif # OPENJDK_TARGET_OS
    -
    -$(eval $(call SetupNativeCompilation,LIBSPLASHSCREEN,\
    -		LIBRARY:=splashscreen,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(LIBSPLASHSCREEN_DIRS),\
    -		EXCLUDE_FILES:=imageioJPEG.c jpegdecoder.c pngtest.c,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS),\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libsplashscreen/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX:=$(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) $(GIFLIB_LDFLAGS),\
    -		LDFLAGS_SUFFIX_solaris:=-lc,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=splashscreen.dll" \
    -			  -D "JDK_INTERNAL_NAME=splashscreen" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsplashscreen,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(LIBSPLASHSCREEN)
    -
    -ifeq ($(OPENJDK_TARGET_OS),macosx)
    -$(LIBSPLASHSCREEN) :  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX)
    -endif
    -
    -endif
    -
    -##########################################################################################
    -
    -ifndef OPENJDK
    -
    -LIBDCPR_SRC_DIRS:=\
    -	$(JDK_TOPDIR)/src/closed/share/native/sun/dc/doe \
    -	$(JDK_TOPDIR)/src/closed/share/native/sun/dc/path \
    -	$(JDK_TOPDIR)/src/closed/share/native/sun/dc/pr \
    -	$(JDK_TOPDIR)/src/closed/share/native/sun/dc/util
    -
    -LIBDCPR_CFLAGS:=$(foreach dir,$(LIBDCPR_SRC_DIRS),-I$(dir)) \
    -	          -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBDCPR,\
    -		LIBRARY:=dcpr,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(LIBDCPR_SRC_DIRS),\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -			$(LIBDCPR_CFLAGS), \
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libdcpr/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX:=$(LIBM) $(LDFLAGS_JDKLIB_SUFFIX),\
    -		LDFLAGS_SUFFIX_posix:=-lm,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=dcpr.dll" \
    -			  -D "JDK_INTERNAL_NAME=dcpr" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libdcpr,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBDCPR) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBDCPR)
    -
    -endif
    -
    -##########################################################################################
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC,\
    -		LIBRARY:=j2pcsc,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \
    -                     $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio,\
    -		LANG:=C,\
    -		CFLAGS_posix:=-D__sun_jdk,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -                     -I$(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \
    -                     -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio\
    -                     -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio/MUSCLE,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libj2pcsc/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX_posix:=$(LIBDL), \
    -		LDFLAGS_SUFFIX_windows:=winscard.lib,\
    -		LDFLAGS_SUFFIX_solaris:=-lc,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=j2pcsc.dll" \
    -			  -D "JDK_INTERNAL_NAME=j2pcsc" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libj2pcsc,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJ2PCSC)
    -
    -##########################################################################################
    -
    -ifneq ($(OPENJDK_TARGET_OS), windows)
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS,\
    -		LIBRARY:=j2gss,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \
    -                     $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -                     -I$(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \
    -                     -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libj2gss/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX:=$(LIBDL),\
    -		LDFLAGS_SUFFIX_solaris:=-lc,\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libj2gss,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJ2GSS)
    -endif
    -
    -##########################################################################################
    -
    -ifneq ($(BUILD_CRYPTO),no)
    -  BUILD_LIBKRB5_NAME:=
    -  ifeq ($(OPENJDK_TARGET_OS), windows)
    -     BUILD_LIBKRB5_NAME:=w2k_lsa_auth
    -     BUILD_LIBKRB5_SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/krb5
    -     BUILD_LIBKRB5_LIBS:=advapi32.lib Secur32.lib netapi32.lib kernel32.lib user32.lib \
    -			 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib \
    -			 ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib
    -  else ifeq ($(OPENJDK_TARGET_OS), macosx)
    -     BUILD_LIBKRB5_NAME:=osxkrb5
    -     BUILD_LIBKRB5_SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/krb5
    -     BUILD_LIBKRB5_LIBS:=-framework Kerberos
    -  endif
    -
    -  ifneq ($(BUILD_LIBKRB5_NAME),)
    -    $(eval $(call SetupNativeCompilation,BUILD_LIBKRB5,\
    -		LIBRARY:=$(BUILD_LIBKRB5_NAME),\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(BUILD_LIBKRB5_SRC),\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -		        -I$(JDK_TOPDIR)/src/share/native/sun/security/krb5 \
    -                        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/krb5 ,\
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX:=$(BUILD_LIBKRB5_LIBS) ,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=$(BUILD_LIBKRB5_NAME).dll" \
    -			  -D "JDK_INTERNAL_NAME=$(BUILD_LIBKRB5_NAME)" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libkrb5,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -    BUILD_LIBRARIES += $(BUILD_LIBKRB5)
    -  endif
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBSUNMSCAPI,\
    -		LIBRARY:=sunmscapi,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/mscapi,\
    -		LANG:=C++,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -                        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/mscapi ,\
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX:=Crypt32.Lib advapi32.lib,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=sunmscapi.dll" \
    -			  -D "JDK_INTERNAL_NAME=sunmscapi" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsunmscapi,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBSUNMSCAPI)
    -endif
    -
    -##########################################################################################
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11,\
    -		LIBRARY:=j2pkcs11,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \
    -                     $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11 \
    -                     $(JDK_TOPDIR)/src/share/native/sun/security/pkcs11/wrapper \
    -                     $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11/wrapper,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -		        -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \
    -		        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11 \
    -		        -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11/wrapper \
    -                        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11/wrapper,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libj2pkcs11/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX_posix:=$(LIBDL),\
    -		LDFLAGS_SUFFIX_solaris:=-lc,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=j2pkcs11.dll" \
    -			  -D "JDK_INTERNAL_NAME=j2pkcs11" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libj2pkcs11,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJ2PKCS11)
    -
    -##########################################################################################
    -
    -ifeq ($(ENABLE_INTREE_EC),yes)
    -
    -BUILD_LIBSUNEC_FLAGS:= -I$(JDK_TOPDIR)/src/share/native/sun/security/ec \
    -                       -I$(JDK_TOPDIR)/src/share/native/sun/security/ec/impl
    -
    -#
    -# On sol-sparc...all libraries are compiled with -xregs=no%appl
    -#   (set in CFLAGS_REQUIRED_sparc)
    -#
    -# except!!! libsunec.so
    -#
    -ECC_JNI_SOLSPARC_FILTER:=
    -ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
    -     ECC_JNI_SOLSPARC_FILTER:=-xregs=no%appl
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBSUNEC,\
    -		LIBRARY:=sunec,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/ec \
    -                     $(JDK_TOPDIR)/src/share/native/sun/security/ec/impl, \
    -		LANG:=C++, \
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CFLAGS_JDKLIB))\
    -                        $(BUILD_LIBSUNEC_FLAGS) \
    -                        -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B,\
    -		CXXFLAGS:=$(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CXXFLAGS_JDKLIB)) \
    -                          $(BUILD_LIBSUNEC_FLAGS),\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libsunec/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK),\
    -		LDFLAGS_macosx:=$(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX:=$(LIBCXX),\
    -                LDFLAGS_SUFFIX_linux:=-lc ,\
    -                LDFLAGS_SUFFIX_solaris:=-lc ,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=sunec.dll" \
    -			  -D "JDK_INTERNAL_NAME=sunec" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsunec,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBSUNEC)
    -endif
    -
    -##########################################################################################
    -
    -LIBJSOUND_SRC_DIRS:=\
    -	$(JDK_TOPDIR)/src/share/native/com/sun/media/sound \
    -	$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/media/sound
    -
    -LIBJSOUND_SRC_FILES:=Utilities.c Platform.c
    -
    -LIBJSOUND_LANG:=C
    -LIBJSOUND_CFLAGS:=$(foreach dir,$(LIBJSOUND_SRC_DIRS),-I$(dir))
    -
    -EXTRA_SOUND_JNI_LIBS:=
    -
    -LIBJSOUND_MIDIFILES:=\
    -	MidiInDevice.c \
    -	MidiInDeviceProvider.c \
    -	MidiOutDevice.c \
    -	MidiOutDeviceProvider.c \
    -	PlatformMidi.c
    -
    -# files needed for ports
    -LIBJSOUND_PORTFILES:=\
    -	PortMixerProvider.c \
    -	PortMixer.c
    -
    -# files needed for direct audio
    -LIBJSOUND_DAUDIOFILES:=\
    -	DirectAudioDeviceProvider.c \
    -	DirectAudioDevice.c
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -	EXTRA_SOUND_JNI_LIBS += jsoundds
    -	LIBJSOUND_CFLAGS += -DX_PLATFORM=X_WINDOWS \
    -                            -DUSE_PLATFORM_MIDI_OUT=TRUE \
    -                            -DUSE_PLATFORM_MIDI_IN=TRUE \
    -                            -DUSE_PORTS=TRUE
    -	LIBJSOUND_SRC_FILES += \
    -		PLATFORM_API_WinOS_MidiIn.cpp \
    -		PLATFORM_API_WinOS_MidiOut.c \
    -		PLATFORM_API_WinOS_Util.c \
    -		PLATFORM_API_WinOS_Ports.c
    -	LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
    -	LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
    -endif # OPENJDK_TARGET_OS windows
    -
    -ifeq ($(OPENJDK_TARGET_OS), linux)
    -	EXTRA_SOUND_JNI_LIBS += jsoundalsa
    -	LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX
    -endif # OPENJDK_TARGET_OS linux
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -	LIBJSOUND_LANG:=C++
    -	LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX \
    -                            -DUSE_PORTS=TRUE \
    -                            -DUSE_DAUDIO=TRUE \
    -                            -DUSE_PLATFORM_MIDI_OUT=TRUE \
    -                            -DUSE_PLATFORM_MIDI_IN=TRUE
    -	LIBJSOUND_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/com/sun/media/sound
    -	LIBJSOUND_SRC_FILES += \
    -		PLATFORM_API_MacOSX_Utils.cpp \
    -		PLATFORM_API_MacOSX_PCM.cpp \
    -		PLATFORM_API_MacOSX_Ports.cpp \
    -                PLATFORM_API_MacOSX_MidiIn.c \
    -                PLATFORM_API_MacOSX_MidiOut.c \
    -                PLATFORM_API_MacOSX_MidiUtils.c
    -	LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
    -	LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
    -	LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
    -endif # OPENJDK_TARGET_OS macosx
    -
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -	LIBJSOUND_CFLAGS += -DX_PLATFORM=X_SOLARIS \
    -                            -DUSE_PORTS=TRUE \
    -                            -DUSE_DAUDIO=TRUE
    -	LIBJSOUND_SRC_FILES += \
    -		PLATFORM_API_SolarisOS_Utils.c \
    -		PLATFORM_API_SolarisOS_Ports.c \
    -		PLATFORM_API_SolarisOS_PCM.c
    -	LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
    -	LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
    -	LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
    -endif # OPENJDK_TARGET_OS solaris
    -
    -
    -ifeq ($(JVM_VARIANT_ZERO), true)
    -	LIBJSOUND_CFLAGS += -DX_ARCH=X_ZERO
    -else
    -  ifeq ($(OPENJDK_TARGET_CPU), x86)
    -	LIBJSOUND_CFLAGS += -DX_ARCH=X_I586
    -  endif
    -
    -  ifeq ($(OPENJDK_TARGET_CPU), sparc)
    -	LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARC
    -  endif
    -
    -  ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
    -	LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARCV9
    -  endif
    -
    -  ifeq ($(OPENJDK_TARGET_CPU), x86_64)
    -	LIBJSOUND_CFLAGS += -DX_ARCH=X_AMD64
    -  endif
    -
    -  ifeq ($(OPENJDK_TARGET_CPU), arm)
    -	LIBJSOUND_CFLAGS += -DX_ARCH=X_ARM
    -  endif
    -
    -  ifeq ($(OPENJDK_TARGET_CPU), ppc)
    -	LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC
    -  endif
    -endif
    -
    -LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND,\
    -		LIBRARY:=jsound,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(LIBJSOUND_SRC_DIRS),\
    -		INCLUDE_FILES:=$(LIBJSOUND_SRC_FILES),\
    -		LANG:=$(LIBJSOUND_LANG),\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -		        $(LIBJSOUND_CFLAGS), \
    -		CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjsound/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB)\
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_macosx:=-framework CoreAudio -framework CoreFoundation \
    -				-framework CoreServices -framework AudioUnit $(LIBCXX) \
    -				-framework CoreMIDI -framework AudioToolbox,\
    -		LDFLAGS_windows:=$(WIN_JAVA_LIB) advapi32.lib winmm.lib,\
    -		LDFLAGS_SUFFIX_posix:=-ljava -ljvm,\
    -		LDFLAGS_SUFFIX_solaris:=-lc ,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=jsound.dll" \
    -			  -D "JDK_INTERNAL_NAME=jsound" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjsound,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBJSOUND) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJSOUND)
    -
    -##########################################################################################
    -
    -ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)),)
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA,\
    -		LIBRARY:=jsoundalsa,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(LIBJSOUND_SRC_DIRS),\
    -		INCLUDE_FILES:=Utilities.c $(LIBJSOUND_MIDIFILES) $(LIBJSOUND_PORTFILES) \
    -                                $(LIBJSOUND_DAUDIOFILES) \
    -				PLATFORM_API_LinuxOS_ALSA_CommonUtils.c   \
    -				PLATFORM_API_LinuxOS_ALSA_PCM.c     \
    -				PLATFORM_API_LinuxOS_ALSA_PCMUtils.c   \
    -				PLATFORM_API_LinuxOS_ALSA_MidiIn.c  \
    -				PLATFORM_API_LinuxOS_ALSA_MidiOut.c \
    -				PLATFORM_API_LinuxOS_ALSA_MidiUtils.c \
    -				PLATFORM_API_LinuxOS_ALSA_Ports.c,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) $(ALSA_CFLAGS) \
    -			$(LIBJSOUND_CFLAGS) \
    -			-DUSE_DAUDIO=TRUE \
    -			-DUSE_PORTS=TRUE  \
    -			-DUSE_PLATFORM_MIDI_OUT=TRUE \
    -			-DUSE_PLATFORM_MIDI_IN=TRUE, \
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjsoundalsa/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB)\
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX:=$(ALSA_LIBS) -ljava -ljvm,\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjsoundalsa,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBJSOUNDALSA) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJSOUNDALSA)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifneq ($(filter jsoundds, $(EXTRA_SOUND_JNI_LIBS)),)
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDDS,\
    -		LIBRARY:=jsoundds,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(LIBJSOUND_SRC_DIRS),\
    -		INCLUDE_FILES:=Utilities.c $(LIBJSOUND_DAUDIOFILES) \
    -				PLATFORM_API_WinOS_DirectSound.cpp, \
    -		LANG:=C++,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -			$(LIBJSOUND_CFLAGS) \
    -			-DUSE_DAUDIO=TRUE, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
    -			 $(call SET_SHARED_LIBRARY_ORIGIN),\
    -		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) dsound.lib winmm.lib user32.lib ole32.lib,\
    -		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
    -		RC_FLAGS:=$(RC_FLAGS)\
    -			  -D "JDK_FNAME=jsoundds.dll" \
    -			  -D "JDK_INTERNAL_NAME=jsoundds" \
    -			  -D "JDK_FTYPE=0x2L",\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjsoundds,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBJSOUNDDS) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJSOUNDDS)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -ifndef OPENJDK
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJ2UCRYPTO,\
    -		LIBRARY:=j2ucrypto,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -			-I$(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto ,\
    -		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libj2ucrypto/mapfile-vers, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB),\
    -		LDFLAGS_SUFFIX:=$(LIBDL),\
    -		LDFLAGS_SUFFIX_solaris:=-lc,\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libj2ucrypto,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBJ2UCRYPTO) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJ2UCRYPTO)
    -
    -endif
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBAPPLESCRIPTENGINE,\
    -		LIBRARY:=AppleScriptEngine,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(JDK_TOPDIR)/src/macosx/native/apple/applescript,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -			-I$(JDK_TOPDIR)/src/macosx/native/apple/applescript \
    -			-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -                        -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB)\
    -			 $(call SET_SHARED_LIBRARY_ORIGIN), \
    -		LDFLAGS_SUFFIX:=-framework Cocoa \
    -                                -framework Carbon \
    -                                -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -                                -framework JavaNativeFoundation \
    -                                $(LDFLAGS_JDKLIB_SUFFIX),\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libAppleScriptEngine,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBAPPLESCRIPTENGINE) : $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBAPPLESCRIPTENGINE)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBOSXAPP,\
    -		LIBRARY:=osxapp,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(JDK_TOPDIR)/src/macosx/native/sun/osxapp,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -			-I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
    -			-I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp \
    -                        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -                        -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks,\
    -		LDFLAGS:=$(LDFLAGS_JDKLIB)\
    -			 $(call SET_SHARED_LIBRARY_ORIGIN), \
    -		LDFLAGS_SUFFIX_macosx:=\
    -	-framework Accelerate \
    -	-framework ApplicationServices \
    -	-framework AudioToolbox \
    -	-framework Carbon \
    -	-framework Cocoa \
    -	-framework Security \
    -	-framework ExceptionHandling \
    -        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -	-framework JavaNativeFoundation \
    -	-framework JavaRuntimeSupport \
    -	-framework OpenGL \
    -	-framework IOSurface \
    -	-framework QuartzCore, \
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libosxapp,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBOSXAPP)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -
    -LIBOSX_DIRS:=\
    -  $(JDK_TOPDIR)/src/macosx/native/com/apple/concurrent \
    -  $(JDK_TOPDIR)/src/macosx/native/java/util \
    -  $(JDK_TOPDIR)/src/macosx/native/com/apple/eio \
    -  $(JDK_TOPDIR)/src/macosx/native/apple/security \
    -  $(JDK_TOPDIR)/src/macosx/native/apple/launcher
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBOSX,\
    -		LIBRARY:=osx,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(LIBOSX_DIRS),\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -                        $(foreach dir,$(LIBOSX_DIRS),-I$(dir)) \
    -                        -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
    -                        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -                        -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks,\
    -		LDFLAGS:=$(LDFLAGS_JDKLIB)\
    -			 $(call SET_SHARED_LIBRARY_ORIGIN), \
    -		LDFLAGS_SUFFIX_macosx:=\
    -    -losxapp \
    -    -framework Cocoa \
    -    -framework ApplicationServices \
    -    -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -    -framework JavaNativeFoundation \
    -    -framework JavaRuntimeSupport \
    -    -framework Security \
    -    -framework SystemConfiguration \
    -    $(LDFLAGS_JDKLIB_SUFFIX), \
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libosx,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBOSX)
    -
    -$(BUILD_LIBOSX) : $(BUILD_LIBOSXAPP)
    -
    -$(BUILD_LIBOSX) : $(BUILD_LIBJAVA)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -
    -LIBAWT_LWAWT_FILES:=\
    -        awt.m \
    -        ApplicationDelegate.m \
    -        CFRetainedResource.m \
    -        CGLGraphicsConfig.m \
    -        CGLSurfaceData.m \
    -        CGLLayer.m \
    -        CGraphicsConfig.m \
    -        CGraphicsDevice.m \
    -        CGraphicsEnv.m \
    -        CCharToGlyphMapper.m \
    -        CSystemColors.m \
    -        AWTFont.m \
    -        CGGlyphOutlines.m \
    -        CGGlyphImages.m \
    -        CoreTextSupport.m \
    -        AWTStrike.m \
    -        InitIDs.m \
    -        AWTEvent.m \
    -        AWTView.m \
    -        AWTWindow.m \
    -        AWTSurfaceLayers.m \
    -        CCursorManager.m \
    -        CClipboard.m \
    -        CDataTransferer.m \
    -        CDragSource.m \
    -        CDragSourceContextPeer.m \
    -        CDropTarget.m \
    -        CDropTargetContextPeer.m \
    -        CInputMethod.m \
    -        CDesktopPeer.m \
    -        OSVersion.m \
    -        DnDUtilities.m \
    -        CFileDialog.m \
    -        CImage.m \
    -        CMenu.m \
    -        CMenuBar.m \
    -        CMenuComponent.m \
    -        CMenuItem.m \
    -        CPopupMenu.m \
    -        CRobot.m \
    -        CTrayIcon.m \
    -        CWrapper.m \
    -        JavaAccessibilityAction.m \
    -        JavaAccessibilityUtilities.m \
    -        JavaComponentAccessibility.m \
    -        JavaTextAccessibility.m \
    -        LWCToolkit.m \
    -        GeomUtilities.m \
    -        CPrinterJob.m \
    -        PrintModel.m \
    -        PrinterSurfaceData.m \
    -        PrinterView.m \
    -        QuartzSurfaceData.m \
    -        QuartzRenderer.m \
    -        CTextPipe.m \
    -        ImageSurfaceData.m \
    -        awt_DrawingSurface.m \
    -        \
    -        OGLBlitLoops.c \
    -        OGLBufImgOps.c \
    -        OGLContext.c \
    -        OGLFuncs.c \
    -        OGLMaskBlit.c \
    -        OGLMaskFill.c \
    -        OGLPaints.c \
    -        OGLRenderQueue.c \
    -        OGLRenderer.c \
    -        OGLSurfaceData.c \
    -        OGLTextRenderer.c \
    -        OGLVertexCache.c \
    -        AccelGlyphCache.c \
    -        CUPSfuncs.c
    -
    -
    -LIBAWT_LWAWT_DIRS:=\
    -  $(JDK_TOPDIR)/src/macosx/native/sun/awt \
    -  $(JDK_TOPDIR)/src/macosx/native/sun/font \
    -  $(JDK_TOPDIR)/src/macosx/native/sun/java2d/opengl \
    -  $(JDK_TOPDIR)/src/solaris/native/sun/awt \
    -  $(JDK_TOPDIR)/src/share/native/sun/font \
    -  $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT,\
    -		LIBRARY:=awt_lwawt,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(LIBAWT_LWAWT_DIRS),\
    -		LANG:=C,\
    -		INCLUDE_FILES:=$(LIBAWT_LWAWT_FILES),\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -                        $(X_CFLAGS) \
    -                        $(X_LIBS) \
    -                        $(foreach dir,$(LIBAWT_LWAWT_DIRS),-I$(dir)) \
    -                        -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
    -                        -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
    -                        -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d \
    -                        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
    -                        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    -                        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    -                        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    -                        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -                        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -                        -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks,\
    -		LDFLAGS:=$(LDFLAGS_JDKLIB)\
    -			 $(call SET_SHARED_LIBRARY_ORIGIN), \
    -		LDFLAGS_SUFFIX_macosx:=-lawt -lmlib_image -losxapp -ljvm $(LIBM) \
    -				       -framework Accelerate \
    -				       -framework ApplicationServices \
    -				       -framework AudioToolbox \
    -				       -framework Carbon \
    -				       -framework Cocoa \
    -				       -framework Security \
    -				       -framework ExceptionHandling \
    -				       -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -				       -framework JavaNativeFoundation \
    -				       -framework JavaRuntimeSupport \
    -				       -framework OpenGL \
    -				       -framework QuartzCore -ljava,\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libawt_lwawt,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBAWT_LWAWT)
    -
    -$(BUILD_LIBAWT_LWAWT) : $(BUILD_LIBAWT)
    -
    -$(BUILD_LIBAWT_LWAWT) : $(BUILD_LIBMLIB_IMAGE)
    -
    -$(BUILD_LIBAWT_LWAWT) : $(BUILD_LIBOSXAPP)
    -
    -$(BUILD_LIBAWT_LWAWT) : $(BUILD_LIBJAVA)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI,\
    -		LIBRARY:=osxui,\
    -                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(JDK_TOPDIR)/src/macosx/native/com/apple/laf,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -                        -I$(JDK_TOPDIR)/src/macosx/native/com/apple/laf \
    -			-I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
    -			-I$(JDK_TOPDIR)/src/macosx/native/sun/awt \
    -                        -F/System/Library/Frameworks/JavaVM.framework/Frameworks, \
    -		LDFLAGS:=$(LDFLAGS_JDKLIB)\
    -			 $(call SET_SHARED_LIBRARY_ORIGIN) \
    -			 -Xlinker -rpath -Xlinker @loader_path,\
    -		LDFLAGS_SUFFIX_macosx:=-lawt -losxapp -lawt_lwawt \
    -				       -framework Cocoa \
    -				       -framework Carbon \
    -				       -framework ApplicationServices \
    -				       -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -				       -framework JavaNativeFoundation \
    -				       -framework JavaRuntimeSupport \
    -				       -ljava -ljvm,\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libosxui,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBOSXUI)
    -
    -$(BUILD_LIBOSXUI) : $(BUILD_LIBAWT)
    -
    -$(BUILD_LIBOSXUI) : $(BUILD_LIBOSXAPP)
    -
    -$(BUILD_LIBOSXUI) : $(BUILD_LIBAWT_LWAWT)
    -
    -#$(BUILD_LIBOSXUI) : $(BUILD_LIBJAVA)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -
    -# Ugly hack to mimic behaviour in old build where this is built as an xcode project.
    -SET_SHARED_LIBRARY_NAME=-Xlinker -install_name -Xlinker /usr/local/lib/libJObjC.dylib
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJOBJC32,\
    -		LIBRARY:=JObjC,\
    -                OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs/libjobjc32,\
    -		SRC:=$(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/native \
    -                     $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/native ,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=-fpascal-strings \
    -                        -fobjc-gc \
    -                        -gdwarf-2 \
    -                        $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers_jobjc \
    -                        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -			-m32,\
    -		LDFLAGS:=$(LDFLAGS_JDKLIB)\
    -			-m32, \
    -		LDFLAGS_SUFFIX:=-framework Foundation -framework JavaVM \
    -                                  -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -                                  -framework JavaNativeFoundation \
    -                                  -lffi, \
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjobjc32,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJOBJC64,\
    -		LIBRARY:=JObjC,\
    -                OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs/libjobjc64,\
    -		SRC:=$(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/native \
    -                     $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/native ,\
    -		LANG:=C,\
    -		OPTIMIZATION:=LOW, \
    -		CFLAGS:=-fpascal-strings \
    -                        -fobjc-gc \
    -                        -gdwarf-2 \
    -                        $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers_jobjc \
    -                        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -			, \
    -		LDFLAGS:=-fpascal-strings \
    -                         -fobjc-gc \
    -                         -gdwarf-2 \
    -                         $(LDFLAGS_JDKLIB)\
    -			 $(call SET_SHARED_LIBRARY_ORIGIN), \
    -		LDFLAGS_SUFFIX:=-framework Foundation -framework JavaVM \
    -                                  -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -                                  -framework JavaNativeFoundation \
    -                                  -lffi, \
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjobjc64,\
    -		DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
    -
    -$(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)JObjC$(SHARED_LIBRARY_SUFFIX): $(BUILD_LIBJOBJC32) $(BUILD_LIBJOBJC64)
    -	$(LIPO) -create -output $@ $(BUILD_LIBJOBJC32) $(BUILD_LIBJOBJC64)
    -
    -BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)JObjC$(SHARED_LIBRARY_SUFFIX)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifndef OPENJDK
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -
    -  ACCESSBRIDGE_SRCDIR:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge
    -
    -  define SetupAccessBridge
    -    # Parameter 1 Suffix
    -    # Parameter 2 Machine
    -    # Parameter 3 ACCESSBRIDGE_ARCH_ suffix
    -
    -    $(call SetupNativeCompilation,BUILD_JAWTACCESSBRIDGE$1,\
    -		LIBRARY=JAWTAccessBridge$1,\
    -		OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(ACCESSBRIDGE_SRCDIR),\
    -		INCLUDE_FILES:=JAWTAccessBridge.cpp,\
    -		LANG:=C++,\
    -		OPTIMIZATION:=LOW,\
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -			-DACCESSBRIDGE_ARCH_$3,\
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
    -			 winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \
    -			 ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
    -			 -subsystem:windows -machine:$2 \
    -			 -def:$(ACCESSBRIDGE_SRCDIR)/JAWTAccessBridge.DEF,\
    -		VERSIONINFO_RESOURCE:=$(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc,\
    -		RC_FLAGS:=$(RC_FLAGS),\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjawtaccessbridge$1,\
    -		DEBUG_SYMBOLS:=true)
    -
    -    $$(BUILD_JAWTACCESSBRIDGE$1): $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
    -
    -    $(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1,\
    -		LIBRARY=JavaAccessBridge$1,\
    -		OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(ACCESSBRIDGE_SRCDIR),\
    -		INCLUDE_FILES:=AccessBridgeATInstance.cpp AccessBridgeDebug.cpp \
    -			       AccessBridgeJavaEntryPoints.cpp \
    -			       AccessBridgeMessages.cpp JavaAccessBridge.cpp,\
    -		LANG:=C++,\
    -		OPTIMIZATION:=LOW,\
    -		CFLAGS:=$(CFLAGS_JDKLIB) \
    -			-DACCESSBRIDGE_ARCH_$3,\
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
    -			 winspool.lib comdlg32.lib advapi32.lib shell32.lib \
    -			 ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
    -			 -subsystem:windows -machine:$2 \
    -			 -def:$(ACCESSBRIDGE_SRCDIR)/JavaAccessBridge.DEF,\
    -		VERSIONINFO_RESOURCE:=$(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc,\
    -		RC_FLAGS:=$(RC_FLAGS),\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjavaaccessbridge$1,\
    -		DEBUG_SYMBOLS:=true)
    -
    -    $(call SetupNativeCompilation,BUILD_WINDOWSACCESSBRIDGE$1,\
    -		LIBRARY=WindowsAccessBridge$1,\
    -		OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
    -		SRC:=$(ACCESSBRIDGE_SRCDIR),\
    -		INCLUDE_FILES:=AccessBridgeJavaVMInstance.cpp AccessBridgeMessageQueue.cpp \
    -			       AccessBridgeMessages.cpp AccessBridgeWindowsEntryPoints.cpp \
    -			       WinAccessBridge.cpp AccessBridgeDebug.cpp \
    -			       AccessBridgeEventHandler.cpp,\
    -		LANG:=C++,\
    -		OPTIMIZATION:=LOW,\
    -		CFLAGS:=$(filter-out -MD,$(CFLAGS_JDKLIB)) -MT \
    -			-DACCESSBRIDGE_ARCH_$3,\
    -		LDFLAGS:=$(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
    -			 winspool.lib comdlg32.lib advapi32.lib shell32.lib \
    -			 ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
    -			 -subsystem:windows -machine:$2 \
    -			 -def:$(ACCESSBRIDGE_SRCDIR)/WinAccessBridge.DEF,\
    -		VERSIONINFO_RESOURCE:=$(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc,\
    -		RC_FLAGS:=$(RC_FLAGS),\
    -		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libwindowsaccessbridge$1,\
    -		DEBUG_SYMBOLS:=true)
    -
    -    BUILD_LIBRARIES += $$(BUILD_JAWTACCESSBRIDGE$1) $$(BUILD_JAVAACCESSBRIDGE$1) \
    -		       $$(BUILD_WINDOWSACCESSBRIDGE$1)
    -
    -  endef
    -
    -  ifeq ($(OPENJDK_TARGET_CPU_BITS),32)
    -    $(eval $(call SetupAccessBridge,-32,I386,32))
    -    $(eval $(call SetupAccessBridge,,I386,LEGACY))
    -  else
    -    $(eval $(call SetupAccessBridge,-64,X64,64))
    -  endif
    -endif
    -endif
    +include lib/Awt2dLibraries.gmk
     
    +include lib/SoundLibraries.gmk
     
     ##########################################################################################
     
    diff --git a/jdk/makefiles/CopyFiles.gmk b/jdk/makefiles/CopyFiles.gmk
    index 2b3cbf2e200..0ac509cc7be 100644
    --- a/jdk/makefiles/CopyFiles.gmk
    +++ b/jdk/makefiles/CopyFiles.gmk
    @@ -28,27 +28,27 @@ INCLUDEDIR = $(JDK_OUTPUTDIR)/include
     OPENJDK_TARGET_OS_INCLUDE = $(INCLUDEDIR)/$(OPENJDK_TARGET_OS)
     
     ifeq ($(OPENJDK_TARGET_OS), windows)
    -     OPENJDK_TARGET_OS_INCLUDE = $(INCLUDEDIR)/win32
    +  OPENJDK_TARGET_OS_INCLUDE = $(INCLUDEDIR)/win32
     else ifeq ($(OPENJDK_TARGET_OS), macosx)
    -     OPENJDK_TARGET_OS_INCLUDE = $(INCLUDEDIR)/darwin
    +  OPENJDK_TARGET_OS_INCLUDE = $(INCLUDEDIR)/darwin
     endif
     
     #
     # Copy exported header files to outputdir.
     #
    -H_TARGET_FILES =$(INCLUDEDIR)/jdwpTransport.h		\
    -		$(INCLUDEDIR)/jni.h 			\
    -		$(INCLUDEDIR)/jvmti.h			\
    -		$(INCLUDEDIR)/jvmticmlr.h		\
    -		$(INCLUDEDIR)/classfile_constants.h	\
    -		$(INCLUDEDIR)/jawt.h			\
    -		$(OPENJDK_TARGET_OS_INCLUDE)/jni_md.h	\
    -		$(OPENJDK_TARGET_OS_INCLUDE)/jawt_md.h
    +H_TARGET_FILES = $(INCLUDEDIR)/jdwpTransport.h \
    +    $(INCLUDEDIR)/jni.h \
    +    $(INCLUDEDIR)/jvmti.h \
    +    $(INCLUDEDIR)/jvmticmlr.h \
    +    $(INCLUDEDIR)/classfile_constants.h \
    +    $(INCLUDEDIR)/jawt.h \
    +    $(OPENJDK_TARGET_OS_INCLUDE)/jni_md.h \
    +    $(OPENJDK_TARGET_OS_INCLUDE)/jawt_md.h
     
     $(INCLUDEDIR)/%.h: $(JDK_TOPDIR)/src/share/javavm/export/%.h
     	$(call install-file)
     
    -$(OPENJDK_TARGET_OS_INCLUDE)/%.h: $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export/%.h
    +$(OPENJDK_TARGET_OS_INCLUDE)/%.h: $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_EXPORT_DIR)/javavm/export/%.h
     	$(call install-file)
     
     COPY_FILES = $(H_TARGET_FILES)
    @@ -56,22 +56,22 @@ COPY_FILES = $(H_TARGET_FILES)
     ##########################################################################################
     
     ifndef OPENJDK
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
         COPY_FILES += $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCallbacks.h \
    -		  $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCalls.h \
    -		  $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgePackages.h \
    -		  $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCalls.c \
    -		  $(JDK_OUTPUTDIR)/lib/accessibility.properties
    +        $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCalls.h \
    +        $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgePackages.h \
    +        $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCalls.c \
    +        $(JDK_OUTPUTDIR)/lib/accessibility.properties
     
         $(OPENJDK_TARGET_OS_INCLUDE)/bridge/%: \
    -		$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/%
    -	$(install-file)
    +        $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/%
    +		$(install-file)
     
         $(JDK_OUTPUTDIR)/lib/accessibility.properties: \
    -		$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/accessibility.properties
    -	$(install-file)
    +        $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/accessibility.properties
    +		$(install-file)
     
    -endif
    +  endif
     endif
     
     ##########################################################################################
    @@ -125,9 +125,9 @@ COPY_FILES += $(PSFONTPROPFILE_TARGET_FILES)
     # Copy flavormap.properties, cursor.properties and cursors gif files to LIBDIR
     #
     ifneq ($(OPENJDK_TARGET_OS), macosx)
    -OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib
    +  OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib
     else
    -OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/macosx/lib
    +  OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/macosx/lib
     endif
     
     $(LIBDIR)/flavormap.properties: $(OPENJDK_TARGET_OS_LIB_SRC)/flavormap.properties
    @@ -145,11 +145,11 @@ COPY_FILES += $(CURSORS_DEST_DIR)/cursors.properties
     
     CURSORS_LIB_SRC = $(JDK_TOPDIR)/src/share/lib/images/cursors
     ifeq ($(OPENJDK_TARGET_OS), windows)
    -CURSORS_SRC_FILES = $(CURSORS_LIB_SRC)/invalid32x32.gif $(wildcard $(CURSORS_LIB_SRC)/win32_*.gif)
    +  CURSORS_SRC_FILES = $(CURSORS_LIB_SRC)/invalid32x32.gif $(wildcard $(CURSORS_LIB_SRC)/win32_*.gif)
     else # OPENJDK_TARGET_OS
    -CURSORS_SRC_FILES = $(CURSORS_LIB_SRC)/invalid32x32.gif $(wildcard $(CURSORS_LIB_SRC)/motif_*.gif)
    +  CURSORS_SRC_FILES = $(CURSORS_LIB_SRC)/invalid32x32.gif $(wildcard $(CURSORS_LIB_SRC)/motif_*.gif)
     endif # OPENJDK_TARGET_OS
    -CURSORS_TARGET_FILES =  $(subst $(CURSORS_LIB_SRC),$(CURSORS_DEST_DIR),$(CURSORS_SRC_FILES))
    +CURSORS_TARGET_FILES = $(subst $(CURSORS_LIB_SRC),$(CURSORS_DEST_DIR),$(CURSORS_SRC_FILES))
     
     $(CURSORS_DEST_DIR)/%: $(CURSORS_LIB_SRC)/%
     	$(call install-file)
    @@ -158,7 +158,7 @@ COPY_FILES += $(CURSORS_TARGET_FILES)
     
     ##########################################################################################
     
    -CONTENT_TYPES_SRC=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib
    +CONTENT_TYPES_SRC = $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib
     
     $(LIBDIR)/content-types.properties: $(CONTENT_TYPES_SRC)/content-types.properties
     	$(call install-file)
    @@ -183,14 +183,14 @@ COPY_FILES += $(LIBDIR)/hijrah-config-umalqura.properties
     
     ##########################################################################################
     
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    +ifeq ($(OPENJDK_TARGET_OS), windows)
     
    -TZMAPPINGS_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib
    +  TZMAPPINGS_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib
     
    -$(LIBDIR)/tzmappings: $(TZMAPPINGS_SRC)/tzmappings
    +  $(LIBDIR)/tzmappings: $(TZMAPPINGS_SRC)/tzmappings
     	$(call install-file)
     
    -COPY_FILES += $(LIBDIR)/tzmappings
    +  COPY_FILES += $(LIBDIR)/tzmappings
     
     endif
     
    @@ -199,13 +199,13 @@ endif
     ICCPROFILE_DEST_DIR := $(LIBDIR)/cmm
     
     ifdef OPENJDK
    -    ICCPROFILE_SRC_DIR := $(JDK_TOPDIR)/src/share/lib/cmm/lcms
    +  ICCPROFILE_SRC_DIR := $(JDK_TOPDIR)/src/share/lib/cmm/lcms
     else
    -    ICCPROFILE_SRC_DIR := $(JDK_TOPDIR)/src/closed/share/lib/cmm/kcms
    +  ICCPROFILE_SRC_DIR := $(JDK_TOPDIR)/src/closed/share/lib/cmm/kcms
     endif
     
    -ICCPROFILE_SRCS:=$(wildcard $(ICCPROFILE_SRC_DIR)/*.pf)
    -ICCPROFILE_TARGET_FILES:=$(subst $(ICCPROFILE_SRC_DIR),$(ICCPROFILE_DEST_DIR),$(ICCPROFILE_SRCS))
    +ICCPROFILE_SRCS := $(wildcard $(ICCPROFILE_SRC_DIR)/*.pf)
    +ICCPROFILE_TARGET_FILES := $(subst $(ICCPROFILE_SRC_DIR),$(ICCPROFILE_DEST_DIR),$(ICCPROFILE_SRCS))
     
     $(ICCPROFILE_DEST_DIR)%.pf: $(ICCPROFILE_SRC_DIR)%.pf
     	$(call install-file)
    @@ -215,60 +215,58 @@ COPY_FILES += $(ICCPROFILE_TARGET_FILES)
     
     ##########################################################################################
     
    -#make sure freetype dll will be available at runtime as well as link time
    -#
    -#NB: Default freetype build system uses -h linker option and
    -#   result .so contains hardcoded library name that is later
    -#   used for adding dependencies to other objects
    -#   (e.g. libfontmanager.so).
    -#
    -#   It is not obvious how to extract that hardcoded name (libfreetype.so.6)
    -#   without overcomplicating logic here.
    -#   To workaround this we hardcode .6 suffix for now.
    -#
    -#   Note that .so.6 library will not be found by System.loadLibrary()
    -#        but fortunately we need to load FreeType library explicitly
    -#        on windows only
    -#
    -#TODO: rework this to avoid hardcoding library name in the makefile
    -#
    -ifdef OPENJDK
    -    ifeq ($(OPENJDK_TARGET_OS), windows)
    -        FREETYPE_LIB = $(JDK_OUTPUTDIR)/bin/$(call SHARED_LIBRARY,freetype)
    -    else
    -        ifeq ($(USING_SYSTEM_FT_LIB), false)
    -            FREETYPE_LIB = $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/$(call SHARED_LIBRARY,freetype).6
    +ifneq ($(FREETYPE_BUNDLE_LIB_PATH), )
    +  # We need to bundle the freetype library, so it will be available at runtime as well as link time.
    +  #
    +  # NB: Default freetype build system uses -h linker option and
    +  # result .so contains hardcoded library name that is later
    +  # used for adding dependencies to other objects
    +  # (e.g. libfontmanager.so).
    +  #
    +  # It is not obvious how to extract that hardcoded name (libfreetype.so.6)
    +  # without overcomplicating logic here.
    +  # To workaround this we hardcode .6 suffix for now.
    +  #
    +  # Note that .so.6 library will not be found by System.loadLibrary()
    +  # but fortunately we need to load FreeType library explicitly
    +  # on windows only
    +  #
    +  #TODO: rework this to avoid hardcoding library name in the makefile
    +  #
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
    +    FREETYPE_TARGET_LIB = $(JDK_OUTPUTDIR)/bin/$(call SHARED_LIBRARY,freetype)
    +  else
    +    FREETYPE_TARGET_LIB = $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/$(call SHARED_LIBRARY,freetype).6
    +  endif
    +
    +  $(FREETYPE_TARGET_LIB): $(FREETYPE_BUNDLE_LIB_PATH)/$(call SHARED_LIBRARY,freetype)
    +	$(CP) $(FREETYPE_BUNDLE_LIB_PATH)/$(call SHARED_LIBRARY,freetype) $@
    +        ifeq ($(OPENJDK_BUILD_OS), windows)
    +	  $(CHMOD) +rx $@
             endif
    -    endif
     
    -    $(FREETYPE_LIB): $(FREETYPE2_LIB_PATH)/$(call SHARED_LIBRARY,freetype)
    -	$(CP) $(FREETYPE2_LIB_PATH)/$(call SHARED_LIBRARY,freetype) $@
    -    ifeq ($(OPENJDK_BUILD_OS), windows)
    -	$(CHMOD) +rx $@
    -    endif
    -
    -    COPY_FILES += $(FREETYPE_LIB)
    +  COPY_FILES += $(FREETYPE_TARGET_LIB)
     endif
     
     ##########################################################################################
     
     # Copy msvcrXX.dll on windows
     
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -    MSVCR_TARGET := $(JDK_OUTPUTDIR)/bin/$(notdir $(MSVCR_DLL))
    -    # Chmod to avoid permission issues if bundles are unpacked on unix platforms.
    -    $(MSVCR_TARGET): $(MSVCR_DLL)
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  MSVCR_TARGET := $(JDK_OUTPUTDIR)/bin/$(notdir $(MSVCR_DLL))
    +  # Chmod to avoid permission issues if bundles are unpacked on unix platforms.
    +  $(MSVCR_TARGET): $(MSVCR_DLL)
     	$(call install-file)
     	$(CHMOD) a+rx $@
     
    -    COPY_FILES += $(MSVCR_TARGET)
    +  COPY_FILES += $(MSVCR_TARGET)
     endif
     
     ##########################################################################################
     
    -HPROF_SRC=$(JDK_TOPDIR)/src/share/demo/jvmti/hprof/jvm.hprof.txt
    +HPROF_SRC = $(JDK_TOPDIR)/src/share/demo/jvmti/hprof/jvm.hprof.txt
     
    -$(LIBDIR)/jvm.hprof.txt : $(HPROF_SRC)
    +$(LIBDIR)/jvm.hprof.txt: $(HPROF_SRC)
     	$(call install-file)
     
     COPY_FILES += $(LIBDIR)/jvm.hprof.txt
    @@ -279,12 +277,12 @@ COPY_FILES += $(LIBDIR)/jvm.hprof.txt
     # How to install jvm.cfg.
     #
     ifeq ($(JVM_VARIANT_ZERO), true)
    -    JVMCFG_ARCH := zero
    +  JVMCFG_ARCH := zero
     else
    -    JVMCFG_ARCH := $(OPENJDK_TARGET_CPU_LEGACY)
    +  JVMCFG_ARCH := $(OPENJDK_TARGET_CPU_LEGACY)
     endif
     
    -ifeq ($(OPENJDK_TARGET_OS),macosx)
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
       JVMCFG_SRC := $(JDK_TOPDIR)/src/macosx/bin/$(JVMCFG_ARCH)/jvm.cfg
     else
       JVMCFG_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/$(JVMCFG_ARCH)/jvm.cfg
    @@ -294,7 +292,7 @@ JVMCFG := $(JVMCFG_DIR)/jvm.cfg
     
     # To do: should this also support -zeroshark?
     
    -ifeq ($(OPENJDK_TARGET_CPU_BITS),64)
    +ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
       COPY_JVM_CFG_FILE := true
     else
       # On 32-bit machines we have three potential VMs: client, server and minimal.
    @@ -305,7 +303,7 @@ else
       # The main problem is deciding whether to use aliases for the VMs that are not
       # present and the current position is that we add aliases for client and server, but
       # not for minimal.
    -  CLIENT_AND_SERVER := $(and $(findstring true,$(JVM_VARIANT_SERVER)),$(findstring true,$(JVM_VARIANT_CLIENT)))
    +  CLIENT_AND_SERVER := $(and $(findstring true, $(JVM_VARIANT_SERVER)), $(findstring true, $(JVM_VARIANT_CLIENT)))
       ifeq ($(CLIENT_AND_SERVER), true)
         COPY_JVM_CFG_FILE := true
       else
    @@ -317,35 +315,34 @@ else
     endif
     
     ifeq ($(COPY_JVM_CFG_FILE), true)
    -    $(JVMCFG): $(JVMCFG_SRC)
    +  $(JVMCFG): $(JVMCFG_SRC)
     	$(call install-file)
     else
    -    $(JVMCFG):
    +  $(JVMCFG):
     	$(MKDIR) -p $(@D)
     	$(RM) $(@)
    -
    -    # Now check for other permutations
    -    ifeq ($(JVM_VARIANT_SERVER), true)
    -	$(PRINTF) "-server KNOWN\n">>$(@)
    -	$(PRINTF) "-client ALIASED_TO -server\n">>$(@)
    -        ifeq ($(JVM_VARIANT_MINIMAL1), true)
    +        # Now check for other permutations
    +        ifeq ($(JVM_VARIANT_SERVER), true)
    +	  $(PRINTF) "-server KNOWN\n">>$(@)
    +	  $(PRINTF) "-client ALIASED_TO -server\n">>$(@)
    +          ifeq ($(JVM_VARIANT_MINIMAL1), true)
     	    $(PRINTF) "-minimal KNOWN\n">>$(@)
    -        endif
    -    else
    -        ifeq ($(JVM_VARIANT_CLIENT), true)
    +          endif
    +        else
    +          ifeq ($(JVM_VARIANT_CLIENT), true)
     	    $(PRINTF) "-client KNOWN\n">>$(@)
     	    $(PRINTF) "-server ALIASED_TO -client\n">>$(@)
                 ifeq ($(JVM_VARIANT_MINIMAL1), true)
    -	        $(PRINTF) "-minimal KNOWN\n">>$(@)
    +	      $(PRINTF) "-minimal KNOWN\n">>$(@)
                 endif
    -        else
    +          else
                 ifeq ($(JVM_VARIANT_MINIMAL1), true)
    -	        $(PRINTF) "-minimal KNOWN\n">>$(@)
    -	        $(PRINTF) "-server ALIASED_TO -minimal\n">>$(@)
    -	        $(PRINTF) "-client ALIASED_TO -minimal\n">>$(@)
    +	      $(PRINTF) "-minimal KNOWN\n">>$(@)
    +	      $(PRINTF) "-server ALIASED_TO -minimal\n">>$(@)
    +	      $(PRINTF) "-client ALIASED_TO -minimal\n">>$(@)
                 endif
    +          endif
             endif
    -    endif
     endif
     
     COPY_FILES += $(JVMCFG)
    @@ -355,9 +352,23 @@ COPY_FILES += $(JVMCFG)
     PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-$(OPENJDK_TARGET_OS)
     PROPS_DST := $(JDK_OUTPUTDIR)/lib/security/java.security
     
    +ifndef OPENJDK
    +
    +RESTRICTED_PKGS_SRC := $(JDK_TOPDIR)/src/closed/share/lib/security/restricted.pkgs
    +RESTRICTED_PKGS := $(shell $(CAT) $(RESTRICTED_PKGS_SRC) | $(TR) "\n" " ")
    +
    +$(PROPS_DST): $(PROPS_SRC)
    +	$(MKDIR) -p $(@D)
    +	$(TOOL_ADDTORESTRICTEDPKGS) $^ $@.tmp $(RESTRICTED_PKGS)
    +	$(MV) $@.tmp $@
    +
    +else
    +
     $(PROPS_DST): $(PROPS_SRC)
     	$(call install-file)
     
    +endif
    +
     COPY_FILES += $(PROPS_DST)
     
     ##########################################################################################
    @@ -382,122 +393,141 @@ COPY_FILES += $(CACERTS_DST)
     
     ##########################################################################################
     
    +BLACKLISTED_CERTS_SRC := $(JDK_TOPDIR)/src/share/lib/security/blacklisted.certs
    +BLACKLISTED_CERTS_DST := $(JDK_OUTPUTDIR)/lib/security/blacklisted.certs
    +
     ifndef OPENJDK
     
    -BLACKLIST_SRC   := $(JDK_TOPDIR)/src/closed/share/lib/security/blacklist
    -BLACKLIST_DST   := $(JDK_OUTPUTDIR)/lib/security/blacklist
    +  BLACKLIST_SRC := $(JDK_TOPDIR)/src/closed/share/lib/security/blacklist
    +  BLACKLIST_DST := $(JDK_OUTPUTDIR)/lib/security/blacklist
     
    -TRUSTEDLIBS_SRC := $(JDK_TOPDIR)/src/closed/share/lib/security/trusted.libraries
    -TRUSTEDLIBS_DST := $(JDK_OUTPUTDIR)/lib/security/trusted.libraries
    +  BLACKLISTED_CERTS_SRC += $(wildcard $(JDK_TOPDIR)/src/closed/share/lib/security/blacklisted.certs)
     
    -$(BLACKLIST_DST): $(BLACKLIST_SRC)
    +  TRUSTEDLIBS_SRC := $(JDK_TOPDIR)/src/closed/share/lib/security/trusted.libraries
    +  TRUSTEDLIBS_DST := $(JDK_OUTPUTDIR)/lib/security/trusted.libraries
    +
    +  $(BLACKLIST_DST): $(BLACKLIST_SRC)
     	$(call install-file)
     
    -COPY_FILES += $(BLACKLIST_DST)
    +  COPY_FILES += $(BLACKLIST_DST)
     
    -$(TRUSTEDLIBS_DST): $(TRUSTEDLIBS_SRC)
    +  $(TRUSTEDLIBS_DST): $(TRUSTEDLIBS_SRC)
     	$(call install-file)
     
    -COPY_FILES += $(TRUSTEDLIBS_DST)
    +  COPY_FILES += $(TRUSTEDLIBS_DST)
     
     endif
     
    +$(BLACKLISTED_CERTS_DST): $(BLACKLISTED_CERTS_SRC)
    +	$(MKDIR) -p $(@D)
    +	$(CAT) $^ | $(SED) '/^$$/d' | $(SORT) | $(UNIQ) > $@.tmp
    +	$(GREP) -i Algorithm $@.tmp > $@
    +	if [ `$(SED) -n -e "$$=" $@` != 1 ]; then \
    +	   $(ECHO) "Different algorithms defined in $^"; \
    +	   $(RM) $@ $@.tmp; \
    +	   false; \
    +	fi
    +	$(GREP) -iv Algorithm $@.tmp >> $@
    +	$(RM) $@.tmp
    +
    +COPY_FILES += $(BLACKLISTED_CERTS_DST)
    +
     ##########################################################################################
     
     ifndef OPENJDK
     
    -SHARED_FONTS_SRC_DIR := $(JDK_TOPDIR)/src/closed/share/lib/fonts
    -SHARED_FONTS_DST_DIR := $(JDK_OUTPUTDIR)/lib/fonts
    -SHARED_FONTS_FILES   := \
    -	LucidaTypewriterRegular.ttf	\
    -	LucidaTypewriterBold.ttf        \
    -	LucidaBrightRegular.ttf         \
    -	LucidaBrightDemiBold.ttf        \
    -	LucidaBrightItalic.ttf          \
    -	LucidaBrightDemiItalic.ttf	\
    -	LucidaSansRegular.ttf       	\
    -	LucidaSansDemiBold.ttf       	\
    +  SHARED_FONTS_SRC_DIR := $(JDK_TOPDIR)/src/closed/share/lib/fonts
    +  SHARED_FONTS_DST_DIR := $(JDK_OUTPUTDIR)/lib/fonts
    +  SHARED_FONTS_FILES := \
    +      LucidaTypewriterRegular.ttf \
    +      LucidaTypewriterBold.ttf \
    +      LucidaBrightRegular.ttf \
    +      LucidaBrightDemiBold.ttf \
    +      LucidaBrightItalic.ttf \
    +      LucidaBrightDemiItalic.ttf \
    +      LucidaSansRegular.ttf \
    +      LucidaSansDemiBold.ttf \
     
    -SHARED_FONTS_SRC := $(foreach F,$(SHARED_FONTS_FILES),$(SHARED_FONTS_SRC_DIR)/$(F))
    -SHARED_FONTS_DST := $(foreach F,$(SHARED_FONTS_FILES),$(SHARED_FONTS_DST_DIR)/$(F))
    +  SHARED_FONTS_SRC := $(foreach F, $(SHARED_FONTS_FILES), $(SHARED_FONTS_SRC_DIR)/$(F))
    +  SHARED_FONTS_DST := $(foreach F, $(SHARED_FONTS_FILES), $(SHARED_FONTS_DST_DIR)/$(F))
     
    -$(SHARED_FONTS_DST_DIR)/%.ttf : $(SHARED_FONTS_SRC_DIR)/%.ttf
    +  $(SHARED_FONTS_DST_DIR)/%.ttf: $(SHARED_FONTS_SRC_DIR)/%.ttf
     	$(call install-file)
     
    -$(SHARED_FONTS_DST_DIR)/fonts.dir : $(JDK_TOPDIR)/src/solaris/classes/sun/awt/motif/java.fonts.dir
    +  $(SHARED_FONTS_DST_DIR)/fonts.dir: $(JDK_TOPDIR)/src/solaris/classes/sun/awt/motif/java.fonts.dir
     	$(call install-file)
     
    -COPY_FILES += $(SHARED_FONTS_DST)
    +  COPY_FILES += $(SHARED_FONTS_DST)
     
    -ifneq ($(OPENJDK_TARGET_OS), windows)
    +  ifneq ($(OPENJDK_TARGET_OS), windows)
         COPY_FILES += $(SHARED_FONTS_DST_DIR)/fonts.dir
    -endif
    +  endif
     
    -ifeq ($(OPENJDK_TARGET_OS), linux)
    +  ifeq ($(OPENJDK_TARGET_OS), linux)
     
    -# The oblique fonts are only needed/wanted on Linux.
    +  # The oblique fonts are only needed/wanted on Linux.
     
    -OBL_FONTS_SRC_DIR := $(JDK_TOPDIR)/src/closed/share/lib/fonts/oblique
    -OBL_FONTS_DST_DIR := $(JDK_OUTPUTDIR)/lib/oblique-fonts
    -OBL_FONTS_FILES   := LucidaTypewriterOblique.ttf LucidaTypewriterBoldOblique.ttf \
    -                    LucidaSansOblique.ttf LucidaSansDemiOblique.ttf
    +    OBL_FONTS_SRC_DIR := $(JDK_TOPDIR)/src/closed/share/lib/fonts/oblique
    +    OBL_FONTS_DST_DIR := $(JDK_OUTPUTDIR)/lib/oblique-fonts
    +    OBL_FONTS_FILES := LucidaTypewriterOblique.ttf LucidaTypewriterBoldOblique.ttf \
    +        LucidaSansOblique.ttf LucidaSansDemiOblique.ttf
     
    -OBL_FONTS_SRC := $(foreach F,$(OBL_FONTS_FILES),$(OBL_FONTS_SRC_DIR)/$(F))
    -OBL_FONTS_DST := $(foreach F,$(OBL_FONTS_FILES),$(OBL_FONTS_DST_DIR)/$(F))
    +    OBL_FONTS_SRC := $(foreach F, $(OBL_FONTS_FILES), $(OBL_FONTS_SRC_DIR)/$(F))
    +    OBL_FONTS_DST := $(foreach F, $(OBL_FONTS_FILES), $(OBL_FONTS_DST_DIR)/$(F))
     
    -$(OBL_FONTS_DST_DIR)/%.ttf : $(OBL_FONTS_SRC_DIR)/%.ttf
    +    $(OBL_FONTS_DST_DIR)/%.ttf: $(OBL_FONTS_SRC_DIR)/%.ttf
     	$(call install-file)
     
    -$(OBL_FONTS_DST_DIR)/fonts.dir : $(JDK_TOPDIR)/src/solaris/classes/sun/awt/motif/java.oblique-fonts.dir
    +    $(OBL_FONTS_DST_DIR)/fonts.dir: $(JDK_TOPDIR)/src/solaris/classes/sun/awt/motif/java.oblique-fonts.dir
     	$(call install-file)
     
    -COPY_FILES += $(OBL_FONTS_DST) $(OBL_FONTS_DST_DIR)/fonts.dir
    +    COPY_FILES += $(OBL_FONTS_DST) $(OBL_FONTS_DST_DIR)/fonts.dir
     
    -endif # linux
    +  endif # linux
     endif # OPENJDK
     
     ##########################################################################################
     
     ifndef OPENJDK
     
    -#
    -# Solaris X11 Direct Graphics Access library
    -#
    +  #
    +  # Solaris X11 Direct Graphics Access library
    +  #
     
    -_DGALIBS_sparc = \
    -	libxinerama.so \
    -	libjdgaSUNWcg6.so \
    -	libjdgaSUNWffb.so \
    -	libjdgaSUNWm64.so \
    -	libjdgaSUNWafb.so
    +  _DGALIBS_sparc = \
    +      libxinerama.so \
    +      libjdgaSUNWcg6.so \
    +      libjdgaSUNWffb.so \
    +      libjdgaSUNWm64.so \
    +      libjdgaSUNWafb.so
     
    -_DGALIBS_sparcv9 = \
    -	libxinerama.so \
    -	libjdgaSUNWcg6.so \
    -	libjdgaSUNWffb.so \
    -	libjdgaSUNWm64.so \
    -	libjdgaSUNWafb.so
    +  _DGALIBS_sparcv9 = \
    +      libxinerama.so \
    +      libjdgaSUNWcg6.so \
    +      libjdgaSUNWffb.so \
    +      libjdgaSUNWm64.so \
    +      libjdgaSUNWafb.so
     
    -_DGALIBS_i586 = 	# no i586 library yet
    +  _DGALIBS_i586 = # no i586 library yet
     
    -_DGALIBS_amd64 = 	# no amd64 library yet
    +  _DGALIBS_amd64 = # no amd64 library yet
     
    -DGALIBS = $(_DGALIBS_$(OPENJDK_TARGET_CPU_LEGACY):%=$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/%)
    +  DGALIBS = $(_DGALIBS_$(OPENJDK_TARGET_CPU_LEGACY):%=$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/%)
     
    -$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libxinerama.so: $(JDK_TOPDIR)/src/closed/solaris/lib/$(OPENJDK_TARGET_CPU_LEGACY)/libxinerama.so
    +  $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libxinerama.so: $(JDK_TOPDIR)/src/closed/solaris/lib/$(OPENJDK_TARGET_CPU_LEGACY)/libxinerama.so
     	$(call install-file)
     	$(CHMOD) 755 $@
     
    -$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjdgaSUNW%.so: $(JDK_TOPDIR)/src/closed/solaris/lib/$(OPENJDK_TARGET_CPU_LEGACY)/libjdgaSUNW%.so
    +  $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjdgaSUNW%.so: $(JDK_TOPDIR)/src/closed/solaris/lib/$(OPENJDK_TARGET_CPU_LEGACY)/libjdgaSUNW%.so
     	$(call install-file)
     	$(CHMOD) 755 $@
     
    -$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjdgaSUNWafb.so: $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjdgaSUNWffb.so
    +  $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjdgaSUNWafb.so: $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjdgaSUNWffb.so
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(LN) -s $( $$@
     endef
    -$(foreach i,$(META-INF_RULES_SERVICES),$(eval $(call addto_meta-inf_services,$i)))
    +$(foreach i, $(META-INF_RULES_SERVICES), $(eval $(call addto_meta-inf_services, $i)))
     # Here is the generic rule, whose receipt the above rules will trigger.
     
     COPY_EXTRA += $(OUT_SERVICES_FILES)
    @@ -224,7 +224,7 @@ COPY_EXTRA += $(OUT_SERVICES_FILES_PRINT)
     
     ###
     
    -$(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat : $(JDK_OUTPUTDIR)/gensrc/sun/nio/cs/ext/sjis0213.dat
    +$(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat: $(JDK_OUTPUTDIR)/gensrc/sun/nio/cs/ext/sjis0213.dat
     	$(call install-file)
     
     COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat
    @@ -234,17 +234,17 @@ COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat
     JAVAX_SOUND_SRC := $(JDK_TOPDIR)/src/share/classes/com/sun/media/sound/services
     
     JAVAX_SOUND_SRC_FILES := \
    -            javax.sound.midi.spi.MidiDeviceProvider \
    -            javax.sound.midi.spi.MidiFileReader \
    -            javax.sound.midi.spi.MidiFileWriter \
    -            javax.sound.midi.spi.SoundbankReader \
    -            javax.sound.sampled.spi.AudioFileReader \
    -            javax.sound.sampled.spi.AudioFileWriter \
    -            javax.sound.sampled.spi.FormatConversionProvider \
    -            javax.sound.sampled.spi.MixerProvider
    +    javax.sound.midi.spi.MidiDeviceProvider \
    +    javax.sound.midi.spi.MidiFileReader \
    +    javax.sound.midi.spi.MidiFileWriter \
    +    javax.sound.midi.spi.SoundbankReader \
    +    javax.sound.sampled.spi.AudioFileReader \
    +    javax.sound.sampled.spi.AudioFileWriter \
    +    javax.sound.sampled.spi.FormatConversionProvider \
    +    javax.sound.sampled.spi.MixerProvider
     
    -COPY_EXTRA += $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/,$(JAVAX_SOUND_SRC_FILES))
    +COPY_EXTRA += $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, $(JAVAX_SOUND_SRC_FILES))
     
    -JAVAX_SOUND_RULES := $(foreach F,$(JAVAX_SOUND_SRC_FILES),$(JDK_OUTPUTDIR)/classes/META-INF/services/$(notdir $F):$(JAVAX_SOUND_SRC)/$F)
    +JAVAX_SOUND_RULES := $(foreach F, $(JAVAX_SOUND_SRC_FILES), $(JDK_OUTPUTDIR)/classes/META-INF/services/$(notdir $F):$(JAVAX_SOUND_SRC)/$F)
     
    -$(foreach R,$(JAVAX_SOUND_RULES),$(eval $(call addto_meta-inf_services,$R)))
    +$(foreach R, $(JAVAX_SOUND_RULES), $(eval $(call addto_meta-inf_services, $R)))
    diff --git a/jdk/makefiles/CopySamples.gmk b/jdk/makefiles/CopySamples.gmk
    index 1f6b3bfb893..10d084a0144 100644
    --- a/jdk/makefiles/CopySamples.gmk
    +++ b/jdk/makefiles/CopySamples.gmk
    @@ -41,15 +41,15 @@ SAMPLE_TARGET := $(subst $(SAMPLE_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_SOUR
     
     ifndef OPENJDK
     # Exclude Main.java in EbayClient dir
    -    SAMPLE_CLOSED_SOURCE := $(shell $(FIND) $(SAMPLE_CLOSED_SOURCE_DIR) -type f -print | $(GREP) -v EbayClient/Main.java)
    -    SAMPLE_CLOSED_TARGET := $(subst $(SAMPLE_CLOSED_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_CLOSED_SOURCE))
    -    SAMPLE_TARGET += $(SAMPLE_CLOSED_TARGET)
    +  SAMPLE_CLOSED_SOURCE := $(shell $(FIND) $(SAMPLE_CLOSED_SOURCE_DIR) -type f -print | $(GREP) -v EbayClient/Main.java)
    +  SAMPLE_CLOSED_TARGET := $(subst $(SAMPLE_CLOSED_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_CLOSED_SOURCE))
    +  SAMPLE_TARGET += $(SAMPLE_CLOSED_TARGET)
     endif
     
     ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris macosx))
    -    SAMPLE_SOLARIS_SOURCE := $(shell $(FIND) $(SAMPLE_SOLARIS_SOURCE_DIR) -type f -print)
    -    SAMPLE_SOLARIS_TARGET := $(subst $(SAMPLE_SOLARIS_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_SOLARIS_SOURCE))
    -    SAMPLE_TARGET += $(SAMPLE_SOLARIS_TARGET)
    +  SAMPLE_SOLARIS_SOURCE := $(shell $(FIND) $(SAMPLE_SOLARIS_SOURCE_DIR) -type f -print)
    +  SAMPLE_SOLARIS_TARGET := $(subst $(SAMPLE_SOLARIS_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_SOLARIS_SOURCE))
    +  SAMPLE_TARGET += $(SAMPLE_SOLARIS_TARGET)
     endif
     
     $(SAMPLE_TARGET_DIR)/dtrace/%: $(SAMPLE_SOLARIS_SOURCE_DIR)/dtrace/%
    @@ -63,6 +63,6 @@ $(SAMPLE_TARGET_DIR)/%: $(SAMPLE_SOURCE_DIR)/%
     
     COPY_FILES += $(SAMPLE_TARGET)
     
    -all: $(COPY_FILES) 
    +all: $(COPY_FILES)
     
     .PHONY: all
    diff --git a/jdk/makefiles/CreateJars.gmk b/jdk/makefiles/CreateJars.gmk
    index e1d0a5d311b..8b965466d4e 100644
    --- a/jdk/makefiles/CreateJars.gmk
    +++ b/jdk/makefiles/CreateJars.gmk
    @@ -31,7 +31,7 @@ include Setup.gmk
     default: all
     
     # Prepare the find cache. Only used if running on windows.
    -$(eval $(call FillCacheFind,$(JDK_OUTPUTDIR)/classes))
    +$(eval $(call FillCacheFind, $(JDK_OUTPUTDIR)/classes))
     
     include Tools.gmk
     
    @@ -40,53 +40,53 @@ include Profiles.gmk
     #
     # This makefile...so that altering will trigger rebuilding include/exclude-lists => jars
     #
    -MAKEFILE=$(JDK_TOPDIR)/makefiles/CreateJars.gmk
    +MAKEFILE = $(JDK_TOPDIR)/makefiles/CreateJars.gmk
     #
     # And similarly for the Profiles
    -PROFILE_MAKEFILES=$(JDK_TOPDIR)/makefiles/Profiles.gmk $(JDK_TOPDIR)/makefiles/profile-rtjar-includes.txt
    +PROFILE_MAKEFILES = $(JDK_TOPDIR)/makefiles/Profiles.gmk $(JDK_TOPDIR)/makefiles/profile-rtjar-includes.txt
     
     MAINMANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf
     BEANMANIFEST := $(JDK_TOPDIR)/make/javax/swing/beaninfo/manifest
     
    -$(eval $(call MakeDir,$(IMAGES_OUTPUTDIR)/lib))
    +$(eval $(call MakeDir, $(IMAGES_OUTPUTDIR)/lib))
     
     ##########################################################################################
     
    -$(eval $(call SetupArchive,BUILD_JCONSOLE_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes,\
    -		SUFFIXES:=.class .gif .png .properties,\
    -		INCLUDES:=sun/tools/jconsole com/sun/tools/jconsole,\
    -		JARMAIN:=sun.tools.jconsole.JConsole,\
    -		JAR:=$(IMAGES_OUTPUTDIR)/lib/jconsole.jar,\
    -		SKIP_METAINF:=true))
    +$(eval $(call SetupArchive,BUILD_JCONSOLE_JAR, , \
    +    SRCS := $(JDK_OUTPUTDIR)/classes, \
    +    SUFFIXES := .class .gif .png .properties, \
    +    INCLUDES := sun/tools/jconsole com/sun/tools/jconsole, \
    +    JARMAIN := sun.tools.jconsole.JConsole, \
    +    JAR := $(IMAGES_OUTPUTDIR)/lib/jconsole.jar, \
    +    SKIP_METAINF := true))
     
     
     ##########################################################################################
     
    -$(eval $(call SetupArchive,BUILD_DNS_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes,\
    -		INCLUDES:=sun/net/spi/nameservice/dns,\
    -		EXTRA_FILES:=META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor,\
    -		JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/dnsns.jar,\
    -		SKIP_METAINF:=true))
    +$(eval $(call SetupArchive,BUILD_DNS_JAR, , \
    +    SRCS := $(JDK_OUTPUTDIR)/classes, \
    +    INCLUDES := sun/net/spi/nameservice/dns, \
    +    EXTRA_FILES := META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor, \
    +    JAR := $(IMAGES_OUTPUTDIR)/lib/ext/dnsns.jar, \
    +    SKIP_METAINF := true))
     
     
     ##########################################################################################
     
     LOCALEDATA_INCLUDE_LOCALES := ar be bg ca cs da de el es et fi fr ga hi hr hu in is it \
    -                              iw ja ko lt lv mk ms mt nl no pl pt ro ru sk sl sq sr sv \
    -                              th tr uk vi zh
    +    iw ja ko lt lv mk ms mt nl no pl pt ro ru sk sl sq sr sv \
    +    th tr uk vi zh
     
    -LOCALEDATA_INCLUDES := $(addprefix sun/text/resources/,$(LOCALEDATA_INCLUDE_LOCALES)) \
    -		       $(addprefix sun/util/resources/,$(LOCALEDATA_INCLUDE_LOCALES))
    +LOCALEDATA_INCLUDES := $(addprefix sun/text/resources/, $(LOCALEDATA_INCLUDE_LOCALES)) \
    +    $(addprefix sun/util/resources/, $(LOCALEDATA_INCLUDE_LOCALES))
     
    -$(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes,\
    -		SUFFIXES:=.class _dict _th,\
    -		INCLUDES:=$(LOCALEDATA_INCLUDES),\
    -		EXCLUDES:=sun/text/resources/th/BreakIteratorRules_th.class,\
    -		JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/localedata.jar,\
    -		SKIP_METAINF:=true))
    +$(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR, , \
    +    SRCS := $(JDK_OUTPUTDIR)/classes, \
    +    SUFFIXES := .class _dict _th, \
    +    INCLUDES := $(LOCALEDATA_INCLUDES), \
    +    EXCLUDES := sun/text/resources/th/BreakIteratorRules_th.class, \
    +    JAR := $(IMAGES_OUTPUTDIR)/lib/ext/localedata.jar, \
    +    SKIP_METAINF := true))
     
     ##########################################################################################
     #
    @@ -102,128 +102,122 @@ $(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR,,\
     # This value should exclude types destined for jars other than rt.jar and resources.jar.
     # When building a Profile this value augments the profile specific exclusions
     RT_JAR_EXCLUDES += \
    -	com/oracle/security \
    -	com/sun/codemodel \
    -	com/sun/crypto/provider \
    -	com/sun/istack/internal/tools \
    -	com/sun/jarsigner \
    -	com/sun/java/accessibility \
    -	com/sun/javadoc \
    -	com/sun/jdi \
    -	com/sun/net/ssl/internal/ssl \
    -	com/sun/source \
    -	com/sun/tools \
    -	com/sun/xml/internal/dtdparser \
    -	com/sun/xml/internal/rngom \
    -	com/sun/xml/internal/xsom \
    -	javax/crypto \
    -	javax/swing/AbstractButtonBeanInfo.class \
    -	javax/swing/beaninfo \
    -	javax/swing/BoxBeanInfo.class \
    -	javax/swing/JAppletBeanInfo.class \
    -	javax/swing/JButtonBeanInfo.class \
    -	javax/swing/JCheckBoxBeanInfo.class \
    -	javax/swing/JCheckBoxMenuItemBeanInfo.class \
    -	javax/swing/JColorChooserBeanInfo.class \
    -	javax/swing/JComboBoxBeanInfo.class \
    -	javax/swing/JComponentBeanInfo.class \
    -	javax/swing/JDesktopPaneBeanInfo.class \
    -	javax/swing/JDialogBeanInfo.class \
    -	javax/swing/JEditorPaneBeanInfo.class \
    -	javax/swing/JFileChooserBeanInfo.class \
    -	javax/swing/JFormattedTextFieldBeanInfo.class \
    -	javax/swing/JFrameBeanInfo.class \
    -	javax/swing/JInternalFrameBeanInfo.class \
    -	javax/swing/JLabelBeanInfo.class \
    -	javax/swing/JLayeredPaneBeanInfo.class \
    -	javax/swing/JListBeanInfo.class \
    -	javax/swing/JMenuBarBeanInfo.class \
    -	javax/swing/JMenuBeanInfo.class \
    -	javax/swing/JMenuItemBeanInfo.class \
    -	javax/swing/JOptionPaneBeanInfo.class \
    -	javax/swing/JPanelBeanInfo.class \
    -	javax/swing/JPasswordFieldBeanInfo.class \
    -	javax/swing/JPopupMenuBeanInfo.class \
    -	javax/swing/JProgressBarBeanInfo.class \
    -	javax/swing/JRadioButtonBeanInfo.class \
    -	javax/swing/JRadioButtonMenuItemBeanInfo.class \
    -	javax/swing/JScrollBarBeanInfo.class \
    -	javax/swing/JScrollPaneBeanInfo.class \
    -	javax/swing/JSeparatorBeanInfo.class \
    -	javax/swing/JSliderBeanInfo.class \
    -	javax/swing/JSpinnerBeanInfo.class \
    -	javax/swing/JSplitPaneBeanInfo.class \
    -	javax/swing/JTabbedPaneBeanInfo.class \
    -	javax/swing/JTableBeanInfo.class \
    -	javax/swing/JTextAreaBeanInfo.class \
    -	javax/swing/JTextFieldBeanInfo.class \
    -	javax/swing/JTextPaneBeanInfo.class \
    -	javax/swing/JToggleButtonBeanInfo.class \
    -	javax/swing/JToolBarBeanInfo.class \
    -	javax/swing/JTreeBeanInfo.class \
    -	javax/swing/JWindowBeanInfo.class \
    -	javax/swing/SwingBeanInfoBase.class \
    -	javax/swing/text/JTextComponentBeanInfo.class \
    -	META-INF/services/com.sun.jdi.connect.Connector \
    -	META-INF/services/com.sun.jdi.connect.spi.TransportService \
    -	META-INF/services/com.sun.tools.attach.spi.AttachProvider \
    -	META-INF/services/com.sun.tools.xjc.Plugin \
    -	META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor \
    -	org/relaxng/datatype \
    -	sun/awt/HKSCS.class \
    -	sun/awt/motif/X11GB2312.class \
    -	sun/awt/motif/X11GB2312\$$$$Decoder.class \
    -	sun/awt/motif/X11GB2312\$$$$Encoder.class \
    -	sun/awt/motif/X11GBK.class \
    -	sun/awt/motif/X11GBK\$$$$Encoder.class \
    -	sun/awt/motif/X11KSC5601.class \
    -	sun/awt/motif/X11KSC5601\$$$$Decoder.class \
    -	sun/awt/motif/X11KSC5601\$$$$Encoder.class \
    -	sun/jvmstat \
    -	sun/net/spi/nameservice/dns \
    -	sun/nio/cs/ext \
    -	sun/rmi/rmic \
    -	sun/security/ec \
    -	sun/security/internal \
    -	sun/security/mscapi \
    -	sun/security/pkcs11 \
    -	sun/security/provider/Sun.class \
    -	sun/security/rsa/SunRsaSign.class \
    -	sun/security/ssl \
    -	sun/security/tools/jarsigner \
    -	sun/swing/BeanInfoUtils.class \
    -	sun/text/resources/cldr \
    -	sun/tools/asm \
    -	sun/tools/attach \
    -	sun/tools/java \
    -	sun/tools/javac \
    -	sun/tools/jcmd \
    -	sun/tools/jconsole \
    -	sun/tools/jinfo \
    -	sun/tools/jmap \
    -	sun/tools/jps \
    -	sun/tools/jstack \
    -	sun/tools/jstat \
    -	sun/tools/jstatd \
    -	sun/tools/native2ascii \
    -	sun/tools/serialver \
    -	sun/tools/tree \
    -	sun/tools/util \
    -	sun/util/cldr/CLDRLocaleDataMetaInfo.class \
    -	sun/util/resources/cldr \
    -	$(LOCALEDATA_INCLUDES) \
    -	com/oracle/jrockit/jfr \
    -	oracle/jrockit/jfr \
    -	jdk/jfr
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -        RT_JAR_EXCLUDES += com/sun/nio/sctp \
    -                           sun/nio/ch/sctp
    -endif
    +    com/sun/codemodel \
    +    com/sun/crypto/provider \
    +    com/sun/istack/internal/tools \
    +    com/sun/jarsigner \
    +    com/sun/java/accessibility \
    +    com/sun/javadoc \
    +    com/sun/jdi \
    +    com/sun/net/ssl/internal/ssl \
    +    com/sun/source \
    +    com/sun/tools \
    +    com/sun/xml/internal/dtdparser \
    +    com/sun/xml/internal/rngom \
    +    com/sun/xml/internal/xsom \
    +    javax/crypto \
    +    javax/swing/AbstractButtonBeanInfo.class \
    +    javax/swing/beaninfo \
    +    javax/swing/BoxBeanInfo.class \
    +    javax/swing/JAppletBeanInfo.class \
    +    javax/swing/JButtonBeanInfo.class \
    +    javax/swing/JCheckBoxBeanInfo.class \
    +    javax/swing/JCheckBoxMenuItemBeanInfo.class \
    +    javax/swing/JColorChooserBeanInfo.class \
    +    javax/swing/JComboBoxBeanInfo.class \
    +    javax/swing/JComponentBeanInfo.class \
    +    javax/swing/JDesktopPaneBeanInfo.class \
    +    javax/swing/JDialogBeanInfo.class \
    +    javax/swing/JEditorPaneBeanInfo.class \
    +    javax/swing/JFileChooserBeanInfo.class \
    +    javax/swing/JFormattedTextFieldBeanInfo.class \
    +    javax/swing/JFrameBeanInfo.class \
    +    javax/swing/JInternalFrameBeanInfo.class \
    +    javax/swing/JLabelBeanInfo.class \
    +    javax/swing/JLayeredPaneBeanInfo.class \
    +    javax/swing/JListBeanInfo.class \
    +    javax/swing/JMenuBarBeanInfo.class \
    +    javax/swing/JMenuBeanInfo.class \
    +    javax/swing/JMenuItemBeanInfo.class \
    +    javax/swing/JOptionPaneBeanInfo.class \
    +    javax/swing/JPanelBeanInfo.class \
    +    javax/swing/JPasswordFieldBeanInfo.class \
    +    javax/swing/JPopupMenuBeanInfo.class \
    +    javax/swing/JProgressBarBeanInfo.class \
    +    javax/swing/JRadioButtonBeanInfo.class \
    +    javax/swing/JRadioButtonMenuItemBeanInfo.class \
    +    javax/swing/JScrollBarBeanInfo.class \
    +    javax/swing/JScrollPaneBeanInfo.class \
    +    javax/swing/JSeparatorBeanInfo.class \
    +    javax/swing/JSliderBeanInfo.class \
    +    javax/swing/JSpinnerBeanInfo.class \
    +    javax/swing/JSplitPaneBeanInfo.class \
    +    javax/swing/JTabbedPaneBeanInfo.class \
    +    javax/swing/JTableBeanInfo.class \
    +    javax/swing/JTextAreaBeanInfo.class \
    +    javax/swing/JTextFieldBeanInfo.class \
    +    javax/swing/JTextPaneBeanInfo.class \
    +    javax/swing/JToggleButtonBeanInfo.class \
    +    javax/swing/JToolBarBeanInfo.class \
    +    javax/swing/JTreeBeanInfo.class \
    +    javax/swing/JWindowBeanInfo.class \
    +    javax/swing/SwingBeanInfoBase.class \
    +    javax/swing/text/JTextComponentBeanInfo.class \
    +    META-INF/services/com.sun.jdi.connect.Connector \
    +    META-INF/services/com.sun.jdi.connect.spi.TransportService \
    +    META-INF/services/com.sun.tools.attach.spi.AttachProvider \
    +    META-INF/services/com.sun.tools.xjc.Plugin \
    +    META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor \
    +    org/relaxng/datatype \
    +    sun/awt/HKSCS.class \
    +    sun/awt/motif/X11GB2312.class \
    +    sun/awt/motif/X11GB2312\$$$$Decoder.class \
    +    sun/awt/motif/X11GB2312\$$$$Encoder.class \
    +    sun/awt/motif/X11GBK.class \
    +    sun/awt/motif/X11GBK\$$$$Encoder.class \
    +    sun/awt/motif/X11KSC5601.class \
    +    sun/awt/motif/X11KSC5601\$$$$Decoder.class \
    +    sun/awt/motif/X11KSC5601\$$$$Encoder.class \
    +    sun/jvmstat \
    +    sun/net/spi/nameservice/dns \
    +    sun/nio/cs/ext \
    +    sun/rmi/rmic \
    +    sun/security/ec \
    +    sun/security/internal \
    +    sun/security/mscapi \
    +    sun/security/pkcs11 \
    +    sun/security/provider/Sun.class \
    +    sun/security/rsa/SunRsaSign.class \
    +    sun/security/ssl \
    +    sun/security/tools/jarsigner \
    +    sun/swing/BeanInfoUtils.class \
    +    sun/text/resources/cldr \
    +    sun/tools/asm \
    +    sun/tools/attach \
    +    sun/tools/java \
    +    sun/tools/javac \
    +    sun/tools/jcmd \
    +    sun/tools/jconsole \
    +    sun/tools/jinfo \
    +    sun/tools/jmap \
    +    sun/tools/jps \
    +    sun/tools/jstack \
    +    sun/tools/jstat \
    +    sun/tools/jstatd \
    +    sun/tools/native2ascii \
    +    sun/tools/serialver \
    +    sun/tools/tree \
    +    sun/tools/util \
    +    sun/util/cldr/CLDRLocaleDataMetaInfo.class \
    +    sun/util/resources/cldr \
    +    $(LOCALEDATA_INCLUDES) \
    +    com/oracle/jrockit/jfr \
    +    oracle/jrockit/jfr \
    +    jdk/jfr
     
     # Find all files in the classes dir to use as dependencies. This could be more fine granular.
    -ALL_FILES_IN_CLASSES := $(call not-containing,_the.,$(filter-out %javac_state,\
    -                        $(call CacheFind,$(JDK_OUTPUTDIR)/classes)))
    +ALL_FILES_IN_CLASSES := $(call not-containing, _the., $(filter-out %javac_state, \
    +    $(call CacheFind, $(JDK_OUTPUTDIR)/classes)))
     
     RT_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar_manifest
     RESOURCE_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar_manifest
    @@ -231,9 +225,9 @@ RESOURCE_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.j
     $(RT_JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
     	$(MKDIR) -p $(@D)
     	$(RM) $@ $@.tmp
    -	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" 		\
    -	       -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
    -	       $(MAINMANIFEST) >> $@.tmp
    +	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
    +	    -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
    +	    $(MAINMANIFEST) >> $@.tmp
     	$(ECHO) >> $@.tmp
     	$(CAT) $(BEANMANIFEST) >> $@.tmp
     	$(MV) $@.tmp $@
    @@ -241,9 +235,9 @@ $(RT_JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
     $(RESOURCE_JAR_MANIFEST_FILE): $(MAINMANIFEST)
     	$(MKDIR) -p $(@D)
     	$(RM) $@ $@.tmp
    -	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" 		\
    -	       -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
    -	       $(MAINMANIFEST) >> $@.tmp
    +	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
    +	    -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
    +	    $(MAINMANIFEST) >> $@.tmp
     	$(MV) $@.tmp $@
     
     $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude: $(MAKEFILE) $(PROFILE_MAKEFILES)
    @@ -252,32 +246,32 @@ $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude: $(MAKEFILE) $(PROFILE_MAKEF
     	$(call ListPathsSafely,RT_JAR_EXCLUDES,\n, >> $@.tmp)
     	$(MV) $@.tmp $@
     
    -$(IMAGES_OUTPUTDIR)/lib/classlist : $(JDK_TOPDIR)/make/tools/sharing/classlist.$(OPENJDK_TARGET_OS) \
    -  $(MAKEFILE)
    +$(IMAGES_OUTPUTDIR)/lib/classlist: $(JDK_TOPDIR)/make/tools/sharing/classlist.$(OPENJDK_TARGET_OS) \
    +    $(MAKEFILE)
     	$(MKDIR) -p $(@D)
     	$(RM) $@ $@.tmp
     	$(TOOL_ADDJSUM) $< $@.tmp
     	$(MV) $@.tmp $@
     
     $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents: $(BUILD_TOOLS) $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude \
    -					 $(ALL_FILES_IN_CLASSES) $(IMAGES_OUTPUTDIR)/lib/classlist
    +    $(ALL_FILES_IN_CLASSES) $(IMAGES_OUTPUTDIR)/lib/classlist
     	$(MKDIR) -p $(@D)
     	$(RM) $@ $@.tmp
     	($(CD) $(JDK_OUTPUTDIR)/classes && \
    -	    $(TOOL_JARREORDER) \
    -		-o  $@.tmp $(IMAGES_OUTPUTDIR)/lib/classlist $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude . )
    +	$(TOOL_JARREORDER) \
    +	    -o $@.tmp $(IMAGES_OUTPUTDIR)/lib/classlist $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude . )
     	$(MV) $@.tmp $@
     
     $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents
     	$(MKDIR) -p $(@D)
     	$(RM) $@ $@.tmp
     	$(GREP) -e '\.class$$' $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
    -ifneq ($(PROFILE),)
    -#       # Add back classes from excluded packages (fixing the $ substitution in the process)
    -	for type in  $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
    -	  $(ECHO) $$type >> $@.tmp ; \
    -	done
    -endif
    +        ifneq ($(PROFILE), )
    +          # # Add back classes from excluded packages (fixing the $ substitution in the process)
    +	  for type in $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
    +	    $(ECHO) $$type >> $@.tmp ; \
    +	  done
    +        endif
     	$(MV) $@.tmp $@
     
     $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents
    @@ -286,21 +280,21 @@ $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents: $(IMAGES_OUTPUTDI
     	$(GREP) -v -e '\.class$$' \
     	    -e '/_the\.*' -e '^_the\.*' -e '\\_the\.*' -e 'javac_state' \
     	    $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
    -ifneq ($(PROFILE),)
    -#       # Strip out all META-INF/services/ entries
    -	$(GREP) -v -e 'META-INF/services/' $@.tmp > $@.tmp2
    -#       # Add back the required services
    -#       # FIXME: On Solaris if PROFILE_INCLUDE_METAINF_SERVICES is not defined
    -#       # we get a syntax error from sh. That doesn't happen on linux
    -	for service in $(PROFILE_INCLUDE_METAINF_SERVICES) ; do \
    -	  $(ECHO) $$service >> $@.tmp2; \
    -	done
    -	$(MV) $@.tmp2 $@.tmp
    -endif
    +        ifneq ($(PROFILE), )
    +          # # Strip out all META-INF/services/ entries
    +	  $(GREP) -v -e 'META-INF/services/' $@.tmp > $@.tmp2
    +          # # Add back the required services
    +          # # FIXME: On Solaris if PROFILE_INCLUDE_METAINF_SERVICES is not defined
    +          # # we get a syntax error from sh. That doesn't happen on linux
    +	  for service in $(PROFILE_INCLUDE_METAINF_SERVICES) ; do \
    +	    $(ECHO) $$service >> $@.tmp2; \
    +	  done
    +	  $(MV) $@.tmp2 $@.tmp
    +        endif
     	$(MV) $@.tmp $@
     
     # This is a hack but I don't know how to make this fit into the existing scheme
    -$(PROFILE_VERSION_CLASS_TARGETS) : $(PROFILE_VERSION_JAVA_TARGETS)
    +$(PROFILE_VERSION_CLASS_TARGETS): $(PROFILE_VERSION_JAVA_TARGETS)
     	@$(JAVAC) -d $(@D)/../../ $(@D)/$(VERSION_JAVA_FILE)
     
     
    @@ -322,486 +316,204 @@ CLASSES_TO_DEBEAN = \
         com/sun/java/util/jar/pack/PackerImpl.class \
         com/sun/java/util/jar/pack/UnpackerImpl.class
     
    -ifneq ($(PROFILE),)
    -    BEANLESS_CLASSES_TARGETS := $(addprefix $(BEANLESS_CLASSES)/, $(CLASSES_TO_DEBEAN))
    +ifneq ($(PROFILE), )
    +  BEANLESS_CLASSES_TARGETS := $(addprefix $(BEANLESS_CLASSES)/, $(CLASSES_TO_DEBEAN))
     endif
     
     
     RT_JAR_CREATE_OPTIONS := c0fm
     RT_JAR_UPDATE_OPTIONS := u0f
     ifeq ($(COMPRESS_JARS), true)
    -    RT_JAR_CREATE_OPTIONS := cfm
    -    RT_JAR_UPDATE_OPTIONS := uf
    +  RT_JAR_CREATE_OPTIONS := cfm
    +  RT_JAR_UPDATE_OPTIONS := uf
     endif
     
     # This defines a target-specific variables to make the shell logic easier to see.
     # We need to find the Version.class file for the profile currently being built
     $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: \
    -  CLASS_FILE = $(if $(PROFILE),$(strip $(foreach class,$(PROFILE_VERSION_CLASS_TARGETS),$(if $(findstring $(PROFILE),$(class)),$(class)))), NO_SUCH_FILE)
    +    CLASS_FILE = $(if $(PROFILE), $(strip $(foreach class, $(PROFILE_VERSION_CLASS_TARGETS), $(if $(findstring $(PROFILE), $(class)), $(class)))), NO_SUCH_FILE)
     # This is the real target
     $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents $(RT_JAR_MANIFEST_FILE) $(PROFILE_VERSION_CLASS_TARGETS) $(BEANLESS_CLASSES_TARGETS)
     	$(ECHO) Creating rt.jar $(PROFILE) Compressed=$(COMPRESS_JARS)
     	$(MKDIR) -p $(@D)
     	$(RM) $@ $@.tmp
     	$(CD) $(JDK_OUTPUTDIR)/classes && \
    -	    $(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RT_JAR_MANIFEST_FILE) \
    -	        @$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents && \
    -	    if [ -f $(CLASS_FILE) ]; then \
    -	      $(ECHO)  Updating rt.jar $(PROFILE) && \
    -	      $(CD) $(patsubst %$(VERSION_CLASS_PATH),%,$(CLASS_FILE)) && \
    -                $(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(VERSION_CLASS_PATH); \
    -	      $(CD) $(BEANLESS_CLASSES) && \
    -		$(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(CLASSES_TO_DEBEAN); \
    -            fi
    +	$(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RT_JAR_MANIFEST_FILE) \
    +	    @$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents && \
    +	if [ -f $(CLASS_FILE) ]; then \
    +	  $(ECHO) Updating rt.jar $(PROFILE) && \
    +	  $(CD) $(patsubst %$(VERSION_CLASS_PATH), %, $(CLASS_FILE)) && \
    +	  $(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(VERSION_CLASS_PATH); \
    +	  $(CD) $(BEANLESS_CLASSES) && \
    +	  $(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(CLASSES_TO_DEBEAN); \
    +	fi
     	$(MV) $@.tmp $@
     
     $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/resources.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents \
    -				    $(RESOURCE_JAR_MANIFEST_FILE)
    +    $(RESOURCE_JAR_MANIFEST_FILE)
     	$(ECHO) Creating resources.jar
     	$(MKDIR) -p $(@D)
     	$(RM) $@ $@.tmp
     	$(CD) $(JDK_OUTPUTDIR)/classes && \
    -	    $(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RESOURCE_JAR_MANIFEST_FILE) \
    -	        @$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents
    +	$(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RESOURCE_JAR_MANIFEST_FILE) \
    +	    @$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents
     	$(MV) $@.tmp $@
     
     ##########################################################################################
     
     ifneq ($(OPENJDK_TARGET_OS), windows)
    -    CHARSETS_EXTRA_FILES:=sun/awt/motif/X11GBK.class \
    -                          sun/awt/motif/X11GB2312\$$$$Decoder.class \
    -                          sun/awt/motif/X11GB2312.class \
    -                          sun/awt/motif/X11KSC5601\$$$$Decoder.class \
    -                          sun/awt/motif/X11KSC5601\$$$$Encoder.class \
    -                          sun/awt/motif/X11GB2312\$$$$Encoder.class \
    -                          sun/awt/motif/X11GBK\$$$$Encoder.class \
    -                          sun/awt/motif/X11KSC5601.class
    +  CHARSETS_EXTRA_FILES := sun/awt/motif/X11GBK.class \
    +      sun/awt/motif/X11GB2312\$$$$Decoder.class \
    +      sun/awt/motif/X11GB2312.class \
    +      sun/awt/motif/X11KSC5601\$$$$Decoder.class \
    +      sun/awt/motif/X11KSC5601\$$$$Encoder.class \
    +      sun/awt/motif/X11GB2312\$$$$Encoder.class \
    +      sun/awt/motif/X11GBK\$$$$Encoder.class \
    +      sun/awt/motif/X11KSC5601.class
     endif
     
    -$(eval $(call SetupArchive,BUILD_CHARSETS_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes, \
    -		SUFFIXES:=.class .dat,\
    -		INCLUDES:=sun/nio/cs/ext,\
    -		EXTRA_FILES := sun/awt/HKSCS.class \
    -			       $(CHARSETS_EXTRA_FILES), \
    -		JAR:=$(IMAGES_OUTPUTDIR)/lib/charsets.jar, \
    -		SKIP_METAINF := true, \
    -                CHECK_COMPRESS_JAR:=true))
    +$(eval $(call SetupArchive,BUILD_CHARSETS_JAR, , \
    +    SRCS := $(JDK_OUTPUTDIR)/classes, \
    +    SUFFIXES := .class .dat, \
    +    INCLUDES := sun/nio/cs/ext, \
    +    EXTRA_FILES := sun/awt/HKSCS.class \
    +        $(CHARSETS_EXTRA_FILES), \
    +    JAR := $(IMAGES_OUTPUTDIR)/lib/charsets.jar, \
    +    SKIP_METAINF := true, \
    +    CHECK_COMPRESS_JAR := true))
     
     ##########################################################################################
     
     ifndef OPENJDK
    -ifeq ($(ENABLE_JFR), true)
    -    $(eval $(call SetupArchive,BUILD_JFR_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes,\
    -		SUFFIXES:=.class .jfc .xsd,\
    -		INCLUDES:=com/oracle/jrockit/jfr \
    -			  oracle/jrockit/jfr \
    -			  jdk/jfr,\
    -		JAR:=$(IMAGES_OUTPUTDIR)/lib/jfr.jar,\
    -		SKIP_METAINF:=true,\
    -		MANIFEST:=$(MAINMANIFEST), \
    -                CHECK_COMPRESS_JAR:=true))
    +  ifeq ($(ENABLE_JFR), true)
    +    $(eval $(call SetupArchive,BUILD_JFR_JAR, , \
    +        SRCS := $(JDK_OUTPUTDIR)/classes, \
    +        SUFFIXES := .class .jfc .xsd, \
    +        INCLUDES := com/oracle/jrockit/jfr \
    +            oracle/jrockit/jfr \
    +            jdk/jfr, \
    +        JAR := $(IMAGES_OUTPUTDIR)/lib/jfr.jar, \
    +        SKIP_METAINF := true, \
    +        MANIFEST := $(MAINMANIFEST), \
    +        CHECK_COMPRESS_JAR := true))
     
    -endif
    -endif
    -
    -##########################################################################################
    -
    -$(eval $(call SetupArchive,BUILD_JSSE_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes,\
    -		INCLUDES:=sun/security/provider/Sun.class \
    -			  sun/security/rsa/SunRsaSign.class \
    -			  sun/security/ssl \
    -			  com/sun/net/ssl/internal/ssl,\
    -		JAR:=$(IMAGES_OUTPUTDIR)/lib/jsse.jar,\
    -		SKIP_METAINF:=true,\
    -		MANIFEST:=$(MAINMANIFEST), \
    -                CHECK_COMPRESS_JAR:=true))
    -
    -##########################################################################################
    -# Create manifest for security jars
    -
    -#
    -# Include these extra attributes for now, should probably take out.
    -#
    -JCE_MANIFEST := $(IMAGES_OUTPUTDIR)/lib/_the.security.manifest.mf
    -$(JCE_MANIFEST): $(MAINMANIFEST)
    -	$(MKDIR) -p $(@D)
    -	$(RM) $@ $@.tmp
    -	$(SED) -e "s#@@RELEASE@@#$(JDK_VERSION)#"       \
    -               -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
    -               $(MAINMANIFEST) >> $@.tmp
    -	$(ECHO) "Extension-Name: javax.crypto" >> $@.tmp
    -	$(ECHO) "Implementation-Vendor-Id: com.sun" >> $@.tmp
    -	$(MV) $@.tmp $@
    -
    -##########################################################################################
    -# For security and crypto jars, always build the jar, but for closed, install the prebuilt
    -# signed version instead of the newly built jar. Unsigned jars are treated as intermediate
    -# targets and explicitly added to the JARS list. For open, signing is not needed. See
    -# SignJars.gmk for more information.
    -#
    -# The source for the crypto jars is not available for all licensees. The BUILD_CRYPTO
    -# variable is set to no if these jars can't be built to skip that step of the build.
    -# Note that for OPENJDK, the build will fail if BUILD_CRYPTO=no since then there is no
    -# other way to get the jars than to build them.
    -
    -SUNPKCS11_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunpkcs11.jar
    -SUNPKCS11_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunpkcs11.jar
    -
    -$(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR,,\
    -	SRCS:=$(JDK_OUTPUTDIR)/classes, \
    -	SUFFIXES:=.class,\
    -	INCLUDES:=sun/security/pkcs11,\
    -	JAR:=$(SUNPKCS11_JAR_UNSIGNED), \
    -        MANIFEST:=$(JCE_MANIFEST), \
    -	SKIP_METAINF := true))
    -
    -$(SUNPKCS11_JAR_UNSIGNED): $(JCE_MANIFEST)
    -
    -ifndef OPENJDK
    -    SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
    -    $(SUNPKCS11_JAR_DST) : $(SUNPKCS11_JAR_SRC)
    -	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunPKCS11 provider..."
    -	$(install-file)
    -else
    -    $(SUNPKCS11_JAR_DST) : $(SUNPKCS11_JAR_UNSIGNED)
    -	$(install-file)
    -endif
    -
    -JARS += $(SUNPKCS11_JAR_UNSIGNED)
    -
    -##########################################################################################
    -
    -SUNEC_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunec.jar
    -SUNEC_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunec.jar
    -
    -$(eval $(call SetupArchive,BUILD_SUNEC_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes, \
    -		SUFFIXES:=.class,\
    -		INCLUDES:=sun/security/ec,\
    -		JAR:=$(SUNEC_JAR_UNSIGNED), \
    -                MANIFEST:=$(JCE_MANIFEST), \
    -		SKIP_METAINF := true))
    -
    -$(SUNEC_JAR_UNSIGNED): $(JCE_MANIFEST)
    -
    -ifndef OPENJDK
    -    SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
    -    $(SUNEC_JAR_DST) : $(SUNEC_JAR_SRC)
    -	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunEC provider..."
    -	$(install-file)
    -else
    -    $(SUNEC_JAR_DST) : $(SUNEC_JAR_UNSIGNED)
    -	$(install-file)
    -endif
    -
    -JARS += $(SUNEC_JAR_UNSIGNED)
    -
    -##########################################################################################
    -
    -$(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes,\
    -		SUFFIXES:=BeanInfo.class .gif,\
    -		INCLUDES:=javax/swing sun/swing,\
    -		EXCLUDES:=javax/swing/plaf,\
    -		EXTRA_FILES:=javax/swing/SwingBeanInfoBase.class sun/swing/BeanInfoUtils.class,\
    -		JAR:=$(IMAGES_OUTPUTDIR)/lib/dt.jar,\
    -		SKIP_METAINF:=true))
    -
    -##########################################################################################
    -
    -SUNJCE_PROVIDER_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunjce_provider.jar
    -SUNJCE_PROVIDER_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunjce_provider.jar
    -
    -ifneq ($(BUILD_CRYPTO),no)
    -  $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes, \
    -		SUFFIXES:=.class,\
    -		INCLUDES:= com/sun/crypto/provider,\
    -		JAR:=$(SUNJCE_PROVIDER_JAR_UNSIGNED), \
    -                MANIFEST:=$(JCE_MANIFEST), \
    -		SKIP_METAINF := true))
    -
    -  $(SUNJCE_PROVIDER_JAR_UNSIGNED): $(JCE_MANIFEST)
    -
    -  JARS += $(SUNJCE_PROVIDER_JAR_UNSIGNED)
    -endif
    -
    -ifndef OPENJDK
    -    SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar
    -    $(SUNJCE_PROVIDER_JAR_DST) : $(SUNJCE_PROVIDER_JAR_SRC)
    -	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunJCE provider..."
    -	$(install-file)
    -else
    -    $(SUNJCE_PROVIDER_JAR_DST) : $(SUNJCE_PROVIDER_JAR_UNSIGNED)
    -	$(install-file)
    -endif
    -
    -##########################################################################################
    -
    -JCE_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/jce.jar
    -JCE_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/jce.jar
    -
    -ifneq ($(BUILD_CRYPTO),no)
    -  $(eval $(call SetupArchive,BUILD_JCE_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes, \
    -		SUFFIXES:=.class,\
    -		INCLUDES:= javax/crypto sun/security/internal,\
    -		JAR:=$(JCE_JAR_UNSIGNED), \
    -                MANIFEST:=$(JCE_MANIFEST), \
    -		SKIP_METAINF := true))
    -
    -  $(JCE_JAR_UNSIGNED): $(JCE_MANIFEST)
    -
    -  JARS +=  $(JCE_JAR_UNSIGNED)
    -endif
    -
    -ifndef OPENJDK
    -  JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
    -  $(JCE_JAR_DST) : $(JCE_JAR_SRC)
    -	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt jce.jar..."
    -	$(install-file)
    -else
    -  $(JCE_JAR_DST) : $(JCE_JAR_UNSIGNED)
    -	$(install-file)
    -endif
    -
    -##########################################################################################
    -
    -US_EXPORT_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/US_export_policy.jar
    -US_EXPORT_POLICY_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/US_export_policy.jar
    -
    -ifneq ($(BUILD_CRYPTO),no)
    -  #
    -  # TODO fix so that SetupArchive does not write files into SRCS
    -  #   then we don't need this extra copying
    -
    -  # NOTE:  We currently do not place restrictions on our limited export
    -  # policy.  This was not a typo.
    -  #
    -  US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
    -  US_EXPORT_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/US_export_policy_jar.tmp
    -
    -  $(US_EXPORT_POLICY_JAR_TMP)/% : $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
    -	$(install-file)
    -
    -  US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
    -
    -  $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR,$(US_EXPORT_POLICY_JAR_DEPS),\
    -		SRCS:=$(US_EXPORT_POLICY_JAR_TMP), \
    -		SUFFIXES:= .policy,\
    -		JAR:=$(US_EXPORT_POLICY_JAR_UNSIGNED), \
    -		EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
    -		SKIP_METAINF := true))
    -
    -  JARS += $(US_EXPORT_POLICY_JAR_UNSIGNED)
    -endif
    -
    -ifndef OPENJDK
    -  $(US_EXPORT_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar
    -	$(ECHO) $(LOG_INFO) Copying $(@F)
    -	$(install-file)
    -else
    -  $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNSIGNED)
    -	$(install-file)
    -endif
    -
    -##########################################################################################
    -
    -LOCAL_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/local_policy.jar
    -LOCAL_POLICY_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/local_policy.jar
    -
    -ifneq ($(BUILD_CRYPTO),no)
    -  #
    -  # TODO fix so that SetupArchive does not write files into SRCS
    -  #   then we don't need this extra copying
    -  #
    -  LOCAL_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/local_policy_jar.tmp
    -
    -  ifeq ($(UNLIMITED_CRYPTO), true)
    -    LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
    -    LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/default_local.policy
    -    LOCAL_POLICY_JAR_ATTR := Crypto-Strength: unlimited
    -  else
    -    LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/limited
    -    LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy \
    -                             $(LOCAL_POLICY_JAR_TMP)/default_local.policy
    -    LOCAL_POLICY_JAR_ATTR := Crypto-Strength: limited
       endif
    -
    -  $(LOCAL_POLICY_JAR_TMP)/% : $(LOCAL_POLICY_JAR_SRC_DIR)/%
    -	$(install-file)
    -
    -  $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR,$(LOCAL_POLICY_JAR_DEPS),\
    -		SRCS:=$(LOCAL_POLICY_JAR_TMP),\
    -		SUFFIXES:= .policy,\
    -		JAR:=$(LOCAL_POLICY_JAR_UNSIGNED), \
    -		EXTRA_MANIFEST_ATTR := $(LOCAL_POLICY_JAR_ATTR), \
    -		SKIP_METAINF := true))
    -
    -  JARS += $(LOCAL_POLICY_JAR_UNSIGNED)
    -endif
    -
    -ifndef OPENJDK
    -  $(LOCAL_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
    -	$(ECHO) $(LOG_INFO) Copying $(@F)
    -	$(install-file)
    -else
    -  $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNSIGNED)
    -	$(install-file)
     endif
     
     ##########################################################################################
     
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -
    -SUNMSCAPI_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunmscapi.jar
    -SUNMSCAPI_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunmscapi.jar
    -
    -$(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes, \
    -		SUFFIXES:=.class,\
    -		INCLUDES:= sun/security/mscapi,\
    -		JAR:=$(SUNMSCAPI_JAR_UNSIGNED), \
    -		MANIFEST:=$(JCE_MANIFEST), \
    -		SKIP_METAINF:=true))
    -
    -$(SUNMSCAPI_JAR_UNSIGNED): $(JCE_MANIFEST)
    -
    -ifndef OPENJDK
    -    SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar
    -    $(SUNMSCAPI_JAR_DST) : $(SUNMSCAPI_JAR_SRC)
    -	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunMSCAPI provider..."
    -	$(install-file)
    -else
    -    $(SUNMSCAPI_JAR_DST) : $(SUNMSCAPI_JAR_UNSIGNED)
    -	$(install-file)
    -endif
    -
    -JARS += $(SUNMSCAPI_JAR_UNSIGNED)
    -
    -endif
    +$(eval $(call SetupArchive,BUILD_JSSE_JAR, , \
    +    SRCS := $(JDK_OUTPUTDIR)/classes, \
    +    INCLUDES := sun/security/provider/Sun.class \
    +        sun/security/rsa/SunRsaSign.class \
    +        sun/security/ssl \
    +        com/sun/net/ssl/internal/ssl, \
    +    JAR := $(IMAGES_OUTPUTDIR)/lib/jsse.jar, \
    +    SKIP_METAINF := true, \
    +    MANIFEST := $(MAINMANIFEST), \
    +    CHECK_COMPRESS_JAR := true))
     
     ##########################################################################################
     
    -ifeq ($(OPENJDK_TARGET_OS),solaris)
    -ifndef OPENJDK
    -
    -UCRYPTO_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/ucrypto.jar
    -UCRYPTO_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/ucrypto.jar
    -UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar
    -
    -$(eval $(call SetupArchive,BUILD_UCRYPTO_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes, \
    -		SUFFIXES:=.class,\
    -		INCLUDES:=com/oracle/security/ucrypto,\
    -		JAR:=$(UCRYPTO_JAR_UNSIGNED), \
    -		MANIFEST:=$(JCE_MANIFEST), \
    -		SKIP_METAINF:=true))
    -
    -$(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST)
    -
    -$(UCRYPTO_JAR_DST) : $(UCRYPTO_JAR_SRC)
    -	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..."
    -	$(install-file)
    -
    -JARS += $(UCRYPTO_JAR_UNSIGNED)
    -
    -endif
    -endif
    +$(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR, , \
    +    SRCS := $(JDK_OUTPUTDIR)/classes, \
    +    SUFFIXES := BeanInfo.class .gif, \
    +    INCLUDES := javax/swing sun/swing, \
    +    EXCLUDES := javax/swing/plaf, \
    +    EXTRA_FILES := javax/swing/SwingBeanInfoBase.class sun/swing/BeanInfoUtils.class, \
    +    JAR := $(IMAGES_OUTPUTDIR)/lib/dt.jar, \
    +    SKIP_METAINF := true))
     
     ##########################################################################################
     
     # Get the CLDRVERSION
    -include GensrcCLDR.gmk
    +include gensrc/GensrcCLDR.gmk
     
     CLDRDATA_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/cldrdata.jar
     
    -$(eval $(call SetupArchive,BUILD_CLDRDATA_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes,\
    -		SUFFIXES:=.class,\
    -		INCLUDES:=sun/text/resources/cldr \
    -			  sun/util/cldr \
    -			  sun/util/resources/cldr,\
    -		EXCLUDES:=sun/util/cldr/CLDRLocaleProviderAdapter,\
    -		JAR:=$(CLDRDATA_JAR_DST),\
    -		EXTRA_MANIFEST_ATTR:=CLDR-Version: $(CLDRVERSION),\
    -		SKIP_METAINF:=true))
    +$(eval $(call SetupArchive,BUILD_CLDRDATA_JAR, , \
    +    SRCS := $(JDK_OUTPUTDIR)/classes, \
    +    SUFFIXES := .class, \
    +    INCLUDES := sun/text/resources/cldr \
    +        sun/util/cldr \
    +        sun/util/resources/cldr, \
    +    EXCLUDES := sun/util/cldr/CLDRLocaleProviderAdapter, \
    +    JAR := $(CLDRDATA_JAR_DST), \
    +    EXTRA_MANIFEST_ATTR := CLDR-Version: $(CLDRVERSION), \
    +    SKIP_METAINF := true))
     
     ##########################################################################################
     
     TOOLS_JAR_INCLUDES := \
    -        com/sun/codemodel       \
    -	com/sun/istack/internal/tools       \
    -	com/sun/jarsigner	\
    -	com/sun/javadoc		\
    -	com/sun/jdi		\
    -	com/sun/source          \
    -	com/sun/tools/attach	\
    -	com/sun/tools/classfile \
    -	com/sun/tools/corba     \
    -	com/sun/tools/doclets   \
    -	com/sun/tools/doclint   \
    -	com/sun/tools/example/debug/expr \
    -	com/sun/tools/example/debug/tty  \
    -	com/sun/tools/extcheck  \
    -	com/sun/tools/hat       \
    -        com/sun/tools/internal/jxc             \
    -	com/sun/tools/internal/jxc/ap   \
    -	com/sun/tools/internal/ws       \
    -	com/sun/tools/internal/ws/wscompile/plugin/at_generated \
    -	com/sun/tools/internal/xjc       \
    -	com/sun/tools/javac     \
    -	com/sun/tools/javadoc   \
    -	com/sun/tools/javah     \
    -	com/sun/tools/javap     \
    -	com/sun/tools/jdeps	\
    -	com/sun/tools/jdi	\
    -	com/sun/tools/script/shell	\
    -	com/sun/xml/internal/dtdparser \
    -        com/sun/xml/internal/rngom       \
    -        com/sun/xml/internal/xsom       \
    -        org/relaxng/datatype   \
    -	sun/applet		\
    -	sun/jvmstat		\
    -	sun/rmi/rmic		\
    -	sun/security/tools/jarsigner \
    -	sun/tools/asm		\
    -	sun/tools/attach	\
    -	sun/tools/jar		\
    -	sun/tools/java		\
    -	sun/tools/javac		\
    -	sun/tools/jcmd		\
    -	sun/tools/jinfo         \
    -	sun/tools/jmap		\
    -	sun/tools/jps		\
    -	sun/tools/jstack        \
    -	sun/tools/jstat		\
    -	sun/tools/jstatd	\
    -	sun/tools/native2ascii	\
    -	sun/tools/serialver	\
    -	sun/tools/tree		\
    -	sun/tools/util
    +    com/sun/codemodel \
    +    com/sun/istack/internal/tools \
    +    com/sun/jarsigner \
    +    com/sun/javadoc \
    +    com/sun/jdi \
    +    com/sun/source \
    +    com/sun/tools/attach \
    +    com/sun/tools/classfile \
    +    com/sun/tools/corba \
    +    com/sun/tools/doclets \
    +    com/sun/tools/doclint \
    +    com/sun/tools/example/debug/expr \
    +    com/sun/tools/example/debug/tty \
    +    com/sun/tools/extcheck \
    +    com/sun/tools/hat \
    +    com/sun/tools/internal/jxc \
    +    com/sun/tools/internal/jxc/ap \
    +    com/sun/tools/internal/ws \
    +    com/sun/tools/internal/ws/wscompile/plugin/at_generated \
    +    com/sun/tools/internal/xjc \
    +    com/sun/tools/javac \
    +    com/sun/tools/javadoc \
    +    com/sun/tools/javah \
    +    com/sun/tools/javap \
    +    com/sun/tools/jdeps \
    +    com/sun/tools/jdi \
    +    com/sun/tools/script/shell \
    +    com/sun/xml/internal/dtdparser \
    +    com/sun/xml/internal/rngom \
    +    com/sun/xml/internal/xsom \
    +    org/relaxng/datatype \
    +    sun/applet \
    +    sun/jvmstat \
    +    sun/rmi/rmic \
    +    sun/security/tools/jarsigner \
    +    sun/tools/asm \
    +    sun/tools/attach \
    +    sun/tools/jar \
    +    sun/tools/java \
    +    sun/tools/javac \
    +    sun/tools/jcmd \
    +    sun/tools/jinfo \
    +    sun/tools/jmap \
    +    sun/tools/jps \
    +    sun/tools/jstack \
    +    sun/tools/jstat \
    +    sun/tools/jstatd \
    +    sun/tools/native2ascii \
    +    sun/tools/serialver \
    +    sun/tools/tree \
    +    sun/tools/util
     
     # The sjavac tools is not ready for public consumption.
    -TOOLS_JAR_EXCLUDES=com/sun/tools/sjavac
    +TOOLS_JAR_EXCLUDES = com/sun/tools/sjavac
     
    -$(eval $(call SetupArchive,BUILD_TOOLS_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes,\
    -		SUFFIXES:=.class .prp .gif .properties .xml .css .xsd .js .html .txt .java \
    -			  Tool aliasmap options,\
    -		INCLUDES:=$(TOOLS_JAR_INCLUDES),\
    -		EXCLUDES:=$(TOOLS_JAR_EXCLUDES),\
    -		EXTRA_FILES:=META-INF/services/com.sun.jdi.connect.Connector \
    -			     META-INF/services/com.sun.jdi.connect.spi.TransportService \
    -			     META-INF/services/com.sun.tools.attach.spi.AttachProvider \
    -			     META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \
    -			     META-INF/services/com.sun.tools.internal.xjc.Plugin,\
    -		JAR:=$(IMAGES_OUTPUTDIR)/lib/tools.jar,\
    -		SKIP_METAINF:=true, \
    -                CHECK_COMPRESS_JAR:=true))
    +$(eval $(call SetupArchive,BUILD_TOOLS_JAR, , \
    +    SRCS := $(JDK_OUTPUTDIR)/classes, \
    +    SUFFIXES := .class .prp .gif .properties .xml .css .xsd .js .html .txt .java \
    +        Tool aliasmap options, \
    +    INCLUDES := $(TOOLS_JAR_INCLUDES), \
    +    EXCLUDES := $(TOOLS_JAR_EXCLUDES), \
    +    EXTRA_FILES := META-INF/services/com.sun.jdi.connect.Connector \
    +        META-INF/services/com.sun.jdi.connect.spi.TransportService \
    +        META-INF/services/com.sun.tools.attach.spi.AttachProvider \
    +        META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \
    +        META-INF/services/com.sun.tools.internal.xjc.Plugin, \
    +    JAR := $(IMAGES_OUTPUTDIR)/lib/tools.jar, \
    +    SKIP_METAINF := true, \
    +    CHECK_COMPRESS_JAR := true))
     
     
     ##########################################################################################
    @@ -821,9 +533,9 @@ include javadoc/NON_CORE_PKGS.gmk
     # Swing has taken this approach only as a temporary measure to avoid
     # the compiler warnings until we can properly document these packages.
     # This is covered under 6491853.
    -EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf.windows  \
    -                        com.sun.java.swing.plaf.motif    \
    -                        com.sun.java.swing.plaf.gtk
    +EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf.windows \
    +    com.sun.java.swing.plaf.motif \
    +    com.sun.java.swing.plaf.gtk
     
     #
     # Include the exported private packages in ct.sym.
    @@ -831,7 +543,7 @@ EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf.windows  \
     # with a new module system (being discussed for JDK 8).
     #
     EXPORTED_PRIVATE_PKGS = com.oracle.net \
    -                        com.oracle.nio
    +    com.oracle.nio
     
     $(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(IMAGES_OUTPUTDIR)/lib/rt.jar
     	$(RM) -r $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
    @@ -846,63 +558,50 @@ $(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(IMAGES_OUTPUTDIR)/lib/rt.jar
     	    $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
     	$(TOUCH) $@
     
    -$(eval $(call MakeDir,$(IMAGES_OUTPUTDIR)/symbols))
    -$(eval $(call SetupArchive,BUILD_CT_SYM,$(IMAGES_OUTPUTDIR)/symbols/_the.symbols,\
    -		SRCS:=$(IMAGES_OUTPUTDIR)/symbols,\
    -		INCLUDES:=META-INF/sym,\
    -		JAR:=$(IMAGES_OUTPUTDIR)/lib/ct.sym, \
    -		CHECK_COMPRESS_JAR:=true))
    +$(eval $(call MakeDir, $(IMAGES_OUTPUTDIR)/symbols))
    +$(eval $(call SetupArchive,BUILD_CT_SYM, $(IMAGES_OUTPUTDIR)/symbols/_the.symbols, \
    +    SRCS := $(IMAGES_OUTPUTDIR)/symbols, \
    +    INCLUDES := META-INF/sym, \
    +    JAR := $(IMAGES_OUTPUTDIR)/lib/ct.sym, \
    +    CHECK_COMPRESS_JAR := true))
     
     
     ##########################################################################################
     
     SRC_ZIP_INCLUDES = \
    -	com/sun/corba			\
    -	com/sun/image/codec/jpeg	\
    -	com/sun/imageio                 \
    -	com/sun/java_cup		\
    -	com/sun/javadoc			\
    -	com/sun/java/swing		\
    -	com/sun/jlex	        	\
    -	com/sun/jmx			\
    -	com/sun/naming			\
    -	com/sun/org/apache		\
    -	com/sun/security/auth		\
    -	com/sun/security/jgss		\
    -	com/sun/source			\
    -	java/applet			\
    -	java/awt			\
    -	java/beans			\
    -	java/io				\
    -	java/lang			\
    -	java/math			\
    -	java/net			\
    -	java/nio			\
    -	java/rmi			\
    -	java/security			\
    -	java/sql			\
    -	java/text			\
    -	java/util			\
    -	javax/accessibility		\
    -	javax/annotation		\
    -	javax/imageio			\
    -	javax/lang			\
    -	javax/management		\
    -	javax/naming			\
    -	javax/print			\
    -	javax/rmi			\
    -	javax/script			\
    -	javax/security			\
    -	javax/sound			\
    -	javax/sql			\
    -	javax/swing			\
    -	javax/tools			\
    -	javax/xml			\
    -	org/ietf			\
    -	org/omg				\
    -	org/w3c/dom			\
    -	org/xml/sax			\
    -	sunw
    +    com/sun/corba \
    +    com/sun/image/codec/jpeg \
    +    com/sun/imageio \
    +    com/sun/java_cup \
    +    com/sun/javadoc \
    +    com/sun/java/swing \
    +    com/sun/jmx \
    +    com/sun/naming \
    +    com/sun/org/apache \
    +    com/sun/security/auth \
    +    com/sun/security/jgss \
    +    com/sun/source \
    +    java \
    +    javax/accessibility \
    +    javax/annotation \
    +    javax/imageio \
    +    javax/lang \
    +    javax/management \
    +    javax/naming \
    +    javax/print \
    +    javax/rmi \
    +    javax/script \
    +    javax/security \
    +    javax/sound \
    +    javax/sql \
    +    javax/swing \
    +    javax/tools \
    +    javax/xml \
    +    org/ietf \
    +    org/omg \
    +    org/w3c/dom \
    +    org/xml/sax \
    +    #
     
     SRC_ZIP_SRCS = $(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes
     SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gensrc
    @@ -915,10 +614,10 @@ endif
     # Need to copy launcher src files into desired directory structure
     # before zipping the sources.
     LAUNCHER_SRC_FILES := $(wildcard $(JDK_TOPDIR)/src/share/bin/*) \
    -                      $(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/java_md*)
    -LAUNCHER_ZIP_SRC := $(patsubst $(JDK_TOPDIR)/src/share/bin/%,$(IMAGES_OUTPUTDIR)/src/launcher/%,\
    -		    $(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/%,$(IMAGES_OUTPUTDIR)/src/launcher/%,\
    -			$(LAUNCHER_SRC_FILES)))
    +    $(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/java_md*)
    +LAUNCHER_ZIP_SRC := $(patsubst $(JDK_TOPDIR)/src/share/bin/%, $(IMAGES_OUTPUTDIR)/src/launcher/%, \
    +    $(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/%, $(IMAGES_OUTPUTDIR)/src/launcher/%, \
    +    $(LAUNCHER_SRC_FILES)))
     
     $(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/share/bin/%
     	$(install-file)
    @@ -929,90 +628,78 @@ $(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DI
     $(IMAGES_OUTPUTDIR)/src.zip: $(LAUNCHER_ZIP_SRC)
     
     # This dir needs to exist before macro is evaluated to avoid warning from find.
    -$(eval $(call MakeDir,$(IMAGES_OUTPUTDIR)/src))
    -$(eval $(call SetupZipArchive,BUILD_SRC_ZIP,\
    -		SRC:=$(SRC_ZIP_SRCS) $(IMAGES_OUTPUTDIR)/src,\
    -		INCLUDES:=$(SRC_ZIP_INCLUDES) launcher,\
    -		EXCLUDES:=javax/swing/beaninfo,\
    -		SUFFIXES:=.java .c .h,\
    -		ZIP:=$(IMAGES_OUTPUTDIR)/src.zip,\
    -		EXTRA_DEPS:=$(LAUNCHER_ZIP_SRC)))
    +$(eval $(call MakeDir, $(IMAGES_OUTPUTDIR)/src))
    +$(eval $(call SetupZipArchive,BUILD_SRC_ZIP, \
    +    SRC := $(SRC_ZIP_SRCS) $(IMAGES_OUTPUTDIR)/src, \
    +    INCLUDES := $(SRC_ZIP_INCLUDES) launcher, \
    +    EXCLUDES := javax/swing/beaninfo, \
    +    SUFFIXES := .java .c .h, \
    +    ZIP := $(IMAGES_OUTPUTDIR)/src.zip, \
    +    EXTRA_DEPS := $(LAUNCHER_ZIP_SRC)))
     
     ##########################################################################################
     
     ifndef OPENJDK
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
     
    -    $(eval $(call SetupArchive,BUILD_JACCESS_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes,\
    -		INCLUDES:=com/sun/java/accessibility/util,\
    -		JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar,\
    -		SKIP_METAINF:=true))
    +    $(eval $(call SetupArchive,BUILD_JACCESS_JAR, , \
    +        SRCS := $(JDK_OUTPUTDIR)/classes, \
    +        INCLUDES := com/sun/java/accessibility/util, \
    +        JAR := $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar, \
    +        SKIP_METAINF := true))
     
         JARS += $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar
     
         ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
    -        $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_32_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes_ab/32bit $(JDK_OUTPUTDIR)/classes,\
    -		INCLUDES:=com/sun/java/accessibility,\
    -		JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-32.jar,\
    -		SKIP_METAINF:=true))
    +      $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_32_JAR, , \
    +          SRCS := $(JDK_OUTPUTDIR)/classes_ab/32bit, \
    +          INCLUDES := com/sun/java/accessibility, \
    +          JAR := $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-32.jar, \
    +          SKIP_METAINF := true))
     
    -        $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_LEGACY_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes_ab/legacy $(JDK_OUTPUTDIR)/classes,\
    -		INCLUDES:=com/sun/java/accessibility,\
    -		JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/access-bridge.jar,\
    -		SKIP_METAINF:=true))
    +      $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_LEGACY_JAR, , \
    +          SRCS := $(JDK_OUTPUTDIR)/classes_ab/legacy, \
    +          INCLUDES := com/sun/java/accessibility, \
    +          JAR := $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge.jar, \
    +          SKIP_METAINF := true))
     
    -        JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-32.jar \
    -		$(IMAGES_OUTPUTDIR)/lib/ext/access-bridge.jar
    +      JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-32.jar \
    +          $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge.jar
         else
    -        $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_64_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/classes_ab/64bit $(JDK_OUTPUTDIR)/classes,\
    -		INCLUDES:=com/sun/java/accessibility,\
    -		EXCLUDES:=com/sun/java/accessibility/util/java,\
    -		JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar,\
    -		SKIP_METAINF:=true))
    +      $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_64_JAR, , \
    +          SRCS := $(JDK_OUTPUTDIR)/classes_ab/64bit, \
    +          INCLUDES := com/sun/java/accessibility, \
    +          JAR := $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar, \
    +          SKIP_METAINF := true))
     
    -        JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar
    +      JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar
         endif
    -endif
    +  endif
     endif
     
     ##########################################################################################
     
     #
     # This is an empty jar (only contains manifest) and fits poorly into framework...
    -#   create simple rule instead
    +# create simple rule instead
     #
    -$(IMAGES_OUTPUTDIR)/lib/management-agent.jar : $(JDK_TOPDIR)/src/share/classes/sun/management/manifest
    +$(IMAGES_OUTPUTDIR)/lib/management-agent.jar: $(JDK_TOPDIR)/src/share/classes/sun/management/manifest
     	$(JAR) cfm $@ $<
     
     ##########################################################################################
     
    -$(IMAGES_OUTPUTDIR)/lib/ext/zipfs.jar : $(JDK_OUTPUTDIR)/demo/nio/zipfs/zipfs.jar
    +$(IMAGES_OUTPUTDIR)/lib/ext/zipfs.jar: $(JDK_OUTPUTDIR)/demo/nio/zipfs/zipfs.jar
     	$(install-file)
     
     ##########################################################################################
     
    -ifeq ($(OPENJDK_TARGET_OS),macosx)
    -    $(eval $(call SetupArchive,BUILD_JOBJC_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/jobjc_classes,\
    -		JAR:=$(IMAGES_OUTPUTDIR)/lib/JObjC.jar, \
    -		JARINDEX:=true))
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  $(eval $(call SetupArchive,BUILD_JOBJC_JAR, , \
    +      SRCS := $(JDK_OUTPUTDIR)/jobjc_classes, \
    +      JAR := $(IMAGES_OUTPUTDIR)/lib/JObjC.jar, \
    +      JARINDEX := true))
     endif
     
    -##########################################################################################
    -
    -ifndef OPENJDK
    -    $(eval $(call SetupArchive,BUILD_ALT_RT_JAR,,\
    -		SRCS:=$(JDK_OUTPUTDIR)/altclasses_classes,\
    -		JAR:=$(IMAGES_OUTPUTDIR)/lib/alt-rt.jar))
    -
    -endif
    -
    -##########################################################################################
    -
     # This file is imported from hotspot in Import.gmk. Copying it into images/lib so that
     # all jars can be found in one place when creating images in Images.gmk. It needs to be
     # done here so that clean targets can be simple and accurate.
    @@ -1023,25 +710,25 @@ $(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar: $(JDK_OUTPUTDIR)/lib/sa-jdi.jar
     #
     # sec-bin.zip is used by builds where the corresponding sources are not available
     #
    -$(eval $(call SetupZipArchive,BUILD_SEC_BIN_ZIP,\
    -		SRC:=$(JDK_OUTPUTDIR),\
    -		INCLUDES:=classes/javax/net \
    -			  classes/javax/security/cert \
    -			  classes/com/sun/net/ssl \
    -			  classes/com/sun/security/cert \
    -			  classes/sun/net/www/protocol/https \
    -			  classes/sun/security/pkcs12 \
    -			  classes/sun/security/ssl \
    -			  classes/sun/security/krb5 \
    -			  classes/sun/security/krb5/internal \
    -			  classes/sun/security/krb5/internal/ccache \
    -			  classes/sun/security/krb5/internal/crypto \
    -			  classes/sun/security/krb5/internal/ktab \
    -			  classes/sun/security/krb5/internal/rcache \
    -			  classes/sun/security/krb5/internal/util,\
    -		INCLUDE_FILES:=classes/sun/security/jgss/spi/GSSContextSpi.class,\
    -		EXCLUDES:=classes/sun/security/krb5/internal/tools,\
    -		ZIP:=$(IMAGES_OUTPUTDIR)/sec-bin.zip))
    +$(eval $(call SetupZipArchive,BUILD_SEC_BIN_ZIP, \
    +    SRC := $(JDK_OUTPUTDIR), \
    +    INCLUDES := classes/javax/net \
    +        classes/javax/security/cert \
    +        classes/com/sun/net/ssl \
    +        classes/com/sun/security/cert \
    +        classes/sun/net/www/protocol/https \
    +        classes/sun/security/pkcs12 \
    +        classes/sun/security/ssl \
    +        classes/sun/security/krb5 \
    +        classes/sun/security/krb5/internal \
    +        classes/sun/security/krb5/internal/ccache \
    +        classes/sun/security/krb5/internal/crypto \
    +        classes/sun/security/krb5/internal/ktab \
    +        classes/sun/security/krb5/internal/rcache \
    +        classes/sun/security/krb5/internal/util, \
    +    INCLUDE_FILES := classes/sun/security/jgss/spi/GSSContextSpi.class, \
    +    EXCLUDES := classes/sun/security/krb5/internal/tools, \
    +    ZIP := $(IMAGES_OUTPUTDIR)/sec-bin.zip))
     
     JARS += $(IMAGES_OUTPUTDIR)/sec-bin.zip
     
    @@ -1049,34 +736,41 @@ JARS += $(IMAGES_OUTPUTDIR)/sec-bin.zip
     #
     # Windows specific binary security packages.
     #
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -    # sec-windows-bin.zip is used by builds where the corresponding sources are not available
    -    $(eval $(call SetupZipArchive,BUILD_SEC_WINDOWS_BIN_ZIP,\
    -		SRC:=$(JDK_OUTPUTDIR),\
    -		INCLUDES:=classes/sun/security/krb5/internal/tools,\
    -		ZIP:=$(IMAGES_OUTPUTDIR)/sec-windows-bin.zip))
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  # sec-windows-bin.zip is used by builds where the corresponding sources are not available
    +  $(eval $(call SetupZipArchive,BUILD_SEC_WINDOWS_BIN_ZIP, \
    +      SRC := $(JDK_OUTPUTDIR), \
    +      INCLUDES := classes/sun/security/krb5/internal/tools, \
    +      ZIP := $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip))
     
    -    JARS += $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip
    +  JARS += $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip
     
    -    # JGSS files contain the native Kerberos library
    -    ifeq ($(OPENJDK_TARGET_CPU),x86_64)
    -        JGSS_ZIP_NAME=jgss-windows-x64-bin.zip
    -    else
    -        JGSS_ZIP_NAME=jgss-windows-i586-bin.zip
    -    endif
    +  # JGSS files contain the native Kerberos library
    +  ifeq ($(OPENJDK_TARGET_CPU), x86_64)
    +    JGSS_ZIP_NAME = jgss-windows-x64-bin.zip
    +  else
    +    JGSS_ZIP_NAME = jgss-windows-i586-bin.zip
    +  endif
     
    -    $(eval $(call SetupZipArchive,BUILD_JGSS_BIN_ZIP,\
    -		SRC:=$(JDK_OUTPUTDIR),\
    -		INCLUDE_FILES:=bin/w2k_lsa_auth.dll \
    -			       bin/w2k_lsa_auth.map \
    -			       bin/w2k_lsa_auth.pdb,\
    -		ZIP:=$(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)))
    +  $(eval $(call SetupZipArchive,BUILD_JGSS_BIN_ZIP, \
    +      SRC := $(JDK_OUTPUTDIR), \
    +      INCLUDE_FILES := bin/w2k_lsa_auth.dll \
    +          bin/w2k_lsa_auth.map \
    +          bin/w2k_lsa_auth.pdb, \
    +      ZIP := $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)))
     
    -    JARS += $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)
    +  JARS += $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)
     endif
     
     ##########################################################################################
     
    +# This rule copies all jars from jdk/lib/... to images/lib/... to avoid having to track 
    +# which jars are where
    +$(IMAGES_OUTPUTDIR)/lib/%: $(JDK_OUTPUTDIR)/lib/%
    +	$(install-file)
    +
    +##########################################################################################
    +
     # Import nashorn.jar from nashorn dist dir.
     $(IMAGES_OUTPUTDIR)/lib/ext/nashorn.jar: $(NASHORN_DIST)/nashorn.jar
     	$(install-file)
    diff --git a/jdk/makefiles/CreateSecurityJars.gmk b/jdk/makefiles/CreateSecurityJars.gmk
    new file mode 100644
    index 00000000000..f7e54160232
    --- /dev/null
    +++ b/jdk/makefiles/CreateSecurityJars.gmk
    @@ -0,0 +1,329 @@
    +#
    +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    +#
    +# This code is free software; you can redistribute it and/or modify it
    +# under the terms of the GNU General Public License version 2 only, as
    +# published by the Free Software Foundation.  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.
    +#
    +
    +default: all
    +
    +include $(SPEC)
    +include MakeBase.gmk
    +include JavaCompilation.gmk
    +include Setup.gmk
    +
    +# The jars created in this file are required for the exploded jdk image to function and
    +# cannot wait to be built in the images target.
    +
    +##########################################################################################
    +# Create manifest for security jars
    +#
    +# Include these extra attributes for now, should probably take out.
    +#
    +MAINMANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf
    +JCE_MANIFEST := $(JDK_OUTPUTDIR)/lib/_the.security.manifest.mf
    +
    +$(JCE_MANIFEST): $(MAINMANIFEST)
    +	$(MKDIR) -p $(@D)
    +	$(RM) $@ $@.tmp
    +	$(SED) -e "s#@@RELEASE@@#$(JDK_VERSION)#" \
    +	    -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
    +	    $(MAINMANIFEST) >> $@.tmp
    +	$(ECHO) "Extension-Name: javax.crypto" >> $@.tmp
    +	$(ECHO) "Implementation-Vendor-Id: com.sun" >> $@.tmp
    +	$(MV) $@.tmp $@
    +
    +##########################################################################################
    +# For security and crypto jars, always build the jar, but for closed, install the prebuilt
    +# signed version instead of the newly built jar. Unsigned jars are treated as intermediate
    +# targets and explicitly added to the JARS list. For open, signing is not needed. See
    +# SignJars.gmk for more information.
    +#
    +# The source for the crypto jars is not available for all licensees. The BUILD_CRYPTO
    +# variable is set to no if these jars can't be built to skip that step of the build.
    +# Note that for OPENJDK, the build will fail if BUILD_CRYPTO=no since then there is no
    +# other way to get the jars than to build them.
    +
    +SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
    +SUNPKCS11_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunpkcs11.jar
    +
    +$(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR, , \
    +    SRCS := $(JDK_OUTPUTDIR)/classes_security, \
    +    SUFFIXES := .class, \
    +    INCLUDES := sun/security/pkcs11, \
    +    JAR := $(SUNPKCS11_JAR_UNSIGNED), \
    +    MANIFEST := $(JCE_MANIFEST), \
    +    SKIP_METAINF := true))
    +
    +$(SUNPKCS11_JAR_UNSIGNED): $(JCE_MANIFEST)
    +
    +ifndef OPENJDK
    +  SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
    +  $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_SRC)
    +	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunPKCS11 provider..."
    +	$(install-file)
    +else
    +  $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_UNSIGNED)
    +	$(install-file)
    +endif
    +
    +JARS += $(SUNPKCS11_JAR_UNSIGNED) $(SUNPKCS11_JAR_DST)
    +
    +##########################################################################################
    +
    +SUNEC_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunec.jar
    +SUNEC_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunec.jar
    +
    +$(eval $(call SetupArchive,BUILD_SUNEC_JAR, , \
    +    SRCS := $(JDK_OUTPUTDIR)/classes_security, \
    +    SUFFIXES := .class, \
    +    INCLUDES := sun/security/ec, \
    +    JAR := $(SUNEC_JAR_UNSIGNED), \
    +    MANIFEST := $(JCE_MANIFEST), \
    +    SKIP_METAINF := true))
    +
    +$(SUNEC_JAR_UNSIGNED): $(JCE_MANIFEST)
    +
    +ifndef OPENJDK
    +  SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
    +  $(SUNEC_JAR_DST): $(SUNEC_JAR_SRC)
    +	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunEC provider..."
    +	$(install-file)
    +else
    +  $(SUNEC_JAR_DST): $(SUNEC_JAR_UNSIGNED)
    +	$(install-file)
    +endif
    +
    +JARS += $(SUNEC_JAR_UNSIGNED) $(SUNEC_JAR_DST)
    +
    +##########################################################################################
    +
    +SUNJCE_PROVIDER_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunjce_provider.jar
    +SUNJCE_PROVIDER_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunjce_provider.jar
    +
    +ifneq ($(BUILD_CRYPTO), no)
    +  $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR, , \
    +      SRCS := $(JDK_OUTPUTDIR)/classes_security, \
    +      SUFFIXES := .class, \
    +      INCLUDES := com/sun/crypto/provider, \
    +      JAR := $(SUNJCE_PROVIDER_JAR_UNSIGNED), \
    +      MANIFEST := $(JCE_MANIFEST), \
    +      SKIP_METAINF := true))
    +
    +  $(SUNJCE_PROVIDER_JAR_UNSIGNED): $(JCE_MANIFEST)
    +
    +  JARS += $(SUNJCE_PROVIDER_JAR_UNSIGNED)
    +endif
    +
    +ifndef OPENJDK
    +  SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar
    +  $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_SRC)
    +	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunJCE provider..."
    +	$(install-file)
    +else
    +  $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_UNSIGNED)
    +	$(install-file)
    +endif
    +
    +JARS += $(SUNJCE_PROVIDER_JAR_DST)
    +
    +##########################################################################################
    +
    +JCE_JAR_DST := $(JDK_OUTPUTDIR)/lib/jce.jar
    +JCE_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/jce.jar
    +
    +ifneq ($(BUILD_CRYPTO), no)
    +  $(eval $(call SetupArchive,BUILD_JCE_JAR, , \
    +      SRCS := $(JDK_OUTPUTDIR)/classes_security, \
    +      SUFFIXES := .class, \
    +      INCLUDES := javax/crypto sun/security/internal, \
    +      JAR := $(JCE_JAR_UNSIGNED), \
    +      MANIFEST := $(JCE_MANIFEST), \
    +      SKIP_METAINF := true))
    +
    +  $(JCE_JAR_UNSIGNED): $(JCE_MANIFEST)
    +
    +  JARS += $(JCE_JAR_UNSIGNED)
    +endif
    +
    +ifndef OPENJDK
    +  JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
    +  $(JCE_JAR_DST): $(JCE_JAR_SRC)
    +	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt jce.jar..."
    +	$(install-file)
    +else
    +  $(JCE_JAR_DST): $(JCE_JAR_UNSIGNED)
    +	$(install-file)
    +endif
    +
    +JARS += $(JCE_JAR_DST)
    +
    +##########################################################################################
    +
    +US_EXPORT_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/US_export_policy.jar
    +US_EXPORT_POLICY_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/US_export_policy.jar
    +
    +ifneq ($(BUILD_CRYPTO), no)
    +  #
    +  # TODO fix so that SetupArchive does not write files into SRCS
    +  # then we don't need this extra copying
    +  #
    +  # NOTE: We currently do not place restrictions on our limited export
    +  # policy. This was not a typo.
    +  #
    +  US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
    +  US_EXPORT_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/US_export_policy_jar.tmp
    +
    +  $(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
    +	$(install-file)
    +
    +  US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
    +
    +  $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, $(US_EXPORT_POLICY_JAR_DEPS), \
    +      SRCS := $(US_EXPORT_POLICY_JAR_TMP), \
    +      SUFFIXES := .policy, \
    +      JAR := $(US_EXPORT_POLICY_JAR_UNSIGNED), \
    +      EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
    +      SKIP_METAINF := true))
    +
    +  JARS += $(US_EXPORT_POLICY_JAR_UNSIGNED)
    +endif
    +
    +ifndef OPENJDK
    +  $(US_EXPORT_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar
    +	$(ECHO) $(LOG_INFO) Copying $(@F)
    +	$(install-file)
    +else
    +  $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNSIGNED)
    +	$(install-file)
    +endif
    +
    +JARS += $(US_EXPORT_POLICY_JAR_DST)
    +
    +##########################################################################################
    +
    +LOCAL_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/local_policy.jar
    +LOCAL_POLICY_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/local_policy.jar
    +
    +ifneq ($(BUILD_CRYPTO), no)
    +  #
    +  # TODO fix so that SetupArchive does not write files into SRCS
    +  # then we don't need this extra copying
    +  #
    +  LOCAL_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/local_policy_jar.tmp
    +
    +  ifeq ($(UNLIMITED_CRYPTO), true)
    +    LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
    +    LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/default_local.policy
    +    LOCAL_POLICY_JAR_ATTR := Crypto-Strength: unlimited
    +  else
    +    LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/limited
    +    LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy \
    +        $(LOCAL_POLICY_JAR_TMP)/default_local.policy
    +    LOCAL_POLICY_JAR_ATTR := Crypto-Strength: limited
    +  endif
    +
    +  $(LOCAL_POLICY_JAR_TMP)/%: $(LOCAL_POLICY_JAR_SRC_DIR)/%
    +	$(install-file)
    +
    +  $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR, $(LOCAL_POLICY_JAR_DEPS), \
    +      SRCS := $(LOCAL_POLICY_JAR_TMP), \
    +      SUFFIXES := .policy, \
    +      JAR := $(LOCAL_POLICY_JAR_UNSIGNED), \
    +      EXTRA_MANIFEST_ATTR := $(LOCAL_POLICY_JAR_ATTR), \
    +      SKIP_METAINF := true))
    +
    +  JARS += $(LOCAL_POLICY_JAR_UNSIGNED)
    +endif
    +
    +ifndef OPENJDK
    +  $(LOCAL_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
    +	$(ECHO) $(LOG_INFO) Copying $(@F)
    +	$(install-file)
    +else
    +  $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNSIGNED)
    +	$(install-file)
    +endif
    +
    +JARS += $(LOCAL_POLICY_JAR_DST)
    +
    +##########################################################################################
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +
    +  SUNMSCAPI_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunmscapi.jar
    +  SUNMSCAPI_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunmscapi.jar
    +
    +  $(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR, , \
    +      SRCS := $(JDK_OUTPUTDIR)/classes_security, \
    +      SUFFIXES := .class, \
    +      INCLUDES := sun/security/mscapi, \
    +      JAR := $(SUNMSCAPI_JAR_UNSIGNED), \
    +      MANIFEST := $(JCE_MANIFEST), \
    +      SKIP_METAINF := true))
    +
    +  $(SUNMSCAPI_JAR_UNSIGNED): $(JCE_MANIFEST)
    +
    +  ifndef OPENJDK
    +    SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar
    +    $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_SRC)
    +	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunMSCAPI provider..."
    +	$(install-file)
    +  else
    +    $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_UNSIGNED)
    +	$(install-file)
    +  endif
    +
    +  JARS += $(SUNMSCAPI_JAR_UNSIGNED) $(SUNMSCAPI_JAR_DST)
    +
    +endif
    +
    +##########################################################################################
    +
    +ifeq ($(OPENJDK_TARGET_OS), solaris)
    +  ifndef OPENJDK
    +
    +    UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar
    +    UCRYPTO_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/ucrypto.jar
    +    UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar
    +
    +    $(eval $(call SetupArchive,BUILD_UCRYPTO_JAR, , \
    +        SRCS := $(JDK_OUTPUTDIR)/classes_security, \
    +        SUFFIXES := .class, \
    +        INCLUDES := com/oracle/security/ucrypto, \
    +        JAR := $(UCRYPTO_JAR_UNSIGNED), \
    +        MANIFEST := $(JCE_MANIFEST), \
    +        SKIP_METAINF := true))
    +
    +    $(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST)
    +
    +    $(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_SRC)
    +	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..."
    +	$(install-file)
    +
    +    JARS += $(UCRYPTO_JAR_UNSIGNED) $(UCRYPTO_JAR_DST)
    +
    +  endif
    +endif
    +
    +all: $(JARS)
    +
    +.PHONY: default all
    diff --git a/jdk/makefiles/GenerateClasses.gmk b/jdk/makefiles/GenerateClasses.gmk
    index 3ee2a050d2f..f4dafc55087 100644
    --- a/jdk/makefiles/GenerateClasses.gmk
    +++ b/jdk/makefiles/GenerateClasses.gmk
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
     # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     #
     # This code is free software; you can redistribute it and/or modify it
    @@ -28,69 +28,92 @@ default: all
     include $(SPEC)
     include MakeBase.gmk
     include RMICompilation.gmk
    +include JavaCompilation.gmk
    +include Setup.gmk
     
    -# To ensure the latest stub generator files are picked up from corba repo
    -# when available, we need to run with latest rmic version available. 
    -ifneq ($(COMPILE_TYPE),cross)
    -    RMIC := $(FIXPATH) $(JDK_OUTPUTDIR)/bin/rmic
    -endif  
    +##########################################################################################
    +
    +RMIC_PKGS := \
    +    sun/rmi/rmic \
    +    sun/tools/asm \
    +    sun/tools/java \
    +    sun/tools/javac \
    +    sun/tools/tree \
    +    sun/tools/util \
    +    #
    +
    +$(eval $(call SetupJavaCompilation,BUILD_BOOTSTRAP_RMIC, \
    +    SETUP := GENERATE_OLDBYTECODE, \
    +    SRC := $(JDK_TOPDIR)/src/share/classes, \
    +    INCLUDES := $(RMIC_PKGS), \
    +    BIN := $(JDK_OUTPUTDIR)/btclasses_rmic, \
    +    COPY := .properties, \
    +    JAVAC_SOURCE_PATH_OVERRIDE := $(addprefix $(JDK_TOPDIR)/src/share/classes/, $(RMIC_PKGS))))
    +
    +##########################################################################################
    +
    +BTRMIC_CP := $(CORBA_OUTPUTDIR)/btjars/btcorba.jar$(PATH_SEP)$(JDK_OUTPUTDIR)/btclasses_rmic$(PATH_SEP)$(BOOTSTRAP_JAVAC_JAR)
    +BTRMIC_ARGS := "-Xbootclasspath/p:$(BTRMIC_CP)" -cp "$(BTRMIC_CP)"
    +RMIC := $(JAVA) $(BTRMIC_ARGS) sun.rmi.rmic.Main
     
     CLASSES_DIR := $(JDK_OUTPUTDIR)/classes
    -# NOTE: If the smart javac dependency management is reintroduced, these classes risk 
    +# NOTE: If the smart javac dependency management is reintroduced, these classes risk
     # interfering with the dependency checking. In that case they will need to be kept separate.
     STUB_CLASSES_DIR := $(JDK_OUTPUTDIR)/classes
     RMIC_GENSRC_DIR := $(JDK_OUTPUTDIR)/gendocsrc_rmic
     
    -GENCLASSES :=
    +GENCLASSES := 
     
     ##########################################################################################
     #
     # Generate RMI stubs
     #
     
    -$(eval $(call SetupRMICompilation,RMI_12,\
    -		CLASSES:=sun.rmi.server.Activation$$$$ActivationSystemImpl\
    -			 java.rmi.activation.ActivationGroup\
    -			 com.sun.jndi.rmi.registry.ReferenceWrapper,\
    -		CLASSES_DIR:=$(CLASSES_DIR),\
    -		STUB_CLASSES_DIR:=$(STUB_CLASSES_DIR),\
    -		RUN_V12:=true))
    +$(eval $(call SetupRMICompilation,RMI_12, \
    +    CLASSES := sun.rmi.server.Activation$$$$ActivationSystemImpl \
    +        java.rmi.activation.ActivationGroup \
    +        com.sun.jndi.rmi.registry.ReferenceWrapper, \
    +    CLASSES_DIR := $(CLASSES_DIR), \
    +    STUB_CLASSES_DIR := $(STUB_CLASSES_DIR), \
    +    RUN_V12 := true))
     GENCLASSES += $(RMI_12)
     
    -$(eval $(call SetupRMICompilation,RMI_11,\
    -		CLASSES:=sun.rmi.registry.RegistryImpl\
    -			 sun.rmi.transport.DGCImpl,\
    -		CLASSES_DIR:=$(CLASSES_DIR),\
    -		STUB_CLASSES_DIR:=$(STUB_CLASSES_DIR),\
    -		RUN_V11:=true))
    +$(eval $(call SetupRMICompilation,RMI_11, \
    +    CLASSES := sun.rmi.registry.RegistryImpl \
    +        sun.rmi.transport.DGCImpl, \
    +    CLASSES_DIR := $(CLASSES_DIR), \
    +    STUB_CLASSES_DIR := $(STUB_CLASSES_DIR), \
    +    RUN_V11 := true))
     GENCLASSES += $(RMI_11)
     
     # For RMI/IIOP call rmic a second time with -standardPackage option
     # so that *_tie classes are generated in package without the prefix
     # org.omg.stub (6375696)
    -JMAN_RMI_CLASSES:=javax.management.remote.rmi.RMIConnectionImpl\
    -		  javax.management.remote.rmi.RMIServerImpl
    -$(eval $(call SetupRMICompilation,RMI_IIOP,\
    -		CLASSES:=$(JMAN_RMI_CLASSES),\
    -		CLASSES_DIR:=$(CLASSES_DIR),\
    -		STUB_CLASSES_DIR:=$(STUB_CLASSES_DIR),\
    -		RUN_V12:=true,\
    -		RUN_IIOP:=true,\
    -		RUN_IIOP_STDPKG:=true))
    +JMAN_RMI_CLASSES := javax.management.remote.rmi.RMIConnectionImpl \
    +    javax.management.remote.rmi.RMIServerImpl
    +$(eval $(call SetupRMICompilation,RMI_IIOP, \
    +    CLASSES := $(JMAN_RMI_CLASSES), \
    +    CLASSES_DIR := $(CLASSES_DIR), \
    +    STUB_CLASSES_DIR := $(STUB_CLASSES_DIR), \
    +    RUN_V12 := true, \
    +    RUN_IIOP := true, \
    +    RUN_IIOP_STDPKG := true))
     GENCLASSES += $(RMI_IIOP)
     
     # Keep generated RMI/JRMP Stub source files and copy them to RMIC_GENSRC_DIR
     # so that javadoc can include them in the API (4997471)
    -$(eval $(call SetupRMICompilation,RMI_SRC,\
    -		CLASSES:=$(JMAN_RMI_CLASSES),\
    -		CLASSES_DIR:=$(CLASSES_DIR),\
    -		STUB_CLASSES_DIR:=$(RMIC_GENSRC_DIR),\
    -		RUN_V12:=true,\
    -		KEEP_GENERATED:=true))
    -GENCLASSES += $(filter %.java,$(RMI_SRC))
    +$(eval $(call SetupRMICompilation,RMI_SRC, \
    +    CLASSES := $(JMAN_RMI_CLASSES), \
    +    CLASSES_DIR := $(CLASSES_DIR), \
    +    STUB_CLASSES_DIR := $(RMIC_GENSRC_DIR), \
    +    RUN_V12 := true, \
    +    KEEP_GENERATED := true))
    +GENCLASSES += $(filter %.java, $(RMI_SRC))
     
     ##########################################################################################
     
    +$(RMI_12) $(RMI_11) $(RMI_IIOP) $(RMI_SRC): $(BUILD_BOOTSTRAP_RMIC)
    +
     $(RMIC_GENSRC_DIR)/_the.classes.removed: $(GENCLASSES)
     	$(FIND) $(RMIC_GENSRC_DIR) -name "*.class" $(FIND_DELETE)
     	$(TOUCH) $@
    diff --git a/jdk/makefiles/GenerateData.gmk b/jdk/makefiles/GenerateData.gmk
    index f35cf3278df..f4739ee4342 100644
    --- a/jdk/makefiles/GenerateData.gmk
    +++ b/jdk/makefiles/GenerateData.gmk
    @@ -38,16 +38,16 @@ include Tools.gmk
     # These are written directly into classes dir.
     GENDATA :=
     
    -include GendataBreakIterator.gmk
    +include gendata/GendataBreakIterator.gmk
     GENDATA += $(BREAK_ITERATOR)
     
    -include GendataFontConfig.gmk
    +include gendata/GendataFontConfig.gmk
     GENDATA += $(GENDATA_FONT_CONFIG)
     
    -include GendataTZDB.gmk
    +include gendata/GendataTZDB.gmk
     GENDATA += $(GENDATA_TZDB)
     
    -include GendataHtml32dtd.gmk
    +include gendata/GendataHtml32dtd.gmk
     GENDATA += $(GENDATA_HTML32DTD)
     
     ##########################################################################################
    @@ -75,9 +75,9 @@ GENDATA += $(GENDATA_CURDATA)
     
     ##########################################################################################
     
    -$(GENDATA) : $(BUILD_TOOLS)
    +$(GENDATA): $(BUILD_TOOLS)
     
    -$(JDK_OUTPUTDIR)/classes/_the.gendata : $(GENDATA)
    +$(JDK_OUTPUTDIR)/classes/_the.gendata: $(GENDATA)
     	$(TOUCH) $@
     
     all: $(JDK_OUTPUTDIR)/classes/_the.gendata
    diff --git a/jdk/makefiles/GenerateJavaSources.gmk b/jdk/makefiles/GenerateSources.gmk
    similarity index 71%
    rename from jdk/makefiles/GenerateJavaSources.gmk
    rename to jdk/makefiles/GenerateSources.gmk
    index 7bc05989ce9..7674fcd3744 100644
    --- a/jdk/makefiles/GenerateJavaSources.gmk
    +++ b/jdk/makefiles/GenerateSources.gmk
    @@ -38,57 +38,59 @@ include Tools.gmk
     # Now include all the rules that generate Java sources.
     # The Java sources are written into the gensrc_.... directories.
     
    -include GensrcProperties.gmk
    +include gensrc/GensrcProperties.gmk
     GENSRC += $(GENSRC_PROPERTIES)
     
    -include GensrcLocaleDataMetaInfo.gmk
    +include gensrc/GensrcLocaleDataMetaInfo.gmk
     GENSRC += $(GENSRC_LOCALEDATAMETAINFO)
     
    -include GensrcCharacterData.gmk
    +include gensrc/GensrcCharacterData.gmk
     GENSRC += $(GENSRC_CHARACTERDATA)
     
    -include GensrcJDWP.gmk
    +include gensrc/GensrcJDWP.gmk
     GENSRC += $(GENSRC_JDWP)
     
    -include GensrcMisc.gmk
    +include gensrc/GensrcMisc.gmk
     GENSRC += $(GENSRC_MISC)
     
    -include GensrcCharsetMapping.gmk
    +include gensrc/GensrcCharsetMapping.gmk
     GENSRC += $(GENSRC_CHARSETMAPPING)
     
    -include GensrcCharsetCoder.gmk
    +include gensrc/GensrcCharsetCoder.gmk
     GENSRC += $(GENSRC_CHARSETCODER)
     
    -include GensrcBuffer.gmk
    +include gensrc/GensrcBuffer.gmk
     GENSRC += $(GENSRC_BUFFER)
     
    -include GensrcExceptions.gmk
    +include gensrc/GensrcExceptions.gmk
     GENSRC += $(GENSRC_EXCEPTIONS)
     
    -ifneq ($(OPENJDK_TARGET_OS),windows)
    -include GensrcIcons.gmk
    -GENSRC += $(GENSRC_AWT_ICONS)
    +ifneq ($(OPENJDK_TARGET_OS), windows)
    +  include gensrc/GensrcIcons.gmk
    +  GENSRC += $(GENSRC_AWT_ICONS)
     
    -ifeq ($(OPENJDK_TARGET_OS),macosx)
    -GENSRC += $(GENSRC_OSX_ICONS)
    +  ifeq ($(OPENJDK_TARGET_OS), macosx)
    +    GENSRC += $(GENSRC_OSX_ICONS)
    +  endif
    +
    +  ifneq ($(OPENJDK_TARGET_OS), macosx)
    +    include gensrc/GensrcX11Wrappers.gmk
    +    GENSRC += $(GENSRC_X11WRAPPERS)
    +  endif
     endif
     
    -include GensrcX11Wrappers.gmk
    -GENSRC += $(GENSRC_X11WRAPPERS)
    -endif
    -
    -include GensrcCLDR.gmk
    +include gensrc/GensrcCLDR.gmk
     GENSRC += $(GENSRC_CLDR)
     
    -include GensrcSwing.gmk
    +include gensrc/GensrcSwing.gmk
     GENSRC += $(GENSRC_SWING_BEANINFO) $(GENSRC_SWING_NIMBUS)
     
     ifeq ($(OPENJDK_TARGET_OS), macosx)
    -     include GensrcJObjC.gmk
    -     GENSRC += $(GENSRC_JOBJC)
    +  include gensrc/GensrcJObjC.gmk
    +  GENSRC += $(GENSRC_JOBJC)
     endif
     
    -$(GENSRC) : $(BUILD_TOOLS)
    +$(GENSRC): $(BUILD_TOOLS)
     
     all: $(GENSRC)
     
    diff --git a/jdk/makefiles/GensrcBuffer.gmk b/jdk/makefiles/GensrcBuffer.gmk
    deleted file mode 100644
    index 55b51d050d8..00000000000
    --- a/jdk/makefiles/GensrcBuffer.gmk
    +++ /dev/null
    @@ -1,380 +0,0 @@
    -#
    -# 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
    -# 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.
    -#
    -
    -GENSRC_BUFFER :=
    -
    -GENSRC_BUFFER_TMP := $(JDK_OUTPUTDIR)/gensrc
    -GENSRC_BUFFER_DST := $(JDK_OUTPUTDIR)/gensrc/java/nio
    -
    -GENSRC_BUFFER_SRC := $(JDK_TOPDIR)/src/share/classes/java/nio
    -
    -###
    -
    -$(GENSRC_BUFFER_DST)/_the.buffer.dir :
    -	$(ECHO) "Generating buffer classes"
    -	$(MKDIR) -p $(@D)
    -	$(TOUCH) $@
    -
    -define fixRw
    -	$1_RW := $2
    -	$1_rwkey := rw
    -	ifeq (R,$2)
    -		 $1_rwkey := ro
    -	endif
    -endef
    -
    -define typesAndBits
    -        # param 1 target
    -        # param 2 type
    -        # param 3 BO
    -	$1_a := a
    -	$1_A := A
    -
    -	$1_type := $2
    -
    -	ifeq ($2, byte)
    -		$1_x        := b
    -		$1_Type     := Byte
    -		$1_fulltype := byte
    -		$1_Fulltype := Byte
    -		$1_category := integralType
    -		$1_LBPV     := 0
    -	endif
    -
    -	ifeq ($2, char)
    -		$1_x        := c
    -		$1_Type     := Char
    -		$1_fulltype := character
    -		$1_Fulltype := Character
    -		$1_category := integralType
    -                $1_streams  := streamableType
    -                $1_streamtype := int
    -                $1_Streamtype := Int
    -		$1_LBPV     := 1
    -	endif
    -
    -	ifeq ($2, short)
    -		$1_x        := s
    -		$1_Type     := Short
    -		$1_fulltype := short
    -		$1_Fulltype := Short
    -		$1_category := integralType
    -		$1_LBPV     := 1
    -	endif
    -
    -	ifeq ($2, int)
    -		$1_a := an
    -		$1_A := An
    -		$1_x        := i
    -		$1_Type     := Int
    -		$1_fulltype := integer
    -		$1_Fulltype := Integer
    -		$1_category := integralType
    -		$1_LBPV     := 2
    -	endif
    -
    -	ifeq ($2, long)
    -		$1_x        := l
    -		$1_Type     := Long
    -		$1_fulltype := long
    -		$1_Fulltype := Long
    -		$1_category := integralType	
    -		$1_LBPV     := 3
    -	endif
    -
    -	ifeq ($2, float)
    -		$1_x        := f
    -		$1_Type     := Float
    -		$1_fulltype := float
    -		$1_Fulltype := Float
    -		$1_category := floatingPointType
    -		$1_LBPV     := 2
    -	endif
    -
    -	ifeq ($2, double)
    -		$1_x        := d
    -		$1_Type     := Double
    -		$1_fulltype := double
    -		$1_Fulltype := Double
    -		$1_category := floatingPointType
    -		$1_LBPV     := 3
    -	endif
    -
    -	$1_Swaptype := $$($1_Type)
    -	$1_memtype := $2
    -	$1_Memtype := $$($1_Type)
    -
    -	ifeq ($2, float)
    -		$1_memtype := int
    -		$1_Memtype := Int
    -		ifneq ($3,U)
    -			$1_Swaptype := Int
    -			$1_fromBits := Float.intBitsToFloat
    -			$1_toBits   := Float.floatToRawIntBits
    -		endif
    -	endif
    -
    -	ifeq ($2, double)
    -		$1_memtype := long
    -		$1_Memtype := Long
    -		ifneq ($3,U)
    -			$1_Swaptype := Long
    -			$1_fromBits := Double.longBitsToDouble
    -			$1_toBits   := Double.doubleToRawLongBits
    -		endif
    -	endif
    -
    -	ifeq ($3, S)
    -		$1_swap := Bits.swap
    -	endif
    -endef
    -
    -define genBinOps
    -        # param 1 target
    -        # param 2 type
    -        # param 3 BO
    -        # param 4 RW
    -        # param 5 nbytes
    -        # param 6 nbytesButOne
    -	$(call typesAndBits,$1,$2,$3)
    -	$(call fixRw,$1,$4)
    -	$1_nbytes := $5
    -	$1_nbytesButOne := $6
    -	$1_CMD := $(TOOL_SPP) \
    -		-Dtype=$$($1_type) \
    -		-DType=$$($1_Type) \
    -		-Dfulltype=$$($1_fulltype) \
    -		-Dmemtype=$$($1_memtype) \
    -		-DMemtype=$$($1_Memtype) \
    -		-DfromBits=$$($1_fromBits) \
    -		-DtoBits=$$($1_toBits) \
    -		-DLG_BYTES_PER_VALUE=$$($1_LBPV) \
    -		-DBYTES_PER_VALUE="(1 << $$($1_LBPV))" \
    -		-Dnbytes=$$($1_nbytes) \
    -		-DnbytesButOne=$$($1_nbytesButOne) \
    -		-DRW=$$($1_RW) \
    -		-K$$($1_rwkey) \
    -		-Da=$$($1_a) \
    -		-be
    -endef
    -
    -define SetupGenBuffer
    -        # param 1 is for output file
    -        # param 2 is template dependency
    -        # param 3-9 are named args.
    -        #   type :=
    -        #   BIN  :=
    -        #   RW   := Mutability (R)ead-only (W)ritable
    -        #   BO   := (U)nswapped/(S)wapped/(L)ittle/(B)ig
    -        #
    -	$(if $3,$1_$(strip $3))
    -	$(if $4,$1_$(strip $4))
    -	$(if $5,$1_$(strip $5))
    -	$(if $6,$1_$(strip $6))
    -	$(if $7,$1_$(strip $7))
    -	$(if $8,$1_$(strip $8))
    -	$(if $9,$1_$(strip $9))
    -	$(if $(10),$1_$(strip $(10)))
    -	$(if $(11),$1_$(strip $(11)))
    -	$(if $(12),$1_$(strip $(12)))
    -	$(if $(13),$1_$(strip $(13)))
    -	$(if $(14),$1_$(strip $(14)))
    -	$(foreach i,3 4 5 6 7 8 9 10 11 12 13 14 15,$(if $($i),$1_$(strip $($i)))$(NEWLINE))
    -	$(call LogSetupMacroEntry,SetupGenBuffer($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
    -	$(if $(16),$(error Internal makefile error: Too many arguments to SetupGenBuffer, please update GensrcBuffer.gmk))
    -
    -	$(call fixRw,$1,$$($1_RW))
    -	$(call typesAndBits,$1,$$($1_type),$$($1_BO))
    -
    -	$1_DST     := $(GENSRC_BUFFER_DST)/$1.java
    -	$1_SRC     := $(GENSRC_BUFFER_SRC)/$(strip $2).java.template
    -	$1_SRC_BIN := $(GENSRC_BUFFER_SRC)/$(strip $2)-bin.java.template
    -
    -	$1_DEP := $$($1_SRC)
    -	ifneq ($$($1_BIN),1)
    -		$1_DEP := $$($1_SRC)
    -		$1_OUT := $$($1_DST)
    -	else
    -		$1_DEP += $$($1_SRC) $$($1_SRC_BIN)
    -		$1_OUT := $(GENSRC_BUFFER_DST)/$1.binop.0.java
    -	endif
    -
    -	ifeq ($$($1_BIN),1)
    -		$(call genBinOps,$1_char,char,$$($1_BO),$$($1_RW),two,one)
    -		$(call genBinOps,$1_short,short,$$($1_BO),$$($1_RW),two,one)
    -		$(call genBinOps,$1_int,int,$$($1_BO),$$($1_RW),four,three)
    -		$(call genBinOps,$1_long,long,$$($1_BO),$$($1_RW),eight,seven)
    -		$(call genBinOps,$1_float,float,$$($1_BO),$$($1_RW),four,three)
    -		$(call genBinOps,$1_double,double,$$($1_BO),$$($1_RW),eight,seven)
    -	endif
    -
    -$$($1_DST) : $$($1_DEP) $(GENSRC_BUFFER_DST)/_the.buffer.dir
    -	$(TOOL_SPP) < $$($1_SRC) > $$($1_OUT).tmp \
    -		-K$$($1_type) \
    -		-K$$($1_category) \
    -		-K$$($1_streams) \
    -		-Dtype=$$($1_type) \
    -		-DType=$$($1_Type) \
    -		-Dfulltype=$$($1_fulltype) \
    -		-DFulltype=$$($1_Fulltype) \
    -                -Dstreamtype=$$($1_streamtype) \
    -                -DStreamtype=$$($1_Streamtype) \
    -		-Dx=$$($1_x) \
    -		-Dmemtype=$$($1_memtype) \
    -		-DMemtype=$$($1_Memtype) \
    -		-DSwaptype=$$($1_Swaptype) \
    -		-DfromBits=$$($1_fromBits) \
    -		-DtoBits=$$($1_toBits) \
    -		-DLG_BYTES_PER_VALUE=$$($1_LBPV) \
    -		-DBYTES_PER_VALUE="(1 << $$($1_LBPV))" \
    -		-DBO=$$($1_BO) \
    -		-Dswap=$$($1_swap) \
    -		-DRW=$$($1_RW) \
    -		-K$$($1_rwkey) \
    -		-Da=$$($1_a) \
    -		-DA=$$($1_A) \
    -		-Kbo$$($1_BO)
    -		$(MV) $$($1_OUT).tmp $$($1_OUT)
    -# Do the extra bin thing
    -ifeq ($$($1_BIN),1)
    -	$(SED) -e '/#BIN/,$$$$d' < $$($1_OUT) > $$($1_DST).tmp
    -	$(RM) $$($1_OUT)
    -	$$($1_char_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
    -	$$($1_short_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
    -	$$($1_int_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
    -	$$($1_long_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
    -	$$($1_float_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
    -	$$($1_double_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
    -	$(PRINTF) "}\n" >> $$($1_DST).tmp
    -	mv $$($1_DST).tmp $$($1_DST)
    -endif
    -
    -GENSRC_BUFFER += $$($1_DST)
    -
    -endef
    -
    -###
    -
    -X_BUF :=X-Buffer
    -
    -$(eval $(call SetupGenBuffer,ByteBuffer,  $(X_BUF),type:=byte,BIN:=1))
    -$(eval $(call SetupGenBuffer,CharBuffer,  $(X_BUF),type:=char))
    -$(eval $(call SetupGenBuffer,ShortBuffer, $(X_BUF),type:=short))
    -$(eval $(call SetupGenBuffer,IntBuffer,   $(X_BUF),type:=int))
    -$(eval $(call SetupGenBuffer,LongBuffer,  $(X_BUF),type:=long))
    -$(eval $(call SetupGenBuffer,FloatBuffer, $(X_BUF),type:=float))
    -$(eval $(call SetupGenBuffer,DoubleBuffer,$(X_BUF),type:=double))
    -
    -# Buffers whose contents are heap-allocated
    -# 
    -HEAP_X_BUF := Heap-X-Buffer
    -
    -$(eval $(call SetupGenBuffer,HeapByteBuffer,   $(HEAP_X_BUF),type:=byte))
    -$(eval $(call SetupGenBuffer,HeapByteBufferR,  $(HEAP_X_BUF),type:=byte,RW:=R))
    -$(eval $(call SetupGenBuffer,HeapCharBuffer,   $(HEAP_X_BUF),type:=char))
    -$(eval $(call SetupGenBuffer,HeapCharBufferR,  $(HEAP_X_BUF),type:=char,RW:=R))
    -$(eval $(call SetupGenBuffer,HeapShortBuffer,  $(HEAP_X_BUF),type:=short))
    -$(eval $(call SetupGenBuffer,HeapShortBufferR, $(HEAP_X_BUF),type:=short,RW:=R))
    -$(eval $(call SetupGenBuffer,HeapIntBuffer,    $(HEAP_X_BUF),type:=int))
    -$(eval $(call SetupGenBuffer,HeapIntBufferR,   $(HEAP_X_BUF),type:=int,RW:=R))
    -$(eval $(call SetupGenBuffer,HeapLongBuffer,   $(HEAP_X_BUF),type:=long))
    -$(eval $(call SetupGenBuffer,HeapLongBufferR,  $(HEAP_X_BUF),type:=long,RW:=R))
    -$(eval $(call SetupGenBuffer,HeapFloatBuffer,  $(HEAP_X_BUF),type:=float))
    -$(eval $(call SetupGenBuffer,HeapFloatBufferR, $(HEAP_X_BUF),type:=float,RW:=R))
    -$(eval $(call SetupGenBuffer,HeapDoubleBuffer, $(HEAP_X_BUF),type:=double))
    -$(eval $(call SetupGenBuffer,HeapDoubleBufferR,$(HEAP_X_BUF),type:=double,RW:=R))
    -
    -# Direct byte buffer
    -# 
    -DIRECT_X_BUF := Direct-X-Buffer
    -
    -$(eval $(call SetupGenBuffer,DirectByteBuffer, $(DIRECT_X_BUF),type:=byte,BIN:=1))
    -$(eval $(call SetupGenBuffer,DirectByteBufferR,$(DIRECT_X_BUF),type:=byte,BIN:=1,RW:=R))
    -
    -# Unswapped views of direct byte buffers
    -#
    -$(eval $(call SetupGenBuffer,DirectCharBufferU,   $(DIRECT_X_BUF),type:=char,BO:=U))
    -$(eval $(call SetupGenBuffer,DirectCharBufferRU,  $(DIRECT_X_BUF),type:=char,RW:=R,BO:=U))
    -$(eval $(call SetupGenBuffer,DirectShortBufferU,  $(DIRECT_X_BUF),type:=short,BO:=U))
    -$(eval $(call SetupGenBuffer,DirectShortBufferRU, $(DIRECT_X_BUF),type:=short,RW:=R,BO:=U))
    -$(eval $(call SetupGenBuffer,DirectIntBufferU,    $(DIRECT_X_BUF),type:=int,BO:=U))
    -$(eval $(call SetupGenBuffer,DirectIntBufferRU,   $(DIRECT_X_BUF),type:=int,RW:=R,BO:=U))
    -$(eval $(call SetupGenBuffer,DirectLongBufferU,   $(DIRECT_X_BUF),type:=long,BO:=U))
    -$(eval $(call SetupGenBuffer,DirectLongBufferRU,  $(DIRECT_X_BUF),type:=long,RW:=R,BO:=U))
    -$(eval $(call SetupGenBuffer,DirectFloatBufferU,  $(DIRECT_X_BUF),type:=float,BO:=U))
    -$(eval $(call SetupGenBuffer,DirectFloatBufferRU, $(DIRECT_X_BUF),type:=float,RW:=R,BO:=U))
    -$(eval $(call SetupGenBuffer,DirectDoubleBufferU, $(DIRECT_X_BUF),type:=double,BO:=U))
    -$(eval $(call SetupGenBuffer,DirectDoubleBufferRU,$(DIRECT_X_BUF),type:=double,RW:=R,BO:=U))
    -
    -# Swapped views of direct byte buffers
    -#
    -$(eval $(call SetupGenBuffer,DirectCharBufferS,   $(DIRECT_X_BUF),type:=char,BO:=S))
    -$(eval $(call SetupGenBuffer,DirectCharBufferRS,  $(DIRECT_X_BUF),type:=char,RW:=R,BO:=S))
    -$(eval $(call SetupGenBuffer,DirectShortBufferS,  $(DIRECT_X_BUF),type:=short,BO:=S))
    -$(eval $(call SetupGenBuffer,DirectShortBufferRS, $(DIRECT_X_BUF),type:=short,RW:=R,BO:=S))
    -$(eval $(call SetupGenBuffer,DirectIntBufferS,    $(DIRECT_X_BUF),type:=int,BO:=S))
    -$(eval $(call SetupGenBuffer,DirectIntBufferRS,   $(DIRECT_X_BUF),type:=int,RW:=R,BO:=S))
    -$(eval $(call SetupGenBuffer,DirectLongBufferS,   $(DIRECT_X_BUF),type:=long,BO:=S))
    -$(eval $(call SetupGenBuffer,DirectLongBufferRS,  $(DIRECT_X_BUF),type:=long,RW:=R,BO:=S))
    -$(eval $(call SetupGenBuffer,DirectFloatBufferS,  $(DIRECT_X_BUF),type:=float,BO:=S))
    -$(eval $(call SetupGenBuffer,DirectFloatBufferRS, $(DIRECT_X_BUF),type:=float,RW:=R,BO:=S))
    -$(eval $(call SetupGenBuffer,DirectDoubleBufferS, $(DIRECT_X_BUF),type:=double,BO:=S))
    -$(eval $(call SetupGenBuffer,DirectDoubleBufferRS,$(DIRECT_X_BUF),type:=double,RW:=R,BO:=S))
    -
    -# Big-endian views of byte buffers
    -#
    -BYTE_X_BUF := ByteBufferAs-X-Buffer
    -
    -$(eval $(call SetupGenBuffer,ByteBufferAsCharBufferB,   $(BYTE_X_BUF),type:=char,BO:=B))
    -$(eval $(call SetupGenBuffer,ByteBufferAsCharBufferRB,  $(BYTE_X_BUF),type:=char,RW:=R,BO:=B))
    -$(eval $(call SetupGenBuffer,ByteBufferAsShortBufferB,  $(BYTE_X_BUF),type:=short,BO:=B))
    -$(eval $(call SetupGenBuffer,ByteBufferAsShortBufferRB, $(BYTE_X_BUF),type:=short,RW:=R,BO:=B))
    -$(eval $(call SetupGenBuffer,ByteBufferAsIntBufferB,    $(BYTE_X_BUF),type:=int,BO:=B))
    -$(eval $(call SetupGenBuffer,ByteBufferAsIntBufferRB,   $(BYTE_X_BUF),type:=int,RW:=R,BO:=B))
    -$(eval $(call SetupGenBuffer,ByteBufferAsLongBufferB,   $(BYTE_X_BUF),type:=long,BO:=B))
    -$(eval $(call SetupGenBuffer,ByteBufferAsLongBufferRB,  $(BYTE_X_BUF),type:=long,RW:=R,BO:=B))
    -$(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferB,  $(BYTE_X_BUF),type:=float,BO:=B))
    -$(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferRB, $(BYTE_X_BUF),type:=float,RW:=R,BO:=B))
    -$(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferB, $(BYTE_X_BUF),type:=double,BO:=B))
    -$(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferRB,$(BYTE_X_BUF),type:=double,RW:=R,BO:=B))
    -
    -# Little-endian views of byte buffers
    -#
    -$(eval $(call SetupGenBuffer,ByteBufferAsCharBufferL,   $(BYTE_X_BUF),type:=char,BO:=L))
    -$(eval $(call SetupGenBuffer,ByteBufferAsCharBufferRL,  $(BYTE_X_BUF),type:=char,RW:=R,BO:=L))
    -$(eval $(call SetupGenBuffer,ByteBufferAsShortBufferL,  $(BYTE_X_BUF),type:=short,BO:=L))
    -$(eval $(call SetupGenBuffer,ByteBufferAsShortBufferRL, $(BYTE_X_BUF),type:=short,RW:=R,BO:=L))
    -$(eval $(call SetupGenBuffer,ByteBufferAsIntBufferL,    $(BYTE_X_BUF),type:=int,BO:=L))
    -$(eval $(call SetupGenBuffer,ByteBufferAsIntBufferRL,   $(BYTE_X_BUF),type:=int,RW:=R,BO:=L))
    -$(eval $(call SetupGenBuffer,ByteBufferAsLongBufferL,   $(BYTE_X_BUF),type:=long,BO:=L))
    -$(eval $(call SetupGenBuffer,ByteBufferAsLongBufferRL,  $(BYTE_X_BUF),type:=long,RW:=R,BO:=L))
    -$(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferL,  $(BYTE_X_BUF),type:=float,BO:=L))
    -$(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferRL, $(BYTE_X_BUF),type:=float,RW:=R,BO:=L))
    -$(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferL, $(BYTE_X_BUF),type:=double,BO:=L))
    -$(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferRL,$(BYTE_X_BUF),type:=double,RW:=R,BO:=L))
    -
    -###
    -
    -$(GENSRC_BUFFER) : $(BUILD_TOOLS)
    diff --git a/jdk/makefiles/GensrcCharsetCoder.gmk b/jdk/makefiles/GensrcCharsetCoder.gmk
    deleted file mode 100644
    index 1ae71492ea6..00000000000
    --- a/jdk/makefiles/GensrcCharsetCoder.gmk
    +++ /dev/null
    @@ -1,107 +0,0 @@
    -#
    -# 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
    -# 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.
    -#
    -
    -GENSRC_CHARSETCODER :=
    -
    -GENSRC_CHARSETCODER_TMP := $(JDK_OUTPUTDIR)/gensrc
    -GENSRC_CHARSETCODER_DST := $(JDK_OUTPUTDIR)/gensrc/java/nio/charset
    -
    -GENSRC_CHARSETCODER_SRC := $(JDK_TOPDIR)/src/share/classes/java/nio
    -
    -GENSRC_CHARSETCODER_TEMPLATE := $(GENSRC_CHARSETCODER_SRC)/charset/Charset-X-Coder.java.template
    -
    -###
    -
    -$(GENSRC_CHARSETCODER_DST)/CharsetDecoder.java : $(GENSRC_CHARSETCODER_TEMPLATE)
    -	$(MKDIR) -p $(@D)
    -	-$(RM) $@.tmp
    -	$(TOOL_SPP) < $< >$@.tmp \
    -		-Kdecoder \
    -		-DA='A' \
    -		-Da='a' \
    -		-DCode='Decode' \
    -		-Dcode='decode' \
    -		-DitypesPhrase='bytes in a specific charset' \
    -		-DotypesPhrase='sixteen-bit Unicode characters' \
    -		-Ditype='byte' \
    -		-Dotype='character' \
    -		-DItype='Byte' \
    -		-DOtype='Char' \
    -		-Dcoder='decoder' \
    -		-DCoder='Decoder' \
    -		-Dcoding='decoding' \
    -		-DOtherCoder='Encoder' \
    -		-DreplTypeName='string' \
    -		-DdefaultRepl='"\\uFFFD"' \
    -		-DdefaultReplName='"\\uFFFD"<\/tt>' \
    -		-DreplType='String' \
    -		-DreplFQType='java.lang.String' \
    -		-DreplLength='length()' \
    -		-DItypesPerOtype='CharsPerByte' \
    -		-DnotLegal='not legal for this charset' \
    -		-Dotypes-per-itype='chars-per-byte' \
    -		-DoutSequence='Unicode character'
    -	$(MV) $@.tmp $@
    -
    -GENSRC_CHARSETCODER += $(GENSRC_CHARSETCODER_DST)/CharsetDecoder.java
    -
    -###
    -
    -$(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java : $(GENSRC_CHARSETCODER_TEMPLATE)
    -	$(MKDIR) -p $(@D)
    -	-$(RM) $@.tmp
    -	$(TOOL_SPP) < $< >$@.tmp \
    -		-Kencoder \
    -		-DA='An' \
    -		-Da='an' \
    -		-DCode='Encode' \
    -		-Dcode='encode' \
    -		-DitypesPhrase='sixteen-bit Unicode characters' \
    -		-DotypesPhrase='bytes in a specific charset' \
    -		-Ditype='character' \
    -		-Dotype='byte' \
    -		-DItype='Char' \
    -		-DOtype='Byte' \
    -		-Dcoder='encoder' \
    -		-DCoder='Encoder' \
    -		-Dcoding='encoding' \
    -		-DOtherCoder='Decoder' \
    -		-DreplTypeName='byte array' \
    -		-DdefaultRepl='new byte[] { (byte)'"'"\\?"'"' }' \
    -		-DdefaultReplName='{<\/tt>\ (byte)'"'"\\?"'"'<\/tt>\ }<\/tt>' \
    -		-DreplType='byte[]' \
    -		-DreplFQType='byte[]' \
    -		-DreplLength='length' \
    -		-DItypesPerOtype='BytesPerChar' \
    -		-DnotLegal='not a legal sixteen-bit Unicode sequence' \
    -		-Dotypes-per-itype='bytes-per-char' \
    -		-DoutSequence='byte sequence in the given charset'
    -	$(MV) $@.tmp $@
    -
    -GENSRC_CHARSETCODER += $(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java
    -
    -###
    -
    -$(GENSRC_CHARSETCODER) : $(BUILD_TOOLS)
    diff --git a/jdk/makefiles/GensrcMisc.gmk b/jdk/makefiles/GensrcMisc.gmk
    deleted file mode 100644
    index 812b2cee6c7..00000000000
    --- a/jdk/makefiles/GensrcMisc.gmk
    +++ /dev/null
    @@ -1,225 +0,0 @@
    -#
    -# 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
    -# 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.
    -#
    -
    -include ProfileNames.gmk
    -
    -##########################################################################################
    -# Install the launcher name, release version string, full version
    -# string and the runtime name into the Version.java file.
    -# To be printed by java -version
    -
    -$(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \
    -$(PROFILE_VERSION_JAVA_TARGETS): \
    -		$(JDK_TOPDIR)/src/share/classes/sun/misc/Version.java.template
    -	$(MKDIR) -p $(@D)
    -	$(RM) $@ $@.tmp
    -	$(ECHO) Generating sun/misc/Version.java $(call profile_version_name, $@)
    -	$(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \
    -	       -e 's/@@java_version@@/$(RELEASE)/g' \
    -	       -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \
    -	       -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \
    -	       -e 's/@@java_profile_name@@/$(call profile_version_name, $@)/g' \
    -            $< > $@.tmp
    -	$(MV) $@.tmp $@
    -
    -GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \
    -    $(PROFILE_VERSION_JAVA_TARGETS)
    -
    -##########################################################################################
    -# Version file for jconsole
    -
    -$(JDK_OUTPUTDIR)/gensrc/sun/tools/jconsole/Version.java: \
    -                $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/Version.java.template
    -	$(MKDIR) -p $(@D)
    -	$(RM) $@ $@.tmp
    -	$(ECHO) $(LOG_INFO) Generating sun/tools/jconsole/Version.java
    -	$(SED) -e 's/@@jconsole_version@@/$(FULL_VERSION)/g' $< > $@.tmp
    -	$(MV) $@.tmp $@
    -
    -GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/tools/jconsole/Version.java
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS_API),posix)
    -    UPSUFFIX:=$(OPENJDK_TARGET_OS)
    -    ifeq ($(OPENJDK_TARGET_OS),macosx)
    -        UPSUFFIX:=bsd
    -    endif
    -    # UNIXProcess.java is different for solaris and linux. We need to copy
    -    # the correct UNIXProcess.java over to $(JDK_OUTPUTDIR)/gensrc/java/lang/.
    -
    -    $(JDK_OUTPUTDIR)/gensrc/java/lang/UNIXProcess.java : \
    -              $(JDK_TOPDIR)/src/solaris/classes/java/lang/UNIXProcess.java.$(UPSUFFIX)
    -	$(ECHO) $(LOG_INFO) Copying UNIXProcess.java.$(OPENJDK_TARGET_OS) to java/lang/UNIXProcess.java
    -	$(call install-file)
    -	$(CHMOD) u+rw $@
    -
    -    GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/java/lang/UNIXProcess.java
    -endif
    -
    -##########################################################################################
    -
    -GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java
    -
    -GENSRC_SOR_SRC := $(JDK_TOPDIR)/src/share/native/sun/nio/ch
    -GENSRC_SOR_SRC_FILE := genSocketOptionRegistry.c
    -GENSRC_SOR_BIN := $(JDK_OUTPUTDIR)/gensrc/genSocketOptionRegistry
    -
    -SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOR_SRC)/$(GENSRC_SOR_SRC_FILE) | \
    -	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 
    -
    -$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOR_EXE,\
    -		SRC:=$(GENSRC_SOR_SRC),\
    -		INCLUDE_FILES:=$(GENSRC_SOR_SRC_FILE),\
    -		LANG:=C,\
    -		CC:=$(BUILD_CC),\
    -		LDEXE:=$(BUILD_LD),\
    -		OBJECT_DIR:=$(GENSRC_SOR_BIN),\
    -		OUTPUT_DIR:=$(GENSRC_SOR_BIN),\
    -                PROGRAM:=genSocketOptionRegistry))
    -
    -ifneq ($(wildcard $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java),)
    -  HAS_SOCKET_OPTION_REGISTRY:=true
    -endif
    -
    -ifneq ($(HAS_SOCKET_OPTION_REGISTRY),true)
    -$(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java : $(BUILD_GENSRC_SOR_EXE)
    -	$(MKDIR) -p $(@D)
    -	$(RM) $@ $@.tmp
    -	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
    -	$(BUILD_GENSRC_SOR_EXE) >> $@.tmp
    -	$(MV) $@.tmp $@
    -else
    -$(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java : $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java
    -	$(call install-file)
    -endif
    -
    -##########################################################################################
    -
    -ifneq ($(OPENJDK_TARGET_OS),windows)
    -
    -GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java
    -
    -GENSRC_UC_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
    -GENSRC_UC_SRC_FILE := genUnixConstants.c
    -GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/gensrc/genUnixConstants
    -
    -UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \
    -	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 
    -
    -$(eval $(call SetupNativeCompilation,BUILD_GENSRC_UC_EXE,\
    -		SRC:=$(GENSRC_UC_SRC),\
    -		INCLUDE_FILES:=$(GENSRC_UC_SRC_FILE),\
    -		LANG:=C,\
    -		CC:=$(BUILD_CC),\
    -		LDEXE:=$(BUILD_CC),\
    -		CFLAGS:=$(filter -D%,$(CFLAGS_JDKEXE)),\
    -		OBJECT_DIR:=$(GENSRC_UC_BIN),\
    -                OUTPUT_DIR:=$(GENSRC_UC_BIN),\
    -		PROGRAM:=genUnixConstants))
    -
    -ifneq ($(wildcard $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java),)
    -  HAS_UNIX_CONSTANTS:=true
    -endif
    -
    -ifneq ($(HAS_UNIX_CONSTANTS),true)
    -$(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java : $(BUILD_GENSRC_UC_EXE)
    -	$(MKDIR) -p $(@D)
    -	$(RM) $@ $@.tmp
    -	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
    -	$(BUILD_GENSRC_UC_EXE) >> $@.tmp
    -	$(MV) $@.tmp $@
    -else
    -$(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java : $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java
    -	$(call install-file)
    -endif
    -
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS),solaris)
    -
    -GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java
    -
    -GENSRC_SOL_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
    -GENSRC_SOL_SRC_FILE := genSolarisConstants.c
    -GENSRC_SOL_BIN := $(JDK_OUTPUTDIR)/gensrc/genSolarisConstants
    -
    -SOL_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOL_SRC)/$(GENSRC_SOL_SRC_FILE) | \
    -	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 
    -
    -$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOL_EXE,\
    -		SRC:=$(GENSRC_SOL_SRC),\
    -		INCLUDE_FILES:=$(GENSRC_SOL_SRC_FILE),\
    -		LANG:=C,\
    -		CC:=$(BUILD_CC),\
    -		LDEXE:=$(BUILD_CC),\
    -		OBJECT_DIR:=$(GENSRC_SOL_BIN),\
    -		OUTPUT_DIR:=$(GENSRC_SOL_BIN),\
    -		PROGRAM:=genSolarisConstants))
    -
    -$(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java : $(BUILD_GENSRC_SOL_EXE)
    -	$(MKDIR) -p $(@D)
    -	$(RM) $@ $@.tmp
    -	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
    -	$(BUILD_GENSRC_SOL_EXE) >> $@.tmp
    -	$(MV) $@.tmp $@
    -
    -
    -endif
    -
    -##########################################################################################
    -
    -ifndef OPENJDK
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -
    -    AB_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc_ab
    -    AB_SRC_DIR := $(JDK_TOPDIR)/src/closed/windows/classes/com/sun/java/accessibility
    -
    -    ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
    -         $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java: \
    -			$(AB_SRC_DIR)/32bit/AccessBridge.java
    -		$(install-file)
    -
    -         $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java: \
    -			$(AB_SRC_DIR)/legacy/AccessBridge.java
    -		$(install-file)
    -
    -        GENSRC_MISC += $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java \
    -		       $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java
    -
    -    else
    -         $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java: \
    -			$(AB_SRC_DIR)/64bit/AccessBridge.java
    -		$(install-file)
    -
    -         GENSRC_MISC += $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java
    -
    -    endif
    -endif
    -endif
    -
    -##########################################################################################
    \ No newline at end of file
    diff --git a/jdk/makefiles/GensrcProperties.gmk b/jdk/makefiles/GensrcProperties.gmk
    deleted file mode 100644
    index 3ef3a538475..00000000000
    --- a/jdk/makefiles/GensrcProperties.gmk
    +++ /dev/null
    @@ -1,388 +0,0 @@
    -#
    -# 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
    -# 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.
    -#
    -
    -# Prepare the find cache. This is only used on windows.
    -$(eval $(call FillCacheFind,$(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/windows/classes))
    -
    -# All .properties files to be compiled are appended to this variable.
    -ALL_COMPILED_PROPSOURCES:=
    -# All generated .java files from compilation are appended to this variable.
    -ALL_COMPILED_PROPJAVAS:=
    -# The (very long) command line for compilation, stored in a file, prior to use.
    -COMPILE_PROPCMDLINE:=
    -
    -# All .properties files to be cleaned are appended to this variable.
    -ALL_CLEANED_PROPSOURCES:=
    -# All generated cleaned .properties files from cleaning are appended to this variable.
    -ALL_CLEANED_PROPOUTPUT:=
    -# The (very long) command line for cleaning, stored in a file, prior to use.
    -CLEAN_PROPCMDLINE:=
    -
    -define add_properties_to_compile
    -  # $1 is the name of the properties group
    -  # $2 is the files belonging to this group
    -  # $3 is the super class for the generated java file.
    -  # $4 is a from pattern for translating stripped name from source to target
    -  # $5 is the to pattern replacing $3 in the target
    -
    -  # Strip away prefix and suffix,
    -  # leaving for example: sun/util/resources/CurrencyNames_sv
    -  $1_PROPPATHS:=$$(patsubst $(JDK_TOPDIR)/src/windows/classes/%.properties,%,\
    -		$$(patsubst $(JDK_TOPDIR)/src/macosx/classes/%.properties,%,\
    -                $$(patsubst $(JDK_TOPDIR)/src/share/classes/%.properties,%,$2)))
    -
    -  # Apply optional name transformation, example: hz_TW -> hz_HK
    -  $(if $4,$1_PROPPATHS:=$$(patsubst $4,$5,$$($1_PROPPATHS)))
    -
    -  # Accumulate all found properties files.
    -  ALL_COMPILED_PROPSOURCES+=$2
    -
    -  # Generate the list of to be created java files.
    -  ALL_COMPILED_PROPJAVAS+=$$(patsubst %,$(JDK_OUTPUTDIR)/gensrc/%.java,$$($1_PROPPATHS))
    -
    -  # Now generate a sequence of "-compile ...CurrencyNames_sv.properties ...CurrencyNames_sv.java ListResourceBundle"
    -  # suitable to be fed into the CompileProperties command.
    -  COMPILE_PROPCMDLINE+=$$(subst _SPACE_,$(SPACE),$$(join $$(addprefix -compile_SPACE_,$2), \
    -		$$(addsuffix _SPACE_$(strip $3),\
    -                    $$(addprefix _SPACE_$(JDK_OUTPUTDIR)/gensrc/,\
    -                        $$(addsuffix .java,$$($1_PROPPATHS))))))
    -endef
    -
    -define add_properties_to_clean
    -  # $1 is the name of the properties group
    -  # $2 is the files belonging to this group
    -  # $3 is a from pattern for translating stripped name from source to target
    -  # $4 is the to pattern replacing $3 in the target
    -  # $5 optional name of extra directory to put properties files in (ex: resources)
    -
    -  # Strip away prefix and suffix,
    -  # leaving for example: sun/util/resources/CurrencyNames_sv
    -  $1_PROPPATHS:=$$(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/%.properties,%,\
    -                $$(patsubst $(JDK_TOPDIR)/src/share/classes/%.properties,%,$2))
    -
    -  # Apply optional name transformation, example: hz_TW -> hz_HK
    -  $(if $3,$1_PROPPATHS:=$$(patsubst $3,$4,$$($1_PROPPATHS)))
    -
    -  # Accumulate all found properties files.
    -  ALL_CLEANED_PROPSOURCES+=$2
    -
    -  # Generate the list of to be created java files.
    -  $1_PROPOUTPUT:=$$(patsubst %,$(JDK_OUTPUTDIR)/classes/%.properties,$$($1_PROPPATHS))
    -  # If the properties target file isn't in a "resources" dir, add one.
    -  ifneq ($5,)
    -    $1_PROPOUTPUT:=$$(foreach p,$$($1_PROPOUTPUT), $$(dir $$p)$5/$$(notdir $$p))
    -  endif
    -
    -  ALL_CLEANED_PROPOUTPUT+=$$($1_PROPOUTPUT)
    -
    -  # Now generate a sequence of "-clean ...[src]...CurrencyNames_sv.properties ...[build]...CurrencyNames_sv.properties"
    -  # suitable to be fed into the StripProperties command.
    -  CLEAN_PROPCMDLINE+=$$(subst _SPACE_,$(SPACE),$$(join $$(addprefix -clean_SPACE_,$2), \
    -                    $$(addprefix _SPACE_,$$($1_PROPOUTPUT))))
    -endef
    -
    -# Some packages contain pregenerated java files instead of properties files.
    -# But unfortunately not all properties should be converted, some should be
    -# copied....argggghhh.
    -
    -# For example:
    -#    sun/applet/resources
    -#    sun/misc/resources
    -#    sun/text/resources
    -#    sun/tools/jconsole/resources
    -#    sun/tools/native2ascii/resources
    -#    sun/util/resources
    -
    -# Some packages have properties that need to be converted to java source files.
    -
    -#com/apple/laf/resources
    -ifeq ($(OPENJDK_TARGET_OS),macosx)
    -    $(eval $(call add_properties_to_compile,COM_APPLE_LAF,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/macosx/classes/com/apple/laf/resources)),\
    -	ListResourceBundle))
    -endif
    -
    -#com/sun/accessibility/internal/resources
    -$(eval $(call add_properties_to_compile,COM_SUN_ACCESSIBILITY,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/accessibility/internal/resources)),\
    -	ListResourceBundle))
    -$(eval $(call add_properties_to_compile,COM_SUN_ACCESSIBILITY_HK,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/accessibility/internal/resources)),\
    -	ListResourceBundle,%zh_TW,%zh_HK))
    -#com/sun/imageio/plugins/common
    -$(eval $(call add_properties_to_clean,COM_SUN_IMAGEIO,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/imageio))))
    -#com/sun/java/swing/plaf/gtk/resources
    -ifneq ($(OPENJDK_TARGET_OS), windows)
    -# Only compile GTK resource bundles on Solaris/Linux
    -$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_GTK,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk/resources)),\
    -	ListResourceBundle))
    -$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_GTK_HK,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk/resources)),\
    -	ListResourceBundle,%zh_TW,%zh_HK))
    -endif
    -#com/sun/java/swing/plaf/motif/resources
    -$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_MOTIF,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif/resources)),\
    -	ListResourceBundle))
    -$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_MOTIF_HK,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif/resources)),\
    -	ListResourceBundle,%zh_TW,%zh_HK))
    -#com/sun/java/swing/plaf/windows/resources
    -$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_WINDOWS,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows/resources)),\
    -	ListResourceBundle))
    -$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_WINDOWS_HK,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows/resources)),\
    -	ListResourceBundle,%zh_TW,%zh_HK))
    -#com/sun/java/util/jar/pack
    -$(eval $(call add_properties_to_clean,JNDI_COSNAMING,\
    -	$(JDK_TOPDIR)/src/share/classes/com/sun/java/util/jar/pack/intrinsic.properties))
    -#com/sun/jndi/cosnaming
    -$(eval $(call add_properties_to_clean,JNDI_COSNAMING,\
    -	$(JDK_TOPDIR)/src/share/classes/com/sun/jndi/cosnaming/jndiprovider.properties))
    -#com/sun/jndi/ldap
    -$(eval $(call add_properties_to_clean,JNDI_COSNAMING,\
    -	$(JDK_TOPDIR)/src/share/classes/com/sun/jndi/ldap/jndiprovider.properties))
    -
    -#com/sun/org/apache/xml/internal/security/resource
    -#FIXME: The "xmlsecurity*.properties" pattern is not ideal; we might want to find
    -#a better way to select the properties files that are needed.
    -$(eval $(call add_properties_to_clean,XML_SECURITY,\
    -	$(filter $(JDK_TOPDIR)/src/share/classes/com/sun/org/apache/xml/internal/security/resource/xmlsecurity%.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/org/apache/xml/internal/security/resource))))
    -
    -#com/sun/rowset
    -$(eval $(call add_properties_to_clean,COM_SUN_ROWSET,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/rowset))))
    -$(eval $(call add_properties_to_clean,COM_SUN_ROWSET_HK,\
    -	$(filter %zh_TW.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/rowset)),\
    -	%zh_TW,%zh_HK))
    -
    -#com/sun/swing/internal/plaf/basic/resources
    -$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_BASIC,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/basic/resources)),\
    -	ListResourceBundle))
    -$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_BASIC_HK,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/basic/resources)),\
    -	ListResourceBundle,%zh_TW,%zh_HK))
    -#com/sun/swing/internal/plaf/metal/resources
    -$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_METAL,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/metal/resources)),\
    -	ListResourceBundle))
    -$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_METAL_HK,\
    -	$(filter %.properties,$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/metal/resources)),\
    -	ListResourceBundle,%zh_TW,%zh_HK))
    -#com/sun/swing/internal/plaf/synth/resources
    -$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_SYNTH,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/synth/resources)),\
    -	ListResourceBundle))
    -$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_SYNTH_HK,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/synth/resources)),\
    -	ListResourceBundle,%zh_TW,%zh_HK))
    -
    -#com/sun/tools/jdi/resources
    -$(eval $(call add_properties_to_compile,COM_SUN_TOOLS_JDI,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/tools/jdi/resources)),\
    -	ListResourceBundle))
    -
    -#com/sun/tools/script/shell
    -#java/util
    -#javax/sql/rowset
    -$(eval $(call add_properties_to_clean,JAVAX_SQL_ROWSET,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/javax/sql/rowset))))
    -#sun/awt/resources
    -$(eval $(call add_properties_to_compile,SUN_AWT,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/awt/resources)),\
    -	ListResourceBundle))
    -$(eval $(call add_properties_to_compile,SUN_AWT_HK,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/awt/resources)),\
    -	ListResourceBundle,%zh_TW,%zh_HK))
    -#sun/awt/windows/
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -    $(eval $(call add_properties_to_compile,SUN_AWT,\
    -	$(filter $(JDK_TOPDIR)/src/windows/classes/sun/awt/windows/awtLocalization%.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/windows/classes/sun/awt/windows)),\
    -	ListResourceBundle))
    -    $(eval $(call add_properties_to_compile,SUN_AWT_HK,\
    -	$(filter $(JDK_TOPDIR)/src/windows/classes/sun/awt/windows/awtLocalization%.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/windows/classes/sun/awt/windows)),\
    -	ListResourceBundle,%zh_TW,%zh_HK))
    -endif
    -
    -#sun/launcher/resources
    -$(eval $(call add_properties_to_compile,SUN_LAUNCHER,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/launcher/resources)),\
    -	ListResourceBundle))
    -$(eval $(call add_properties_to_compile,SUN_LAUNCHER_HK,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/launcher/resources)),\
    -	ListResourceBundle,%zh_TW,%zh_HK))
    -#sun/management/resources
    -$(eval $(call add_properties_to_compile,SUN_MANAGEMENT,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/management/resources)),\
    -	ListResourceBundle))
    -$(eval $(call add_properties_to_compile,SUN_MANAGEMENT_KH,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/management/resources)),\
    -	ListResourceBundle,%zh_TW,%zh_HK))
    -#sun/print
    -#sun/print/resources
    -$(eval $(call add_properties_to_compile,SUN_PRINT,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/print/resources)),\
    -	ListResourceBundle))
    -$(eval $(call add_properties_to_compile,SUN_PRINT_HK,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/print/resources)),\
    -	ListResourceBundle,%zh_TW,%zh_HK))
    -#sun/rmi/registry/resources
    -$(eval $(call add_properties_to_clean,SUN_RMI_REGISTRY,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/rmi/registry/resources))))
    -$(eval $(call add_properties_to_clean,SUN_RMI_REGISTRY_HK,\
    -	$(filter %zh_TW.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/rmi/registry/resources)),\
    -	%zh_TW,%zh_HK))
    -
    -#sun/rmi/rmic/resources
    -$(eval $(call add_properties_to_clean,SUN_RMI_RMIC,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/rmi/rmic/resources))))
    -
    -#sun/rmi/server/resources
    -$(eval $(call add_properties_to_clean,SUN_RMI_SERVER,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/rmi/server/resources))))
    -$(eval $(call add_properties_to_clean,SUN_RMI_SERVER_HK,\
    -	$(filter %zh_TW.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/rmi/server/resources)),\
    -	%zh_TW,%zh_HK))
    -
    -# sun/tools/jar/resources
    -$(eval $(call add_properties_to_compile,SUN_TOOLS_JAR,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/tools/jar/resources)),\
    -	ListResourceBundle))
    -$(eval $(call add_properties_to_compile,SUN_TOOLS_JAR_HK,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/tools/jar/resources)),\
    -	ListResourceBundle,%zh_TW,%zh_HK))
    -
    -#sun/tools/javac/resources
    -# It's unclear if the other localized property files here are supposed to be copied or not
    -# but the old build system didn't copy them.
    -$(eval $(call add_properties_to_clean,SUN_TOOLS_SERIALVER,\
    -	$(filter %javac.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/tools/javac/resources))))
    -
    -#sun/tools/jconsole/resources
    -$(eval $(call add_properties_to_clean,SUN_TOOLS_JCONSOLE,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/resources))))
    -
    -#sun/tools/serialver
    -$(eval $(call add_properties_to_clean,SUN_TOOLS_SERIALVER,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/tools/serialver)),,,resources))
    -
    -#sun/util/logging/resources
    -$(eval $(call add_properties_to_compile,SUN_UTIL_LOGGING,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/util/logging/resources)),\
    -	ListResourceBundle))
    -$(eval $(call add_properties_to_compile,SUN_UTIL_LOGGING_HK,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/util/logging/resources)),\
    -	ListResourceBundle,%zh_TW,%zh_HK))
    -# sun/util/resources
    -$(eval $(call add_properties_to_compile,SUN_UTIL,\
    -	$(filter %.properties,\
    -	$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/sun/util/resources)),\
    -	sun.util.resources.LocaleNamesBundle))
    -
    -# Now setup the rule for the generation of the resource bundles.
    -$(JDK_OUTPUTDIR)/gensrc/_the.compiled_properties : $(ALL_COMPILED_PROPSOURCES) $(BUILD_TOOLS)
    -#	Generate all output directories in advance since the build tool does not do that...
    -	$(MKDIR) -p $(sort $(dir $(ALL_COMPILED_PROPJAVAS)))
    -	$(ECHO) Compiling $(words $(ALL_COMPILED_PROPSOURCES)) properties into resource bundles
    -	$(call ListPathsSafely,COMPILE_PROPCMDLINE,\n, >> $(JDK_OUTPUTDIR)/gensrc/_the.cmdline)
    -	$(TOOL_COMPILEPROPERTIES) -quiet @$(JDK_OUTPUTDIR)/gensrc/_the.cmdline
    -	$(TOUCH) $@
    -
    -# Now setup the rule for the generation of the cleaned properties.
    -# FIXME: We currently don't handle removed properties incrementally. 
    -$(JDK_OUTPUTDIR)/classes/_the.cleaned_properties : $(ALL_CLEANED_PROPSOURCES) $(BUILD_TOOLS)
    -	$(RM) $(JDK_OUTPUTDIR)/classes/_the.cleaned_properties.cmdline
    -#	Generate all output directories in advance since the build tool does not do that...
    -	$(MKDIR) -p $(sort $(dir $(ALL_CLEANED_PROPOUTPUT)))
    -	$(ECHO) Copying and cleaning $(words $(ALL_CLEANED_PROPSOURCES)) properties 
    -	$(call ListPathsSafely,CLEAN_PROPCMDLINE,\n, >> $(JDK_OUTPUTDIR)/classes/_the.cleaned_properties.cmdline)
    -	$(TOOL_STRIPPROPERTIES) @$(JDK_OUTPUTDIR)/classes/_the.cleaned_properties.cmdline
    -	$(TOUCH) $@
    -
    -$(ALL_COMPILED_PROPJAVAS) : $(JDK_OUTPUTDIR)/gensrc/_the.compiled_properties
    -
    -$(ALL_CLEANED_PROPOUTPUT) : $(JDK_OUTPUTDIR)/classes/_the.cleaned_properties
    -
    -
    -# Some zh_HK resources are just copied of zh_TW
    -$(JDK_OUTPUTDIR)/gensrc/%_zh_HK.java: $(JDK_TOPDIR)/src/share/classes/%_zh_TW.java
    -	$(MKDIR) -p $(@D)
    -	$(CAT) $< | $(SED) -e '/class/s/_zh_TW/_zh_HK/' > $@
    -
    -ZH_HK_JAVA:=	sun/applet/resources/MsgAppletViewer_zh_HK.java \
    -		sun/misc/resources/Messages_zh_HK.java \
    -		sun/security/util/AuthResources_zh_HK.java \
    -                sun/security/util/Resources_zh_HK.java
    -
    -ZH_HK_JAVA_FILES:=$(addprefix $(JDK_OUTPUTDIR)/gensrc/,$(ZH_HK_JAVA))
    -
    -
    -GENSRC_PROPERTIES:=$(ALL_COMPILED_PROPJAVAS) $(ALL_CLEANED_PROPOUTPUT) $(ZH_HK_JAVA_FILES)
    diff --git a/jdk/makefiles/Images.gmk b/jdk/makefiles/Images.gmk
    index d265f4cd587..e40cc6d09f2 100644
    --- a/jdk/makefiles/Images.gmk
    +++ b/jdk/makefiles/Images.gmk
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
     # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     #
     # This code is free software; you can redistribute it and/or modify it
    @@ -31,13 +31,13 @@ include Setup.gmk
     default: images
     
     # Prepare the find cache. Only used if running on windows.
    -$(eval $(call FillCacheFind,\
    +$(eval $(call FillCacheFind, \
         $(wildcard $(JDK_OUTPUTDIR)/bin \
    -               $(JDK_OUTPUTDIR)/lib \
    -               $(IMAGES_OUTPUTDIR)/lib \
    -               $(JDK_OUTPUTDIR)/include \
    -               $(JDK_OUTPUTDIR)/sample \
    -               $(JDK_OUTPUTDIR)/demo)))
    +        $(JDK_OUTPUTDIR)/lib \
    +        $(IMAGES_OUTPUTDIR)/lib \
    +        $(JDK_OUTPUTDIR)/include \
    +        $(JDK_OUTPUTDIR)/sample \
    +        $(JDK_OUTPUTDIR)/demo)))
     
     include Tools.gmk
     
    @@ -92,189 +92,214 @@ endef
     ################################################################################
     # /bin dir
     
    -ifeq ($(PROFILE),)
    -    NOT_JRE_BIN_FILES := \
    -	appletviewer$(EXE_SUFFIX) \
    -	extcheck$(EXE_SUFFIX) \
    -	idlj$(EXE_SUFFIX) \
    -	jar$(EXE_SUFFIX) \
    -	jarsigner$(EXE_SUFFIX) \
    -	java-rmi.cgi \
    -	javac$(EXE_SUFFIX) \
    -	javadoc$(EXE_SUFFIX) \
    -	javah$(EXE_SUFFIX) \
    -	javap$(EXE_SUFFIX) \
    -	jdeps$(EXE_SUFFIX) \
    -	jcmd$(EXE_SUFFIX) \
    -	jdb$(EXE_SUFFIX) \
    -	jps$(EXE_SUFFIX) \
    -	jrunscript$(EXE_SUFFIX) \
    -	jstat$(EXE_SUFFIX) \
    -	jstatd$(EXE_SUFFIX) \
    -	jstack$(EXE_SUFFIX) \
    -	packagebean$(SCRIPT_SUFFIX) \
    -	rmic$(EXE_SUFFIX) \
    -	serialver$(EXE_SUFFIX) \
    -	unregbean$(EXE_SUFFIX) \
    -	jconsole$(EXE_SUFFIX) \
    -	jinfo$(EXE_SUFFIX) \
    -	jmap$(EXE_SUFFIX) \
    -	native2ascii$(EXE_SUFFIX) \
    -	xjc$(EXE_SUFFIX) \
    -	wsgen$(EXE_SUFFIX) \
    -	wsimport$(EXE_SUFFIX) \
    -        schemagen$(EXE_SUFFIX) \
    -	jsadebugd$(EXE_SUFFIX) \
    -	jhat$(EXE_SUFFIX)
    +ifeq ($(PROFILE), )
    +  NOT_JRE_BIN_FILES := \
    +      appletviewer$(EXE_SUFFIX) \
    +      extcheck$(EXE_SUFFIX) \
    +      idlj$(EXE_SUFFIX) \
    +      jar$(EXE_SUFFIX) \
    +      jarsigner$(EXE_SUFFIX) \
    +      java-rmi.cgi \
    +      javac$(EXE_SUFFIX) \
    +      javadoc$(EXE_SUFFIX) \
    +      javah$(EXE_SUFFIX) \
    +      javap$(EXE_SUFFIX) \
    +      jdeps$(EXE_SUFFIX) \
    +      jcmd$(EXE_SUFFIX) \
    +      jdb$(EXE_SUFFIX) \
    +      jps$(EXE_SUFFIX) \
    +      jrunscript$(EXE_SUFFIX) \
    +      jstat$(EXE_SUFFIX) \
    +      jstatd$(EXE_SUFFIX) \
    +      jstack$(EXE_SUFFIX) \
    +      packagebean$(SCRIPT_SUFFIX) \
    +      rmic$(EXE_SUFFIX) \
    +      serialver$(EXE_SUFFIX) \
    +      unregbean$(EXE_SUFFIX) \
    +      jconsole$(EXE_SUFFIX) \
    +      jinfo$(EXE_SUFFIX) \
    +      jmap$(EXE_SUFFIX) \
    +      native2ascii$(EXE_SUFFIX) \
    +      xjc$(EXE_SUFFIX) \
    +      wsgen$(EXE_SUFFIX) \
    +      wsimport$(EXE_SUFFIX) \
    +      schemagen$(EXE_SUFFIX) \
    +      jsadebugd$(EXE_SUFFIX) \
    +      jhat$(EXE_SUFFIX)
     endif
     
     WINDOWS_JDK_BIN_FILES = \
    -	$(EXE_SUFFIX) \
    -	$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \
    -	$(notdir $(MSVCR_DLL))
    +    $(EXE_SUFFIX) \
    +    $(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \
    +    $(notdir $(MSVCR_DLL))
     
     WINDOWS_JDKJRE_BIN_FILES := \
    -	$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \
    -	$(SALIB_NAME)
    +    $(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \
    +    $(SALIB_NAME)
     
     # Find all files in bin dir
    -ALL_BIN_LIST := $(call CacheFind,$(JDK_OUTPUTDIR)/bin)
    +ALL_BIN_LIST := $(call CacheFind, $(JDK_OUTPUTDIR)/bin)
     
     # Prevent sjavac from entering the images.
    -ALL_BIN_LIST := $(filter-out %/sjavac,$(ALL_BIN_LIST))
    +ALL_BIN_LIST := $(filter-out %/sjavac, $(ALL_BIN_LIST))
     
     # For unknown reason the debuginfo files for executables are not put into images
     # e.g filter them out
    -ifneq ($(OPENJDK_TARGET_OS),windows)
    -    ALL_BIN_LIST := $(filter-out %.debuginfo %.diz, $(ALL_BIN_LIST))
    +ifneq ($(OPENJDK_TARGET_OS), windows)
    +  ALL_BIN_LIST := $(filter-out %.debuginfo %.diz, $(ALL_BIN_LIST))
     else
    -# On windows, the libraries are in the bin dir, only filter out debuginfo files
    -# for executables. "java" is both a library and executable.
    -    ALL_BIN_EXEC_FILES := $(filter-out java.exe,$(notdir $(filter %.exe,$(ALL_BIN_LIST))))
    -    ALL_BIN_DEBUG_FILTER := $(addprefix %,$(patsubst %.exe,%.debuginfo,$(ALL_BIN_EXEC_FILES)) \
    -					   $(patsubst %.exe,%.diz,$(ALL_BIN_EXEC_FILES))) %.pdb
    -    ALL_BIN_LIST := $(filter-out $(ALL_BIN_DEBUG_FILTER),$(ALL_BIN_LIST))
    +  # On windows, the libraries are in the bin dir, only filter out debuginfo files
    +  # for executables. "java" is both a library and executable.
    +  ALL_BIN_EXEC_FILES := $(filter-out java.exe, $(notdir $(filter %.exe, $(ALL_BIN_LIST))))
    +  ALL_BIN_DEBUG_FILTER := $(addprefix %, $(patsubst %.exe, %.debuginfo, $(ALL_BIN_EXEC_FILES)) \
    +      $(patsubst %.exe, %.diz, $(ALL_BIN_EXEC_FILES))) %.pdb
    +  ALL_BIN_LIST := $(filter-out $(ALL_BIN_DEBUG_FILTER), $(ALL_BIN_LIST))
     endif
     
    -JDKJRE_BIN_LIST := $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES)), $(ALL_BIN_LIST))
    -JRE_BIN_LIST := $(filter-out $(addprefix %,$(WINDOWS_JDKJRE_BIN_FILES)), $(JDKJRE_BIN_LIST))
    +JDKJRE_BIN_LIST := $(filter-out $(addprefix %, $(NOT_JRE_BIN_FILES)), $(ALL_BIN_LIST))
    +JRE_BIN_LIST := $(filter-out $(addprefix %, $(WINDOWS_JDKJRE_BIN_FILES)), $(JDKJRE_BIN_LIST))
     
    -ifeq ($(OPENJDK_TARGET_OS),windows)
    -    JDK_BIN_LIST := $(filter $(addprefix %,$(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST))
    -    # On windows x86, the server jvm is filtered out from the j2re image. This could possibly 
    -    # be handled by profiles in the future. If no client jvm is built, leave server in.
    -    ifeq ($(OPENJDK_TARGET_CPU),x86)
    -        ifeq ($(JVM_VARIANT_CLIENT),true)
    -            JRE_BIN_LIST := $(filter-out $(JDK_OUTPUTDIR)/bin/server/%,$(JRE_BIN_LIST))
    -	endif
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  JDK_BIN_LIST := $(filter $(addprefix %, $(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST))
    +  # On windows x86, the server jvm is filtered out from the j2re image. This could possibly
    +  # be handled by profiles in the future. If no client jvm is built, leave server in.
    +  ifeq ($(OPENJDK_TARGET_CPU), x86)
    +    ifeq ($(JVM_VARIANT_CLIENT), true)
    +      JRE_BIN_LIST := $(filter-out $(JDK_OUTPUTDIR)/bin/server/%, $(JRE_BIN_LIST))
         endif
    +  endif
     else
    -    JDK_BIN_LIST := $(ALL_BIN_LIST)
    +  JDK_BIN_LIST := $(ALL_BIN_LIST)
     endif
     
    -ifneq ($(OPENJDK_TARGET_CPU_ISADIR),)
    -    OVERLAY_FILTER := $(JDK_OUTPUTDIR)/bin$(OPENJDK_TARGET_CPU_ISADIR)%
    +ifneq ($(OPENJDK_TARGET_CPU_ISADIR), )
    +  OVERLAY_FILTER := $(JDK_OUTPUTDIR)/bin$(OPENJDK_TARGET_CPU_ISADIR)%
     endif
     
    -$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JRE_BIN_LIST)),\
    +$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JRE_BIN_LIST)), \
         $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_IMAGE_DIR),$f,JRE_BIN_TARGETS)))
    -$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDK_BIN_LIST)),\
    +$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDK_BIN_LIST)), \
         $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_BIN_TARGETS)))
    -$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)),\
    +$(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)), \
         $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS)))
     
    -$(foreach f,$(filter $(OVERLAY_FILTER),$(JRE_BIN_LIST)),\
    +$(foreach f,$(filter $(OVERLAY_FILTER),$(JRE_BIN_LIST)), \
         $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_OVERLAY_IMAGE_DIR),$f,JRE_BIN_TARGETS)))
    -$(foreach f,$(filter $(OVERLAY_FILTER),$(JDK_BIN_LIST)),\
    +$(foreach f,$(filter $(OVERLAY_FILTER),$(JDK_BIN_LIST)), \
         $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),$f,JDK_BIN_TARGETS)))
    -$(foreach f,$(filter $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)),\
    +$(foreach f,$(filter $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)), \
         $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS)))
     
    +ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_BITS),solaris-64)
    +  define AddIsadirLink
    +    # Param 1 - src file
    +    # Param 2 - variable to add targets to
    +
    +    $1_LINK := $$(dir $1)$(OPENJDK_TARGET_CPU_ISADIR)/$$(notdir $1)
    +
    +    $$($1_LINK):
    +	$(ECHO) $(LOG_INFO) Creating link $$(patsubst $(OUTPUT_ROOT)/%,%,$$@)
    +	$(MKDIR) -p $$(@D)
    +	$(LN) -s ../$$(@F) $$@
    +
    +    $2 += $$($1_LINK)
    +  endef
    +
    +  $(foreach f,$(JRE_BIN_TARGETS),$(eval $(call AddIsadirLink,$f,JRE_BIN_ISADIR_LINK_TARGETS)))
    +  $(foreach f,$(JDK_BIN_TARGETS),$(eval $(call AddIsadirLink,$f,JDK_BIN_ISADIR_LINK_TARGETS)))
    +  $(foreach f,$(JDKJRE_BIN_TARGETS),$(eval $(call AddIsadirLink,$f,JDKJRE_BIN_ISADIR_LINK_TARGETS)))
    +endif
    +
     ################################################################################
     # /lib dir
     ifneq ($(OPENJDK_TARGET_OS), macosx)
    -    JDKJRE_LIB_FILES := \
    -	$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \
    -	$(SALIB_NAME)
    +  JDKJRE_LIB_FILES := \
    +      $(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \
    +      $(SALIB_NAME)
     endif
     
    -ifeq ($(PROFILE),)
    -    NOT_JRE_LIB_FILES := \
    -	tools.jar \
    -	jconsole.jar \
    -	sa-jdi.jar \
    -	dt.jar \
    -	orb.idl \
    -	ir.idl \
    -	ct.sym
    +ifeq ($(PROFILE), )
    +  NOT_JRE_LIB_FILES := \
    +      tools.jar \
    +      jconsole.jar \
    +      sa-jdi.jar \
    +      dt.jar \
    +      orb.idl \
    +      ir.idl \
    +      ct.sym
     
    -    ifeq ($(OPENJDK_TARGET_OS), windows)
    -      NOT_JRE_LIB_FILES += jawt.lib jvm.lib
    -    endif
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
    +    NOT_JRE_LIB_FILES += jawt.lib jvm.lib
    +  endif
     endif
     
     JDK_LIB_FILES := $(NOT_JRE_LIB_FILES)
     ifeq ($(OPENJDK_TARGET_OS), linux)
    -    JDK_LIB_FILES += jexec
    +  JDK_LIB_FILES += jexec
    +endif
    +
    +ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris),) # If Linux or Solaris
    +    JDK_LIB_FILES += $(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \
    +		     $(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX)
     endif
     
     # Find all files to copy from $(JDK_OUTPUTDIR)/lib
     # Jar files are not expected to be here
    -ALL_JDKOUT_LIB_LIST := $(call not-containing,_the.,$(filter-out %.jar,\
    -                            $(call CacheFind,$(JDK_OUTPUTDIR)/lib)))
    +ALL_JDKOUT_LIB_LIST := $(call not-containing,_the., $(filter-out %.jar, \
    +    $(call CacheFind, $(JDK_OUTPUTDIR)/lib)))
     # Find all files to copy from $(IMAGES_OUTPUTDIR)/lib
     # This is were the jar files are and might not exist if building overlay-images
    -ifneq ($(wildcard $(IMAGES_OUTPUTDIR)/lib),)
    -    ALL_IMAGES_LIB_LIST := $(call not-containing,_the.,\
    -                            $(call CacheFind,$(IMAGES_OUTPUTDIR)/lib))
    +ifneq ($(wildcard $(IMAGES_OUTPUTDIR)/lib), )
    +  ALL_IMAGES_LIB_LIST := $(call not-containing,_the., \
    +      $(call CacheFind, $(IMAGES_OUTPUTDIR)/lib))
     endif
     
     # Filter files to copy for each destination
    -JRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\
    -                       $(ALL_JDKOUT_LIB_LIST))
    -JDKJRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES)),$(ALL_JDKOUT_LIB_LIST))
    -JDK_JDKOUT_LIB_LIST := $(filter $(addprefix %,$(JDK_LIB_FILES)),$(ALL_JDKOUT_LIB_LIST))
    +JRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %, $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)), \
    +    $(ALL_JDKOUT_LIB_LIST))
    +JDKJRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %, $(NOT_JRE_LIB_FILES)), $(ALL_JDKOUT_LIB_LIST))
    +JDK_JDKOUT_LIB_LIST := $(filter $(addprefix %, $(JDK_LIB_FILES)), $(ALL_JDKOUT_LIB_LIST))
     
    -JRE_IMAGES_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\
    -                       $(ALL_IMAGES_LIB_LIST))
    -JDKJRE_IMAGES_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES)),$(ALL_IMAGES_LIB_LIST))
    -JDK_IMAGES_LIB_LIST := $(filter $(addprefix %,$(JDK_LIB_FILES)),$(ALL_IMAGES_LIB_LIST))
    +JRE_IMAGES_LIB_LIST := $(filter-out $(addprefix %, $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)), \
    +    $(ALL_IMAGES_LIB_LIST))
    +JDKJRE_IMAGES_LIB_LIST := $(filter-out $(addprefix %, $(NOT_JRE_LIB_FILES)), $(ALL_IMAGES_LIB_LIST))
    +JDK_IMAGES_LIB_LIST := $(filter $(addprefix %, $(JDK_LIB_FILES)), $(ALL_IMAGES_LIB_LIST))
     
     # Iterate over files to copy to create rules for each one
    -$(foreach f,$(JRE_JDKOUT_LIB_LIST),\
    +$(foreach f,$(JRE_JDKOUT_LIB_LIST), \
         $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_IMAGE_DIR),$f,JRE_LIB_TARGETS)))
    -$(foreach f,$(JDK_JDKOUT_LIB_LIST),\
    +$(foreach f,$(JDK_JDKOUT_LIB_LIST), \
         $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_LIB_TARGETS)))
    -$(foreach f,$(JDKJRE_JDKOUT_LIB_LIST),\
    +$(foreach f,$(JDKJRE_JDKOUT_LIB_LIST), \
         $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_LIB_TARGETS)))
     
    -$(foreach f,$(JRE_IMAGES_LIB_LIST),\
    +$(foreach f,$(JRE_IMAGES_LIB_LIST), \
         $(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR),$(JRE_IMAGE_DIR),$f,JRE_LIB_TARGETS)))
    -$(foreach f,$(JDK_IMAGES_LIB_LIST),\
    +$(foreach f,$(JDK_IMAGES_LIB_LIST), \
         $(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_LIB_TARGETS)))
    -$(foreach f,$(JDKJRE_IMAGES_LIB_LIST),\
    +$(foreach f,$(JDKJRE_IMAGES_LIB_LIST), \
         $(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_LIB_TARGETS)))
     
    -$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JRE_JDKOUT_LIB_LIST)),\
    +$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JRE_JDKOUT_LIB_LIST)), \
         $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_OVERLAY_IMAGE_DIR),$f,JRE_OVERLAY_LIB_TARGETS)))
    -$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDK_JDKOUT_LIB_LIST)),\
    +$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDK_JDKOUT_LIB_LIST)), \
         $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),$f,JDK_OVERLAY_LIB_TARGETS)))
    -$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDKJRE_JDKOUT_LIB_LIST)),\
    +$(foreach f,$(filter $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_ISADIR)/%,$(JDKJRE_JDKOUT_LIB_LIST)), \
         $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_OVERLAY_LIB_TARGETS)))
     
    -ifneq ($(PROFILE),)
    -# Files in lib$(PROFILE) are excluded from the generic copying routines so 
    -# we have to add them back in here
    -$(foreach f,$(CUSTOM_PROFILE_JARS),\
    -    $(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR)/lib$(PROFILE),$(JRE_IMAGE_DIR)/lib,$f,JRE_LIB_TARGETS)))
    +ifneq ($(PROFILE), )
    +  # Files in lib$(PROFILE) are excluded from the generic copying routines so
    +  # we have to add them back in here
    +  $(foreach f,$(CUSTOM_PROFILE_JARS), \
    +      $(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR)/lib$(PROFILE),$(JRE_IMAGE_DIR)/lib,$f,JRE_LIB_TARGETS)))
     endif
     
     # CTE plugin security change require new empty directory lib/applet
    -$(JRE_IMAGE_DIR)/lib/applet: 
    +$(JRE_IMAGE_DIR)/lib/applet:
     	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
     	$(MKDIR) -p $@
     
    -$(JDK_IMAGE_DIR)/jre/lib/applet: 
    +$(JDK_IMAGE_DIR)/jre/lib/applet:
     	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
     	$(MKDIR) -p $@
     
    @@ -298,185 +323,187 @@ $(JDK_IMAGE_DIR)/jre/lib/ext/meta-index: $(JDKJRE_LIB_TARGETS)
     ################################################################################
     # /man dir
     # Avoid evaluating this whole section on windows for speed and stability
    -ifneq ($(OPENJDK_TARGET_OS),windows)
    -    JRE_MAN_PAGES := \
    -	java.1		\
    -	keytool.1	\
    -	orbd.1          \
    -	pack200.1	\
    -	policytool.1    \
    -	rmid.1		\
    -	rmiregistry.1	\
    -	servertool.1    \
    -	tnameserv.1     \
    -	unpack200.1
    +ifneq ($(OPENJDK_TARGET_OS), windows)
    +  JRE_MAN_PAGES := \
    +      java.1 \
    +      keytool.1 \
    +      orbd.1 \
    +      pack200.1 \
    +      policytool.1 \
    +      rmid.1 \
    +      rmiregistry.1 \
    +      servertool.1 \
    +      tnameserv.1 \
    +      unpack200.1
     
    -    ifndef OPENJDK
    -        JRE_MAN_PAGES += javaws.1
    +  ifndef OPENJDK
    +    ifneq ($(OPENJDK_TARGET_OS), solaris)
    +      JRE_MAN_PAGES += javaws.1
         endif
    +  endif
     
    -    JDK_MAN_PAGES =        \
    -	$(JRE_MAN_PAGES)   \
    -	appletviewer.1     \
    -	extcheck.1         \
    -	idlj.1             \
    -	jar.1              \
    -	jarsigner.1        \
    -	javac.1            \
    -	javadoc.1          \
    -	javah.1            \
    -	javap.1            \
    -	jconsole.1         \
    -	jcmd.1             \
    -	jdb.1              \
    -	jhat.1             \
    -        jinfo.1            \
    -        jmap.1             \
    -        jps.1              \
    -	jrunscript.1       \
    -        jsadebugd.1        \
    -        jstack.1           \
    -        jstat.1            \
    -        jstatd.1           \
    -	native2ascii.1     \
    -	rmic.1             \
    -        schemagen.1        \
    -	serialver.1        \
    -        wsgen.1            \
    -        wsimport.1         \
    -        xjc.1
    +  JDK_MAN_PAGES = \
    +      $(JRE_MAN_PAGES) \
    +      appletviewer.1 \
    +      extcheck.1 \
    +      idlj.1 \
    +      jar.1 \
    +      jarsigner.1 \
    +      javac.1 \
    +      javadoc.1 \
    +      javah.1 \
    +      javap.1 \
    +      jconsole.1 \
    +      jcmd.1 \
    +      jdb.1 \
    +      jhat.1 \
    +      jinfo.1 \
    +      jmap.1 \
    +      jps.1 \
    +      jrunscript.1 \
    +      jsadebugd.1 \
    +      jstack.1 \
    +      jstat.1 \
    +      jstatd.1 \
    +      native2ascii.1 \
    +      rmic.1 \
    +      schemagen.1 \
    +      serialver.1 \
    +      wsgen.1 \
    +      wsimport.1 \
    +      xjc.1
     
    -    ifndef OPENJDK
    -        JDK_MAN_PAGES += jvisualvm.1
    -    endif
    +  ifndef OPENJDK
    +    JDK_MAN_PAGES += jvisualvm.1
    +  endif
     
    -    # This variable is potentially overridden in the closed makefile.
    -    MAN_SRC_BASEDIR ?= $(JDK_TOPDIR)/src
    +  # This variable is potentially overridden in the closed makefile.
    +  MAN_SRC_BASEDIR ?= $(JDK_TOPDIR)/src
     
    -    ifeq ($(OPENJDK_TARGET_OS), linux)
    -        MAN_SRC_DIR:=$(MAN_SRC_BASEDIR)/linux/doc
    -        MAN1_SUBDIR:=man
    -    endif
    -    ifeq ($(OPENJDK_TARGET_OS), solaris)
    -        MAN_SRC_DIR:=$(MAN_SRC_BASEDIR)/solaris/doc
    -        MAN1_SUBDIR:=sun/man/man1
    -    endif
    -    ifeq ($(OPENJDK_TARGET_OS), macosx)
    -        MAN_SRC_DIR:=$(MAN_SRC_BASEDIR)/bsd/doc
    -        MAN1_SUBDIR:=man
    -        JDK_MAN_PAGES := $(filter-out jcmd.1, $(JDK_MAN_PAGES))
    -        JDK_MAN_PAGES := $(filter-out jvisualvm.1, $(JDK_MAN_PAGES))
    -    endif
    +  ifeq ($(OPENJDK_TARGET_OS), linux)
    +    MAN_SRC_DIR := $(MAN_SRC_BASEDIR)/linux/doc
    +    MAN1_SUBDIR := man
    +  endif
    +  ifeq ($(OPENJDK_TARGET_OS), solaris)
    +    MAN_SRC_DIR := $(MAN_SRC_BASEDIR)/solaris/doc
    +    MAN1_SUBDIR := sun/man/man1
    +  endif
    +  ifeq ($(OPENJDK_TARGET_OS), macosx)
    +    MAN_SRC_DIR := $(MAN_SRC_BASEDIR)/bsd/doc
    +    MAN1_SUBDIR := man
    +    JDK_MAN_PAGES := $(filter-out jcmd.1, $(JDK_MAN_PAGES))
    +    JDK_MAN_PAGES := $(filter-out jvisualvm.1, $(JDK_MAN_PAGES))
    +  endif
     
     
    -    $(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
    +  $(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
     	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
     	$(install-file)
     
    -    $(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
    +  $(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
     	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
     	$(install-file)
     
    -    $(JRE_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/%
    +  $(JRE_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/%
     	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
     	$(install-file)
     
    -    $(JDK_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/%
    +  $(JDK_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/%
     	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
     	$(install-file)
     
    -    define install-ja-manpage
    +  define install-ja-manpage
     	$(MKDIR) -p $(@D)
     	$(CAT) $< \
    -		| $(NATIVE2ASCII) -encoding eucJP \
    -		| $(SED) 's/@@VERSION@@/$(THIS_JDK_VERSION)/g' \
    -		| $(NATIVE2ASCII) -reverse -encoding $1 \
    -		> $@
    -    endef
    +	    | $(NATIVE2ASCII) -encoding eucJP \
    +	    | $(SED) 's/@@VERSION@@/$(THIS_JDK_VERSION)/g' \
    +	    | $(NATIVE2ASCII) -reverse -encoding $1 \
    +	    > $@
    +  endef
     
    -    $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
    +  $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
     	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    -	$(call install-ja-manpage,UTF-8)
    +	$(call install-ja-manpage, UTF-8)
     
    -    $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
    +  $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
     	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    -	$(call install-ja-manpage,UTF-8)
    +	$(call install-ja-manpage, UTF-8)
     
    -    $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
    +  $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
     	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    -	$(call install-ja-manpage,PCK)
    +	$(call install-ja-manpage, PCK)
     
    -    $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
    +  $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
     	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    -	$(call install-ja-manpage,PCK)
    +	$(call install-ja-manpage, PCK)
     
    -    ifeq ($(OPENJDK_TARGET_OS), solaris)
    -        $(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
    -		$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    -		$(install-file)
    +  ifeq ($(OPENJDK_TARGET_OS), solaris)
    +    $(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
    +	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    +	$(install-file)
     
    -        $(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
    -		$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    -		$(install-file)
    -    endif
    +    $(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
    +	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    +	$(install-file)
    +  endif
     
    -    # Old build creates empty man page for this, mimicing behaviour.
    -    $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/jcmd.1 $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/jcmd.1 $(JDK_IMAGE_DIR)/man/ja/man1/jcmd.1:
    +  # Old build creates empty man page for this, mimicing behaviour.
    +  $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/jcmd.1 $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/jcmd.1 $(JDK_IMAGE_DIR)/man/ja/man1/jcmd.1:
     	$(ECHO) $(LOG_INFO) Creating dummy $(patsubst $(OUTPUT_ROOT)/%,%,$@)
     	$(MKDIR) -p $(@D)
     	$(TOUCH) $@
     
    -    ifeq ($(OPENJDK_TARGET_OS), linux)
    -        $(JRE_IMAGE_DIR)/man/ja:
    -		$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    -		$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
    +  ifeq ($(OPENJDK_TARGET_OS), linux)
    +    $(JRE_IMAGE_DIR)/man/ja:
    +	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    +	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
     
    -        $(JDK_IMAGE_DIR)/man/ja:
    -		$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    -		$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
    -    endif
    +    $(JDK_IMAGE_DIR)/man/ja:
    +	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    +	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
    +  endif
     
    -    ifeq ($(OPENJDK_TARGET_OS), macosx)
    -        $(JRE_IMAGE_DIR)/man/ja:
    -		$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    -		$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
    +  ifeq ($(OPENJDK_TARGET_OS), macosx)
    +    $(JRE_IMAGE_DIR)/man/ja:
    +	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    +	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
     
    -        $(JDK_IMAGE_DIR)/man/ja:
    -		$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    -		$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
    -    endif
    +    $(JDK_IMAGE_DIR)/man/ja:
    +	$(ECHO) $(LOG_INFO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    +	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
    +  endif
     
    -    ifeq ($(OPENJDK_TARGET_OS), linux)
    -        JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \
    -                             $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \
    -                             $(JRE_IMAGE_DIR)/man/ja
    +  ifeq ($(OPENJDK_TARGET_OS), linux)
    +    JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
    +        $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
    +        $(JRE_IMAGE_DIR)/man/ja
     
    -        JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \
    -                             $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \
    -                             $(JDK_IMAGE_DIR)/man/ja
    -    endif
    +    JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
    +        $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
    +    $(JDK_IMAGE_DIR)/man/ja
    +  endif
     
    -    ifeq ($(OPENJDK_TARGET_OS), solaris)
    -        JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \
    -                             $(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/,$(JRE_MAN_PAGES)) \
    -                             $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \
    -                             $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/,$(JRE_MAN_PAGES))
    +  ifeq ($(OPENJDK_TARGET_OS), solaris)
    +    JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
    +        $(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/, $(JRE_MAN_PAGES)) \
    +        $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
    +        $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JRE_MAN_PAGES))
     
    -        JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \
    -                             $(addprefix $(JDK_IMAGE_DIR)/man/ja/man1/,$(JDK_MAN_PAGES)) \
    -                             $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \
    -                             $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/,$(JDK_MAN_PAGES))
    -    endif
    +    JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
    +        $(addprefix $(JDK_IMAGE_DIR)/man/ja/man1/, $(JDK_MAN_PAGES)) \
    +        $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
    +        $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/, $(JDK_MAN_PAGES))
    +  endif
     
    -    ifeq ($(OPENJDK_TARGET_OS), macosx)
    -        JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \
    -                             $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \
    -                             $(JRE_IMAGE_DIR)/man/ja
    +  ifeq ($(OPENJDK_TARGET_OS), macosx)
    +    JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/, $(JRE_MAN_PAGES)) \
    +        $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JRE_MAN_PAGES)) \
    +        $(JRE_IMAGE_DIR)/man/ja
     
    -        JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \
    -                             $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \
    -                             $(JDK_IMAGE_DIR)/man/ja
    -    endif
    +    JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/, $(JDK_MAN_PAGES)) \
    +        $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/, $(JDK_MAN_PAGES)) \
    +        $(JDK_IMAGE_DIR)/man/ja
    +  endif
     
     endif # Windows
     
    @@ -485,9 +512,9 @@ endif # Windows
     
     # FIXME: demo/applets/GraphLayout/GraphPanel$2.class is sometimes not copied.
     
    -#   The db demo contains an empty dir that needs to be copied. The other 
    -#   directories will always trigger the rule for recompile since 
    -#   _the.list_of_packages files are touched.
    +# The db demo contains an empty dir that needs to be copied. The other
    +# directories will always trigger the rule for recompile since
    +# _the.list_of_packages files are touched.
     $(JDK_IMAGE_DIR)/demo/%: $(JDK_OUTPUTDIR)/demo/%
     	if [ ! -d "$@" ]; then \
     	  $(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'; \
    @@ -495,36 +522,36 @@ $(JDK_IMAGE_DIR)/demo/%: $(JDK_OUTPUTDIR)/demo/%
     	  if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) '$<' '$@'; fi \
     	fi
     
    -#   Find all files including directories
    -JDK_DEMO_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/demo/%,$(JDK_IMAGE_DIR)/demo/%,\
    -			$(shell $(FIND) $(JDK_OUTPUTDIR)/demo ! \( -name "_the*" -o -name "javac_state" \) ))
    +# Find all files including directories
    +JDK_DEMO_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/demo/%, $(JDK_IMAGE_DIR)/demo/%, \
    +    $(shell $(FIND) $(JDK_OUTPUTDIR)/demo ! \( -name "_the*" -o -name "javac_state" \) ))
     
     
     
     # Param 1 is source file
     define CreateOverlayDemoRule
    -    $1_TARGET:=$$(subst $(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),\
    -			$$(dir $1)$(OPENJDK_TARGET_CPU_ISADIR)/$$(notdir $1))
    -    $$($1_TARGET): $1
    -		$(ECHO) $(LOG_INFO) Copying '$$(patsubst $(OUTPUT_ROOT)/%,%,$$@)'
    -		$$(call install-file)
    +  $1_TARGET := $$(subst $(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR), \
    +      $$(dir $1)$(OPENJDK_TARGET_CPU_ISADIR)/$$(notdir $1))
    +  $$($1_TARGET): $1
    +	$(ECHO) $(LOG_INFO) Copying '$$(patsubst $(OUTPUT_ROOT)/%,%,$$@)'
    +	$$(call install-file)
     
    -    JDK_OVERLAY_DEMO_TARGETS += $$($1_TARGET)
    +  JDK_OVERLAY_DEMO_TARGETS += $$($1_TARGET)
     endef
    -JDK_OVERLAY_DEMO_SOURCES := $(filter %$(SHARED_LIBRARY_SUFFIX),$(call CacheFind,$(JDK_OUTPUTDIR)/demo))
    -$(foreach lib,$(JDK_OVERLAY_DEMO_SOURCES),$(eval $(call CreateOverlayDemoRule,$(lib))))
    +JDK_OVERLAY_DEMO_SOURCES := $(filter %$(SHARED_LIBRARY_SUFFIX), $(call CacheFind, $(JDK_OUTPUTDIR)/demo))
    +$(foreach lib, $(JDK_OVERLAY_DEMO_SOURCES), $(eval $(call CreateOverlayDemoRule, $(lib))))
     
     ################################################################################
     # /sample dir
     
    -$(foreach f,$(call CacheFind,$(JDK_OUTPUTDIR)/sample),\
    +$(foreach f,$(call CacheFind,$(JDK_OUTPUTDIR)/sample), \
         $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_SAMPLE_TARGETS)))
     
     ################################################################################
     # /db dir
     
     ifndef OPENJDK
    -    $(IMAGES_OUTPUTDIR)/_unzip/%.unzipped: $(JDK_TOPDIR)/src/closed/share/db/%
    +  $(IMAGES_OUTPUTDIR)/_unzip/%.unzipped: $(JDK_TOPDIR)/src/closed/share/db/%
     	$(ECHO) Unzipping $(patsubst $(SRC_ROOT)/%,%,$<)
     	$(MKDIR) -p $(JDK_IMAGE_DIR)/db
     	cd $(JDK_IMAGE_DIR)/db && $(UNZIP) -q -o $< -x */index.html */KEYS */test/* *javadoc/* */docs/* */demo/* 2> /dev/null
    @@ -532,49 +559,51 @@ ifndef OPENJDK
     	$(MKDIR) -p $(@D)
     	$(TOUCH) $@
     
    -    $(JDK_IMAGE_DIR)/db/README-JDK.html: $(JDK_TOPDIR)/src/closed/share/db/README-JDK.html
    +  $(JDK_IMAGE_DIR)/db/README-JDK.html: $(JDK_TOPDIR)/src/closed/share/db/README-JDK.html
     	$(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
    +	$(MKDIR) -p $(@D)
     	$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > $@
     
    -    $(JDK_IMAGE_DIR)/db/3RDPARTY: $(JDK_TOPDIR)/src/closed/share/db/3RDPARTY
    +  $(JDK_IMAGE_DIR)/db/3RDPARTY: $(JDK_TOPDIR)/src/closed/share/db/3RDPARTY
     	$(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
    +	$(MKDIR) -p $(@D)
     	$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > $@
     
    -    JDK_DB_TARGETS := $(patsubst $(JDK_TOPDIR)/src/closed/share/db/%,$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped,\
    -			$(wildcard $(JDK_TOPDIR)/src/closed/share/db/*.zip)) \
    -		      $(JDK_IMAGE_DIR)/db/README-JDK.html $(JDK_IMAGE_DIR)/db/3RDPARTY
    +  JDK_DB_TARGETS := $(patsubst $(JDK_TOPDIR)/src/closed/share/db/%, $(IMAGES_OUTPUTDIR)/_unzip/%.unzipped, \
    +      $(wildcard $(JDK_TOPDIR)/src/closed/share/db/*.zip)) \
    +      $(JDK_IMAGE_DIR)/db/README-JDK.html $(JDK_IMAGE_DIR)/db/3RDPARTY
     
     endif
     
     ################################################################################
     # /include dir
     
    -$(foreach f,$(call CacheFind,$(JDK_OUTPUTDIR)/include),\
    +$(foreach f,$(call CacheFind,$(JDK_OUTPUTDIR)/include), \
         $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_INCLUDE_TARGETS)))
     
     ################################################################################
     # doc files
     
     ifdef OPENJDK
    -    JRE_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
    -    JDK_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
    -    JRE_DOC_LOCATION := $(JDK_TOPDIR)
    -    JDK_DOC_LOCATION := $(JDK_TOPDIR)
    +  JRE_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
    +  JDK_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
    +  JRE_DOC_LOCATION := $(JDK_TOPDIR)
    +  JDK_DOC_LOCATION := $(JDK_TOPDIR)
     else
    -    JRE_DOC_FILES := COPYRIGHT Welcome.html LICENSE THIRDPARTYLICENSEREADME.txt
    -    JDK_DOC_FILES := COPYRIGHT README.html  LICENSE THIRDPARTYLICENSEREADME.txt
    -    ifeq ($(OPENJDK_TARGET_OS), windows)
    -        JRE_DOC_FILES += README.txt
    -    else
    -        JRE_DOC_FILES += README
    -    endif
    -    JDK_DOC_FILES += demo/DEMOS_LICENSE sample/SAMPLES_LICENSE
    -    JRE_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/share/doc/jre
    -    JDK_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/share/doc/jdk
    +  JRE_DOC_FILES := COPYRIGHT Welcome.html LICENSE THIRDPARTYLICENSEREADME.txt
    +  JDK_DOC_FILES := COPYRIGHT README.html LICENSE THIRDPARTYLICENSEREADME.txt
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
    +    JRE_DOC_FILES += README.txt
    +  else
    +    JRE_DOC_FILES += README
    +  endif
    +  JDK_DOC_FILES += demo/DEMOS_LICENSE sample/SAMPLES_LICENSE
    +  JRE_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/share/doc/jre
    +  JDK_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/share/doc/jdk
     endif
    -JRE_DOC_TARGETS := $(addprefix $(JRE_IMAGE_DIR)/,$(JRE_DOC_FILES))
    -JDKJRE_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/jre/,$(JRE_DOC_FILES))
    -JDK_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/,$(JDK_DOC_FILES))
    +JRE_DOC_TARGETS := $(addprefix $(JRE_IMAGE_DIR)/, $(JRE_DOC_FILES))
    +JDKJRE_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/jre/, $(JRE_DOC_FILES))
    +JDK_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/, $(JDK_DOC_FILES))
     
     $(JRE_IMAGE_DIR)/%: $(JRE_DOC_LOCATION)/%
     	$(process-doc-file)
    @@ -605,31 +634,31 @@ JDK_OVERLAY_INFO_FILE := $(JDK_OVERLAY_IMAGE_DIR)/release
     
     # Common way to emit a line into the release or info file
     define info-file-item # name value
    -$(PRINTF) '%s="%s"\n' $1 $2 >> $@
    +	$(PRINTF) '%s="%s"\n' $1 $2 >> $@
     endef
     
     define create-info-file
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(call info-file-item, "JAVA_VERSION", "$(JDK_VERSION)")
    -	$(call info-file-item, "OS_NAME",      "$(REQUIRED_OS_NAME)")
    -	$(call info-file-item, "OS_VERSION",   "$(REQUIRED_OS_VERSION)")
    -	$(call info-file-item, "OS_ARCH",      "$(OPENJDK_TARGET_CPU_LEGACY)")
    +	$(call info-file-item, "OS_NAME", "$(REQUIRED_OS_NAME)")
    +	$(call info-file-item, "OS_VERSION", "$(REQUIRED_OS_VERSION)")
    +	$(call info-file-item, "OS_ARCH", "$(OPENJDK_TARGET_CPU_LEGACY)")
     	if [ -n "$(JDK_ARCH_ABI_PROP_NAME)" ]; then $(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"); fi
    -	$(call info-file-item, "SOURCE",       "$(ALL_SOURCE_TIPS)")
    +	$(call info-file-item, "SOURCE", "$(ALL_SOURCE_TIPS)")
     endef
     
     ALL_SOURCE_TIPS = $(shell \
    -  if [ -f $(OUTPUT_ROOT)/source_tips ] ; then \
    -    $(CAT) $(OUTPUT_ROOT)/source_tips ; \
    -  fi)
    +    if [ -f $(OUTPUT_ROOT)/source_tips ] ; then \
    +      $(CAT) $(OUTPUT_ROOT)/source_tips ; \
    +    fi)
     
     $(JRE_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
     	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
     	$(call create-info-file)
    -ifneq ($(PROFILE),)
    -	$(call info-file-item, "JAVA_PROFILE", "$(call profile_name, $(call profile_number, $(PROFILE)))")
    -endif
    +        ifneq ($(PROFILE), )
    +	  $(call info-file-item, "JAVA_PROFILE", "$(call profile_name, $(call profile_number, $(PROFILE)))")
    +        endif
     
     $(JDK_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
     	$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
    @@ -650,57 +679,57 @@ $(JDK_IMAGE_DIR)/src.zip: $(IMAGES_OUTPUTDIR)/src.zip
     ################################################################################
     # Post processing (strip etc)
     
    -ifneq ($(POST_STRIP_CMD),)
    -    ifeq ($(OPENJDK_TARGET_OS), windows)
    -        EXEC_LIST_BIN:=$(filter-out %$(notdir $(MSVCR_DLL)),$(filter %.exe %.dll,$(ALL_BIN_LIST)))
    -    else
    -        # Find all executables in JDK_OUTPUTDIR since they exist when this makefile is parsed
    -        EXEC_LIST_BIN:=$(shell $(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX) ! -name \*.debuginfo` \
    -		| $(EGREP) 'ELF' | $(CUT) -d':' -f1)
    -        # On mac, the old build searches for static libraries for stripping instead of shared.
    -        # Not clear if it's intentional.
    -	ifneq ($(OPENJDK_TARGET_OS), macosx)
    -            EXEC_LIST_LIB:=$(shell $(FIND) $(JDK_OUTPUTDIR)/lib -type f -name \*$(SHARED_LIBRARY_SUFFIX))
    -	endif
    +ifneq ($(POST_STRIP_CMD), )
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
    +    EXEC_LIST_BIN := $(filter-out %$(notdir $(MSVCR_DLL)), $(filter %.exe %.dll, $(ALL_BIN_LIST)))
    +  else
    +    # Find all executables in JDK_OUTPUTDIR since they exist when this makefile is parsed
    +    EXEC_LIST_BIN := $(shell $(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX) ! -name \*.debuginfo` \
    +        | $(EGREP) 'ELF' | $(CUT) -d':' -f1)
    +    # On mac, the old build searches for static libraries for stripping instead of shared.
    +    # Not clear if it's intentional.
    +    ifneq ($(OPENJDK_TARGET_OS), macosx)
    +      EXEC_LIST_LIB := $(shell $(FIND) $(JDK_OUTPUTDIR)/lib -type f -name \*$(SHARED_LIBRARY_SUFFIX))
         endif
    -    # Filter out sjavac
    -    EXEC_LIST_BIN:=$(filter-out %sjavac$(EXE_SUFFIX),$(EXEC_LIST_BIN))
    +  endif
    +  # Filter out sjavac
    +  EXEC_LIST_BIN := $(filter-out %sjavac$(EXE_SUFFIX), $(EXEC_LIST_BIN))
     
    -    # Filter out the overlay specific bin files
    -    EXEC_LIST:=$(filter-out $(OVERLAY_FILTER),$(EXEC_LIST_BIN)) $(EXEC_LIST_LIB)
    -    EXEC_LIST_OVERLAY:=$(filter $(OVERLAY_FILTER),$(EXEC_LIST_BIN)) $(EXEC_LIST_LIB)
    +  # Filter out the overlay specific bin files
    +  EXEC_LIST := $(filter-out $(OVERLAY_FILTER), $(EXEC_LIST_BIN)) $(EXEC_LIST_LIB)
    +  EXEC_LIST_OVERLAY := $(filter $(OVERLAY_FILTER), $(EXEC_LIST_BIN)) $(EXEC_LIST_LIB)
     
    -    # Filter out non JRE files and convert to unique touch files to depend on
    -    JRE_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre$(PROFILE)/%.stripped,\
    -			$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\
    -				 $(EXEC_LIST)))
    +  # Filter out non JRE files and convert to unique touch files to depend on
    +  JRE_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, $(IMAGES_OUTPUTDIR)/_strip_jre$(PROFILE)/%.stripped, \
    +      $(filter-out $(addprefix %, $(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)), \
    +      $(EXEC_LIST)))
     
    -    JDKJRE_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
    -                        $(IMAGES_OUTPUTDIR)/_strip_jdk/jre/%.stripped, \
    -			$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST)))
    +  JDKJRE_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, \
    +      $(IMAGES_OUTPUTDIR)/_strip_jdk/jre/%.stripped, \
    +      $(filter-out $(addprefix %, $(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST)))
     
    -    JDK_BIN_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
    -                          $(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped, \
    -                          $(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST)))
    +  JDK_BIN_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, \
    +      $(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped, \
    +      $(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST)))
     
    -    # Do the same for overlay image
    -    JRE_OVERLAY_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped,\
    -			$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\
    -				 $(EXEC_LIST_OVERLAY)))
    +  # Do the same for overlay image
    +  JRE_OVERLAY_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, $(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped, \
    +      $(filter-out $(addprefix %, $(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)), \
    +      $(EXEC_LIST_OVERLAY)))
     
    -    JDKJRE_OVERLAY_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
    -                        $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/jre/%.stripped, \
    -			$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST_OVERLAY)))
    +  JDKJRE_OVERLAY_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, \
    +      $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/jre/%.stripped, \
    +      $(filter-out $(addprefix %, $(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST_OVERLAY)))
     
    -    JDK_OVERLAY_BIN_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
    -                          $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped, \
    -                          $(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST_OVERLAY)))
    +  JDK_OVERLAY_BIN_STRIP_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, \
    +      $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped, \
    +      $(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST_OVERLAY)))
     
    -    define mcs-file
    -	$(if $(POST_MCS_CMD),$(POST_MCS_CMD) $<)
    -    endef
    +  define mcs-file
    +	$(if $(POST_MCS_CMD), $(POST_MCS_CMD) $<)
    +  endef
     
    -    define strip-file
    +  define strip-file
     	$(ECHO) Stripping $(LOG_INFO) $(patsubst $(OUTPUT_ROOT)/%,%,$<)
     	$(CHMOD) u+w $<
     	$(POST_STRIP_CMD) $<
    @@ -708,19 +737,19 @@ ifneq ($(POST_STRIP_CMD),)
     	$(CHMOD) go-w $<
     	$(MKDIR) -p $(@D)
     	$(TOUCH) $@
    -    endef
    +  endef
     
    -    # Setup a rule for stripping files based on touch files
    -    $(IMAGES_OUTPUTDIR)/_strip_jre$(PROFILE)/%.stripped: $(JRE_IMAGE_DIR)/%
    +  # Setup a rule for stripping files based on touch files
    +  $(IMAGES_OUTPUTDIR)/_strip_jre$(PROFILE)/%.stripped: $(JRE_IMAGE_DIR)/%
     	$(call strip-file)
     
    -    $(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped: $(JDK_IMAGE_DIR)/%
    +  $(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped: $(JDK_IMAGE_DIR)/%
     	$(call strip-file)
     
    -    $(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped: $(JRE_OVERLAY_IMAGE_DIR)/%
    +  $(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped: $(JRE_OVERLAY_IMAGE_DIR)/%
     	$(call strip-file)
     
    -    $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped: $(JDK_OVERLAY_IMAGE_DIR)/%
    +  $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped: $(JDK_OVERLAY_IMAGE_DIR)/%
     	$(call strip-file)
     
     endif
    @@ -729,43 +758,45 @@ endif
     # Main targets
     
     jre-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) $(JRE_IMAGE_DIR)/lib/applet \
    -	$(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \
    -	$(JRE_MAN_PAGE_LIST) $(JRE_DOC_TARGETS) $(JRE_INFO_FILE) $(JRE_STRIP_LIST)
    +    $(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \
    +    $(JRE_MAN_PAGE_LIST) $(JRE_DOC_TARGETS) $(JRE_INFO_FILE) $(JRE_STRIP_LIST) \
    +    $(JRE_BIN_ISADIR_LINK_TARGETS)
     
     jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \
    -	$(JDK_LIB_TARGETS) $(JDKJRE_LIB_TARGETS) \
    -	$(JDK_IMAGE_DIR)/jre/lib/applet \
    -	$(JDK_DEMO_TARGETS) \
    -	$(JDK_IMAGE_DIR)/jre/lib/meta-index $(JDK_IMAGE_DIR)/jre/lib/ext/meta-index \
    -	$(JDK_MAN_PAGE_LIST) $(JDK_SAMPLE_TARGETS) \
    -	$(JDK_DB_TARGETS) $(JDK_INCLUDE_TARGETS) \
    -	$(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \
    -	$(JDK_INFO_FILE) $(JDKJRE_STRIP_LIST) $(JDK_BIN_STRIP_LIST) \
    -        $(JDK_IMAGE_DIR)/src.zip
    +    $(JDK_LIB_TARGETS) $(JDKJRE_LIB_TARGETS) \
    +    $(JDK_IMAGE_DIR)/jre/lib/applet \
    +    $(JDK_DEMO_TARGETS) \
    +    $(JDK_IMAGE_DIR)/jre/lib/meta-index $(JDK_IMAGE_DIR)/jre/lib/ext/meta-index \
    +    $(JDK_MAN_PAGE_LIST) $(JDK_SAMPLE_TARGETS) \
    +    $(JDK_DB_TARGETS) $(JDK_INCLUDE_TARGETS) \
    +    $(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \
    +    $(JDK_INFO_FILE) $(JDKJRE_STRIP_LIST) $(JDK_BIN_STRIP_LIST) \
    +    $(JDK_IMAGE_DIR)/src.zip \
    +    $(JDK_BIN_ISADIR_LINK_TARGETS) $(JDKJRE_BIN_ISADIR_LINK_TARGETS)
     
     jre-overlay-image: $(JRE_OVERLAY_BIN_TARGETS) $(JRE_OVERLAY_LIB_TARGETS) \
    -	 $(JRE_OVERLAY_INFO_FILE) $(JRE_OVERLAY_STRIP_LIST)
    +    $(JRE_OVERLAY_INFO_FILE) $(JRE_OVERLAY_STRIP_LIST)
     
     jdk-overlay-image: $(JDK_OVERLAY_BIN_TARGETS) $(JDKJRE_OVERLAY_BIN_TARGETS) \
    -	$(JDK_OVERLAY_LIB_TARGETS) $(JDKJRE_OVERLAY_LIB_TARGETS) \
    -	$(JDK_OVERLAY_DEMO_TARGETS) $(JDK_OVERLAY_INFO_FILE) \
    -	$(JDKJRE_OVERLAY_STRIP_LIST) $(JDK_OVERLAY_BIN_STRIP_LIST) 
    +    $(JDK_OVERLAY_LIB_TARGETS) $(JDKJRE_OVERLAY_LIB_TARGETS) \
    +    $(JDK_OVERLAY_DEMO_TARGETS) $(JDK_OVERLAY_INFO_FILE) \
    +    $(JDKJRE_OVERLAY_STRIP_LIST) $(JDK_OVERLAY_BIN_STRIP_LIST)
     
    -ifneq ($(PROFILE),)
    -PROFILE_IMAGE_JARS := $(filter %.jar, $(JRE_LIB_TARGETS))
    +ifneq ($(PROFILE), )
    +  PROFILE_IMAGE_JARS := $(filter %.jar, $(JRE_LIB_TARGETS))
     
    -PROFILE_IMAGE_JARS_CHECKED := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_jars_checked
    +  PROFILE_IMAGE_JARS_CHECKED := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_jars_checked
     
    -$(PROFILE_IMAGE_JARS_CHECKED) : $(PROFILE_IMAGE_JARS)
    +  $(PROFILE_IMAGE_JARS_CHECKED) : $(PROFILE_IMAGE_JARS)
     	$(TOOL_CHECKDEPS) $(JRE_IMAGE_DIR) \
     	    $(call profile_name, $(call profile_number, $(PROFILE)))
     	$(TOUCH) $@
     
    -profile-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) \
    +  profile-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) \
     	$(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \
     	$(JRE_INFO_FILE) $(JRE_STRIP_LIST) $(PROFILE_IMAGE_JARS_CHECKED)
     
    -.PHONY: profile-image
    +  .PHONY: profile-image
     
     endif # Profile
     
    diff --git a/jdk/makefiles/Import.gmk b/jdk/makefiles/Import.gmk
    index d25a1829374..46c64d4d468 100644
    --- a/jdk/makefiles/Import.gmk
    +++ b/jdk/makefiles/Import.gmk
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
     # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     #
     # This code is free software; you can redistribute it and/or modify it
    @@ -40,25 +40,25 @@ IMPORT_BINARIES := CORBA
     #######
     
     # Put the libraries here. Different locations for different target apis.
    -ifeq ($(OPENJDK_TARGET_OS_API),posix)
    -    INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
    -    HOTSPOT_LIB_DIR:=$(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)
    +ifeq ($(OPENJDK_TARGET_OS_API), posix)
    +  INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
    +  HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)
     else
    -    INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/bin
    -    HOTSPOT_LIB_DIR:=$(HOTSPOT_DIST)/jre/bin
    +  INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/bin
    +  HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/jre/bin
     endif
     
     #######
     
     #
     # jar xf/unzip fails when executing them all in parallel
    -#   introduce artificial dependency (_DEP) buuhhh 
    +# introduce artificial dependency (_DEP) buuhhh
     
     define ImportClasses
    -$1_CLASSES_DEP := $$(IMPORT_TARGET_CLASSES)
    -IMPORT_TARGET_CLASSES += $(JDK_OUTPUTDIR)/classes/_the.$1.classes.imported
    +  $1_CLASSES_DEP := $$(IMPORT_TARGET_CLASSES)
    +  IMPORT_TARGET_CLASSES += $(JDK_OUTPUTDIR)/classes/_the.$1.classes.imported
     
    -$(JDK_OUTPUTDIR)/classes/_the.$1.classes.imported : $$($1_DIST)/lib/classes.jar $$($1_CLASSES_DEP)
    +  $(JDK_OUTPUTDIR)/classes/_the.$1.classes.imported: $$($1_DIST)/lib/classes.jar $$($1_CLASSES_DEP)
     	$(ECHO) Importing $1 classes.jar
     	$(MKDIR) -p $$(@D)
     	$(RM) $$@ $$@.tmp
    @@ -67,10 +67,10 @@ $(JDK_OUTPUTDIR)/classes/_the.$1.classes.imported : $$($1_DIST)/lib/classes.jar
     endef
     
     define ImportSources
    -$1_SOURCES_DEP := $$(IMPORT_TARGET_SOURCES)
    -IMPORT_TARGET_SOURCES += $(JDK_OUTPUTDIR)/impsrc/_the.$1.src.imported
    +  $1_SOURCES_DEP := $$(IMPORT_TARGET_SOURCES)
    +  IMPORT_TARGET_SOURCES += $(JDK_OUTPUTDIR)/impsrc/_the.$1.src.imported
     
    -$(JDK_OUTPUTDIR)/impsrc/_the.$1.src.imported : $$($1_DIST)/lib/src.zip $$($1_SOURCES_DEP)
    +  $(JDK_OUTPUTDIR)/impsrc/_the.$1.src.imported: $$($1_DIST)/lib/src.zip $$($1_SOURCES_DEP)
     	$(ECHO) Importing $1 src.zip
     	$(MKDIR) -p $$(@D)
     	$(RM) $$@ $$@.tmp
    @@ -79,10 +79,10 @@ $(JDK_OUTPUTDIR)/impsrc/_the.$1.src.imported : $$($1_DIST)/lib/src.zip $$($1_SOU
     endef
     
     define ImportBinaries
    -$1_BINARIES_DEP := $$(IMPORT_TARGET_BINARIES)
    -IMPORT_TARGET_BINARIES += $(JDK_OUTPUTDIR)/_the.$1.binaries.imported
    +  $1_BINARIES_DEP := $$(IMPORT_TARGET_BINARIES)
    +  IMPORT_TARGET_BINARIES += $(JDK_OUTPUTDIR)/_the.$1.binaries.imported
     
    -$(JDK_OUTPUTDIR)/_the.$1.binaries.imported : $$($1_DIST)/lib/bin.zip $$($1_BINARIES_DEP)
    +  $(JDK_OUTPUTDIR)/_the.$1.binaries.imported: $$($1_DIST)/lib/bin.zip $$($1_BINARIES_DEP)
     	$(ECHO) Importing $1 bin.zip
     	$(MKDIR) -p $$(@D)
     	$(RM) $$@ $$@.tmp
    @@ -92,19 +92,19 @@ endef
     
     #######
     
    -$(foreach I,$(IMPORT_CLASSES), $(eval $(call ImportClasses,$I)))
    -$(foreach I,$(IMPORT_SOURCES), $(eval $(call ImportSources,$I)))
    -$(foreach I,$(IMPORT_BINARIES), $(eval $(call ImportBinaries,$I)))
    +$(foreach I, $(IMPORT_CLASSES), $(eval $(call ImportClasses,$I)))
    +$(foreach I, $(IMPORT_SOURCES), $(eval $(call ImportSources,$I)))
    +$(foreach I, $(IMPORT_BINARIES), $(eval $(call ImportBinaries,$I)))
     
     IMPORT_TARGET_FILES += $(IMPORT_TARGET_CLASSES) $(IMPORT_TARGET_SOURCES) $(IMPORT_TARGET_BINARIES)
     
     #######
     
     define CopyDir
    -        $1_SRC_FILES := $(shell $(FIND) $2 -type f -a \( -name DUMMY $(addprefix -o$(SPACE)-name$(SPACE),$4) \))
    -        $1_DST_FILES := $$(patsubst $2/%,$3/%,$$($1_SRC_FILES))
    -        IMPORT_TARGET_FILES += $$($1_DST_FILES)
    -$3/% : $2/%
    +  $1_SRC_FILES := $(shell $(FIND) $2 -type f -a \( -name DUMMY $(addprefix -o$(SPACE)-name$(SPACE),$4) \))
    +  $1_DST_FILES := $$(patsubst $2/%,$3/%,$$($1_SRC_FILES))
    +  IMPORT_TARGET_FILES += $$($1_DST_FILES)
    +  $3/%: $2/%
     	$(ECHO) $(LOG_INFO) Copying $$(@F)
     	$$(install-file)
     endef
    @@ -114,46 +114,68 @@ endef
     #
     # Import hotspot
     #
    -HOTSPOT_IMPORT_FILES:=$(addprefix $(LIBRARY_PREFIX), jvm.* saproc.* jsig.* sawindbg.* jvm_db.* jvm_dtrace.*) \
    -                      Xusage.txt sa-jdi.jar
    +HOTSPOT_IMPORT_FILES := $(addprefix $(LIBRARY_PREFIX), jvm.* saproc.* jsig.* sawindbg.* jvm_db.* jvm_dtrace.*) \
    +    Xusage.txt sa-jdi.jar
     $(eval $(call CopyDir,HOTSPOT0, $(HOTSPOT_LIB_DIR), $(INSTALL_LIBRARIES_HERE), $(HOTSPOT_IMPORT_FILES)))
     $(eval $(call CopyDir,HOTSPOT1, $(HOTSPOT_DIST)/lib, $(JDK_OUTPUTDIR)/lib, $(HOTSPOT_IMPORT_FILES)))
     
    -JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \
    -                  $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
    -
    -ifneq ($(OPENJDK_TARGET_OS), windows)
    -    ifeq ($(JVM_VARIANT_SERVER), true)
    -        IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/server/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
    -        ifneq (,$(JSIG_DEBUGINFO))
    -            IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/server/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
    -        endif
    -    endif
    -    ifeq ($(JVM_VARIANT_CLIENT), true)
    -        IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/client/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
    -        ifneq (,$(JSIG_DEBUGINFO))
    -            IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/client/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
    -        endif
    -    endif
    -    ifeq ($(JVM_VARIANT_MINIMAL1), true)
    -        IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
    -        ifneq (,$(JSIG_DEBUGINFO))
    -            IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
    -        endif
    -    endif
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig$(SHARED_LIBRARY_SUFFIX).dSYM) \
    +      $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
    +else
    +  JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \
    +      $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
     endif
     
    -$(INSTALL_LIBRARIES_HERE)/server/%$(SHARED_LIBRARY_SUFFIX) : $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
    +ifneq ($(OPENJDK_TARGET_OS), windows)
    +  ifeq ($(JVM_VARIANT_SERVER), true)
    +    IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/server/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
    +    ifneq (, $(JSIG_DEBUGINFO))
    +      IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/server/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
    +    endif
    +  endif
    +  ifeq ($(JVM_VARIANT_CLIENT), true)
    +    IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/client/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
    +    ifneq (, $(JSIG_DEBUGINFO))
    +      IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/client/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
    +    endif
    +  endif
    +  ifneq ($(OPENJDK_TARGET_OS), macosx)
    +    ifeq ($(JVM_VARIANT_MINIMAL1), true)
    +      IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
    +      ifneq (,$(JSIG_DEBUGINFO))
    +        IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
    +      endif
    +    endif
    +  endif
    +endif
    +
    +$(INSTALL_LIBRARIES_HERE)/server/%$(SHARED_LIBRARY_SUFFIX): $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(LN) -s ../$(@F) $@
     
    -$(INSTALL_LIBRARIES_HERE)/server/%.debuginfo : $(INSTALL_LIBRARIES_HERE)/%.debuginfo
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  $(INSTALL_LIBRARIES_HERE)/server/%.dSYM : $(INSTALL_LIBRARIES_HERE)/%.dSYM
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(LN) -s ../$(@F) $@
     
    -$(INSTALL_LIBRARIES_HERE)/server/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
    +  $(INSTALL_LIBRARIES_HERE)/server/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
    +	$(MKDIR) -p $(@D)
    +	$(RM) $@
    +	$(RM) $@.tmp $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
    +	$(LN) -s ../$(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
    +	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM
    +	$(RM) $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
    +	$(MV) $@.tmp $@
    +else
    +  $(INSTALL_LIBRARIES_HERE)/server/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo
    +	$(MKDIR) -p $(@D)
    +	$(RM) $@
    +	$(LN) -s ../$(@F) $@
    +
    +  $(INSTALL_LIBRARIES_HERE)/server/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(RM) $@.tmp $(basename $@).debuginfo
    @@ -161,18 +183,34 @@ $(INSTALL_LIBRARIES_HERE)/server/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
     	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).debuginfo
     	$(RM) $(basename $@).debuginfo
     	$(MV) $@.tmp $@
    +endif
     
    -$(INSTALL_LIBRARIES_HERE)/client/%$(SHARED_LIBRARY_SUFFIX) : $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
    +$(INSTALL_LIBRARIES_HERE)/client/%$(SHARED_LIBRARY_SUFFIX): $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(LN) -s ../$(@F) $@
     
    -$(INSTALL_LIBRARIES_HERE)/client/%.debuginfo : $(INSTALL_LIBRARIES_HERE)/%.debuginfo
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  $(INSTALL_LIBRARIES_HERE)/client/%.dSYM : $(INSTALL_LIBRARIES_HERE)/%.dSYM
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(LN) -s ../$(@F) $@
     
    -$(INSTALL_LIBRARIES_HERE)/client/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
    +  $(INSTALL_LIBRARIES_HERE)/client/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
    +	$(MKDIR) -p $(@D)
    +	$(RM) $@
    +	$(RM) $@.tmp $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
    +	$(LN) -s ../$(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
    +	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM
    +	$(RM) $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
    +	$(MV) $@.tmp $@
    +else
    +  $(INSTALL_LIBRARIES_HERE)/client/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo
    +	$(MKDIR) -p $(@D)
    +	$(RM) $@
    +	$(LN) -s ../$(@F) $@
    +
    +  $(INSTALL_LIBRARIES_HERE)/client/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(RM) $@.tmp $(basename $@).debuginfo
    @@ -180,18 +218,20 @@ $(INSTALL_LIBRARIES_HERE)/client/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
     	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).debuginfo
     	$(RM) $(basename $@).debuginfo
     	$(MV) $@.tmp $@
    +endif
     
    -$(INSTALL_LIBRARIES_HERE)/minimal/%$(SHARED_LIBRARY_SUFFIX) : $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
    +$(INSTALL_LIBRARIES_HERE)/minimal/%$(SHARED_LIBRARY_SUFFIX): $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(LN) -s ../$(@F) $@
     
    -$(INSTALL_LIBRARIES_HERE)/minimal/%.debuginfo : $(INSTALL_LIBRARIES_HERE)/%.debuginfo
    +ifneq ($(OPENJDK_TARGET_OS), macosx)
    +  $(INSTALL_LIBRARIES_HERE)/minimal/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(LN) -s ../$(@F) $@
     
    -$(INSTALL_LIBRARIES_HERE)/minimal/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
    +  $(INSTALL_LIBRARIES_HERE)/minimal/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(RM) $@.tmp $(basename $@).debuginfo
    @@ -199,13 +239,14 @@ $(INSTALL_LIBRARIES_HERE)/minimal/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
     	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).debuginfo
     	$(RM) $(basename $@).debuginfo
     	$(MV) $@.tmp $@
    +endif
     
     ##########################################################################################
     # Unpack the binary distributions of the crypto classes if they exist.
    -SEC_FILES_ZIP:=$(JDK_TOPDIR)/make/tools/crypto/sec-bin.zip
    -SEC_FILES_WIN_ZIP:=$(JDK_TOPDIR)/make/tools/crypto/sec-windows-bin.zip
    -JGSS_WIN32_FILES_ZIP:=$(JDK_TOPDIR)/make/tools/crypto/jgss-windows-i586-bin.zip
    -JGSS_WIN64_FILES_ZIP:=$(JDK_TOPDIR)/make/tools/crypto/jgss-windows-x64-bin.zip
    +SEC_FILES_ZIP := $(JDK_TOPDIR)/make/tools/crypto/sec-bin.zip
    +SEC_FILES_WIN_ZIP := $(JDK_TOPDIR)/make/tools/crypto/sec-windows-bin.zip
    +JGSS_WIN32_FILES_ZIP := $(JDK_TOPDIR)/make/tools/crypto/jgss-windows-i586-bin.zip
    +JGSS_WIN64_FILES_ZIP := $(JDK_TOPDIR)/make/tools/crypto/jgss-windows-x64-bin.zip
     
     define unzip-sec-file
     	$(ECHO) Unzipping $( $$($1_OUT).tmp \
    +	    -K$$($1_type) \
    +	    -K$$($1_category) \
    +	    -K$$($1_streams) \
    +	    -Dtype=$$($1_type) \
    +	    -DType=$$($1_Type) \
    +	    -Dfulltype=$$($1_fulltype) \
    +	    -DFulltype=$$($1_Fulltype) \
    +	    -Dstreamtype=$$($1_streamtype) \
    +	    -DStreamtype=$$($1_Streamtype) \
    +	    -Dx=$$($1_x) \
    +	    -Dmemtype=$$($1_memtype) \
    +	    -DMemtype=$$($1_Memtype) \
    +	    -DSwaptype=$$($1_Swaptype) \
    +	    -DfromBits=$$($1_fromBits) \
    +	    -DtoBits=$$($1_toBits) \
    +	    -DLG_BYTES_PER_VALUE=$$($1_LBPV) \
    +	    -DBYTES_PER_VALUE="(1 << $$($1_LBPV))" \
    +	    -DBO=$$($1_BO) \
    +	    -Dswap=$$($1_swap) \
    +	    -DRW=$$($1_RW) \
    +	    -K$$($1_rwkey) \
    +	    -Da=$$($1_a) \
    +	    -DA=$$($1_A) \
    +	    -Kbo$$($1_BO)
    +	$(MV) $$($1_OUT).tmp $$($1_OUT)
    +        # Do the extra bin thing
    +        ifeq ($$($1_BIN), 1)
    +	  $(SED) -e '/#BIN/,$$$$d' < $$($1_OUT) > $$($1_DST).tmp
    +	  $(RM) $$($1_OUT)
    +	  $$($1_char_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
    +	  $$($1_short_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
    +	  $$($1_int_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
    +	  $$($1_long_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
    +	  $$($1_float_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
    +	  $$($1_double_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
    +	  $(PRINTF) "}\n" >> $$($1_DST).tmp
    +	  mv $$($1_DST).tmp $$($1_DST)
    +        endif
    +
    +  GENSRC_BUFFER += $$($1_DST)
    +
    +endef
    +
    +###
    +
    +X_BUF := X-Buffer
    +
    +$(eval $(call SetupGenBuffer,ByteBuffer,  $(X_BUF), type:=byte, BIN:=1))
    +$(eval $(call SetupGenBuffer,CharBuffer,  $(X_BUF), type:=char))
    +$(eval $(call SetupGenBuffer,ShortBuffer, $(X_BUF), type:=short))
    +$(eval $(call SetupGenBuffer,IntBuffer,   $(X_BUF), type:=int))
    +$(eval $(call SetupGenBuffer,LongBuffer,  $(X_BUF), type:=long))
    +$(eval $(call SetupGenBuffer,FloatBuffer, $(X_BUF), type:=float))
    +$(eval $(call SetupGenBuffer,DoubleBuffer,$(X_BUF), type:=double))
    +
    +# Buffers whose contents are heap-allocated
    +#
    +HEAP_X_BUF := Heap-X-Buffer
    +
    +$(eval $(call SetupGenBuffer,HeapByteBuffer,   $(HEAP_X_BUF), type:=byte))
    +$(eval $(call SetupGenBuffer,HeapByteBufferR,  $(HEAP_X_BUF), type:=byte, RW:=R))
    +$(eval $(call SetupGenBuffer,HeapCharBuffer,   $(HEAP_X_BUF), type:=char))
    +$(eval $(call SetupGenBuffer,HeapCharBufferR,  $(HEAP_X_BUF), type:=char, RW:=R))
    +$(eval $(call SetupGenBuffer,HeapShortBuffer,  $(HEAP_X_BUF), type:=short))
    +$(eval $(call SetupGenBuffer,HeapShortBufferR, $(HEAP_X_BUF), type:=short, RW:=R))
    +$(eval $(call SetupGenBuffer,HeapIntBuffer,    $(HEAP_X_BUF), type:=int))
    +$(eval $(call SetupGenBuffer,HeapIntBufferR,   $(HEAP_X_BUF), type:=int, RW:=R))
    +$(eval $(call SetupGenBuffer,HeapLongBuffer,   $(HEAP_X_BUF), type:=long))
    +$(eval $(call SetupGenBuffer,HeapLongBufferR,  $(HEAP_X_BUF), type:=long, RW:=R))
    +$(eval $(call SetupGenBuffer,HeapFloatBuffer,  $(HEAP_X_BUF), type:=float))
    +$(eval $(call SetupGenBuffer,HeapFloatBufferR, $(HEAP_X_BUF), type:=float, RW:=R))
    +$(eval $(call SetupGenBuffer,HeapDoubleBuffer, $(HEAP_X_BUF), type:=double))
    +$(eval $(call SetupGenBuffer,HeapDoubleBufferR,$(HEAP_X_BUF), type:=double, RW:=R))
    +
    +# Direct byte buffer
    +#
    +DIRECT_X_BUF := Direct-X-Buffer
    +
    +$(eval $(call SetupGenBuffer,DirectByteBuffer, $(DIRECT_X_BUF), type:=byte, BIN:=1))
    +$(eval $(call SetupGenBuffer,DirectByteBufferR,$(DIRECT_X_BUF), type:=byte, BIN:=1, RW:=R))
    +
    +# Unswapped views of direct byte buffers
    +#
    +$(eval $(call SetupGenBuffer,DirectCharBufferU,   $(DIRECT_X_BUF), type:=char, BO:=U))
    +$(eval $(call SetupGenBuffer,DirectCharBufferRU,  $(DIRECT_X_BUF), type:=char, RW:=R, BO:=U))
    +$(eval $(call SetupGenBuffer,DirectShortBufferU,  $(DIRECT_X_BUF), type:=short, BO:=U))
    +$(eval $(call SetupGenBuffer,DirectShortBufferRU, $(DIRECT_X_BUF), type:=short, RW:=R, BO:=U))
    +$(eval $(call SetupGenBuffer,DirectIntBufferU,    $(DIRECT_X_BUF), type:=int, BO:=U))
    +$(eval $(call SetupGenBuffer,DirectIntBufferRU,   $(DIRECT_X_BUF), type:=int, RW:=R, BO:=U))
    +$(eval $(call SetupGenBuffer,DirectLongBufferU,   $(DIRECT_X_BUF), type:=long, BO:=U))
    +$(eval $(call SetupGenBuffer,DirectLongBufferRU,  $(DIRECT_X_BUF), type:=long, RW:=R, BO:=U))
    +$(eval $(call SetupGenBuffer,DirectFloatBufferU,  $(DIRECT_X_BUF), type:=float, BO:=U))
    +$(eval $(call SetupGenBuffer,DirectFloatBufferRU, $(DIRECT_X_BUF), type:=float, RW:=R, BO:=U))
    +$(eval $(call SetupGenBuffer,DirectDoubleBufferU, $(DIRECT_X_BUF), type:=double, BO:=U))
    +$(eval $(call SetupGenBuffer,DirectDoubleBufferRU,$(DIRECT_X_BUF), type:=double, RW:=R, BO:=U))
    +
    +# Swapped views of direct byte buffers
    +#
    +$(eval $(call SetupGenBuffer,DirectCharBufferS,   $(DIRECT_X_BUF), type:=char, BO:=S))
    +$(eval $(call SetupGenBuffer,DirectCharBufferRS,  $(DIRECT_X_BUF), type:=char, RW:=R, BO:=S))
    +$(eval $(call SetupGenBuffer,DirectShortBufferS,  $(DIRECT_X_BUF), type:=short, BO:=S))
    +$(eval $(call SetupGenBuffer,DirectShortBufferRS, $(DIRECT_X_BUF), type:=short, RW:=R, BO:=S))
    +$(eval $(call SetupGenBuffer,DirectIntBufferS,    $(DIRECT_X_BUF), type:=int, BO:=S))
    +$(eval $(call SetupGenBuffer,DirectIntBufferRS,   $(DIRECT_X_BUF), type:=int, RW:=R, BO:=S))
    +$(eval $(call SetupGenBuffer,DirectLongBufferS,   $(DIRECT_X_BUF), type:=long, BO:=S))
    +$(eval $(call SetupGenBuffer,DirectLongBufferRS,  $(DIRECT_X_BUF), type:=long, RW:=R, BO:=S))
    +$(eval $(call SetupGenBuffer,DirectFloatBufferS,  $(DIRECT_X_BUF), type:=float, BO:=S))
    +$(eval $(call SetupGenBuffer,DirectFloatBufferRS, $(DIRECT_X_BUF), type:=float, RW:=R, BO:=S))
    +$(eval $(call SetupGenBuffer,DirectDoubleBufferS, $(DIRECT_X_BUF), type:=double, BO:=S))
    +$(eval $(call SetupGenBuffer,DirectDoubleBufferRS,$(DIRECT_X_BUF), type:=double, RW:=R, BO:=S))
    +
    +# Big-endian views of byte buffers
    +#
    +BYTE_X_BUF := ByteBufferAs-X-Buffer
    +
    +$(eval $(call SetupGenBuffer,ByteBufferAsCharBufferB,   $(BYTE_X_BUF), type:=char, BO:=B))
    +$(eval $(call SetupGenBuffer,ByteBufferAsCharBufferRB,  $(BYTE_X_BUF), type:=char, RW:=R, BO:=B))
    +$(eval $(call SetupGenBuffer,ByteBufferAsShortBufferB,  $(BYTE_X_BUF), type:=short, BO:=B))
    +$(eval $(call SetupGenBuffer,ByteBufferAsShortBufferRB, $(BYTE_X_BUF), type:=short, RW:=R, BO:=B))
    +$(eval $(call SetupGenBuffer,ByteBufferAsIntBufferB,    $(BYTE_X_BUF), type:=int, BO:=B))
    +$(eval $(call SetupGenBuffer,ByteBufferAsIntBufferRB,   $(BYTE_X_BUF), type:=int, RW:=R, BO:=B))
    +$(eval $(call SetupGenBuffer,ByteBufferAsLongBufferB,   $(BYTE_X_BUF), type:=long, BO:=B))
    +$(eval $(call SetupGenBuffer,ByteBufferAsLongBufferRB,  $(BYTE_X_BUF), type:=long, RW:=R, BO:=B))
    +$(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferB,  $(BYTE_X_BUF), type:=float, BO:=B))
    +$(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferRB, $(BYTE_X_BUF), type:=float, RW:=R, BO:=B))
    +$(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferB, $(BYTE_X_BUF), type:=double, BO:=B))
    +$(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferRB,$(BYTE_X_BUF), type:=double, RW:=R, BO:=B))
    +
    +# Little-endian views of byte buffers
    +#
    +$(eval $(call SetupGenBuffer,ByteBufferAsCharBufferL,   $(BYTE_X_BUF), type:=char, BO:=L))
    +$(eval $(call SetupGenBuffer,ByteBufferAsCharBufferRL,  $(BYTE_X_BUF), type:=char, RW:=R, BO:=L))
    +$(eval $(call SetupGenBuffer,ByteBufferAsShortBufferL,  $(BYTE_X_BUF), type:=short, BO:=L))
    +$(eval $(call SetupGenBuffer,ByteBufferAsShortBufferRL, $(BYTE_X_BUF), type:=short, RW:=R, BO:=L))
    +$(eval $(call SetupGenBuffer,ByteBufferAsIntBufferL,    $(BYTE_X_BUF), type:=int, BO:=L))
    +$(eval $(call SetupGenBuffer,ByteBufferAsIntBufferRL,   $(BYTE_X_BUF), type:=int, RW:=R, BO:=L))
    +$(eval $(call SetupGenBuffer,ByteBufferAsLongBufferL,   $(BYTE_X_BUF), type:=long, BO:=L))
    +$(eval $(call SetupGenBuffer,ByteBufferAsLongBufferRL,  $(BYTE_X_BUF), type:=long, RW:=R, BO:=L))
    +$(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferL,  $(BYTE_X_BUF), type:=float, BO:=L))
    +$(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferRL, $(BYTE_X_BUF), type:=float, RW:=R, BO:=L))
    +$(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferL, $(BYTE_X_BUF), type:=double, BO:=L))
    +$(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferRL,$(BYTE_X_BUF), type:=double, RW:=R, BO:=L))
    +
    +###
    +
    +$(GENSRC_BUFFER): $(BUILD_TOOLS)
    diff --git a/jdk/makefiles/GensrcCLDR.gmk b/jdk/makefiles/gensrc/GensrcCLDR.gmk
    similarity index 93%
    rename from jdk/makefiles/GensrcCLDR.gmk
    rename to jdk/makefiles/gensrc/GensrcCLDR.gmk
    index a86c12273da..dd66f9374d8 100644
    --- a/jdk/makefiles/GensrcCLDR.gmk
    +++ b/jdk/makefiles/gensrc/GensrcCLDR.gmk
    @@ -31,8 +31,8 @@ GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc
     CLDR_METAINFO_FILE := $(GENSRC_DIR)/sun/util/cldr/CLDRLocaleDataMetaInfo.java
     
     $(CLDR_METAINFO_FILE): $(wildcard $(CLDRSRCDIR)/common/dtd/*.dtd) \
    -			$(wildcard $(CLDRSRCDIR)/common/main/*.xml) \
    -			$(wildcard $(CLDRSRCDIR)/common/supplemental/*.xml)
    +    $(wildcard $(CLDRSRCDIR)/common/main/*.xml) \
    +    $(wildcard $(CLDRSRCDIR)/common/supplemental/*.xml)
     	$(MKDIR) -p $(@D)
     	$(TOOL_CLDRCONVERTER) -base $(CLDRSRCDIR) -o $(GENSRC_DIR)
     
    diff --git a/jdk/makefiles/GensrcCharacterData.gmk b/jdk/makefiles/gensrc/GensrcCharacterData.gmk
    similarity index 61%
    rename from jdk/makefiles/GensrcCharacterData.gmk
    rename to jdk/makefiles/gensrc/GensrcCharacterData.gmk
    index f64edbab85c..2c6cc7a0739 100644
    --- a/jdk/makefiles/GensrcCharacterData.gmk
    +++ b/jdk/makefiles/gensrc/GensrcCharacterData.gmk
    @@ -24,41 +24,41 @@
     #
     
     #
    -# Rules to create $(JDK_OUTPUTDIR)/gensrc/sun/lang/CharacterData*.java 
    +# Rules to create $(JDK_OUTPUTDIR)/gensrc/sun/lang/CharacterData*.java
     #
     
    -GENSRC_CHARACTERDATA:=
    +GENSRC_CHARACTERDATA :=
     
     CHARACTERDATA = $(JDK_TOPDIR)/make/tools/GenerateCharacter
    -UNICODEDATA   = $(JDK_TOPDIR)/make/tools/UnicodeData
    +UNICODEDATA = $(JDK_TOPDIR)/make/tools/UnicodeData
     
     define SetupCharacterData
    -    $(JDK_OUTPUTDIR)/gensrc/java/lang/$1.java : $(CHARACTERDATA)/$1.java.template $(BUILD_TOOLS)
    +  $(JDK_OUTPUTDIR)/gensrc/java/lang/$1.java: $(CHARACTERDATA)/$1.java.template $(BUILD_TOOLS)
     	$(MKDIR) -p $$(@D)
     	$(ECHO) $(LOG_INFO) Generating $1.java
     	$(TOOL_GENERATECHARACTER) $2 \
    -		-template $(CHARACTERDATA)/$1.java.template \
    -		-spec $(UNICODEDATA)/UnicodeData.txt \
    -		-specialcasing $(UNICODEDATA)/SpecialCasing.txt \
    -		-proplist $(UNICODEDATA)/PropList.txt \
    -		-o $(JDK_OUTPUTDIR)/gensrc/java/lang/$1.java -string \
    -		-usecharforbyte $3
    +	    -template $(CHARACTERDATA)/$1.java.template \
    +	    -spec $(UNICODEDATA)/UnicodeData.txt \
    +	    -specialcasing $(UNICODEDATA)/SpecialCasing.txt \
    +	    -proplist $(UNICODEDATA)/PropList.txt \
    +	    -o $(JDK_OUTPUTDIR)/gensrc/java/lang/$1.java -string \
    +	    -usecharforbyte $3
     
    -    GENSRC_CHARACTERDATA += $(JDK_OUTPUTDIR)/gensrc/java/lang/$1.java
    +  GENSRC_CHARACTERDATA += $(JDK_OUTPUTDIR)/gensrc/java/lang/$1.java
     endef
     
    -$(eval $(call SetupCharacterData,CharacterDataLatin1,,-latin1 8))
    -$(eval $(call SetupCharacterData,CharacterData00,-plane 0,11 4 1))
    -$(eval $(call SetupCharacterData,CharacterData01,-plane 1,11 4 1))
    -$(eval $(call SetupCharacterData,CharacterData02,-plane 2,11 4 1))
    -$(eval $(call SetupCharacterData,CharacterData0E,-plane 14,11 4 1))
    +$(eval $(call SetupCharacterData,CharacterDataLatin1, , -latin1 8))
    +$(eval $(call SetupCharacterData,CharacterData00, -plane 0, 11 4 1))
    +$(eval $(call SetupCharacterData,CharacterData01, -plane 1, 11 4 1))
    +$(eval $(call SetupCharacterData,CharacterData02, -plane 2, 11 4 1))
    +$(eval $(call SetupCharacterData,CharacterData0E, -plane 14, 11 4 1))
     
     # Copy two Java files that need no preprocessing.
    -$(JDK_OUTPUTDIR)/gensrc/java/lang/%.java : $(CHARACTERDATA)/%.java.template
    +$(JDK_OUTPUTDIR)/gensrc/java/lang/%.java: $(CHARACTERDATA)/%.java.template
     	$(ECHO) $(LOG_INFO) Generating $(@F)
     	$(call install-file)
     
     GENSRC_CHARACTERDATA += $(JDK_OUTPUTDIR)/gensrc/java/lang/CharacterDataUndefined.java \
    -                       $(JDK_OUTPUTDIR)/gensrc/java/lang/CharacterDataPrivateUse.java
    +    $(JDK_OUTPUTDIR)/gensrc/java/lang/CharacterDataPrivateUse.java
     
    -$(GENSRC_CHARACTERDATA) : $(BUILD_TOOLS)
    +$(GENSRC_CHARACTERDATA): $(BUILD_TOOLS)
    diff --git a/jdk/makefiles/gensrc/GensrcCharsetCoder.gmk b/jdk/makefiles/gensrc/GensrcCharsetCoder.gmk
    new file mode 100644
    index 00000000000..524c76dcc3f
    --- /dev/null
    +++ b/jdk/makefiles/gensrc/GensrcCharsetCoder.gmk
    @@ -0,0 +1,107 @@
    +#
    +# 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
    +# 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.
    +#
    +
    +GENSRC_CHARSETCODER :=
    +
    +GENSRC_CHARSETCODER_TMP := $(JDK_OUTPUTDIR)/gensrc
    +GENSRC_CHARSETCODER_DST := $(JDK_OUTPUTDIR)/gensrc/java/nio/charset
    +
    +GENSRC_CHARSETCODER_SRC := $(JDK_TOPDIR)/src/share/classes/java/nio
    +
    +GENSRC_CHARSETCODER_TEMPLATE := $(GENSRC_CHARSETCODER_SRC)/charset/Charset-X-Coder.java.template
    +
    +###
    +
    +$(GENSRC_CHARSETCODER_DST)/CharsetDecoder.java: $(GENSRC_CHARSETCODER_TEMPLATE)
    +	$(MKDIR) -p $(@D)
    +	-$(RM) $@.tmp
    +	$(TOOL_SPP) < $< >$@.tmp \
    +	    -Kdecoder \
    +	    -DA='A' \
    +	    -Da='a' \
    +	    -DCode='Decode' \
    +	    -Dcode='decode' \
    +	    -DitypesPhrase='bytes in a specific charset' \
    +	    -DotypesPhrase='sixteen-bit Unicode characters' \
    +	    -Ditype='byte' \
    +	    -Dotype='character' \
    +	    -DItype='Byte' \
    +	    -DOtype='Char' \
    +	    -Dcoder='decoder' \
    +	    -DCoder='Decoder' \
    +	    -Dcoding='decoding' \
    +	    -DOtherCoder='Encoder' \
    +	    -DreplTypeName='string' \
    +	    -DdefaultRepl='"\\uFFFD"' \
    +	    -DdefaultReplName='"\\uFFFD"<\/tt>' \
    +	    -DreplType='String' \
    +	    -DreplFQType='java.lang.String' \
    +	    -DreplLength='length()' \
    +	    -DItypesPerOtype='CharsPerByte' \
    +	    -DnotLegal='not legal for this charset' \
    +	    -Dotypes-per-itype='chars-per-byte' \
    +	    -DoutSequence='Unicode character'
    +	$(MV) $@.tmp $@
    +
    +GENSRC_CHARSETCODER += $(GENSRC_CHARSETCODER_DST)/CharsetDecoder.java
    +
    +###
    +
    +$(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java: $(GENSRC_CHARSETCODER_TEMPLATE)
    +	$(MKDIR) -p $(@D)
    +	-$(RM) $@.tmp
    +	$(TOOL_SPP) < $< >$@.tmp \
    +	    -Kencoder \
    +	    -DA='An' \
    +	    -Da='an' \
    +	    -DCode='Encode' \
    +	    -Dcode='encode' \
    +	    -DitypesPhrase='sixteen-bit Unicode characters' \
    +	    -DotypesPhrase='bytes in a specific charset' \
    +	    -Ditype='character' \
    +	    -Dotype='byte' \
    +	    -DItype='Char' \
    +	    -DOtype='Byte' \
    +	    -Dcoder='encoder' \
    +	    -DCoder='Encoder' \
    +	    -Dcoding='encoding' \
    +	    -DOtherCoder='Decoder' \
    +	    -DreplTypeName='byte array' \
    +	    -DdefaultRepl='new byte[] { (byte)'"'"\\?"'"' }' \
    +	    -DdefaultReplName='{<\/tt>\ (byte)'"'"\\?"'"'<\/tt>\ }<\/tt>' \
    +	    -DreplType='byte[]' \
    +	    -DreplFQType='byte[]' \
    +	    -DreplLength='length' \
    +	    -DItypesPerOtype='BytesPerChar' \
    +	    -DnotLegal='not a legal sixteen-bit Unicode sequence' \
    +	    -Dotypes-per-itype='bytes-per-char' \
    +	    -DoutSequence='byte sequence in the given charset'
    +	$(MV) $@.tmp $@
    +
    +GENSRC_CHARSETCODER += $(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java
    +
    +###
    +
    +$(GENSRC_CHARSETCODER): $(BUILD_TOOLS)
    diff --git a/jdk/makefiles/GensrcCharsetMapping.gmk b/jdk/makefiles/gensrc/GensrcCharsetMapping.gmk
    similarity index 72%
    rename from jdk/makefiles/GensrcCharsetMapping.gmk
    rename to jdk/makefiles/gensrc/GensrcCharsetMapping.gmk
    index 5d320927ed8..6dfc8d9e344 100644
    --- a/jdk/makefiles/GensrcCharsetMapping.gmk
    +++ b/jdk/makefiles/gensrc/GensrcCharsetMapping.gmk
    @@ -23,7 +23,7 @@
     # questions.
     #
     
    -GENSRC_CHARSETMAPPING:=
    +GENSRC_CHARSETMAPPING :=
     
     GENSRC_TMP := $(JDK_OUTPUTDIR)/gensrc
     GENSRC_DST := $(JDK_OUTPUTDIR)/gensrc/sun/nio/cs
    @@ -35,7 +35,7 @@ GENSRC_TEMPLATES := $(GENSRC_SRC)/SingleByte-X.java.template $(GENSRC_SRC)/Doubl
     
     ###
     
    -$(GENSRC_TMP)/_the.charsetmapping.dir :
    +$(GENSRC_TMP)/_the.charsetmapping.dir:
     	$(ECHO) Generating charsetmapping classes
     	$(MKDIR) -p $(GENSRC_DST)/ext
     	$(TOUCH) $@
    @@ -44,7 +44,7 @@ $(GENSRC_TMP)/_the.charsetmapping.dir :
     
     GENSRC_SB := $(GENSRC_TMP)/_the.charsetmapping.sbcs
     
    -$(GENSRC_SB) : $(GENSRC_SRC)/sbcs $(GENSRC_TEMPLATES) $(GENSRC_TMP)/_the.charsetmapping.dir
    +$(GENSRC_SB): $(GENSRC_SRC)/sbcs $(GENSRC_TEMPLATES) $(GENSRC_TMP)/_the.charsetmapping.dir
     	$(TOOL_CHARSETMAPPING) $(LOG_INFO) $(GENSRC_SRC) $(GENSRC_DST) sbcs
     	$(TOUCH) $@
     
    @@ -52,28 +52,28 @@ GENSRC_CHARSETMAPPING += $(GENSRC_SB)
     
     ###
     
    -$(GENSRC_DST)/ext/sjis0213.dat : $(GENSRC_SRC)/sjis0213.map $(GENSRC_SB)
    +$(GENSRC_DST)/ext/sjis0213.dat: $(GENSRC_SRC)/sjis0213.map $(GENSRC_SB)
     	$(TOOL_CHARSETMAPPING) $(LOG_INFO) $< $@ sjis0213
     
     GENSRC_CHARSETMAPPING += $(GENSRC_DST)/ext/sjis0213.dat
     
     ###
     
    -$(GENSRC_DST)/ext/EUC_TWMapping.java : $(GENSRC_JAVA_SRC)/EUC_TW.java $(GENSRC_SB)
    +$(GENSRC_DST)/ext/EUC_TWMapping.java: $(GENSRC_JAVA_SRC)/EUC_TW.java $(GENSRC_SB)
     	$(TOOL_CHARSETMAPPING) $(LOG_INFO) $(GENSRC_SRC) $(GENSRC_DST)/ext euctw $(GENSRC_JAVA_SRC)/EUC_TW.java
     
     GENSRC_CHARSETMAPPING += $(GENSRC_DST)/ext/EUC_TWMapping.java
     
     ###
     
    -$(GENSRC_DST)/ext/HKSCSMapping.java : $(GENSRC_JAVA_SRC)/HKSCS.java $(GENSRC_SB)
    +$(GENSRC_DST)/ext/HKSCSMapping.java: $(GENSRC_JAVA_SRC)/HKSCS.java $(GENSRC_SB)
     	$(TOOL_CHARSETMAPPING) $(LOG_INFO) $(GENSRC_SRC) $(GENSRC_DST)/ext hkscs $(GENSRC_JAVA_SRC)/HKSCS.java
     
     GENSRC_CHARSETMAPPING += $(GENSRC_DST)/ext/HKSCSMapping.java
     
     ###
     
    -$(GENSRC_TMP)/gensrc_the.charsetmapping.extsbcs : $(GENSRC_SRC)/extsbcs $(GENSRC_TEMPLATES) $(GENSRC_SB)
    +$(GENSRC_TMP)/gensrc_the.charsetmapping.extsbcs: $(GENSRC_SRC)/extsbcs $(GENSRC_TEMPLATES) $(GENSRC_SB)
     	$(TOOL_CHARSETMAPPING) $(GENSRC_SRC) $(LOG_INFO) $(GENSRC_DST)/ext extsbcs
     	$(TOUCH) $@
     
    @@ -81,7 +81,7 @@ GENSRC_CHARSETMAPPING += $(GENSRC_TMP)/gensrc_the.charsetmapping.extsbcs
     
     ###
     
    -$(GENSRC_TMP)/gensrc_the.charsetmapping.dbcs : $(GENSRC_SRC)/dbcs $(GENSRC_TEMPLATES) $(GENSRC_SB)
    +$(GENSRC_TMP)/gensrc_the.charsetmapping.dbcs: $(GENSRC_SRC)/dbcs $(GENSRC_TEMPLATES) $(GENSRC_SB)
     	$(TOOL_CHARSETMAPPING) $(GENSRC_SRC) $(LOG_INFO) $(GENSRC_DST)/ext dbcs
     	$(TOUCH) $@
     
    @@ -91,15 +91,14 @@ GENSRC_CHARSETMAPPING += $(GENSRC_TMP)/gensrc_the.charsetmapping.dbcs
     
     GENSRC_CHARSET_PROVIDER_CMD := $(JDK_TOPDIR)/makefiles/scripts/genCharsetProvider.sh
     
    -$(GENSRC_DST)/StandardCharsets.java : $(JDK_TOPDIR)/src/share/classes/sun/nio/cs/standard-charsets \
    -                                      $(GENSRC_CHARSET_PROVIDER_CMD) \
    -                                      $(GENSRC_TMP)/_the.charsetmapping.dir
    -
    +$(GENSRC_DST)/StandardCharsets.java: $(JDK_TOPDIR)/src/share/classes/sun/nio/cs/standard-charsets \
    +    $(GENSRC_CHARSET_PROVIDER_CMD) \
    +    $(GENSRC_TMP)/_the.charsetmapping.dir
     	NAWK="$(NAWK)" TEMPDIR="$(GENSRC_TMP)" SH="$(SH)" \
    -	  HASHER="$(TOOL_HASHER)" \
    -          SCRIPTS="$(JDK_TOPDIR)/makefiles/scripts" \
    -	  $(SH) -e $(GENSRC_CHARSET_PROVIDER_CMD) $(LOG_INFO) $< $(@D)
    +	    HASHER="$(TOOL_HASHER)" \
    +	    SCRIPTS="$(JDK_TOPDIR)/makefiles/scripts" \
    +	    $(SH) -e $(GENSRC_CHARSET_PROVIDER_CMD) $(LOG_INFO) $< $(@D)
     
     GENSRC_CHARSETMAPPING += $(GENSRC_DST)/StandardCharsets.java
     
    -$(GENSRC_CHARSETMAPPING) : $(BUILD_TOOLS)
    +$(GENSRC_CHARSETMAPPING): $(BUILD_TOOLS)
    diff --git a/jdk/makefiles/GensrcExceptions.gmk b/jdk/makefiles/gensrc/GensrcExceptions.gmk
    similarity index 80%
    rename from jdk/makefiles/GensrcExceptions.gmk
    rename to jdk/makefiles/gensrc/GensrcExceptions.gmk
    index a1cd39396c7..cf9c6added1 100644
    --- a/jdk/makefiles/GensrcExceptions.gmk
    +++ b/jdk/makefiles/gensrc/GensrcExceptions.gmk
    @@ -31,11 +31,11 @@ GENSRC_EXCEPTIONS_DST := $(JDK_OUTPUTDIR)/gensrc/java/nio
     GENSRC_EXCEPTIONS_SRC := $(JDK_TOPDIR)/src/share/classes/java/nio
     GENSRC_EXCEPTIONS_CMD := $(JDK_TOPDIR)/makefiles/scripts/genExceptions.sh
     
    -GENSRC_EXCEPTIONS_SRC_DIRS := . charset channels 
    +GENSRC_EXCEPTIONS_SRC_DIRS := . charset channels
     
     ###
     
    -$(GENSRC_EXCEPTIONS_DST)/_the.exceptions.dir :
    +$(GENSRC_EXCEPTIONS_DST)/_the.exceptions.dir:
     	$(ECHO) "Generating exceptions classes"
     	$(MKDIR) -p $(@D)
     	$(TOUCH) $@
    @@ -43,13 +43,13 @@ $(GENSRC_EXCEPTIONS_DST)/_the.exceptions.dir :
     
     ###
     
    -$(GENSRC_EXCEPTIONS_DST)/_the.% : $(GENSRC_EXCEPTIONS_SRC)/%/exceptions \
    -                                  $(GENSRC_EXCEPTIONS_CMD) \
    -                                  $(GENSRC_EXCEPTIONS_DST)/_the.exceptions.dir
    +$(GENSRC_EXCEPTIONS_DST)/_the.%: $(GENSRC_EXCEPTIONS_SRC)/%/exceptions \
    +    $(GENSRC_EXCEPTIONS_CMD) \
    +    $(GENSRC_EXCEPTIONS_DST)/_the.exceptions.dir
     	$(MKDIR) -p $(@D)/$*
    -	SCRIPTS="$(JDK_TOPDIR)/makefiles/scripts" NAWK="$(NAWK)" SH="$(SH)" $(SH) $(GENSRC_EXCEPTIONS_CMD) $< $(@D)/$* $(LOG_INFO) 
    +	SCRIPTS="$(JDK_TOPDIR)/makefiles/scripts" NAWK="$(NAWK)" SH="$(SH)" $(SH) $(GENSRC_EXCEPTIONS_CMD) $< $(@D)/$* $(LOG_INFO)
     	$(TOUCH) $@
     
     GENSRC_EXCEPTIONS += $(foreach D,$(GENSRC_EXCEPTIONS_SRC_DIRS),$(GENSRC_EXCEPTIONS_DST)/_the.$(D))
     
    -$(GENSRC_EXCEPTIONS) : $(BUILD_TOOLS)
    +$(GENSRC_EXCEPTIONS): $(BUILD_TOOLS)
    diff --git a/jdk/makefiles/GensrcIcons.gmk b/jdk/makefiles/gensrc/GensrcIcons.gmk
    similarity index 67%
    rename from jdk/makefiles/GensrcIcons.gmk
    rename to jdk/makefiles/gensrc/GensrcIcons.gmk
    index 01b19c702dd..f0acc3ed1ce 100644
    --- a/jdk/makefiles/GensrcIcons.gmk
    +++ b/jdk/makefiles/gensrc/GensrcIcons.gmk
    @@ -44,18 +44,18 @@ GENSRC_AWT_ICONS_SRC += \
     AWT_ICONPATH := $(JDK_TOPDIR)/src/share/classes/sun/awt/resources
     
     GENSRC_AWT_ICONS_SRC += \
    -   $(AWT_ICONPATH)/security-icon-bw16.png \
    -   $(AWT_ICONPATH)/security-icon-interim16.png \
    -   $(AWT_ICONPATH)/security-icon-yellow16.png \
    -   $(AWT_ICONPATH)/security-icon-bw24.png \
    -   $(AWT_ICONPATH)/security-icon-interim24.png \
    -   $(AWT_ICONPATH)/security-icon-yellow24.png \
    -   $(AWT_ICONPATH)/security-icon-bw32.png \
    -   $(AWT_ICONPATH)/security-icon-interim32.png \
    -   $(AWT_ICONPATH)/security-icon-yellow32.png \
    -   $(AWT_ICONPATH)/security-icon-bw48.png \
    -   $(AWT_ICONPATH)/security-icon-interim48.png \
    -   $(AWT_ICONPATH)/security-icon-yellow48.png
    +    $(AWT_ICONPATH)/security-icon-bw16.png \
    +    $(AWT_ICONPATH)/security-icon-interim16.png \
    +    $(AWT_ICONPATH)/security-icon-yellow16.png \
    +    $(AWT_ICONPATH)/security-icon-bw24.png \
    +    $(AWT_ICONPATH)/security-icon-interim24.png \
    +    $(AWT_ICONPATH)/security-icon-yellow24.png \
    +    $(AWT_ICONPATH)/security-icon-bw32.png \
    +    $(AWT_ICONPATH)/security-icon-interim32.png \
    +    $(AWT_ICONPATH)/security-icon-yellow32.png \
    +    $(AWT_ICONPATH)/security-icon-bw48.png \
    +    $(AWT_ICONPATH)/security-icon-interim48.png \
    +    $(AWT_ICONPATH)/security-icon-yellow48.png
     
     GENSRC_AWT_ICONS_FILES := $(notdir $(GENSRC_AWT_ICONS_SRC))
     
    @@ -64,7 +64,7 @@ GENSRC_AWT_ICONS_DST_NAME = AWTIcon$(2)_$(subst .,_,$(subst -,_,$(1)))
     
     ###
     
    -$(GENSRC_AWT_ICONS_TMP)/_the.icons.dir :
    +$(GENSRC_AWT_ICONS_TMP)/_the.icons.dir:
     	$(ECHO) Generating icon classes
     	$(MKDIR) -p $(GENSRC_AWT_ICONS_DST)
     	$(TOUCH) $@
    @@ -72,15 +72,15 @@ $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir :
     ###
     
     define SetupGensrcAWTIcon
    -        # param 1 is for src-file
    -        # param 2 is for src-dir
    -	$1_SHORTNAME := $(call GENSRC_AWT_ICONS_SHORT_NAME,$1)
    -	$1_NAME32 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,32)
    -	$1_TARGET32 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME32).java
    -	$1_NAME64 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,64)
    -	$1_TARGET64 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME64).java
    +  # param 1 is for src-file
    +  # param 2 is for src-dir
    +  $1_SHORTNAME := $(call GENSRC_AWT_ICONS_SHORT_NAME,$1)
    +  $1_NAME32 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,32)
    +  $1_TARGET32 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME32).java
    +  $1_NAME64 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,64)
    +  $1_TARGET64 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME64).java
     
    -$$($1_TARGET32) : $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir
    +  $$($1_TARGET32): $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir
     	$(RM) $$@ $$@.tmp
     	$(ECHO) "package sun.awt;" > $$@.tmp
     	$(ECHO) "public class $$($1_NAME32) {" >> $$@.tmp
    @@ -89,9 +89,9 @@ $$($1_TARGET32) : $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir
     	$(ECHO) "}; }" >> $$@.tmp
     	$(MV) $$@.tmp $$@
     
    -GENSRC_AWT_ICONS += $$($1_TARGET32)
    +  GENSRC_AWT_ICONS += $$($1_TARGET32)
     
    -$$($1_TARGET64) : $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir
    +  $$($1_TARGET64): $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir
     	$(RM) $$@ $$@.tmp
     	$(ECHO) "package sun.awt;" > $$@.tmp
     	$(ECHO) "public class $$($1_NAME64) {" >> $$@.tmp
    @@ -100,18 +100,18 @@ $$($1_TARGET64) : $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir
     	$(ECHO) "}; }" >> $$@.tmp
     	$(MV) $$@.tmp $$@
     
    -GENSRC_AWT_ICONS += $$($1_TARGET64)
    +  GENSRC_AWT_ICONS += $$($1_TARGET64)
     endef
     
    -$(foreach I,$(GENSRC_AWT_ICONS_SRC), $(eval $(call SetupGensrcAWTIcon,$(notdir $(I)),$(dir $(I)))))
    +$(foreach I, $(GENSRC_AWT_ICONS_SRC), $(eval $(call SetupGensrcAWTIcon,$(notdir $(I)),$(dir $(I)))))
     
     ###
     
    -ifeq ($(OPENJDK_TARGET_OS),macosx)
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
     
    -  GENSRC_OSX_ICONS_TMP  := $(JDK_OUTPUTDIR)/gensrc
    -  GENSRC_OSX_ICONS_DST  := $(GENSRC_OSX_ICONS_TMP)/sun/osxapp
    -  GENSRC_OSX_ICONS      := $(GENSRC_OSX_ICONS_DST)/AWTIconData.h
    +  GENSRC_OSX_ICONS_TMP := $(JDK_OUTPUTDIR)/gensrc
    +  GENSRC_OSX_ICONS_DST := $(GENSRC_OSX_ICONS_TMP)/sun/osxapp
    +  GENSRC_OSX_ICONS := $(GENSRC_OSX_ICONS_DST)/AWTIconData.h
     
       ifdef OPENJDK
         GENSRC_OSX_ICONS_SRC := $(JDK_TOPDIR)/src/macosx/native/sun/osxapp/resource/icons/JavaApp.icns
    @@ -119,7 +119,7 @@ ifeq ($(OPENJDK_TARGET_OS),macosx)
         GENSRC_OSX_ICONS_SRC := $(JDK_TOPDIR)/src/closed/macosx/native/sun/osxapp/resource/icons/JavaApp.icns
       endif
     
    -$(GENSRC_OSX_ICONS_DST)/AWTIconData.h: $(GENSRC_OSX_ICONS_SRC)
    +  $(GENSRC_OSX_ICONS_DST)/AWTIconData.h: $(GENSRC_OSX_ICONS_SRC)
     	$(RM) $@ $@.tmp
     	$(MKDIR) -p $(dir $@)
     	$(ECHO) "static unsigned char sAWTIconData[] = { " >> $@.tmp
    @@ -128,4 +128,3 @@ $(GENSRC_OSX_ICONS_DST)/AWTIconData.h: $(GENSRC_OSX_ICONS_SRC)
     	$(MV) $@.tmp $@
     
     endif
    -
    diff --git a/jdk/makefiles/GensrcJDWP.gmk b/jdk/makefiles/gensrc/GensrcJDWP.gmk
    similarity index 78%
    rename from jdk/makefiles/GensrcJDWP.gmk
    rename to jdk/makefiles/gensrc/GensrcJDWP.gmk
    index e2103532285..de245755c50 100644
    --- a/jdk/makefiles/GensrcJDWP.gmk
    +++ b/jdk/makefiles/gensrc/GensrcJDWP.gmk
    @@ -26,21 +26,21 @@
     # Translate the Java debugger wire protocol (jdwp.spec) file into a JDWP.java file
     # and a JDWPCommands.h C-header file.
     
    -$(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h : $(JDK_TOPDIR)/makefiles/jpda/jdwp/jdwp.spec
    +$(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h: $(JDK_TOPDIR)/makefiles/jpda/jdwp/jdwp.spec
     
    -$(JDK_OUTPUTDIR)/gensrc/com/sun/tools/jdi/JDWP.java : $(JDK_TOPDIR)/makefiles/jpda/jdwp/jdwp.spec
    +$(JDK_OUTPUTDIR)/gensrc/com/sun/tools/jdi/JDWP.java: $(JDK_TOPDIR)/makefiles/jpda/jdwp/jdwp.spec
     	$(MKDIR) -p $(@D)
     	$(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc_jdwp_headers
     	$(RM) $@ $(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h
     	$(ECHO) $(LOG_INFO) Creating JDWP.java and JDWPCommands.h from jdwp.spec
     	$(TOOL_JDWPGEN) $< -jdi $@ -include $(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h
     
    -$(JDK_OUTPUTDIR)/gensrc_jdwp_doc/jdwp-protocol.html : $(JDK_TOPDIR)/makefiles/jpda/jdwp/jdwp.spec
    +$(JDK_OUTPUTDIR)/gensrc_jdwp_doc/jdwp-protocol.html: $(JDK_TOPDIR)/makefiles/jpda/jdwp/jdwp.spec
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(ECHO) $(LOG_INFO) Creating $(@F) from jdwp.spec
     	$(TOOL_JDWPGEN) $< -doc $@
     
    -GENSRC_JDWP:=	$(JDK_OUTPUTDIR)/gensrc/com/sun/tools/jdi/JDWP.java \
    -		$(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h \
    -		$(JDK_OUTPUTDIR)/gensrc_jdwp_doc/jdwp-protocol.html
    +GENSRC_JDWP := $(JDK_OUTPUTDIR)/gensrc/com/sun/tools/jdi/JDWP.java \
    +    $(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h \
    +    $(JDK_OUTPUTDIR)/gensrc_jdwp_doc/jdwp-protocol.html
    diff --git a/jdk/makefiles/GensrcJObjC.gmk b/jdk/makefiles/gensrc/GensrcJObjC.gmk
    similarity index 61%
    rename from jdk/makefiles/GensrcJObjC.gmk
    rename to jdk/makefiles/gensrc/GensrcJObjC.gmk
    index 4f90747bb5d..899ec25545f 100644
    --- a/jdk/makefiles/GensrcJObjC.gmk
    +++ b/jdk/makefiles/gensrc/GensrcJObjC.gmk
    @@ -36,57 +36,57 @@ JOBJC_DST := $(JDK_OUTPUTDIR)/gensrc_jobjc/src
     #
     # Build generator
     #
    -$(eval $(call SetupJavaCompilation,BUILD_JOBJC_PRIMITIVE_CODER,\
    -		SETUP:=GENERATE_OLDBYTECODE,\
    -		DISABLE_SJAVAC:=true,\
    -		INCLUDES:=core/java \
    -                          com/apple,\
    -		SRC:=$(JOBJC_SRC)/src \
    -                     $(JOBJC_SRC)/src/generator/java, \
    -		BIN:=$(JOBJC_TMP)/bin))
    +$(eval $(call SetupJavaCompilation,BUILD_JOBJC_PRIMITIVE_CODER, \
    +    SETUP := GENERATE_OLDBYTECODE, \
    +    DISABLE_SJAVAC := true, \
    +    INCLUDES := core/java \
    +        com/apple, \
    +    SRC := $(JOBJC_SRC)/src \
    +        $(JOBJC_SRC)/src/generator/java, \
    +    BIN := $(JOBJC_TMP)/bin))
     
     GENSRC_JOBJC += $(BUILD_JOBJC_PRIMITIVE_CODER)
     
     #
     # Generate bridge support for select frameworks
     #
    -BRIDGESUPPORT := $(addprefix $(JOBJC_TMP)/bridge/,$(addsuffix Full.bridgesupport,$(JOBJC_FRAMEWORKS)))
    +BRIDGESUPPORT := $(addprefix $(JOBJC_TMP)/bridge/, $(addsuffix Full.bridgesupport, $(JOBJC_FRAMEWORKS)))
     
     #
     # Define macro for rules to create bridge support
    -#    Not sure why, but if the system has this framework bridge support,
    -#    we appear to copy that, otherwise we run GBM which can be very slow.
    +# Not sure why, but if the system has this framework bridge support,
    +# we appear to copy that, otherwise we run GBM which can be very slow.
     #
     define CreateBridgeSupport # Framework
    -$(RM) $@ $@.tmp
    -$(MKDIR) -p $(@D)
    -if [ -f $(FRAMEWORKS_DIR)/$1.framework/Resources/BridgeSupport/$(@F) ]; then \
    -    $(CP) $(FRAMEWORKS_DIR)/$1.framework/Resources/BridgeSupport/$(@F) $@.tmp ;\
    -else \
    -    $(GBM) $(LOG_INFO) -F complete --framework $1 -o $@.tmp ; \
    -fi
    -$(MV) $@.tmp $@
    +	$(RM) $@ $@.tmp
    +	$(MKDIR) -p $(@D)
    +	if [ -f $(FRAMEWORKS_DIR)/$1.framework/Resources/BridgeSupport/$(@F) ]; then \
    +	  $(CP) $(FRAMEWORKS_DIR)/$1.framework/Resources/BridgeSupport/$(@F) $@.tmp ; \
    +	else \
    +	  $(GBM) $(LOG_INFO) -F complete --framework $1 -o $@.tmp ; \
    +	fi
    +	$(MV) $@.tmp $@
     endef
     
     #
     # Currently 3 frameworks, avoid pattern rule due to the names being conflicting
     #
    -$(JOBJC_TMP)/bridge/FoundationFull.bridgesupport : \
    -		$(wildcard $(FRAMEWORKS_DIR)/Foundation.framework/Headers/*.h)
    +$(JOBJC_TMP)/bridge/FoundationFull.bridgesupport: \
    +    $(wildcard $(FRAMEWORKS_DIR)/Foundation.framework/Headers/*.h)
     	$(call CreateBridgeSupport,Foundation)
    -$(JOBJC_TMP)/bridge/CoreFoundationFull.bridgesupport : \
    -		$(wildcard $(FRAMEWORKS_DIR)/CoreFoundation.framework/Headers/*.h)
    +$(JOBJC_TMP)/bridge/CoreFoundationFull.bridgesupport: \
    +    $(wildcard $(FRAMEWORKS_DIR)/CoreFoundation.framework/Headers/*.h)
     	$(call CreateBridgeSupport,CoreFoundation)
    -$(JOBJC_TMP)/bridge/AppKitFull.bridgesupport : \
    -		$(wildcard $(FRAMEWORKS_DIR)/AppKit.framework/Headers/*.h)
    +$(JOBJC_TMP)/bridge/AppKitFull.bridgesupport: \
    +    $(wildcard $(FRAMEWORKS_DIR)/AppKit.framework/Headers/*.h)
     	$(call CreateBridgeSupport,AppKit)
     
     #
     # Find Xbootclasspath, for some reason, this involves firing up Java just
    -#     so we can get the boot classpath, so we can remove anything in that
    -#     classpath that ends with "JObjC.jar", and emit the new bootclasspath.
    +# so we can get the boot classpath, so we can remove anything in that
    +# classpath that ends with "JObjC.jar", and emit the new bootclasspath.
     #
    -$(JOBJC_TMP)/_the.generator_bootclasspath : $(BUILD_JOBJC_PRIMITIVE_CODER)
    +$(JOBJC_TMP)/_the.generator_bootclasspath: $(BUILD_JOBJC_PRIMITIVE_CODER)
     	$(ECHO) Generating jobjc framework bridge
     	$(RM) $@
     	$(JAVA) $(LOG_INFO) -cp $(JOBJC_TMP)/bin com.apple.internal.jobjc.generator.BootClassPathMinus JObjC.jar > $@.tmp
    @@ -94,17 +94,17 @@ $(JOBJC_TMP)/_the.generator_bootclasspath : $(BUILD_JOBJC_PRIMITIVE_CODER)
     
     #
     # Run generator
    -#    Now we use bootclasspath to run java again, with the bridge support to
    -#    generate more source.
    +# Now we use bootclasspath to run java again, with the bridge support to
    +# generate more source.
     #
    -$(JOBJC_TMP)/_the.generator : $(JOBJC_TMP)/_the.generator_bootclasspath $(BRIDGESUPPORT)
    +$(JOBJC_TMP)/_the.generator: $(JOBJC_TMP)/_the.generator_bootclasspath $(BRIDGESUPPORT)
     	$(RM) $@
     	$(JAVA) $(LOG_INFO) -d64 -Xbootclasspath:`$(CAT) $(JOBJC_TMP)/_the.generator_bootclasspath` -cp $(JOBJC_TMP)/bin -ea com.apple.internal.jobjc.generator.Generator dst=$(JOBJC_DST) frameworks=$(JOBJC_TMP)/bridge
     	$(TOUCH) $@
     
     # The generator delets all files in the target dir so it has to work in its
     # own dir and have the files copied over to gensrc aftewards.
    -$(JDK_OUTPUTDIR)/gensrc/_the.jobjc.files : $(JOBJC_TMP)/_the.generator
    +$(JDK_OUTPUTDIR)/gensrc/_the.jobjc.files: $(JOBJC_TMP)/_the.generator
     	$(MKDIR) -p $(@D)
     	$(CP) -rp $(JOBJC_DST)/* $(@D)
     	$(TOUCH) $@
    diff --git a/jdk/makefiles/GensrcLocaleDataMetaInfo.gmk b/jdk/makefiles/gensrc/GensrcLocaleDataMetaInfo.gmk
    similarity index 56%
    rename from jdk/makefiles/GensrcLocaleDataMetaInfo.gmk
    rename to jdk/makefiles/gensrc/GensrcLocaleDataMetaInfo.gmk
    index 1577017b7f2..360a032b304 100644
    --- a/jdk/makefiles/GensrcLocaleDataMetaInfo.gmk
    +++ b/jdk/makefiles/gensrc/GensrcLocaleDataMetaInfo.gmk
    @@ -28,49 +28,49 @@
     # into LocaleDataMetaInfo.java
     
     # First go look for all locale files
    -LOCALE_FILES:=$(shell $(FIND) $(JDK_TOPDIR)/src/share/classes \
    -	-name "FormatData_*.java" -o -name "FormatData_*.properties" -o \
    -	-name "CollationData_*.java" -o -name "CollationData_*.properties" -o \
    -	-name "TimeZoneNames_*.java" -o -name "TimeZoneNames_*.properties" -o \
    -	-name "LocaleNames_*.java" -o -name "LocaleNames_*.properties" -o \
    -	-name "CurrencyNames_*.java" -o -name "CurrencyNames_*.properties" -o \
    -	-name "CalendarData_*.java" -o -name "CalendarData_*.properties")
    +LOCALE_FILES := $(shell $(FIND) $(JDK_TOPDIR)/src/share/classes \
    +    -name "FormatData_*.java" -o -name "FormatData_*.properties" -o \
    +    -name "CollationData_*.java" -o -name "CollationData_*.properties" -o \
    +    -name "TimeZoneNames_*.java" -o -name "TimeZoneNames_*.properties" -o \
    +    -name "LocaleNames_*.java" -o -name "LocaleNames_*.properties" -o \
    +    -name "CurrencyNames_*.java" -o -name "CurrencyNames_*.properties" -o \
    +    -name "CalendarData_*.java" -o -name "CalendarData_*.properties")
     
    -# Then translate the locale files into for example: FormatData_sv 
    -LOCALE_RESOURCES:=$(sort $(subst .properties,,$(subst .java,,$(notdir $(LOCALE_FILES)))))
    +# Then translate the locale files into for example: FormatData_sv
    +LOCALE_RESOURCES := $(sort $(subst .properties,,$(subst .java,,$(notdir $(LOCALE_FILES)))))
     
     # Include the list of resources found during the previous compile.
     -include $(JDK_OUTPUTDIR)/gensrc/_the.locale_resources
     
    -MISSING_RESOURCES:=$(filter-out $(LOCALE_RESOURCES),$(PREV_LOCALE_RESOURCES))
    -NEW_RESOURCES:=$(filter-out $(PREV_LOCALE_RESOURCES),$(LOCALE_RESOURCES))
    +MISSING_RESOURCES := $(filter-out $(LOCALE_RESOURCES), $(PREV_LOCALE_RESOURCES))
    +NEW_RESOURCES := $(filter-out $(PREV_LOCALE_RESOURCES), $(LOCALE_RESOURCES))
     
    -ifneq (,$(MISSING_RESOURCES)$(NEW_RESOURCES))
    -    # There is a difference in the number of supported resources. Trigger a regeneration.
    -    $(shell $(RM) $(JDK_OUTPUTDIR)/gensrc/sun/util/locale/provider/LocaleDataMetaInfo.java)
    +ifneq (, $(MISSING_RESOURCES)$(NEW_RESOURCES))
    +  # There is a difference in the number of supported resources. Trigger a regeneration.
    +  $(shell $(RM) $(JDK_OUTPUTDIR)/gensrc/sun/util/locale/provider/LocaleDataMetaInfo.java)
     endif
     
     # The EN locales
    -EN_LOCALES:=en%
    +EN_LOCALES := en%
     
     # ja-JP-JP and th-TH-TH need to be manually added, as they don't have any resource files.
    -ALL_NON_EN_LOCALES:=ja-JP-JP th-TH-TH
    +ALL_NON_EN_LOCALES := ja-JP-JP th-TH-TH
     
    -SED_ARGS:=-e 's|$(HASH)warn This file is preprocessed before being compiled|// -- This file was mechanically generated: Do not edit! -- //|g'
    +SED_ARGS := -e 's|$(HASH)warn This file is preprocessed before being compiled|// -- This file was mechanically generated: Do not edit! -- //|g'
     
     # This macro creates a sed expression that substitues for example:
     # #FormatData_ENLocales# with: en% locales.
     define CaptureLocale
    -    $1_LOCALES := $$(subst _,-,$$(filter-out $1,$$(subst $1_,,$$(filter $1_%,$(LOCALE_RESOURCES)))))
    -    $1_EN_LOCALES := $$(filter $(EN_LOCALES),$$($1_LOCALES))
    -    $1_NON_EN_LOCALES := $$(filter-out $(EN_LOCALES),$$($1_LOCALES))
    +  $1_LOCALES := $$(subst _,-,$$(filter-out $1, $$(subst $1_,,$$(filter $1_%, $(LOCALE_RESOURCES)))))
    +  $1_EN_LOCALES := $$(filter $(EN_LOCALES), $$($1_LOCALES))
    +  $1_NON_EN_LOCALES := $$(filter-out $(EN_LOCALES), $$($1_LOCALES))
     
    -    ALL_EN_LOCALES += $$($1_EN_LOCALES)
    -    ALL_NON_EN_LOCALES += $$($1_NON_EN_LOCALES)
    +  ALL_EN_LOCALES += $$($1_EN_LOCALES)
    +  ALL_NON_EN_LOCALES += $$($1_NON_EN_LOCALES)
     
    -    # Don't sed in a space if there are no locales.
    -    SED_ARGS+= -e 's/$$(HASH)$1_ENLocales$$(HASH)/$$(if $$($1_EN_LOCALES),$$(SPACE)$$($1_EN_LOCALES),)/g'
    -    SED_ARGS+= -e 's/$$(HASH)$1_NonENLocales$$(HASH)/$$(if $$($1_NON_EN_LOCALES),$$(SPACE)$$($1_NON_EN_LOCALES),)/g'
    +  # Don't sed in a space if there are no locales.
    +  SED_ARGS += -e 's/$$(HASH)$1_ENLocales$$(HASH)/$$(if $$($1_EN_LOCALES),$$(SPACE)$$($1_EN_LOCALES),)/g'
    +  SED_ARGS += -e 's/$$(HASH)$1_NonENLocales$$(HASH)/$$(if $$($1_NON_EN_LOCALES),$$(SPACE)$$($1_NON_EN_LOCALES),)/g'
     endef
     
     #sun.text.resources.FormatData
    @@ -91,17 +91,17 @@ $(eval $(call CaptureLocale,CurrencyNames))
     #sun.util.resources.CalendarData
     $(eval $(call CaptureLocale,CalendarData))
     
    -SED_ARGS+= -e 's/$(HASH)AvailableLocales_ENLocales$(HASH)/$(sort $(ALL_EN_LOCALES))/g'
    -SED_ARGS+= -e 's/$(HASH)AvailableLocales_NonENLocales$(HASH)/$(sort $(ALL_NON_EN_LOCALES))/g'
    +SED_ARGS += -e 's/$(HASH)AvailableLocales_ENLocales$(HASH)/$(sort $(ALL_EN_LOCALES))/g'
    +SED_ARGS += -e 's/$(HASH)AvailableLocales_NonENLocales$(HASH)/$(sort $(ALL_NON_EN_LOCALES))/g'
     
     $(JDK_OUTPUTDIR)/gensrc/sun/util/locale/provider/LocaleDataMetaInfo.java: \
    -		$(JDK_TOPDIR)/src/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template
    +    $(JDK_TOPDIR)/src/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template
     	$(MKDIR) -p $(@D)
     	$(ECHO) Creating sun/util/LocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources.
     	$(PRINTF) "PREV_LOCALE_RESOURCES:=$(LOCALE_RESOURCES)" > $(JDK_OUTPUTDIR)/gensrc/_the.locale_resources
     	$(SED) $(SED_ARGS) $< > $@
     
    -GENSRC_LOCALEDATAMETAINFO:=$(JDK_OUTPUTDIR)/gensrc/sun/util/locale/provider/LocaleDataMetaInfo.java
    +GENSRC_LOCALEDATAMETAINFO := $(JDK_OUTPUTDIR)/gensrc/sun/util/locale/provider/LocaleDataMetaInfo.java
     
     ###
     
    @@ -110,10 +110,10 @@ GENSRC_CRBC_CMD := $(JDK_TOPDIR)/makefiles/scripts/localelist.sh
     
     JRE_NONEXIST_LOCALES := en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh
     
    -$(GENSRC_CRBC_DST) : $(JDK_TOPDIR)/src/share/classes/sun/util/CoreResourceBundleControl-XLocales.java.template \
    -                     $(GENSRC_CRBC_CMD)
    +$(GENSRC_CRBC_DST): $(JDK_TOPDIR)/src/share/classes/sun/util/CoreResourceBundleControl-XLocales.java.template \
    +    $(GENSRC_CRBC_CMD)
     	$(MKDIR) -p $(@D)
    -	NAWK="$(NAWK)" SED="$(SED)" $(SH) $(GENSRC_CRBC_CMD) "$(JRE_NONEXIST_LOCALES)" $< $@ 
    +	NAWK="$(NAWK)" SED="$(SED)" $(SH) $(GENSRC_CRBC_CMD) "$(JRE_NONEXIST_LOCALES)" $< $@
     
     GENSRC_LOCALEDATAMETAINFO += $(GENSRC_CRBC_DST)
     
    diff --git a/jdk/makefiles/gensrc/GensrcMisc.gmk b/jdk/makefiles/gensrc/GensrcMisc.gmk
    new file mode 100644
    index 00000000000..20d082046bf
    --- /dev/null
    +++ b/jdk/makefiles/gensrc/GensrcMisc.gmk
    @@ -0,0 +1,240 @@
    +#
    +# 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
    +# 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.
    +#
    +
    +include ProfileNames.gmk
    +
    +##########################################################################################
    +# Install the launcher name, release version string, full version
    +# string and the runtime name into the Version.java file.
    +# To be printed by java -version
    +
    +$(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \
    +$(PROFILE_VERSION_JAVA_TARGETS): \
    +    $(JDK_TOPDIR)/src/share/classes/sun/misc/Version.java.template
    +	$(MKDIR) -p $(@D)
    +	$(RM) $@ $@.tmp
    +	$(ECHO) Generating sun/misc/Version.java $(call profile_version_name, $@)
    +	$(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \
    +	    -e 's/@@java_version@@/$(RELEASE)/g' \
    +	    -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \
    +	    -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \
    +	    -e 's/@@java_profile_name@@/$(call profile_version_name, $@)/g' \
    +	    $< > $@.tmp
    +	$(MV) $@.tmp $@
    +
    +GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \
    +    $(PROFILE_VERSION_JAVA_TARGETS)
    +
    +##########################################################################################
    +# Version file for jconsole
    +
    +$(JDK_OUTPUTDIR)/gensrc/sun/tools/jconsole/Version.java: \
    +    $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/Version.java.template
    +	$(MKDIR) -p $(@D)
    +	$(RM) $@ $@.tmp
    +	$(ECHO) $(LOG_INFO) Generating sun/tools/jconsole/Version.java
    +	$(SED) -e 's/@@jconsole_version@@/$(FULL_VERSION)/g' $< > $@.tmp
    +	$(MV) $@.tmp $@
    +
    +GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/tools/jconsole/Version.java
    +
    +##########################################################################################
    +
    +ifeq ($(OPENJDK_TARGET_OS_API), posix)
    +  UPSUFFIX := $(OPENJDK_TARGET_OS)
    +  ifeq ($(OPENJDK_TARGET_OS), macosx)
    +    UPSUFFIX := bsd
    +  endif
    +  # UNIXProcess.java is different for solaris and linux. We need to copy
    +  # the correct UNIXProcess.java over to $(JDK_OUTPUTDIR)/gensrc/java/lang/.
    +
    +  $(JDK_OUTPUTDIR)/gensrc/java/lang/UNIXProcess.java: \
    +      $(JDK_TOPDIR)/src/solaris/classes/java/lang/UNIXProcess.java.$(UPSUFFIX)
    +	$(ECHO) $(LOG_INFO) Copying UNIXProcess.java.$(OPENJDK_TARGET_OS) to java/lang/UNIXProcess.java
    +	$(call install-file)
    +	$(CHMOD) u+rw $@
    +
    +  GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/java/lang/UNIXProcess.java
    +endif
    +
    +##########################################################################################
    +
    +GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java
    +
    +GENSRC_SOR_SRC := $(JDK_TOPDIR)/src/share/native/sun/nio/ch
    +GENSRC_SOR_SRC_FILE := genSocketOptionRegistry.c
    +GENSRC_SOR_BIN := $(JDK_OUTPUTDIR)/gensrc/genSocketOptionRegistry
    +
    +SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOR_SRC)/$(GENSRC_SOR_SRC_FILE) | \
    +    $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
    +
    +$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOR_EXE, \
    +    SRC := $(GENSRC_SOR_SRC), \
    +    INCLUDE_FILES := $(GENSRC_SOR_SRC_FILE), \
    +    LANG := C, \
    +    CC := $(BUILD_CC), \
    +    LDEXE := $(BUILD_LD), \
    +    OBJECT_DIR := $(GENSRC_SOR_BIN), \
    +    OUTPUT_DIR := $(GENSRC_SOR_BIN), \
    +    PROGRAM := genSocketOptionRegistry))
    +
    +ifneq ($(wildcard $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java), )
    +  HAS_SOCKET_OPTION_REGISTRY := true
    +endif
    +
    +ifneq ($(HAS_SOCKET_OPTION_REGISTRY), true)
    +  $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java: $(BUILD_GENSRC_SOR_EXE)
    +	$(MKDIR) -p $(@D)
    +	$(RM) $@ $@.tmp
    +	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
    +	$(BUILD_GENSRC_SOR_EXE) >> $@.tmp
    +	$(MV) $@.tmp $@
    +else
    +  $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java: $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java
    +	$(call install-file)
    +endif
    +
    +##########################################################################################
    +
    +ifneq ($(OPENJDK_TARGET_OS), windows)
    +
    +  GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java
    +
    +  GENSRC_UC_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
    +  GENSRC_UC_SRC_FILE := genUnixConstants.c
    +  GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/gensrc/genUnixConstants
    +
    +  UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \
    +      $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_GENSRC_UC_EXE, \
    +      SRC := $(GENSRC_UC_SRC), \
    +      INCLUDE_FILES := $(GENSRC_UC_SRC_FILE), \
    +      LANG := C, \
    +      CC := $(BUILD_CC), \
    +      LDEXE := $(BUILD_CC), \
    +      CFLAGS := $(filter -D%, $(CFLAGS_JDKEXE)), \
    +      OBJECT_DIR := $(GENSRC_UC_BIN), \
    +      OUTPUT_DIR := $(GENSRC_UC_BIN), \
    +      PROGRAM := genUnixConstants))
    +
    +  ifneq ($(wildcard $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java), )
    +    HAS_UNIX_CONSTANTS := true
    +  endif
    +
    +  ifneq ($(HAS_UNIX_CONSTANTS), true)
    +    $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java: $(BUILD_GENSRC_UC_EXE)
    +	$(MKDIR) -p $(@D)
    +	$(RM) $@ $@.tmp
    +	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
    +	$(BUILD_GENSRC_UC_EXE) >> $@.tmp
    +	$(MV) $@.tmp $@
    +  else
    +    $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java: $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java
    +	$(call install-file)
    +  endif
    +
    +endif
    +
    +##########################################################################################
    +
    +ifeq ($(OPENJDK_TARGET_OS), solaris)
    +
    +  GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java
    +
    +  GENSRC_SOL_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
    +  GENSRC_SOL_SRC_FILE := genSolarisConstants.c
    +  GENSRC_SOL_BIN := $(JDK_OUTPUTDIR)/gensrc/genSolarisConstants
    +
    +  SOL_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOL_SRC)/$(GENSRC_SOL_SRC_FILE) | \
    +      $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOL_EXE, \
    +      SRC := $(GENSRC_SOL_SRC), \
    +      INCLUDE_FILES := $(GENSRC_SOL_SRC_FILE), \
    +      LANG := C, \
    +      CC := $(BUILD_CC), \
    +      LDEXE := $(BUILD_CC), \
    +      OBJECT_DIR := $(GENSRC_SOL_BIN), \
    +      OUTPUT_DIR := $(GENSRC_SOL_BIN), \
    +      PROGRAM := genSolarisConstants))
    +
    +  $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java: $(BUILD_GENSRC_SOL_EXE)
    +	$(MKDIR) -p $(@D)
    +	$(RM) $@ $@.tmp
    +	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
    +	$(BUILD_GENSRC_SOL_EXE) >> $@.tmp
    +	$(MV) $@.tmp $@
    +
    +
    +endif
    +
    +##########################################################################################
    +
    +ifndef OPENJDK
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
    +
    +    AB_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc_ab
    +    AB_SRC_DIR := $(JDK_TOPDIR)/src/closed/windows/classes/com/sun/java/accessibility
    +
    +    ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
    +      $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridgeLoader.java: \
    +          $(AB_SRC_DIR)/32bit/AccessBridgeLoader.java
    +		$(install-file)
    +
    +      $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java: \
    +          $(AB_SRC_DIR)/AccessBridge.java
    +		$(install-file)
    +
    +      $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridgeLoader.java: \
    +          $(AB_SRC_DIR)/legacy/AccessBridgeLoader.java
    +		$(install-file)
    +
    +      $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java: \
    +          $(AB_SRC_DIR)/AccessBridge.java
    +		$(install-file)
    +
    +      GENSRC_MISC += $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridgeLoader.java \
    +          $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridgeLoader.java \
    +          $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java \
    +          $(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java
    +
    +    else
    +      $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridgeLoader.java: \
    +          $(AB_SRC_DIR)/64bit/AccessBridgeLoader.java
    +		$(install-file)
    +
    +      $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java: \
    +          $(AB_SRC_DIR)/AccessBridge.java
    +		$(install-file)
    +
    +      GENSRC_MISC += $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridgeLoader.java \
    +          $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java
    +
    +    endif
    +  endif
    +endif
    +
    +##########################################################################################
    diff --git a/jdk/makefiles/gensrc/GensrcProperties.gmk b/jdk/makefiles/gensrc/GensrcProperties.gmk
    new file mode 100644
    index 00000000000..6ef78028aaf
    --- /dev/null
    +++ b/jdk/makefiles/gensrc/GensrcProperties.gmk
    @@ -0,0 +1,395 @@
    +#
    +# 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
    +# 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.
    +#
    +
    +# Prepare the find cache. This is only used on windows.
    +$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/windows/classes))
    +
    +# All .properties files to be compiled are appended to this variable.
    +ALL_COMPILED_PROPSOURCES :=
    +# All generated .java files from compilation are appended to this variable.
    +ALL_COMPILED_PROPJAVAS :=
    +# The (very long) command line for compilation, stored in a file, prior to use.
    +COMPILE_PROPCMDLINE :=
    +
    +# All .properties files to be cleaned are appended to this variable.
    +ALL_CLEANED_PROPSOURCES :=
    +# All generated cleaned .properties files from cleaning are appended to this variable.
    +ALL_CLEANED_PROPOUTPUT :=
    +# The (very long) command line for cleaning, stored in a file, prior to use.
    +CLEAN_PROPCMDLINE :=
    +
    +define add_properties_to_compile
    +  # $1 is the name of the properties group
    +  # $2 is the files belonging to this group
    +  # $3 is the super class for the generated java file.
    +  # $4 is a from pattern for translating stripped name from source to target
    +  # $5 is the to pattern replacing $3 in the target
    +
    +  # Strip away prefix and suffix,
    +  # leaving for example: sun/util/resources/CurrencyNames_sv
    +  $1_PROPPATHS := $$(patsubst $(JDK_TOPDIR)/src/windows/classes/%.properties, %, \
    +      $$(patsubst $(JDK_TOPDIR)/src/macosx/classes/%.properties, %, \
    +      $$(patsubst $(JDK_TOPDIR)/src/share/classes/%.properties, %, $2)))
    +
    +  # Apply optional name transformation, example: hz_TW -> hz_HK
    +  $(if $4, $1_PROPPATHS := $$(patsubst $4, $5, $$($1_PROPPATHS)))
    +
    +  # Accumulate all found properties files.
    +  ALL_COMPILED_PROPSOURCES += $2
    +
    +  # Generate the list of to be created java files.
    +  ALL_COMPILED_PROPJAVAS += $$(patsubst %, $(JDK_OUTPUTDIR)/gensrc/%.java, $$($1_PROPPATHS))
    +
    +  # Now generate a sequence of "-compile ...CurrencyNames_sv.properties ...CurrencyNames_sv.java ListResourceBundle"
    +  # suitable to be fed into the CompileProperties command.
    +  COMPILE_PROPCMDLINE += $$(subst _SPACE_,$(SPACE),$$(join $$(addprefix -compile_SPACE_, $2), \
    +      $$(addsuffix _SPACE_$(strip $3), \
    +      $$(addprefix _SPACE_$(JDK_OUTPUTDIR)/gensrc/, \
    +      $$(addsuffix .java, $$($1_PROPPATHS))))))
    +endef
    +
    +define add_properties_to_clean
    +  # $1 is the name of the properties group
    +  # $2 is the files belonging to this group
    +  # $3 is a from pattern for translating stripped name from source to target
    +  # $4 is the to pattern replacing $3 in the target
    +  # $5 optional name of extra directory to put properties files in (ex: resources)
    +
    +  # Strip away prefix and suffix,
    +  # leaving for example: sun/util/resources/CurrencyNames_sv
    +  $1_PROPPATHS := $$(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/%.properties, %, \
    +      $$(patsubst $(JDK_TOPDIR)/src/share/classes/%.properties, %, $2))
    +
    +  # Apply optional name transformation, example: hz_TW -> hz_HK
    +  $(if $3, $1_PROPPATHS := $$(patsubst $3, $4, $$($1_PROPPATHS)))
    +
    +  # Accumulate all found properties files.
    +  ALL_CLEANED_PROPSOURCES += $2
    +
    +  # Generate the list of to be created java files.
    +  $1_PROPOUTPUT := $$(patsubst %, $(JDK_OUTPUTDIR)/classes/%.properties, $$($1_PROPPATHS))
    +  # If the properties target file isn't in a "resources" dir, add one.
    +  ifneq ($5, )
    +    $1_PROPOUTPUT := $$(foreach p, $$($1_PROPOUTPUT), $$(dir $$p)$5/$$(notdir $$p))
    +  endif
    +
    +  ALL_CLEANED_PROPOUTPUT += $$($1_PROPOUTPUT)
    +
    +  # Now generate a sequence of "-clean ...[src]...CurrencyNames_sv.properties ...[build]...CurrencyNames_sv.properties"
    +  # suitable to be fed into the StripProperties command.
    +  CLEAN_PROPCMDLINE += $$(subst _SPACE_,$(SPACE),$$(join $$(addprefix -clean_SPACE_,$2), \
    +      $$(addprefix _SPACE_, $$($1_PROPOUTPUT))))
    +endef
    +
    +# Some packages contain pregenerated java files instead of properties files.
    +# But unfortunately not all properties should be converted, some should be
    +# copied....argggghhh.
    +
    +# For example:
    +#    sun/applet/resources
    +#    sun/misc/resources
    +#    sun/text/resources
    +#    sun/tools/jconsole/resources
    +#    sun/tools/native2ascii/resources
    +#    sun/util/resources
    +
    +# Some packages have properties that need to be converted to java source files.
    +
    +#com/apple/laf/resources
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  $(eval $(call add_properties_to_compile,COM_APPLE_LAF, \
    +      $(filter %.properties, \
    +      $(call CacheFind, $(JDK_TOPDIR)/src/macosx/classes/com/apple/laf/resources)), \
    +      ListResourceBundle))
    +endif
    +
    +#com/sun/accessibility/internal/resources
    +$(eval $(call add_properties_to_compile,COM_SUN_ACCESSIBILITY, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/accessibility/internal/resources)), \
    +    ListResourceBundle))
    +$(eval $(call add_properties_to_compile,COM_SUN_ACCESSIBILITY_HK, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/accessibility/internal/resources)), \
    +    ListResourceBundle, %zh_TW, %zh_HK))
    +#com/sun/imageio/plugins/common
    +$(eval $(call add_properties_to_clean,COM_SUN_IMAGEIO, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/imageio))))
    +#com/sun/java/swing/plaf/gtk/resources
    +ifneq ($(OPENJDK_TARGET_OS), windows)
    +  # Only compile GTK resource bundles on Solaris/Linux
    +  $(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_GTK, \
    +      $(filter %.properties, \
    +      $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk/resources)), \
    +      ListResourceBundle))
    +  $(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_GTK_HK, \
    +      $(filter %.properties, \
    +      $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk/resources)), \
    +      ListResourceBundle, %zh_TW, %zh_HK))
    +endif
    +#com/sun/java/swing/plaf/motif/resources
    +$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_MOTIF, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif/resources)), \
    +    ListResourceBundle))
    +$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_MOTIF_HK, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif/resources)), \
    +    ListResourceBundle, %zh_TW, %zh_HK))
    +#com/sun/java/swing/plaf/windows/resources
    +$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_WINDOWS, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows/resources)), \
    +    ListResourceBundle))
    +$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_WINDOWS_HK, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows/resources)), \
    +    ListResourceBundle, %zh_TW, %zh_HK))
    +#com/sun/java/util/jar/pack
    +$(eval $(call add_properties_to_clean,JNDI_COSNAMING, \
    +    $(JDK_TOPDIR)/src/share/classes/com/sun/java/util/jar/pack/intrinsic.properties))
    +#com/sun/jndi/cosnaming
    +$(eval $(call add_properties_to_clean,JNDI_COSNAMING, \
    +    $(JDK_TOPDIR)/src/share/classes/com/sun/jndi/cosnaming/jndiprovider.properties))
    +#com/sun/jndi/ldap
    +$(eval $(call add_properties_to_clean,JNDI_COSNAMING, \
    +    $(JDK_TOPDIR)/src/share/classes/com/sun/jndi/ldap/jndiprovider.properties))
    +
    +#com/sun/org/apache/xml/internal/security/resource
    +#FIXME: The "xmlsecurity*.properties" pattern is not ideal; we might want to find
    +#a better way to select the properties files that are needed.
    +$(eval $(call add_properties_to_clean,XML_SECURITY, \
    +    $(filter $(JDK_TOPDIR)/src/share/classes/com/sun/org/apache/xml/internal/security/resource/xmlsecurity%.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/org/apache/xml/internal/security/resource))))
    +
    +#com/sun/rowset
    +$(eval $(call add_properties_to_clean,COM_SUN_ROWSET, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/rowset))))
    +$(eval $(call add_properties_to_clean,COM_SUN_ROWSET_HK, \
    +    $(filter %zh_TW.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/rowset)), \
    +    %zh_TW, %zh_HK))
    +
    +#com/sun/swing/internal/plaf/basic/resources
    +$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_BASIC, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/basic/resources)), \
    +    ListResourceBundle))
    +$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_BASIC_HK, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/basic/resources)), \
    +    ListResourceBundle, %zh_TW, %zh_HK))
    +#com/sun/swing/internal/plaf/metal/resources
    +$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_METAL, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/metal/resources)), \
    +    ListResourceBundle))
    +$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_METAL_HK, \
    +    $(filter %.properties, $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/metal/resources)), \
    +    ListResourceBundle, %zh_TW, %zh_HK))
    +#com/sun/swing/internal/plaf/synth/resources
    +$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_SYNTH, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/synth/resources)), \
    +    ListResourceBundle))
    +$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_SYNTH_HK, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/synth/resources)), \
    +    ListResourceBundle, %zh_TW, %zh_HK))
    +
    +#com/sun/tools/jdi/resources
    +$(eval $(call add_properties_to_compile,COM_SUN_TOOLS_JDI, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/tools/jdi/resources)), \
    +    ListResourceBundle))
    +
    +#com/sun/tools/script/shell
    +#java/util
    +#javax/sql/rowset
    +$(eval $(call add_properties_to_clean,JAVAX_SQL_ROWSET, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/javax/sql/rowset))))
    +#sun/awt/resources
    +$(eval $(call add_properties_to_compile,SUN_AWT, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/awt/resources)), \
    +    ListResourceBundle))
    +$(eval $(call add_properties_to_compile,SUN_AWT_HK, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/awt/resources)), \
    +    ListResourceBundle, %zh_TW, %zh_HK))
    +#sun/awt/windows/
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  $(eval $(call add_properties_to_compile,SUN_AWT, \
    +      $(filter $(JDK_TOPDIR)/src/windows/classes/sun/awt/windows/awtLocalization%.properties, \
    +      $(call CacheFind, $(JDK_TOPDIR)/src/windows/classes/sun/awt/windows)), \
    +      ListResourceBundle))
    +  $(eval $(call add_properties_to_compile,SUN_AWT_HK, \
    +      $(filter $(JDK_TOPDIR)/src/windows/classes/sun/awt/windows/awtLocalization%.properties, \
    +      $(call CacheFind, $(JDK_TOPDIR)/src/windows/classes/sun/awt/windows)), \
    +      ListResourceBundle, %zh_TW, %zh_HK))
    +endif
    +# os x specific awt properties
    +ifeq ($(OPENJDK_TARGET_OS),macosx)
    +$(eval $(call add_properties_to_compile,SUN_AWT,\
    +	$(filter $(JDK_TOPDIR)/src/macosx/classes/sun/awt/resources/%.properties,\
    +	$(call CacheFind,$(JDK_TOPDIR)/src/macosx/classes/sun/awt/resources)),\
    +	ListResourceBundle))
    +endif
    +
    +#sun/launcher/resources
    +$(eval $(call add_properties_to_compile,SUN_LAUNCHER, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/launcher/resources)), \
    +    ListResourceBundle))
    +$(eval $(call add_properties_to_compile,SUN_LAUNCHER_HK, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/launcher/resources)), \
    +    ListResourceBundle, %zh_TW, %zh_HK))
    +#sun/management/resources
    +$(eval $(call add_properties_to_compile,SUN_MANAGEMENT, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/management/resources)), \
    +    ListResourceBundle))
    +$(eval $(call add_properties_to_compile,SUN_MANAGEMENT_KH, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/management/resources)), \
    +    ListResourceBundle, %zh_TW, %zh_HK))
    +#sun/print
    +#sun/print/resources
    +$(eval $(call add_properties_to_compile,SUN_PRINT, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/print/resources)), \
    +    ListResourceBundle))
    +$(eval $(call add_properties_to_compile,SUN_PRINT_HK, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/print/resources)), \
    +    ListResourceBundle, %zh_TW, %zh_HK))
    +#sun/rmi/registry/resources
    +$(eval $(call add_properties_to_clean,SUN_RMI_REGISTRY, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/rmi/registry/resources))))
    +$(eval $(call add_properties_to_clean,SUN_RMI_REGISTRY_HK, \
    +    $(filter %zh_TW.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/rmi/registry/resources)), \
    +    %zh_TW, %zh_HK))
    +
    +#sun/rmi/rmic/resources
    +$(eval $(call add_properties_to_clean,SUN_RMI_RMIC, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/rmi/rmic/resources))))
    +
    +#sun/rmi/server/resources
    +$(eval $(call add_properties_to_clean,SUN_RMI_SERVER, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/rmi/server/resources))))
    +$(eval $(call add_properties_to_clean,SUN_RMI_SERVER_HK, \
    +    $(filter %zh_TW.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/rmi/server/resources)), \
    +    %zh_TW, %zh_HK))
    +
    +# sun/tools/jar/resources
    +$(eval $(call add_properties_to_compile,SUN_TOOLS_JAR, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/tools/jar/resources)), \
    +    ListResourceBundle))
    +$(eval $(call add_properties_to_compile,SUN_TOOLS_JAR_HK, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/tools/jar/resources)), \
    +    ListResourceBundle, %zh_TW, %zh_HK))
    +
    +#sun/tools/javac/resources
    +# It's unclear if the other localized property files here are supposed to be copied or not
    +# but the old build system didn't copy them.
    +$(eval $(call add_properties_to_clean,SUN_TOOLS_SERIALVER, \
    +    $(filter %javac.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/tools/javac/resources))))
    +
    +#sun/tools/jconsole/resources
    +$(eval $(call add_properties_to_clean,SUN_TOOLS_JCONSOLE, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/resources))))
    +
    +#sun/tools/serialver
    +$(eval $(call add_properties_to_clean,SUN_TOOLS_SERIALVER, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/tools/serialver)), , ,resources))
    +
    +#sun/util/logging/resources
    +$(eval $(call add_properties_to_compile,SUN_UTIL_LOGGING, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/util/logging/resources)), \
    +    ListResourceBundle))
    +$(eval $(call add_properties_to_compile,SUN_UTIL_LOGGING_HK, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/util/logging/resources)), \
    +    ListResourceBundle, %zh_TW, %zh_HK))
    +# sun/util/resources
    +$(eval $(call add_properties_to_compile,SUN_UTIL, \
    +    $(filter %.properties, \
    +    $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/sun/util/resources)), \
    +    sun.util.resources.LocaleNamesBundle))
    +
    +# Now setup the rule for the generation of the resource bundles.
    +$(JDK_OUTPUTDIR)/gensrc/_the.compiled_properties: $(ALL_COMPILED_PROPSOURCES) $(BUILD_TOOLS)
    +        # Generate all output directories in advance since the build tool does not do that...
    +	$(MKDIR) -p $(sort $(dir $(ALL_COMPILED_PROPJAVAS)))
    +	$(ECHO) Compiling $(words $(ALL_COMPILED_PROPSOURCES)) properties into resource bundles
    +	$(call ListPathsSafely,COMPILE_PROPCMDLINE,\n, >> $(JDK_OUTPUTDIR)/gensrc/_the.cmdline)
    +	$(TOOL_COMPILEPROPERTIES) -quiet @$(JDK_OUTPUTDIR)/gensrc/_the.cmdline
    +	$(TOUCH) $@
    +
    +# Now setup the rule for the generation of the cleaned properties.
    +# FIXME: We currently don't handle removed properties incrementally.
    +$(JDK_OUTPUTDIR)/classes/_the.cleaned_properties: $(ALL_CLEANED_PROPSOURCES) $(BUILD_TOOLS)
    +	$(RM) $(JDK_OUTPUTDIR)/classes/_the.cleaned_properties.cmdline
    +        # Generate all output directories in advance since the build tool does not do that...
    +	$(MKDIR) -p $(sort $(dir $(ALL_CLEANED_PROPOUTPUT)))
    +	$(ECHO) Copying and cleaning $(words $(ALL_CLEANED_PROPSOURCES)) properties
    +	$(call ListPathsSafely,CLEAN_PROPCMDLINE,\n, >> $(JDK_OUTPUTDIR)/classes/_the.cleaned_properties.cmdline)
    +	$(TOOL_STRIPPROPERTIES) @$(JDK_OUTPUTDIR)/classes/_the.cleaned_properties.cmdline
    +	$(TOUCH) $@
    +
    +$(ALL_COMPILED_PROPJAVAS): $(JDK_OUTPUTDIR)/gensrc/_the.compiled_properties
    +
    +$(ALL_CLEANED_PROPOUTPUT): $(JDK_OUTPUTDIR)/classes/_the.cleaned_properties
    +
    +
    +# Some zh_HK resources are just copied of zh_TW
    +$(JDK_OUTPUTDIR)/gensrc/%_zh_HK.java: $(JDK_TOPDIR)/src/share/classes/%_zh_TW.java
    +	$(MKDIR) -p $(@D)
    +	$(CAT) $< | $(SED) -e '/class/s/_zh_TW/_zh_HK/' > $@
    +
    +ZH_HK_JAVA := sun/applet/resources/MsgAppletViewer_zh_HK.java \
    +    sun/misc/resources/Messages_zh_HK.java \
    +    sun/security/util/AuthResources_zh_HK.java \
    +    sun/security/util/Resources_zh_HK.java
    +
    +ZH_HK_JAVA_FILES := $(addprefix $(JDK_OUTPUTDIR)/gensrc/, $(ZH_HK_JAVA))
    +
    +
    +GENSRC_PROPERTIES := $(ALL_COMPILED_PROPJAVAS) $(ALL_CLEANED_PROPOUTPUT) $(ZH_HK_JAVA_FILES)
    diff --git a/jdk/makefiles/GensrcSwing.gmk b/jdk/makefiles/gensrc/GensrcSwing.gmk
    similarity index 72%
    rename from jdk/makefiles/GensrcSwing.gmk
    rename to jdk/makefiles/gensrc/GensrcSwing.gmk
    index 5350c143b73..cfdc78d3ca5 100644
    --- a/jdk/makefiles/GensrcSwing.gmk
    +++ b/jdk/makefiles/gensrc/GensrcSwing.gmk
    @@ -25,7 +25,7 @@
     
     #
     # Generate java files for javax.swing.plaf package
    -# 
    +#
     NIMBUS_PACKAGE = javax.swing.plaf
     NIMBUS_GENSRC_DIR = $(JDK_OUTPUTDIR)/gensrc/javax/swing/plaf/nimbus
     NIMBUS_SKIN_FILE = $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/nimbus/skin.laf
    @@ -48,22 +48,22 @@ GENSRC_SWING_NIMBUS := $(JDK_OUTPUTDIR)/gensrc/_the.generated_nimbus
     DOCLETSRC_DIR = $(JDK_TOPDIR)/make/tools/swing-beans
     
     # javax.swing package
    -BEANS	    = AbstractButton Box JComponent JApplet JButton		\
    -	      JCheckBox JCheckBoxMenuItem JComboBox JColorChooser	\
    -	      JDesktopPane JDialog JEditorPane JFileChooser JFrame	\
    -	      JFormattedTextField JInternalFrame JLabel JLayeredPane	\
    -	      JList JMenu JMenuBar JMenuItem JOptionPane JPanel		\
    -	      JPasswordField JPopupMenu JProgressBar JRadioButton	\
    -	      JRadioButtonMenuItem JScrollBar JScrollPane JSeparator	\
    -	      JSlider JSplitPane JSpinner JTabbedPane JTable		\
    -	      JTextArea JTextField JTextPane JToggleButton JToolBar	\
    -	      JTree JWindow
    +BEANS = AbstractButton Box JComponent JApplet JButton \
    +    JCheckBox JCheckBoxMenuItem JComboBox JColorChooser \
    +    JDesktopPane JDialog JEditorPane JFileChooser JFrame \
    +    JFormattedTextField JInternalFrame JLabel JLayeredPane \
    +    JList JMenu JMenuBar JMenuItem JOptionPane JPanel \
    +    JPasswordField JPopupMenu JProgressBar JRadioButton \
    +    JRadioButtonMenuItem JScrollBar JScrollPane JSeparator \
    +    JSlider JSplitPane JSpinner JTabbedPane JTable \
    +    JTextArea JTextField JTextPane JToggleButton JToolBar \
    +    JTree JWindow
     
     # javax.swing.text package
     BEANS_TEXT = JTextComponent
     
     BEANS_SRC = $(BEANS:%=$(JDK_TOPDIR)/src/share/classes/javax/swing/%.java) \
    -	    $(BEANS_TEXT:%=$(JDK_TOPDIR)/src/share/classes/javax/swing/text/%.java)
    +    $(BEANS_TEXT:%=$(JDK_TOPDIR)/src/share/classes/javax/swing/text/%.java)
     
     # Dummy variable so far, in the old build system it was false by default
     SWINGBEAN_DEBUG_FLAG = false
    @@ -71,21 +71,21 @@ SWINGBEAN_DEBUG_FLAG = false
     # LocaleDataMetaInfo needs to be generated before running this to avoid confusing errors
     # in the build log.
     $(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo: $(BEANS_SRC) \
    -		$(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/SwingBeanInfoBase.java \
    -		$(JDK_OUTPUTDIR)/gensrc/sun/swing/BeanInfoUtils.java $(BUILD_TOOLS) \
    -		| $(GENSRC_LOCALEDATAMETAINFO)
    +    $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/SwingBeanInfoBase.java \
    +    $(JDK_OUTPUTDIR)/gensrc/sun/swing/BeanInfoUtils.java $(BUILD_TOOLS) \
    +    | $(GENSRC_LOCALEDATAMETAINFO)
     	$(ECHO) Generating beaninfo
     	$(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing
     	$(JAVA) -Djava.awt.headless=true $(NEW_JAVADOC) \
    -	-sourcepath "$(JDK_TOPDIR)/src/share/classes$(PATH_SEP)$(JDK_OUTPUTDIR)/gensrc" \
    -	 -doclet GenDocletBeanInfo \
    -	-x $(SWINGBEAN_DEBUG_FLAG) -d $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing \
    -	-t $(DOCLETSRC_DIR)/SwingBeanInfo.template -docletpath $(JDK_OUTPUTDIR)/btclasses \
    -	-XDignore.symbol.file=true \
    -	-classpath $(JDK_OUTPUTDIR)/btclasses $(BEANS_SRC) $(LOG_INFO)
    -#       Move the JTextComponent into its proper package directory.
    +	    -sourcepath "$(JDK_TOPDIR)/src/share/classes$(PATH_SEP)$(JDK_OUTPUTDIR)/gensrc" \
    +	    -doclet GenDocletBeanInfo \
    +	    -x $(SWINGBEAN_DEBUG_FLAG) -d $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing \
    +	    -t $(DOCLETSRC_DIR)/SwingBeanInfo.template -docletpath $(JDK_OUTPUTDIR)/btclasses \
    +	    -XDignore.symbol.file=true \
    +	    -classpath $(JDK_OUTPUTDIR)/btclasses $(BEANS_SRC) $(LOG_INFO)
    +        # Move the JTextComponent into its proper package directory.
     	$(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/text
    -	$(MV) $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/JTextComponentBeanInfo.java $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/text/JTextComponentBeanInfo.java 
    +	$(MV) $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/JTextComponentBeanInfo.java $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/text/JTextComponentBeanInfo.java
     	$(TOUCH) $@
     
     # This file is the part of dt.jar
    @@ -94,7 +94,7 @@ $(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo: $(BEANS_SRC) \
     $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/SwingBeanInfoBase.java: $(DOCLETSRC_DIR)/javax/swing/SwingBeanInfoBase.java
     	$(call install-file)
     
    -# This file is the part of dt.jar 
    +# This file is the part of dt.jar
     # For some reason it is under $(JDK_TOPDIR)/make/tools/swing-beans/sun/swing
     # Should it be moved under $(JDK_TOPDIR)/src/share/classes/sun/swing instead?
     $(JDK_OUTPUTDIR)/gensrc/sun/swing/BeanInfoUtils.java: $(DOCLETSRC_DIR)/sun/swing/BeanInfoUtils.java
    diff --git a/jdk/makefiles/GensrcX11Wrappers.gmk b/jdk/makefiles/gensrc/GensrcX11Wrappers.gmk
    similarity index 65%
    rename from jdk/makefiles/GensrcX11Wrappers.gmk
    rename to jdk/makefiles/gensrc/GensrcX11Wrappers.gmk
    index 934ddbed32b..4da4f37b2d9 100644
    --- a/jdk/makefiles/GensrcX11Wrappers.gmk
    +++ b/jdk/makefiles/gensrc/GensrcX11Wrappers.gmk
    @@ -48,75 +48,74 @@ GENSRC_SIZER_DIR := $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator
     GENSRC_X11_VERSION := $(OPENJDK_TARGET_CPU_BITS)
     ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
       ifneq ($(OPENJDK_TARGET_OS), linux)
    -  # On all 64-bit systems except Linux, generate both 32 and 64 bit versions
    -  GENSRC_X11_VERSION := 32 64
    +    # On all 64-bit systems except Linux, generate both 32 and 64 bit versions
    +    GENSRC_X11_VERSION := 32 64
       endif
     else
       ifeq ($(OPENJDK_TARGET_OS), solaris)
    -  # As a special case, solaris 32-bit also generates the 64-bit version
    -  GENSRC_X11_VERSION := 32 64
    +    # As a special case, solaris 32-bit also generates the 64-bit version
    +    GENSRC_X11_VERSION := 32 64
       endif
     endif
     
    -GENSRC_X11_SIZES_USED := $(addprefix $(GENSRC_X11WRAPPERS_TMP)/sizes.,$(GENSRC_X11_VERSION))
    +GENSRC_X11_SIZES_USED := $(addprefix $(GENSRC_X11WRAPPERS_TMP)/sizes., $(GENSRC_X11_VERSION))
     
    -# Copy only the sizes.* files that are actually needed. WrapperGenerator picks up any it finds from the 
    +# Copy only the sizes.* files that are actually needed. WrapperGenerator picks up any it finds from the
     # file prefix it is given so those not needed need to be hidden.
     $(GENSRC_X11WRAPPERS_TMP)/sizes.%: $(GENSRC_SIZER_DIR)/sizes.%
     	$(MKDIR) -p $(@D)
     	$(RM) '$@'
     	$(SORT) $< > $@
     
    -# Run the tool on the offset files copied from the source repository to generate several Java classes 
    +# Run the tool on the offset files copied from the source repository to generate several Java classes
     # used in awt.
    -$(JDK_OUTPUTDIR)/gensrc/_the.generated.x11 : $(GENSRC_X11_SIZES_USED) $(BUILD_TOOLS)
    +$(JDK_OUTPUTDIR)/gensrc/_the.generated.x11: $(GENSRC_X11_SIZES_USED) $(BUILD_TOOLS)
     	$(MKDIR) -p $(GENSRC_X11WRAPPERS_DST)
     	$(TOOL_WRAPPERGENERATOR) $(GENSRC_X11WRAPPERS_DST) $(GENSRC_SIZER_DIR)/xlibtypes.txt "gen" $(GENSRC_X11WRAPPERS_TMP)/sizes
     	$(TOUCH) $@
     
     GENSRC_X11WRAPPERS += $(JDK_OUTPUTDIR)/gensrc/_the.generated.x11
     
    -ifneq ($(COMPILE_TYPE),cross)
    -    # This is not a cross compile, regenerate the offset file, so that we
    -    # can compare it with the version in the source code repository.
    +ifneq ($(COMPILE_TYPE), cross)
    +  # This is not a cross compile, regenerate the offset file, so that we
    +  # can compare it with the version in the source code repository.
     
    -    # Generate the C code for the program that will output the offset file.
    -    $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c : $(GENSRC_SIZER_DIR)/xlibtypes.txt $(BUILD_TOOLS)
    +  # Generate the C code for the program that will output the offset file.
    +  $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c: $(GENSRC_SIZER_DIR)/xlibtypes.txt $(BUILD_TOOLS)
     	$(ECHO) "Generating X11 wrapper ($*-bit version)"
     	$(MKDIR) -p $(@D)
     	$(TOOL_WRAPPERGENERATOR) $(@D) $(GENSRC_SIZER_DIR)/xlibtypes.txt "sizer" $*
     
    -    # use -m32/-m64 only if the compiler supports it
    -    ifeq ($(COMPILER_SUPPORTS_TARGET_BITS_FLAG),true)
    -    MEMORY_MODEL_FLAG="-m$*"
    -    endif
    +  # use -m32/-m64 only if the compiler supports it
    +  ifeq ($(COMPILER_SUPPORTS_TARGET_BITS_FLAG), true)
    +    MEMORY_MODEL_FLAG = "-m$*"
    +  endif
     
    -    # Compile the C code into an executable.
    -    $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe : $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c
    +  # Compile the C code into an executable.
    +  $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c
     	$(MKDIR) -p $(@D)
     	(cd $(@D) && $(CC) $(MEMORY_MODEL_FLAG) -o $@ $< \
    -              $(X_CFLAGS) \
    -              $(X_LIBS) \
    -              -I$(JDK_OUTPUTDIR)/include \
    -              -I$(JDK_TOPDIR)/src/share/javavm/export \
    -              -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export \
    -              -I$(JDK_TOPDIR)/src/share/native/common \
    -              -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \
    -              -I$(JDK_TOPDIR)/src/solaris/native/sun/awt \
    -	      -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -	      -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils -lc)
    +	    $(X_CFLAGS) \
    +	    $(X_LIBS) \
    +	    -I$(JDK_OUTPUTDIR)/include \
    +	    -I$(JDK_TOPDIR)/src/share/javavm/export \
    +	    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_EXPORT_DIR)/javavm/export \
    +	    -I$(JDK_TOPDIR)/src/share/native/common \
    +	    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \
    +	    -I$(JDK_TOPDIR)/src/solaris/native/sun/awt \
    +	    -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    +	    -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils -lc)
     
    -    .PRECIOUS: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c
    +  .PRECIOUS: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c
     
    -    # Run the executable create the offset file and check that it is identical
    -    # to the offset file in the source code repository.
    -    $(GENSRC_X11WRAPPERS_TMP)/sizes.%.verification : $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe
    +  # Run the executable create the offset file and check that it is identical
    +  # to the offset file in the source code repository.
    +  $(GENSRC_X11WRAPPERS_TMP)/sizes.%.verification: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe
     	$(MKDIR) -p $(@D)
     	$(GENSRC_X11WRAPPERS_TMP)/sizer.$*.exe | $(SORT) > $@.tmp
     	$(ECHO) Verifying $(GENSRC_X11WRAPPERS_TMP)/sizes.$*.verification.tmp to $(GENSRC_X11WRAPPERS_TMP)/sizes.$*
     	$(DIFF) $(GENSRC_X11WRAPPERS_TMP)/sizes.$*.verification.tmp $(GENSRC_X11WRAPPERS_TMP)/sizes.$*
     	mv $@.tmp $@
     
    -    GENSRC_X11WRAPPERS += $(GENSRC_X11WRAPPERS_TMP)/sizes.$(OPENJDK_TARGET_CPU_BITS).verification
    +  GENSRC_X11WRAPPERS += $(GENSRC_X11WRAPPERS_TMP)/sizes.$(OPENJDK_TARGET_CPU_BITS).verification
     endif
    -
    diff --git a/jdk/makefiles/jpda/jdwp/jdwp.spec b/jdk/makefiles/jpda/jdwp/jdwp.spec
    index 910fffa57ef..6078ae6d3c5 100644
    --- a/jdk/makefiles/jpda/jdwp/jdwp.spec
    +++ b/jdk/makefiles/jpda/jdwp/jdwp.spec
    @@ -25,42 +25,42 @@
     
     JDWP "Java(tm) Debug Wire Protocol"
     (CommandSet VirtualMachine=1
    -    (Command Version=1 
    +    (Command Version=1
             "Returns the JDWP version implemented by the target VM. "
    -	"The version string format is implementation dependent. "
    -	(Out 
    +        "The version string format is implementation dependent. "
    +        (Out
             )
    -        (Reply 
    -	    (string description "Text information on the VM version")
    -	    (int    jdwpMajor   "Major JDWP Version number")
    -	    (int    jdwpMinor   "Minor JDWP Version number")
    -	    (string vmVersion   "Target VM JRE version, as in the java.version property")
    -	    (string vmName      "Target VM name, as in the java.vm.name property")
    +        (Reply
    +            (string description "Text information on the VM version")
    +            (int    jdwpMajor   "Major JDWP Version number")
    +            (int    jdwpMinor   "Minor JDWP Version number")
    +            (string vmVersion   "Target VM JRE version, as in the java.version property")
    +            (string vmName      "Target VM name, as in the java.vm.name property")
             )
             (ErrorSet
    -            (Error VM_DEAD)   
    +            (Error VM_DEAD)
             )
         )
         (Command ClassesBySignature=2
             "Returns reference types for all the classes loaded by the target VM "
    -	"which match the given signature. "
    -	"Multple reference types will be returned if two or more class "
    -	"loaders have loaded a class of the same name. "
    -	"The search is confined to loaded classes only; no attempt is made "
    -	"to load a class of the given signature. "
    -	(Out
    -	    (string signature "JNI signature of the class to find "
    -	                      "(for example, \"Ljava/lang/String;\"). "
    +        "which match the given signature. "
    +        "Multple reference types will be returned if two or more class "
    +        "loaders have loaded a class of the same name. "
    +        "The search is confined to loaded classes only; no attempt is made "
    +        "to load a class of the given signature. "
    +        (Out
    +            (string signature "JNI signature of the class to find "
    +                              "(for example, \"Ljava/lang/String;\"). "
                 )
             )
    -        (Reply 
    -            (Repeat classes "Number of reference types that follow." 
    +        (Reply
    +            (Repeat classes "Number of reference types that follow."
                     (Group ClassInfo
                         (byte refTypeTag  "Kind "
    -		                      "of following reference type. ")
    +                                      "of following reference type. ")
                         (referenceTypeID typeID "Matching loaded reference type")
                         (int status "The current class "
    -		                "status. ")
    +                                "status. ")
                     )
                 )
             )
    @@ -70,19 +70,19 @@ JDWP "Java(tm) Debug Wire Protocol"
         )
         (Command AllClasses=3
             "Returns reference types for all classes currently loaded by the "
    -	"target VM."
    -	(Out 
    +        "target VM."
    +        (Out
             )
    -        (Reply 
    -            (Repeat classes "Number of reference types that follow." 
    +        (Reply
    +            (Repeat classes "Number of reference types that follow."
                     (Group ClassInfo
                         (byte refTypeTag  "Kind "
    -		                      "of following reference type. ")
    +                                      "of following reference type. ")
                         (referenceTypeID typeID "Loaded reference type")
    -                    (string signature 
    +                    (string signature
                                     "The JNI signature of the loaded reference type")
                         (int status "The current class "
    -		                "status. ")
    +                                "status. ")
                     )
                 )
             )
    @@ -92,16 +92,16 @@ JDWP "Java(tm) Debug Wire Protocol"
         )
         (Command AllThreads=4
             "Returns all threads currently running in the target VM . "
    -	"The returned list contains threads created through "
    -	"java.lang.Thread, all native threads attached to "
    -	"the target VM through JNI, and system threads created "
    -	"by the target VM. Threads that have not yet been started "
    -	"and threads that have completed their execution are not "
    -	"included in the returned list. "
    +        "The returned list contains threads created through "
    +        "java.lang.Thread, all native threads attached to "
    +        "the target VM through JNI, and system threads created "
    +        "by the target VM. Threads that have not yet been started "
    +        "and threads that have completed their execution are not "
    +        "included in the returned list. "
             (Out
             )
             (Reply
    -            (Repeat threads "Number of threads that follow." 
    +            (Repeat threads "Number of threads that follow."
                     (threadObject thread "A running thread")
                 )
             )
    @@ -111,12 +111,12 @@ JDWP "Java(tm) Debug Wire Protocol"
         )
         (Command TopLevelThreadGroups=5
             "Returns all thread groups that do not have a parent. This command "
    -	"may be used as the first step in building a tree (or trees) of the "
    -	"existing thread groups."
    +        "may be used as the first step in building a tree (or trees) of the "
    +        "existing thread groups."
             (Out
             )
             (Reply
    -            (Repeat groups "Number of thread groups that follow." 
    +            (Repeat groups "Number of thread groups that follow."
                     (threadGroupObject group "A top level thread group")
                 )
             )
    @@ -125,29 +125,29 @@ JDWP "Java(tm) Debug Wire Protocol"
             )
         )
         (Command Dispose=6
    -	"Invalidates this virtual machine mirror. "
    -	"The communication channel to the target VM is closed, and "
    -	"the target VM prepares to accept another subsequent connection "
    -	"from this debugger or another debugger, including the "
    -	"following tasks: "
    -	"
      " - "
    • All event requests are cancelled. " - "
    • All threads suspended by the thread-level " - "resume command " - "or the VM-level " - "resume command " - "are resumed as many times as necessary for them to run. " - "
    • Garbage collection is re-enabled in all cases where it was " - "disabled " - "
    " - "Any current method invocations executing in the target VM " - "are continued after the disconnection. Upon completion of any such " - "method invocation, the invoking thread continues from the " - "location where it was originally stopped. " - "

    " - "Resources originating in " - "this VirtualMachine (ObjectReferences, ReferenceTypes, etc.) " - "will become invalid. " + "Invalidates this virtual machine mirror. " + "The communication channel to the target VM is closed, and " + "the target VM prepares to accept another subsequent connection " + "from this debugger or another debugger, including the " + "following tasks: " + "

      " + "
    • All event requests are cancelled. " + "
    • All threads suspended by the thread-level " + "resume command " + "or the VM-level " + "resume command " + "are resumed as many times as necessary for them to run. " + "
    • Garbage collection is re-enabled in all cases where it was " + "disabled " + "
    " + "Any current method invocations executing in the target VM " + "are continued after the disconnection. Upon completion of any such " + "method invocation, the invoking thread continues from the " + "location where it was originally stopped. " + "

    " + "Resources originating in " + "this VirtualMachine (ObjectReferences, ReferenceTypes, etc.) " + "will become invalid. " (Out ) (Reply @@ -157,8 +157,8 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command IDSizes=7 "Returns the sizes of variably-sized data types in the target VM." - "The returned values indicate the number of bytes used by the " - "identifiers in command and reply packets." + "The returned values indicate the number of bytes used by the " + "identifiers in command and reply packets." (Out ) (Reply @@ -173,15 +173,15 @@ JDWP "Java(tm) Debug Wire Protocol" ) ) (Command Suspend=8 - "Suspends the execution of the application running in the target " - "VM. All Java threads currently running will be suspended. " - "

    " - "Unlike java.lang.Thread.suspend, " - "suspends of both the virtual machine and individual threads are " - "counted. Before a thread will run again, it must be resumed through " - "the VM-level resume command " - "or the thread-level resume command " - "the same number of times it has been suspended. " + "Suspends the execution of the application running in the target " + "VM. All Java threads currently running will be suspended. " + "

    " + "Unlike java.lang.Thread.suspend, " + "suspends of both the virtual machine and individual threads are " + "counted. Before a thread will run again, it must be resumed through " + "the VM-level resume command " + "or the thread-level resume command " + "the same number of times it has been suspended. " (Out ) (Reply @@ -193,9 +193,9 @@ JDWP "Java(tm) Debug Wire Protocol" (Command Resume=9 "Resumes execution of the application after the suspend " "command or an event has stopped it. " - "Suspensions of the Virtual Machine and individual threads are " - "counted. If a particular thread is suspended n times, it must " - "resumed n times before it will continue. " + "Suspensions of the Virtual Machine and individual threads are " + "counted. If a particular thread is suspended n times, it must " + "resumed n times before it will continue. " (Out ) (Reply @@ -207,10 +207,10 @@ JDWP "Java(tm) Debug Wire Protocol" "Terminates the target VM with the given exit code. " "On some platforms, the exit code might be truncated, for " "example, to the low order 8 bits. " - "All ids previously returned from the target VM become invalid. " - "Threads running in the VM are abruptly terminated. " - "A thread death exception is not thrown and " - "finally blocks are not run." + "All ids previously returned from the target VM become invalid. " + "Threads running in the VM are abruptly terminated. " + "A thread death exception is not thrown and " + "finally blocks are not run." (Out (int exitCode "the exit code") ) @@ -221,12 +221,12 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command CreateString=11 "Creates a new string object in the target VM and returns " - "its id. " + "its id. " (Out - (string utf "UTF-8 characters to use in the created string. ") + (string utf "UTF-8 characters to use in the created string. ") ) (Reply - (stringObject stringObject + (stringObject stringObject "Created string (instance of java.lang.String) ") ) (ErrorSet @@ -235,32 +235,32 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command Capabilities=12 "Retrieve this VM's capabilities. The capabilities are returned " - "as booleans, each indicating the presence or absence of a " - "capability. The commands associated with each capability will " - "return the NOT_IMPLEMENTED error if the cabability is not " - "available." + "as booleans, each indicating the presence or absence of a " + "capability. The commands associated with each capability will " + "return the NOT_IMPLEMENTED error if the cabability is not " + "available." (Out ) (Reply - (boolean canWatchFieldModification - "Can the VM watch field modification, and therefore " - "can it send the Modification Watchpoint Event?") - (boolean canWatchFieldAccess - "Can the VM watch field access, and therefore " - "can it send the Access Watchpoint Event?") - (boolean canGetBytecodes - "Can the VM get the bytecodes of a given method? ") - (boolean canGetSyntheticAttribute - "Can the VM determine whether a field or method is " - "synthetic? (that is, can the VM determine if the " - "method or the field was invented by the compiler?) ") - (boolean canGetOwnedMonitorInfo - "Can the VM get the owned monitors infornation for " - "a thread?") - (boolean canGetCurrentContendedMonitor - "Can the VM get the current contended monitor of a thread?") - (boolean canGetMonitorInfo - "Can the VM get the monitor information for a given object? ") + (boolean canWatchFieldModification + "Can the VM watch field modification, and therefore " + "can it send the Modification Watchpoint Event?") + (boolean canWatchFieldAccess + "Can the VM watch field access, and therefore " + "can it send the Access Watchpoint Event?") + (boolean canGetBytecodes + "Can the VM get the bytecodes of a given method? ") + (boolean canGetSyntheticAttribute + "Can the VM determine whether a field or method is " + "synthetic? (that is, can the VM determine if the " + "method or the field was invented by the compiler?) ") + (boolean canGetOwnedMonitorInfo + "Can the VM get the owned monitors infornation for " + "a thread?") + (boolean canGetCurrentContendedMonitor + "Can the VM get the current contended monitor of a thread?") + (boolean canGetMonitorInfo + "Can the VM get the monitor information for a given object? ") ) (ErrorSet (Error VM_DEAD) @@ -268,13 +268,13 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command ClassPaths=13 "Retrieve the classpath and bootclasspath of the target VM. " - "If the classpath is not defined, returns an empty list. If the " + "If the classpath is not defined, returns an empty list. If the " "bootclasspath is not defined returns an empty list." (Out ) (Reply - (string baseDir "Base directory used to resolve relative " - "paths in either of the following lists.") + (string baseDir "Base directory used to resolve relative " + "paths in either of the following lists.") (Repeat classpaths "Number of paths in classpath." (string path "One component of classpath") ) (Repeat bootclasspaths "Number of paths in bootclasspath." @@ -297,32 +297,32 @@ JDWP "Java(tm) Debug Wire Protocol" "The sender of this command " "promises that no further commands will be sent " "referencing a freed ID. - "

    " - "Use of this command is not required. If it is not sent, " - "resources associated with each ID will be freed by the back-end " - "at some time after the corresponding object is garbage collected. " - "It is most useful to use this command to reduce the load on the " - "back-end if a very large number of " - "objects has been retrieved from the back-end (a large array, " - "for example) but may not be garbage collected any time soon. " - "

    " + "

    " + "Use of this command is not required. If it is not sent, " + "resources associated with each ID will be freed by the back-end " + "at some time after the corresponding object is garbage collected. " + "It is most useful to use this command to reduce the load on the " + "back-end if a very large number of " + "objects has been retrieved from the back-end (a large array, " + "for example) but may not be garbage collected any time soon. " + "

    " "IDs may be re-used by the back-end after they " "have been freed with this command." "This description assumes reference counting, " "a back-end may use any implementation which operates " "equivalently. " - (Out - (Repeat requests "Number of object dispose requests that follow" - (Group Request - (object object "The object ID") - (int refCnt "The number of times this object ID has been " - "part of a packet received from the back-end. " - "An accurate count prevents the object ID " - "from being freed on the back-end if " - "it is part of an incoming packet, not yet " - "handled by the front-end.") - ) - ) + (Out + (Repeat requests "Number of object dispose requests that follow" + (Group Request + (object object "The object ID") + (int refCnt "The number of times this object ID has been " + "part of a packet received from the back-end. " + "An accurate count prevents the object ID " + "from being freed on the back-end if " + "it is part of an incoming packet, not yet " + "handled by the front-end.") + ) + ) ) (Reply ) @@ -331,16 +331,16 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command HoldEvents=15 "Tells the target VM to stop sending events. Events are not discarded; " - "they are held until a subsequent ReleaseEvents command is sent. " - "This command is useful to control the number of events sent " - "to the debugger VM in situations where very large numbers of events " - "are generated. " - "While events are held by the debugger back-end, application " - "execution may be frozen by the debugger back-end to prevent " - "buffer overflows on the back end. - "Responses to commands are never held and are not affected by this - "command. If events are already being held, this command is " - "ignored." + "they are held until a subsequent ReleaseEvents command is sent. " + "This command is useful to control the number of events sent " + "to the debugger VM in situations where very large numbers of events " + "are generated. " + "While events are held by the debugger back-end, application " + "execution may be frozen by the debugger back-end to prevent " + "buffer overflows on the back end. + "Responses to commands are never held and are not affected by this + "command. If events are already being held, this command is " + "ignored." (Out ) (Reply @@ -350,9 +350,9 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command ReleaseEvents=16 "Tells the target VM to continue sending events. This command is " - "used to restore normal activity after a HoldEvents command. If " - "there is no current HoldEvents command in effect, this command is " - "ignored." + "used to restore normal activity after a HoldEvents command. If " + "there is no current HoldEvents command in effect, this command is " + "ignored." (Out ) (Reply @@ -362,112 +362,112 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command CapabilitiesNew=17 "Retrieve all of this VM's capabilities. The capabilities are returned " - "as booleans, each indicating the presence or absence of a " - "capability. The commands associated with each capability will " - "return the NOT_IMPLEMENTED error if the cabability is not " - "available." + "as booleans, each indicating the presence or absence of a " + "capability. The commands associated with each capability will " + "return the NOT_IMPLEMENTED error if the cabability is not " + "available." "Since JDWP version 1.4." (Out ) (Reply - (boolean canWatchFieldModification - "Can the VM watch field modification, and therefore " - "can it send the Modification Watchpoint Event?") - (boolean canWatchFieldAccess - "Can the VM watch field access, and therefore " - "can it send the Access Watchpoint Event?") - (boolean canGetBytecodes - "Can the VM get the bytecodes of a given method? ") - (boolean canGetSyntheticAttribute - "Can the VM determine whether a field or method is " - "synthetic? (that is, can the VM determine if the " - "method or the field was invented by the compiler?) ") - (boolean canGetOwnedMonitorInfo - "Can the VM get the owned monitors infornation for " - "a thread?") - (boolean canGetCurrentContendedMonitor - "Can the VM get the current contended monitor of a thread?") - (boolean canGetMonitorInfo - "Can the VM get the monitor information for a given object? ") - (boolean canRedefineClasses - "Can the VM redefine classes?") - (boolean canAddMethod - "Can the VM add methods when redefining " + (boolean canWatchFieldModification + "Can the VM watch field modification, and therefore " + "can it send the Modification Watchpoint Event?") + (boolean canWatchFieldAccess + "Can the VM watch field access, and therefore " + "can it send the Access Watchpoint Event?") + (boolean canGetBytecodes + "Can the VM get the bytecodes of a given method? ") + (boolean canGetSyntheticAttribute + "Can the VM determine whether a field or method is " + "synthetic? (that is, can the VM determine if the " + "method or the field was invented by the compiler?) ") + (boolean canGetOwnedMonitorInfo + "Can the VM get the owned monitors infornation for " + "a thread?") + (boolean canGetCurrentContendedMonitor + "Can the VM get the current contended monitor of a thread?") + (boolean canGetMonitorInfo + "Can the VM get the monitor information for a given object? ") + (boolean canRedefineClasses + "Can the VM redefine classes?") + (boolean canAddMethod + "Can the VM add methods when redefining " "classes?") - (boolean canUnrestrictedlyRedefineClasses - "Can the VM redefine classes" + (boolean canUnrestrictedlyRedefineClasses + "Can the VM redefine classes" "in arbitrary ways?") (boolean canPopFrames - "Can the VM pop stack frames?") + "Can the VM pop stack frames?") (boolean canUseInstanceFilters - "Can the VM filter events by specific object?") + "Can the VM filter events by specific object?") (boolean canGetSourceDebugExtension - "Can the VM get the source debug extension?") + "Can the VM get the source debug extension?") (boolean canRequestVMDeathEvent - "Can the VM request VM death events?") + "Can the VM request VM death events?") (boolean canSetDefaultStratum - "Can the VM set a default stratum?") + "Can the VM set a default stratum?") (boolean canGetInstanceInfo - "Can the VM return instances, counts of instances of classes " + "Can the VM return instances, counts of instances of classes " "and referring objects?") (boolean canRequestMonitorEvents - "Can the VM request monitor events?") + "Can the VM request monitor events?") (boolean canGetMonitorFrameInfo - "Can the VM get monitors with frame depth info?") + "Can the VM get monitors with frame depth info?") (boolean canUseSourceNameFilters - "Can the VM filter class prepare events by source name?") + "Can the VM filter class prepare events by source name?") (boolean canGetConstantPool - "Can the VM return the constant pool information?") + "Can the VM return the constant pool information?") (boolean canForceEarlyReturn - "Can the VM force early return from a method?") + "Can the VM force early return from a method?") (boolean reserved22 - "Reserved for future capability") + "Reserved for future capability") (boolean reserved23 - "Reserved for future capability") + "Reserved for future capability") (boolean reserved24 - "Reserved for future capability") + "Reserved for future capability") (boolean reserved25 - "Reserved for future capability") + "Reserved for future capability") (boolean reserved26 - "Reserved for future capability") + "Reserved for future capability") (boolean reserved27 - "Reserved for future capability") + "Reserved for future capability") (boolean reserved28 - "Reserved for future capability") + "Reserved for future capability") (boolean reserved29 - "Reserved for future capability") + "Reserved for future capability") (boolean reserved30 - "Reserved for future capability") + "Reserved for future capability") (boolean reserved31 - "Reserved for future capability") + "Reserved for future capability") (boolean reserved32 - "Reserved for future capability") + "Reserved for future capability") ) (ErrorSet (Error VM_DEAD) ) ) (Command RedefineClasses=18 - "Installs new class definitions. " - "If there are active stack frames in methods of the redefined classes in the " - "target VM then those active frames continue to run the bytecodes of the " - "original method. These methods are considered obsolete - see " - "IsObsolete. The methods in the " - "redefined classes will be used for new invokes in the target VM. " - "The original method ID refers to the redefined method. " - "All breakpoints in the redefined classes are cleared." - "If resetting of stack frames is desired, the " - "PopFrames command can be used " - "to pop frames with obsolete methods." - "

    " - "Requires canRedefineClasses capability - see " - "CapabilitiesNew. " - "In addition to the canRedefineClasses capability, the target VM must " - "have the canAddMethod capability to add methods when redefining classes, " - "or the canUnrestrictedlyRedefineClasses to redefine classes in arbitrary " - "ways." - (Out - (Repeat classes "Number of reference types that follow." + "Installs new class definitions. " + "If there are active stack frames in methods of the redefined classes in the " + "target VM then those active frames continue to run the bytecodes of the " + "original method. These methods are considered obsolete - see " + "IsObsolete. The methods in the " + "redefined classes will be used for new invokes in the target VM. " + "The original method ID refers to the redefined method. " + "All breakpoints in the redefined classes are cleared." + "If resetting of stack frames is desired, the " + "PopFrames command can be used " + "to pop frames with obsolete methods." + "

    " + "Requires canRedefineClasses capability - see " + "CapabilitiesNew. " + "In addition to the canRedefineClasses capability, the target VM must " + "have the canAddMethod capability to add methods when redefining classes, " + "or the canUnrestrictedlyRedefineClasses to redefine classes in arbitrary " + "ways." + (Out + (Repeat classes "Number of reference types that follow." (Group ClassDef (referenceType refType "The reference type.") (Repeat classfile "Number of bytes defining class (below)" @@ -477,7 +477,7 @@ JDWP "Java(tm) Debug Wire Protocol" ) ) ) - (Reply + (Reply ) (ErrorSet (Error INVALID_CLASS "One of the refTypes is not the ID of a reference " @@ -501,9 +501,9 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command SetDefaultStratum=19 "Set the default stratum. Requires canSetDefaultStratum capability - see " - "CapabilitiesNew." - (Out - (string stratumID "default stratum, or empty string to use " + "CapabilitiesNew." + (Out + (string stratumID "default stratum, or empty string to use " "reference type default.") ) (Reply @@ -515,28 +515,28 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command AllClassesWithGeneric=20 "Returns reference types for all classes currently loaded by the " - "target VM. " + "target VM. " "Both the JNI signature and the generic signature are " "returned for each class. " - "Generic signatures are described in the signature attribute " + "Generic signatures are described in the signature attribute " "section in " "The Java™ Virtual Machine Specification. " "Since JDWP version 1.5." - (Out + (Out ) - (Reply - (Repeat classes "Number of reference types that follow." + (Reply + (Repeat classes "Number of reference types that follow." (Group ClassInfo (byte refTypeTag "Kind " - "of following reference type. ") + "of following reference type. ") (referenceTypeID typeID "Loaded reference type") - (string signature + (string signature "The JNI signature of the loaded reference type.") - (string genericSignature + (string genericSignature "The generic signature of the loaded reference type " "or an empty string if there is none.") (int status "The current class " - "status. ") + "status. ") ) ) ) @@ -544,7 +544,7 @@ JDWP "Java(tm) Debug Wire Protocol" (Error VM_DEAD) ) ) - + (Command InstanceCounts=21 "Returns the number of instances of each reference type in the input list. " "Only instances that are reachable for the purposes of " @@ -574,18 +574,18 @@ JDWP "Java(tm) Debug Wire Protocol" (CommandSet ReferenceType=2 (Command Signature=1 "Returns the JNI signature of a reference type. " - "JNI signature formats are described in the " - "Java Native Inteface Specification" - "

    - "For primitive classes " - "the returned signature is the signature of the corresponding primitive " - "type; for example, \"I\" is returned as the signature of the class " - "represented by java.lang.Integer.TYPE." - (Out + "JNI signature formats are described in the " + "Java Native Inteface Specification" + "

    + "For primitive classes " + "the returned signature is the signature of the corresponding primitive " + "type; for example, \"I\" is returned as the signature of the class " + "represented by java.lang.Integer.TYPE." + (Out (referenceType refType "The reference type ID.") ) (Reply - (string signature + (string signature "The JNI signature for the reference type.") ) (ErrorSet @@ -598,7 +598,7 @@ JDWP "Java(tm) Debug Wire Protocol" (Command ClassLoader=2 "Returns the instance of java.lang.ClassLoader which loaded " "a given reference type. If the reference type was loaded by the " - "system class loader, the returned object ID is null." + "system class loader, the returned object ID is null." (Out (referenceType refType "The reference type ID.") ) @@ -614,16 +614,16 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command Modifiers=3 "Returns the modifiers (also known as access flags) for a reference type. " - "The returned bit mask contains information on the declaration " - "of the reference type. If the reference type is an array or " - "a primitive class (for example, java.lang.Integer.TYPE), the " - "value of the returned bit mask is undefined." + "The returned bit mask contains information on the declaration " + "of the reference type. If the reference type is an array or " + "a primitive class (for example, java.lang.Integer.TYPE), the " + "value of the returned bit mask is undefined." (Out (referenceType refType "The reference type ID.") ) (Reply (int modBits "Modifier bits as defined in Chapter 4 of " - "The Java™ Virtual Machine Specification") + "The Java™ Virtual Machine Specification") ) (ErrorSet (Error INVALID_CLASS "refType is not the ID of a reference " @@ -635,8 +635,8 @@ JDWP "Java(tm) Debug Wire Protocol" (Command Fields=4 "Returns information for each field in a reference type. " "Inherited fields are not included. " - "The field list will include any synthetic fields created " - "by the compiler. " + "The field list will include any synthetic fields created " + "by the compiler. " "Fields are returned in the order they occur in the class file." (Out (referenceType refType "The reference type ID.") @@ -648,13 +648,13 @@ JDWP "Java(tm) Debug Wire Protocol" (string name "Name of field.") (string signature "JNI Signature of field.") (int modBits "The modifier bit flags (also known as access flags) " - "which provide additional information on the " + "which provide additional information on the " "field declaration. Individual flag values are " - "defined in Chapter 4 of " - "The Java™ Virtual Machine Specification. " - "In addition, The 0xf0000000 bit identifies " - "the field as synthetic, if the synthetic attribute " - "capability is available.") + "defined in Chapter 4 of " + "The Java™ Virtual Machine Specification. " + "In addition, The 0xf0000000 bit identifies " + "the field as synthetic, if the synthetic attribute " + "capability is available.") ) ) ) @@ -669,9 +669,9 @@ JDWP "Java(tm) Debug Wire Protocol" (Command Methods=5 "Returns information for each method in a reference type. " "Inherited methods are not included. The list of methods will " - "include constructors (identified with the name \"<init>\"), " - "the initialization method (identified with the name \"<clinit>\") " - "if present, and any synthetic methods created by the compiler. " + "include constructors (identified with the name \"<init>\"), " + "the initialization method (identified with the name \"<clinit>\") " + "if present, and any synthetic methods created by the compiler. " "Methods are returned in the order they occur in the class file." (Out (referenceType refType "The reference type ID.") @@ -683,13 +683,13 @@ JDWP "Java(tm) Debug Wire Protocol" (string name "Name of method.") (string signature "JNI signature of method.") (int modBits "The modifier bit flags (also known as access flags) " - "which provide additional information on the " + "which provide additional information on the " "method declaration. Individual flag values are " - "defined in Chapter 4 of " - "The Java™ Virtual Machine Specification. " - "In addition, The 0xf0000000 bit identifies " - "the method as synthetic, if the synthetic attribute " - "capability is available.") + "defined in Chapter 4 of " + "The Java™ Virtual Machine Specification. " + "In addition, The 0xf0000000 bit identifies " + "the method as synthetic, if the synthetic attribute " + "capability is available.") ) ) ) @@ -703,13 +703,13 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command GetValues=6 "Returns the value of one or more static fields of the " - "reference type. Each field must be member of the reference type " - "or one of its superclasses, superinterfaces, or implemented interfaces. " - "Access control is not enforced; for example, the values of private " - "fields can be obtained." + "reference type. Each field must be member of the reference type " + "or one of its superclasses, superinterfaces, or implemented interfaces. " + "Access control is not enforced; for example, the values of private " + "fields can be obtained." (Out (referenceType refType "The reference type ID.") - (Repeat fields "The number of values to get" + (Repeat fields "The number of values to get" (Group Field (field fieldID "A field to get") ) @@ -717,7 +717,7 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Reply (Repeat values "The number of values returned, always equal to fields, " - "the number of values to get." + "the number of values to get." (value value "The field value") ) ) @@ -731,19 +731,19 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command SourceFile=7 "Returns the name of source file in which a reference type was " - "declared. " + "declared. " (Out (referenceType refType "The reference type ID.") ) (Reply (string sourceFile "The source file name. No path information " - "for the file is included") + "for the file is included") ) - (ErrorSet + (ErrorSet (Error INVALID_CLASS "refType is not the ID of a reference " "type.") (Error INVALID_OBJECT "refType is not a known ID.") - (Error ABSENT_INFORMATION "The source file attribute is absent.") + (Error ABSENT_INFORMATION "The source file attribute is absent.") (Error VM_DEAD) ) ) @@ -757,7 +757,7 @@ JDWP "Java(tm) Debug Wire Protocol" (Repeat classes "The number of nested classes and interfaces" (Group TypeInfo (byte refTypeTag "Kind " - "of following reference type. ") + "of following reference type. ") (referenceTypeID typeID "The nested class or interface ID.") ) ) @@ -771,15 +771,15 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command Status=9 "Returns the current status of the reference type. The status " - "indicates the extent to which the reference type has been " - "initialized, as described in section 2.1.6 of " - "The Java™ Virtual Machine Specification. " - "If the class is linked the PREPARED and VERIFIED bits in the returned status bits " - "will be set. If the class is initialized the INITIALIZED bit in the returned " - "status bits will be set. If an error occured during initialization then the " - "ERROR bit in the returned status bits will be set. " - "The returned status bits are undefined for array types and for " - "primitive classes (such as java.lang.Integer.TYPE). " + "indicates the extent to which the reference type has been " + "initialized, as described in section 2.1.6 of " + "The Java™ Virtual Machine Specification. " + "If the class is linked the PREPARED and VERIFIED bits in the returned status bits " + "will be set. If the class is initialized the INITIALIZED bit in the returned " + "status bits will be set. If an error occured during initialization then the " + "ERROR bit in the returned status bits will be set. " + "The returned status bits are undefined for array types and for " + "primitive classes (such as java.lang.Integer.TYPE). " (Out (referenceType refType "The reference type ID.") ) @@ -831,7 +831,7 @@ JDWP "Java(tm) Debug Wire Protocol" (Command SourceDebugExtension=12 "Returns the value of the SourceDebugExtension attribute. " "Since JDWP version 1.4. Requires canGetSourceDebugExtension capability - see " - "CapabilitiesNew." + "CapabilitiesNew." (Out (referenceType refType "The reference type ID.") ) @@ -850,18 +850,18 @@ JDWP "Java(tm) Debug Wire Protocol" (Command SignatureWithGeneric=13 "Returns the JNI signature of a reference type along with the " "generic signature if there is one. " - "Generic signatures are described in the signature attribute " + "Generic signatures are described in the signature attribute " "section in " "The Java™ Virtual Machine Specification. " "Since JDWP version 1.5." - "

    - (Out + "

    + (Out (referenceType refType "The reference type ID.") ) (Reply - (string signature + (string signature "The JNI signature for the reference type.") - (string genericSignature + (string genericSignature "The generic signature for the reference type or an empty " "string if there is none.") ) @@ -876,10 +876,10 @@ JDWP "Java(tm) Debug Wire Protocol" "Returns information, including the generic signature if any, " "for each field in a reference type. " "Inherited fields are not included. " - "The field list will include any synthetic fields created " - "by the compiler. " + "The field list will include any synthetic fields created " + "by the compiler. " "Fields are returned in the order they occur in the class file. " - "Generic signatures are described in the signature attribute " + "Generic signatures are described in the signature attribute " "section in " "The Java™ Virtual Machine Specification. " "Since JDWP version 1.5." @@ -895,13 +895,13 @@ JDWP "Java(tm) Debug Wire Protocol" (string genericSignature "The generic signature of the " "field, or an empty string if there is none.") (int modBits "The modifier bit flags (also known as access flags) " - "which provide additional information on the " + "which provide additional information on the " "field declaration. Individual flag values are " - "defined in Chapter 4 of " - "The Java™ Virtual Machine Specification. " - "In addition, The 0xf0000000 bit identifies " - "the field as synthetic, if the synthetic attribute " - "capability is available.") + "defined in Chapter 4 of " + "The Java™ Virtual Machine Specification. " + "In addition, The 0xf0000000 bit identifies " + "the field as synthetic, if the synthetic attribute " + "capability is available.") ) ) ) @@ -917,11 +917,11 @@ JDWP "Java(tm) Debug Wire Protocol" "Returns information, including the generic signature if any, " "for each method in a reference type. " "Inherited methodss are not included. The list of methods will " - "include constructors (identified with the name \"<init>\"), " - "the initialization method (identified with the name \"<clinit>\") " - "if present, and any synthetic methods created by the compiler. " + "include constructors (identified with the name \"<init>\"), " + "the initialization method (identified with the name \"<clinit>\") " + "if present, and any synthetic methods created by the compiler. " "Methods are returned in the order they occur in the class file. " - "Generic signatures are described in the signature attribute " + "Generic signatures are described in the signature attribute " "section in " "The Java™ Virtual Machine Specification. " "Since JDWP version 1.5." @@ -937,13 +937,13 @@ JDWP "Java(tm) Debug Wire Protocol" (string genericSignature "The generic signature of the method, or " "an empty string if there is none.") (int modBits "The modifier bit flags (also known as access flags) " - "which provide additional information on the " + "which provide additional information on the " "method declaration. Individual flag values are " - "defined in Chapter 4 of " - "The Java™ Virtual Machine Specification. " - "In addition, The 0xf0000000 bit identifies " - "the method as synthetic, if the synthetic attribute " - "capability is available.") + "defined in Chapter 4 of " + "The Java™ Virtual Machine Specification. " + "In addition, The 0xf0000000 bit identifies " + "the method as synthetic, if the synthetic attribute " + "capability is available.") ) ) ) @@ -956,16 +956,16 @@ JDWP "Java(tm) Debug Wire Protocol" ) ) (Command Instances=16 - "Returns instances of this reference type. " + "Returns instances of this reference type. " "Only instances that are reachable for the purposes of " "garbage collection are returned. " "

    Since JDWP version 1.6. Requires canGetInstanceInfo capability - see " - "CapabilitiesNew." + "CapabilitiesNew." (Out (referenceType refType "The reference type ID.") (int maxInstances "Maximum number of instances to return. Must be non-negative. " "If zero, all instances are returned.") - ) + ) (Reply (Repeat instances "The number of instances that follow." (tagged-object instance "An instance of this reference type.") @@ -981,22 +981,22 @@ JDWP "Java(tm) Debug Wire Protocol" ) ) (Command ClassFileVersion=17 - "Returns the class file major and minor version numbers, as defined in the class " + "Returns the class file major and minor version numbers, as defined in the class " "file format of the Java Virtual Machine specification. " "

    Since JDWP version 1.6. " (Out (referenceType refType "The class.") ) (Reply - (int majorVersion "Major version number") - (int minorVersion "Minor version number") + (int majorVersion "Major version number") + (int minorVersion "Minor version number") ) (ErrorSet (Error INVALID_CLASS "refType is not the ID of a reference " "type.") (Error INVALID_OBJECT "refType is not a known ID.") - (Error ABSENT_INFORMATION "The class file version information is " - "absent for primitive and array types.") + (Error ABSENT_INFORMATION "The class file version information is " + "absent for primitive and array types.") (Error VM_DEAD) ) ) @@ -1005,7 +1005,7 @@ JDWP "Java(tm) Debug Wire Protocol" "constant_pool item of the Class File Format in " "The Java™ Virtual Machine Specification. " "

    Since JDWP version 1.6. Requires canGetConstantPool capability - see " - "CapabilitiesNew."" + "CapabilitiesNew."" (Out (referenceType refType "The class.") ) @@ -1024,8 +1024,8 @@ JDWP "Java(tm) Debug Wire Protocol" (Error INVALID_OBJECT "refType is not a known ID.") (Error NOT_IMPLEMENTED "If the target virtual machine does not " "support the retrieval of constant pool information.") - (Error ABSENT_INFORMATION "The Constant Pool information is " - "absent for primitive and array types.") + (Error ABSENT_INFORMATION "The Constant Pool information is " + "absent for primitive and array types.") (Error VM_DEAD) ) ) @@ -1037,7 +1037,7 @@ JDWP "Java(tm) Debug Wire Protocol" (classType clazz "The class type ID.") ) (Reply - (classType superclass + (classType superclass "The superclass (null if the class ID for java.lang.Object is specified).") ) (ErrorSet @@ -1048,14 +1048,14 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command SetValues=2 "Sets the value of one or more static fields. " - "Each field must be member of the class type " - "or one of its superclasses, superinterfaces, or implemented interfaces. " - "Access control is not enforced; for example, the values of private " - "fields can be set. Final fields cannot be set." - "For primitive values, the value's type must match the " - "field's type exactly. For object values, there must exist a " - "widening reference conversion from the value's type to the - "field's type and the field's type must be loaded. " + "Each field must be member of the class type " + "or one of its superclasses, superinterfaces, or implemented interfaces. " + "Access control is not enforced; for example, the values of private " + "fields can be set. Final fields cannot be set." + "For primitive values, the value's type must match the " + "field's type exactly. For object values, there must exist a " + "widening reference conversion from the value's type to the + "field's type and the field's type must be loaded. " (Out (classType clazz "The class type ID.") (Repeat values "The number of fields to set." @@ -1074,36 +1074,36 @@ JDWP "Java(tm) Debug Wire Protocol" "object field is not a known ID.") (Error INVALID_FIELDID) (Error VM_DEAD) - ) + ) ) (Command InvokeMethod=3 "Invokes a static method. " - "The method must be member of the class type " - "or one of its superclasses, superinterfaces, or implemented interfaces. " - "Access control is not enforced; for example, private " - "methods can be invoked." - "

    " - "The method invocation will occur in the specified thread. " - "Method invocation can occur only if the specified thread " - "has been suspended by an event. " - "Method invocation is not supported " - "when the target VM has been suspended by the front-end. " - "

    " - "The specified method is invoked with the arguments in the specified " - "argument list. " - "The method invocation is synchronous; the reply packet is not " - "sent until the invoked method returns in the target VM. " - "The return value (possibly the void value) is " - "included in the reply packet. " - "If the invoked method throws an exception, the " - "exception object ID is set in the reply packet; otherwise, the " - "exception object ID is null. " - "

    " - "For primitive arguments, the argument value's type must match the " - "argument's type exactly. For object arguments, there must exist a " - "widening reference conversion from the argument value's type to the " - "argument's type and the argument's type must be loaded. " - "

    " + "The method must be member of the class type " + "or one of its superclasses, superinterfaces, or implemented interfaces. " + "Access control is not enforced; for example, private " + "methods can be invoked." + "

    " + "The method invocation will occur in the specified thread. " + "Method invocation can occur only if the specified thread " + "has been suspended by an event. " + "Method invocation is not supported " + "when the target VM has been suspended by the front-end. " + "

    " + "The specified method is invoked with the arguments in the specified " + "argument list. " + "The method invocation is synchronous; the reply packet is not " + "sent until the invoked method returns in the target VM. " + "The return value (possibly the void value) is " + "included in the reply packet. " + "If the invoked method throws an exception, the " + "exception object ID is set in the reply packet; otherwise, the " + "exception object ID is null. " + "

    " + "For primitive arguments, the argument value's type must match the " + "argument's type exactly. For object arguments, there must exist a " + "widening reference conversion from the argument value's type to the " + "argument's type and the argument's type must be loaded. " + "

    " "By default, all threads in the target VM are resumed while " "the method is being invoked if they were previously " "suspended by an event or by command. " @@ -1114,28 +1114,28 @@ JDWP "Java(tm) Debug Wire Protocol" "Note, however, that this implicit resume acts exactly like " "the ThreadReference resume command, so if the thread's suspend " "count is greater than 1, it will remain in a suspended state " - "during the invocation. By default, when the invocation completes, " - "all threads in the target VM are suspended, regardless their state " - "before the invocation. " + "during the invocation. By default, when the invocation completes, " + "all threads in the target VM are suspended, regardless their state " + "before the invocation. " "

    " "The resumption of other threads during the invoke can be prevented " "by specifying the INVOKE_SINGLE_THREADED " "bit flag in the options field; however, " "there is no protection against or recovery from the deadlocks " "described above, so this option should be used with great caution. " - "Only the specified thread will be resumed (as described for all " - "threads above). Upon completion of a single threaded invoke, the invoking thread " - "will be suspended once again. Note that any threads started during " - "the single threaded invocation will not be suspended when the " - "invocation completes. " - "

    " + "Only the specified thread will be resumed (as described for all " + "threads above). Upon completion of a single threaded invoke, the invoking thread " + "will be suspended once again. Note that any threads started during " + "the single threaded invocation will not be suspended when the " + "invocation completes. " + "

    " "If the target VM is disconnected during the invoke (for example, through " "the VirtualMachine dispose command) the method invocation continues. " (Out (classType clazz "The class type ID.") (threadObject thread "The thread in which to invoke.") (method methodID "The method to invoke.") - (Repeat arguments + (Repeat arguments (value arg "The argument value.") ) (int options "Invocation options") @@ -1155,30 +1155,30 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command NewInstance=4 "Creates a new object of this type, invoking the specified " - "constructor. The constructor method ID must be a member of " - "the class type." - "

    " - "Instance creation will occur in the specified thread. " - "Instance creation can occur only if the specified thread " - "has been suspended by an event. " - "Method invocation is not supported " - "when the target VM has been suspended by the front-end. " - "

    " - "The specified constructor is invoked with the arguments in the specified " - "argument list. " - "The constructor invocation is synchronous; the reply packet is not " - "sent until the invoked method returns in the target VM. " - "The return value (possibly the void value) is " - "included in the reply packet. " - "If the constructor throws an exception, the " - "exception object ID is set in the reply packet; otherwise, the " - "exception object ID is null. " - "

    " - "For primitive arguments, the argument value's type must match the " - "argument's type exactly. For object arguments, there must exist a " - "widening reference conversion from the argument value's type to the " - "argument's type and the argument's type must be loaded. " - "

    " + "constructor. The constructor method ID must be a member of " + "the class type." + "

    " + "Instance creation will occur in the specified thread. " + "Instance creation can occur only if the specified thread " + "has been suspended by an event. " + "Method invocation is not supported " + "when the target VM has been suspended by the front-end. " + "

    " + "The specified constructor is invoked with the arguments in the specified " + "argument list. " + "The constructor invocation is synchronous; the reply packet is not " + "sent until the invoked method returns in the target VM. " + "The return value (possibly the void value) is " + "included in the reply packet. " + "If the constructor throws an exception, the " + "exception object ID is set in the reply packet; otherwise, the " + "exception object ID is null. " + "

    " + "For primitive arguments, the argument value's type must match the " + "argument's type exactly. For object arguments, there must exist a " + "widening reference conversion from the argument value's type to the " + "argument's type and the argument's type must be loaded. " + "

    " "By default, all threads in the target VM are resumed while " "the method is being invoked if they were previously " "suspended by an event or by command. " @@ -1189,20 +1189,20 @@ JDWP "Java(tm) Debug Wire Protocol" "Note, however, that this implicit resume acts exactly like " "the ThreadReference resume command, so if the thread's suspend " "count is greater than 1, it will remain in a suspended state " - "during the invocation. By default, when the invocation completes, " - "all threads in the target VM are suspended, regardless their state " - "before the invocation. " + "during the invocation. By default, when the invocation completes, " + "all threads in the target VM are suspended, regardless their state " + "before the invocation. " "

    " "The resumption of other threads during the invoke can be prevented " "by specifying the INVOKE_SINGLE_THREADED " "bit flag in the options field; however, " "there is no protection against or recovery from the deadlocks " "described above, so this option should be used with great caution. " - "Only the specified thread will be resumed (as described for all " - "threads above). Upon completion of a single threaded invoke, the invoking thread " - "will be suspended once again. Note that any threads started during " - "the single threaded invocation will not be suspended when the " - "invocation completes. " + "Only the specified thread will be resumed (as described for all " + "threads above). Upon completion of a single threaded invoke, the invoking thread " + "will be suspended once again. Note that any threads started during " + "the single threaded invocation will not be suspended when the " + "invocation completes. " "

    " "If the target VM is disconnected during the invoke (for example, through " "the VirtualMachine dispose command) the method invocation continues. " @@ -1210,14 +1210,14 @@ JDWP "Java(tm) Debug Wire Protocol" (classType clazz "The class type ID.") (threadObject thread "The thread in which to invoke the constructor.") (method methodID "The constructor to invoke.") - (Repeat arguments + (Repeat arguments (value arg "The argument value.") ) (int options "Constructor invocation options") ) (Reply (tagged-object newObject "The newly created object, or null " - "if the constructor threw an exception.") + "if the constructor threw an exception.") (tagged-object exception "The thrown exception, if any; otherwise, null.") ) (ErrorSet @@ -1239,8 +1239,8 @@ JDWP "Java(tm) Debug Wire Protocol" (arrayType arrType "The array type of the new instance.") (int length "The length of the array.") ) - (Reply - (tagged-object newArray "The newly created array object. ") + (Reply + (tagged-object newArray "The newly created array object. ") ) (ErrorSet (Error INVALID_ARRAY) @@ -1254,11 +1254,11 @@ JDWP "Java(tm) Debug Wire Protocol" (CommandSet Method=6 (Command LineTable=1 "Returns line number information for the method, if present. " - "The line table maps source line numbers to the initial code index " - "of the line. The line table " - "is ordered by code index (from lowest to highest). The line number " - "information is constant unless a new class definition is installed " - "using RedefineClasses." + "The line table maps source line numbers to the initial code index " + "of the line. The line table " + "is ordered by code index (from lowest to highest). The line number " + "information is constant unless a new class definition is installed " + "using RedefineClasses." (Out (referenceType refType "The class.") (method methodID "The method.") @@ -1269,7 +1269,7 @@ JDWP "Java(tm) Debug Wire Protocol" (Repeat lines "The number of entries in the line table for this method." (Group LineInfo (long lineCodeIndex "Initial code index of the line, " - "start <= lineCodeIndex < end") + "start <= lineCodeIndex < end") (int lineNumber "Line number.") ) ) @@ -1284,9 +1284,9 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command VariableTable=2 "Returns variable information for the method. The variable table " - "includes arguments and locals declared within the method. For " - "instance methods, the \"this\" reference is included in the " - "table. Also, synthetic variables may be present. " + "includes arguments and locals declared within the method. For " + "instance methods, the \"this\" reference is included in the " + "table. Also, synthetic variables may be present. " (Out (referenceType refType "The class.") (method methodID "The method.") @@ -1297,16 +1297,16 @@ JDWP "Java(tm) Debug Wire Protocol" (Repeat slots "The number of variables." (Group SlotInfo "Information about the variable." (long codeIndex - "First code index at which the variable is visible (unsigned). " - "Used in conjunction with length. " - "The variable can be get or set only when the current " - "codeIndex <= current frame code index < codeIndex + length ") + "First code index at which the variable is visible (unsigned). " + "Used in conjunction with length. " + "The variable can be get or set only when the current " + "codeIndex <= current frame code index < codeIndex + length ") (string name "The variable's name.") (string signature "The variable type's JNI signature.") - (int length - "Unsigned value used in conjunction with codeIndex. " - "The variable can be get or set only when the current " - "codeIndex <= current frame code index < code index + length ") + (int length + "Unsigned value used in conjunction with codeIndex. " + "The variable can be get or set only when the current " + "codeIndex <= current frame code index < code index + length ") (int slot "The local variable's index in its frame") ) ) @@ -1323,8 +1323,8 @@ JDWP "Java(tm) Debug Wire Protocol" (Command Bytecodes=3 "Retrieve the method's bytecodes as defined in " "The Java™ Virtual Machine Specification. " - "Requires canGetBytecodes capability - see " - "CapabilitiesNew." + "Requires canGetBytecodes capability - see " + "CapabilitiesNew." (Out (referenceType refType "The class.") (method methodID "The method.") @@ -1346,11 +1346,11 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command IsObsolete=4 "Determine if this method is obsolete. A method is obsolete if it has been replaced " - "by a non-equivalent method using the " - "RedefineClasses command. " - "The original and redefined methods are considered equivalent if their bytecodes are " - "the same except for indices into the constant pool and the referenced constants are " - "equal." + "by a non-equivalent method using the " + "RedefineClasses command. " + "The original and redefined methods are considered equivalent if their bytecodes are " + "the same except for indices into the constant pool and the referenced constants are " + "equal." (Out (referenceType refType "The class.") (method methodID "The method.") @@ -1358,7 +1358,7 @@ JDWP "Java(tm) Debug Wire Protocol" (Reply (boolean isObsolete "true if this method has been replaced" "by a non-equivalent method using" - "the RedefineClasses command.") + "the RedefineClasses command.") ) (ErrorSet (Error INVALID_CLASS "refType is not the ID of a reference " @@ -1373,10 +1373,10 @@ JDWP "Java(tm) Debug Wire Protocol" (Command VariableTableWithGeneric=5 "Returns variable information for the method, including " "generic signatures for the variables. The variable table " - "includes arguments and locals declared within the method. For " - "instance methods, the \"this\" reference is included in the " - "table. Also, synthetic variables may be present. " - "Generic signatures are described in the signature attribute " + "includes arguments and locals declared within the method. For " + "instance methods, the \"this\" reference is included in the " + "table. Also, synthetic variables may be present. " + "Generic signatures are described in the signature attribute " "section in " "The Java™ Virtual Machine Specification. " "Since JDWP version 1.5." @@ -1390,18 +1390,18 @@ JDWP "Java(tm) Debug Wire Protocol" (Repeat slots "The number of variables." (Group SlotInfo "Information about the variable." (long codeIndex - "First code index at which the variable is visible (unsigned). " - "Used in conjunction with length. " - "The variable can be get or set only when the current " - "codeIndex <= current frame code index < codeIndex + length ") + "First code index at which the variable is visible (unsigned). " + "Used in conjunction with length. " + "The variable can be get or set only when the current " + "codeIndex <= current frame code index < codeIndex + length ") (string name "The variable's name.") (string signature "The variable type's JNI signature.") (string genericSignature "The variable type's generic " "signature or an empty string if there is none.") - (int length - "Unsigned value used in conjunction with codeIndex. " - "The variable can be get or set only when the current " - "codeIndex <= current frame code index < code index + length ") + (int length + "Unsigned value used in conjunction with codeIndex. " + "The variable can be get or set only when the current " + "codeIndex <= current frame code index < code index + length ") (int slot "The local variable's index in its frame") ) ) @@ -1416,7 +1416,7 @@ JDWP "Java(tm) Debug Wire Protocol" ) ) -) +) (CommandSet Field=8 ) (CommandSet ObjectReference=9 @@ -1427,8 +1427,8 @@ JDWP "Java(tm) Debug Wire Protocol" (object object "The object ID") ) (Reply - (byte refTypeTag "Kind " - "of following reference type. ") + (byte refTypeTag "Kind " + "of following reference type. ") (referenceTypeID typeID "The runtime reference type.") ) (ErrorSet @@ -1438,10 +1438,10 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command GetValues=2 "Returns the value of one or more instance fields. " - "Each field must be member of the object's type " - "or one of its superclasses, superinterfaces, or implemented interfaces. " - "Access control is not enforced; for example, the values of private " - "fields can be obtained." + "Each field must be member of the object's type " + "or one of its superclasses, superinterfaces, or implemented interfaces. " + "Access control is not enforced; for example, the values of private " + "fields can be obtained." (Out (object object "The object ID") (Repeat fields "The number of values to get" @@ -1452,9 +1452,9 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Reply (Repeat values "The number of values returned, always equal to 'fields', " - "the number of values to get. Field values are ordered " - "in the reply in the same order as corresponding fieldIDs " - "in the command." + "the number of values to get. Field values are ordered " + "in the reply in the same order as corresponding fieldIDs " + "in the command." (value value "The field value") ) ) @@ -1466,14 +1466,14 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command SetValues=3 "Sets the value of one or more instance fields. " - "Each field must be member of the object's type " - "or one of its superclasses, superinterfaces, or implemented interfaces. " - "Access control is not enforced; for example, the values of private " - "fields can be set. " - "For primitive values, the value's type must match the " - "field's type exactly. For object values, there must be a " - "widening reference conversion from the value's type to the - "field's type and the field's type must be loaded. " + "Each field must be member of the object's type " + "or one of its superclasses, superinterfaces, or implemented interfaces. " + "Access control is not enforced; for example, the values of private " + "fields can be set. " + "For primitive values, the value's type must match the " + "field's type exactly. For object values, there must be a " + "widening reference conversion from the value's type to the + "field's type and the field's type must be loaded. " (Out (object object "The object ID") (Repeat values "The number of fields to set." @@ -1489,13 +1489,13 @@ JDWP "Java(tm) Debug Wire Protocol" (Error INVALID_OBJECT) (Error INVALID_FIELDID) (Error VM_DEAD) - ) + ) ) (Command MonitorInfo=5 "Returns monitor information for an object. All threads int the VM must " - "be suspended." - "Requires canGetMonitorInfo capability - see " - "CapabilitiesNew." + "be suspended." + "Requires canGetMonitorInfo capability - see " + "CapabilitiesNew." (Out (object object "The object ID") ) @@ -1503,7 +1503,7 @@ JDWP "Java(tm) Debug Wire Protocol" (threadObject owner "The monitor owner, or null if it is not currently owned.") (int entryCount "The number of times the monitor has been entered.") (Repeat waiters "The number of threads that are waiting for the monitor " - "0 if there is no current owner" + "0 if there is no current owner" (threadObject thread "A thread waiting for this monitor.") ) ) @@ -1515,32 +1515,32 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command InvokeMethod=6 "Invokes a instance method. " - "The method must be member of the object's type " - "or one of its superclasses, superinterfaces, or implemented interfaces. " - "Access control is not enforced; for example, private " - "methods can be invoked." - "

    " - "The method invocation will occur in the specified thread. " - "Method invocation can occur only if the specified thread " - "has been suspended by an event. " - "Method invocation is not supported " - "when the target VM has been suspended by the front-end. " - "

    " - "The specified method is invoked with the arguments in the specified " - "argument list. " - "The method invocation is synchronous; the reply packet is not " - "sent until the invoked method returns in the target VM. " - "The return value (possibly the void value) is " - "included in the reply packet. " - "If the invoked method throws an exception, the " - "exception object ID is set in the reply packet; otherwise, the " - "exception object ID is null. " - "

    " - "For primitive arguments, the argument value's type must match the " - "argument's type exactly. For object arguments, there must be a " - "widening reference conversion from the argument value's type to the " - "argument's type and the argument's type must be loaded. " - "

    " + "The method must be member of the object's type " + "or one of its superclasses, superinterfaces, or implemented interfaces. " + "Access control is not enforced; for example, private " + "methods can be invoked." + "

    " + "The method invocation will occur in the specified thread. " + "Method invocation can occur only if the specified thread " + "has been suspended by an event. " + "Method invocation is not supported " + "when the target VM has been suspended by the front-end. " + "

    " + "The specified method is invoked with the arguments in the specified " + "argument list. " + "The method invocation is synchronous; the reply packet is not " + "sent until the invoked method returns in the target VM. " + "The return value (possibly the void value) is " + "included in the reply packet. " + "If the invoked method throws an exception, the " + "exception object ID is set in the reply packet; otherwise, the " + "exception object ID is null. " + "

    " + "For primitive arguments, the argument value's type must match the " + "argument's type exactly. For object arguments, there must be a " + "widening reference conversion from the argument value's type to the " + "argument's type and the argument's type must be loaded. " + "

    " "By default, all threads in the target VM are resumed while " "the method is being invoked if they were previously " "suspended by an event or by command. " @@ -1551,20 +1551,20 @@ JDWP "Java(tm) Debug Wire Protocol" "Note, however, that this implicit resume acts exactly like " "the ThreadReference resume command, so if the thread's suspend " "count is greater than 1, it will remain in a suspended state " - "during the invocation. By default, when the invocation completes, " - "all threads in the target VM are suspended, regardless their state " - "before the invocation. " + "during the invocation. By default, when the invocation completes, " + "all threads in the target VM are suspended, regardless their state " + "before the invocation. " "

    " "The resumption of other threads during the invoke can be prevented " "by specifying the INVOKE_SINGLE_THREADED " "bit flag in the options field; however, " "there is no protection against or recovery from the deadlocks " "described above, so this option should be used with great caution. " - "Only the specified thread will be resumed (as described for all " - "threads above). Upon completion of a single threaded invoke, the invoking thread " - "will be suspended once again. Note that any threads started during " - "the single threaded invocation will not be suspended when the " - "invocation completes. " + "Only the specified thread will be resumed (as described for all " + "threads above). Upon completion of a single threaded invoke, the invoking thread " + "will be suspended once again. Note that any threads started during " + "the single threaded invocation will not be suspended when the " + "invocation completes. " "

    " "If the target VM is disconnected during the invoke (for example, through " "the VirtualMachine dispose command) the method invocation continues. " @@ -1593,29 +1593,29 @@ JDWP "Java(tm) Debug Wire Protocol" ) ) (Command DisableCollection=7 - "Prevents garbage collection for the given object. By " - "default all objects in back-end replies may be " - "collected at any time the target VM is running. A call to " - "this command guarantees that the object will not be " - "collected. The " - "EnableCollection " - "command can be used to " - "allow collection once again. " - "

    " - "Note that while the target VM is suspended, no garbage " - "collection will occur because all threads are suspended. " - "The typical examination of variables, fields, and arrays " - "during the suspension is safe without explicitly disabling " - "garbage collection. " - "

    " - "This method should be used sparingly, as it alters the " - "pattern of garbage collection in the target VM and, " - "consequently, may result in application behavior under the " - "debugger that differs from its non-debugged behavior. " - (Out - (object object "The object ID") - ) - (Reply "none" + "Prevents garbage collection for the given object. By " + "default all objects in back-end replies may be " + "collected at any time the target VM is running. A call to " + "this command guarantees that the object will not be " + "collected. The " + "EnableCollection " + "command can be used to " + "allow collection once again. " + "

    " + "Note that while the target VM is suspended, no garbage " + "collection will occur because all threads are suspended. " + "The typical examination of variables, fields, and arrays " + "during the suspension is safe without explicitly disabling " + "garbage collection. " + "

    " + "This method should be used sparingly, as it alters the " + "pattern of garbage collection in the target VM and, " + "consequently, may result in application behavior under the " + "debugger that differs from its non-debugged behavior. " + (Out + (object object "The object ID") + ) + (Reply "none" ) (ErrorSet (Error INVALID_OBJECT) @@ -1623,13 +1623,13 @@ JDWP "Java(tm) Debug Wire Protocol" ) ) (Command EnableCollection=8 - "Permits garbage collection for this object. By default all " - "objects returned by JDWP may become unreachable in the target VM, " - "and hence may be garbage collected. A call to this command is " - "necessary only if garbage collection was previously disabled with " - "the DisableCollection " - "command." - (Out + "Permits garbage collection for this object. By default all " + "objects returned by JDWP may become unreachable in the target VM, " + "and hence may be garbage collected. A call to this command is " + "necessary only if garbage collection was previously disabled with " + "the DisableCollection " + "command." + (Out (object object "The object ID") ) (Reply "none" @@ -1640,7 +1640,7 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command IsCollected=9 "Determines whether an object has been garbage collected in the " - "target VM. " + "target VM. " (Out (object object "The object ID") ) @@ -1660,13 +1660,13 @@ JDWP "Java(tm) Debug Wire Protocol" "such as from a local variable in a stack frame, or from a JNI global " "reference. Such non-object referrers are not returned by this command. " "

    Since JDWP version 1.6. Requires canGetInstanceInfo capability - see " - "CapabilitiesNew." + "CapabilitiesNew." (Out (object object "The object ID") (int maxReferrers "Maximum number of referring objects to return. " "Must be non-negative. If zero, all referring " "objects are returned.") - ) + ) (Reply (Repeat referringObjects "The number of objects that follow." (tagged-object instance "An object that references this object.") @@ -1714,32 +1714,32 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command Suspend=2 "Suspends the thread. " - "

    " - "Unlike java.lang.Thread.suspend(), suspends of both " - "the virtual machine and individual threads are counted. Before " - "a thread will run again, it must be resumed the same number " - "of times it has been suspended. " - "

    " - "Suspending single threads with command has the same " - "dangers java.lang.Thread.suspend(). If the suspended " - "thread holds a monitor needed by another running thread, " - "deadlock is possible in the target VM (at least until the " - "suspended thread is resumed again). " - "

    " - "The suspended thread is guaranteed to remain suspended until " - "resumed through one of the JDI resume methods mentioned above; " - "the application in the target VM cannot resume the suspended thread " - "through {@link java.lang.Thread#resume}. " - "

    " - "Note that this doesn't change the status of the thread (see the " - "ThreadStatus command.) " - "For example, if it was " - "Running, it will still appear running to other threads. " - (Out - (threadObject thread "The thread object ID. ") - ) - (Reply "none" - ) + "

    " + "Unlike java.lang.Thread.suspend(), suspends of both " + "the virtual machine and individual threads are counted. Before " + "a thread will run again, it must be resumed the same number " + "of times it has been suspended. " + "

    " + "Suspending single threads with command has the same " + "dangers java.lang.Thread.suspend(). If the suspended " + "thread holds a monitor needed by another running thread, " + "deadlock is possible in the target VM (at least until the " + "suspended thread is resumed again). " + "

    " + "The suspended thread is guaranteed to remain suspended until " + "resumed through one of the JDI resume methods mentioned above; " + "the application in the target VM cannot resume the suspended thread " + "through {@link java.lang.Thread#resume}. " + "

    " + "Note that this doesn't change the status of the thread (see the " + "ThreadStatus command.) " + "For example, if it was " + "Running, it will still appear running to other threads. " + (Out + (threadObject thread "The thread object ID. ") + ) + (Reply "none" + ) (ErrorSet (Error INVALID_THREAD) (Error INVALID_OBJECT "thread is not a known ID.") @@ -1747,12 +1747,12 @@ JDWP "Java(tm) Debug Wire Protocol" ) ) (Command Resume=3 - "Resumes the execution of a given thread. If this thread was " - "not previously suspended by the front-end, " - "calling this command has no effect. " - "Otherwise, the count of pending suspends on this thread is " - "decremented. If it is decremented to 0, the thread will " - "continue to execute. " + "Resumes the execution of a given thread. If this thread was " + "not previously suspended by the front-end, " + "calling this command has no effect. " + "Otherwise, the count of pending suspends on this thread is " + "decremented. If it is decremented to 0, the thread will " + "continue to execute. " (Out (threadObject thread "The thread object ID. ") ) @@ -1766,13 +1766,13 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command Status=4 "Returns the current status of a thread. The thread status " - "reply indicates the thread status the last time it was running. " - "the suspend status provides information on the thread's " - "suspension, if any." + "reply indicates the thread status the last time it was running. " + "the suspend status provides information on the thread's " + "suspension, if any." (Out (threadObject thread "The thread object ID. ") ) - (Reply + (Reply (int threadStatus "One of the thread status codes " "See JDWP.ThreadStatus") (int suspendStatus "One of the suspend status codes " @@ -1803,11 +1803,11 @@ JDWP "Java(tm) Debug Wire Protocol" "The sequence of frames starts with " "the currently executing frame, followed by its caller, " "and so on. The thread must be suspended, and the returned " - "frameID is valid only while the thread is suspended. " + "frameID is valid only while the thread is suspended. " (Out (threadObject thread "The thread object ID. ") (int startFrame "The index of the first frame to retrieve.") - (int length + (int length "The count of frames to retrieve " "(-1 means all remaining). ") ) @@ -1827,8 +1827,8 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command FrameCount=7 "Returns the count of frames on this thread's stack. " - "The thread must be suspended, and the returned " - "count is valid only while the thread is suspended. " + "The thread must be suspended, and the returned " + "count is valid only while the thread is suspended. " "Returns JDWP.Error.errorThreadNotSuspended if not suspended. " (Out (threadObject thread "The thread object ID. ") @@ -1844,10 +1844,10 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command OwnedMonitors=8 "Returns the objects whose monitors have been entered by this thread. " - "The thread must be suspended, and the returned information is " - "relevant only while the thread is suspended. " - "Requires canGetOwnedMonitorInfo capability - see " - "CapabilitiesNew." + "The thread must be suspended, and the returned information is " + "relevant only while the thread is suspended. " + "Requires canGetOwnedMonitorInfo capability - see " + "CapabilitiesNew." (Out (threadObject thread "The thread object ID. ") ) @@ -1865,19 +1865,19 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command CurrentContendedMonitor=9 "Returns the object, if any, for which this thread is waiting. The " - "thread may be waiting to enter a monitor, or it may be waiting, via " - "the java.lang.Object.wait method, for another thread to invoke the " - "notify method. " - "The thread must be suspended, and the returned information is " - "relevant only while the thread is suspended. " - "Requires canGetCurrentContendedMonitor capability - see " - "CapabilitiesNew." + "thread may be waiting to enter a monitor, or it may be waiting, via " + "the java.lang.Object.wait method, for another thread to invoke the " + "notify method. " + "The thread must be suspended, and the returned information is " + "relevant only while the thread is suspended. " + "Requires canGetCurrentContendedMonitor capability - see " + "CapabilitiesNew." (Out (threadObject thread "The thread object ID. ") ) (Reply (tagged-object monitor "The contended monitor, or null if " - "there is no current contended monitor. ") + "there is no current contended monitor. ") ) (ErrorSet (Error INVALID_THREAD) @@ -1888,11 +1888,11 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command Stop=10 "Stops the thread with an asynchronous exception, as if done by " - "java.lang.Thread.stop " + "java.lang.Thread.stop " (Out (threadObject thread "The thread object ID. ") (object throwable "Asynchronous exception. This object must " - "be an instance of java.lang.Throwable or a subclass") + "be an instance of java.lang.Throwable or a subclass") ) (Reply "none" ) @@ -1918,12 +1918,12 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command SuspendCount=12 "Get the suspend count for this thread. The suspend count is the " - "number of times the thread has been suspended through the " - "thread-level or VM-level suspend commands without a corresponding resume " + "number of times the thread has been suspended through the " + "thread-level or VM-level suspend commands without a corresponding resume " (Out (threadObject thread "The thread object ID. ") ) - (Reply + (Reply (int suspendCount "The number of outstanding suspends of this thread. ") ) (ErrorSet @@ -1937,20 +1937,20 @@ JDWP "Java(tm) Debug Wire Protocol" "the monitor was acquired. Returns stack depth of -1 if " "the implementation cannot determine the stack depth " "(e.g., for monitors acquired by JNI MonitorEnter)." - "The thread must be suspended, and the returned information is " - "relevant only while the thread is suspended. " - "Requires canGetMonitorFrameInfo capability - see " - "CapabilitiesNew. " - "

    Since JDWP version 1.6. " + "The thread must be suspended, and the returned information is " + "relevant only while the thread is suspended. " + "Requires canGetMonitorFrameInfo capability - see " + "CapabilitiesNew. " + "

    Since JDWP version 1.6. " (Out (threadObject thread "The thread object ID. ") ) (Reply (Repeat owned "The number of owned monitors" - (Group monitor + (Group monitor (tagged-object monitor "An owned monitor") - (int stack_depth "Stack depth location where monitor was acquired") + (int stack_depth "Stack depth location where monitor was acquired") ) ) ) @@ -1964,45 +1964,45 @@ JDWP "Java(tm) Debug Wire Protocol" (Command ForceEarlyReturn=14 "Force a method to return before it reaches a return " "statement. " - "

    " + "

    " "The method which will return early is referred to as the " "called method. The called method is the current method (as " "defined by the Frames section in " "The Java™ Virtual Machine Specification) " "for the specified thread at the time this command " "is received. " - "

    " + "

    " "The specified thread must be suspended. " "The return occurs when execution of Java programming " "language code is resumed on this thread. Between sending this " "command and resumption of thread execution, the " "state of the stack is undefined. " - "

    " + "

    " "No further instructions are executed in the called " "method. Specifically, finally blocks are not executed. Note: " "this can cause inconsistent states in the application. " - "

    " + "

    " "A lock acquired by calling the called method (if it is a " "synchronized method) and locks acquired by entering " "synchronized blocks within the called method are " "released. Note: this does not apply to JNI locks or " "java.util.concurrent.locks locks. " - "

    " + "

    " "Events, such as MethodExit, are generated as they would be in " "a normal return. " - "

    " + "

    " "The called method must be a non-native Java programming " "language method. Forcing return on a thread with only one " "frame on the stack causes the thread to exit when resumed. " - "

    " - "For void methods, the value must be a void value. " + "

    " + "For void methods, the value must be a void value. " "For methods that return primitive values, the value's type must " "match the return type exactly. For object values, there must be a " - "widening reference conversion from the value's type to the " - "return type type and the return type must be loaded. " + "widening reference conversion from the value's type to the " + "return type type and the return type must be loaded. " "

    " "Since JDWP version 1.6. Requires canForceEarlyReturn capability - see " - "CapabilitiesNew." + "CapabilitiesNew." (Out (threadObject thread "The thread object ID. ") (value value "The value to return. ") @@ -2050,8 +2050,8 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Reply (threadGroupObject parentGroup "The parent thread group object, or " - "null if the given thread group " - "is a top-level thread group") + "null if the given thread group " + "is a top-level thread group") ) (ErrorSet (Error INVALID_THREAD_GROUP) @@ -2062,7 +2062,7 @@ JDWP "Java(tm) Debug Wire Protocol" (Command Children=3 "Returns the live threads and active thread groups directly contained " "in this thread group. Threads and thread groups in child " - "thread groups are not included. " + "thread groups are not included. " "A thread is alive if it has been started and has not yet been stopped. " "See java.lang.ThreadGroup "for information about active ThreadGroups. @@ -2101,7 +2101,7 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command GetValues=2 "Returns a range of array components. The specified range must " - "be within the bounds of the array. " + "be within the bounds of the array. " (Out (arrayObject arrayObject "The array object ID. ") (int firstIndex "The first index to retrieve.") @@ -2109,8 +2109,8 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Reply (typed-sequence values "The retrieved values. If the values " - "are objects, they are tagged-values; " - "otherwise, they are untagged-values") + "are objects, they are tagged-values; " + "otherwise, they are untagged-values") ) (ErrorSet (Error INVALID_LENGTH "If index is beyond the end of this array.") @@ -2121,11 +2121,11 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command SetValues=3 "Sets a range of array components. The specified range must " - "be within the bounds of the array. " - "For primitive values, each value's type must match the " - "array component type exactly. For object values, there must be a " - "widening reference conversion from the value's type to the - "array component type and the array component type must be loaded. " + "be within the bounds of the array. " + "For primitive values, each value's type must match the " + "array component type exactly. For object values, there must be a " + "widening reference conversion from the value's type to the + "array component type and the array component type must be loaded. " (Out (arrayObject arrayObject "The array object ID. ") (int firstIndex "The first index to set.") @@ -2145,20 +2145,20 @@ JDWP "Java(tm) Debug Wire Protocol" ) (CommandSet ClassLoaderReference=14 (Command VisibleClasses=1 - "Returns a list of all classes which this class loader has " - "been requested to load. This class loader is considered to be " - "an initiating class loader for each class in the returned " - "list. The list contains each " - "reference type defined by this loader and any types for which " - "loading was delegated by this class loader to another class loader. " - "

    " - "The visible class list has useful properties with respect to " - "the type namespace. A particular type name will occur at most " - "once in the list. Each field or variable declared with that " - "type name in a class defined by " - "this class loader must be resolved to that single type. " - "

    " - "No ordering of the returned list is guaranteed. " + "Returns a list of all classes which this class loader has " + "been requested to load. This class loader is considered to be " + "an initiating class loader for each class in the returned " + "list. The list contains each " + "reference type defined by this loader and any types for which " + "loading was delegated by this class loader to another class loader. " + "

    " + "The visible class list has useful properties with respect to " + "the type namespace. A particular type name will occur at most " + "once in the list. Each field or variable declared with that " + "type name in a class defined by " + "this class loader must be resolved to that single type. " + "

    " + "No ordering of the returned list is guaranteed. " (Out (classLoaderObject classLoaderObject "The class loader object ID. ") ) @@ -2166,8 +2166,8 @@ JDWP "Java(tm) Debug Wire Protocol" (Repeat classes "The number of visible classes. " (Group ClassInfo (byte refTypeTag "Kind " - "of following reference type. ") - (referenceTypeID typeID + "of following reference type. ") + (referenceTypeID typeID "A class visible to this class loader.") ) ) @@ -2182,175 +2182,175 @@ JDWP "Java(tm) Debug Wire Protocol" (CommandSet EventRequest=15 (Command Set=1 "Set an event request. When the event described by this request " - "occurs, an event is sent from the " - "target VM. If an event occurs that has not been requested then it is not sent " - "from the target VM. The two exceptions to this are the VM Start Event and " - "the VM Death Event which are automatically generated events - see " - "Composite Command for further details." + "occurs, an event is sent from the " + "target VM. If an event occurs that has not been requested then it is not sent " + "from the target VM. The two exceptions to this are the VM Start Event and " + "the VM Death Event which are automatically generated events - see " + "Composite Command for further details." (Out (byte eventKind "Event kind to request. " "See JDWP.EventKind " - "for a complete list of events that can be requested; " + "for a complete list of events that can be requested; " "some events may require a capability in order to be requested. " - ) - (byte suspendPolicy + ) + (byte suspendPolicy "What threads are suspended when this event occurs? " "Note that the order of events and command replies " - "accurately reflects the order in which threads are " - "suspended and resumed. For example, if a " - "VM-wide resume " - "is processed before an event occurs which suspends the " - "VM, the reply to the resume command will be written to " - "the transport before the suspending event.") + "accurately reflects the order in which threads are " + "suspended and resumed. For example, if a " + "VM-wide resume " + "is processed before an event occurs which suspends the " + "VM, the reply to the resume command will be written to " + "the transport before the suspending event.") (Repeat modifiers "Constraints used to control the number " - "of generated events." + "of generated events." "Modifiers specify additional tests that " - "an event must satisfy before it is placed " - "in the event queue. Events are filtered by " + "an event must satisfy before it is placed " + "in the event queue. Events are filtered by " "applying each modifier to an event in the " - "order they are specified in this collection " - "Only events that satisfy all modifiers " - "are reported. A value of 0 means there are no " - "modifiers in the request." - "

    " + "order they are specified in this collection " + "Only events that satisfy all modifiers " + "are reported. A value of 0 means there are no " + "modifiers in the request." + "

    " "Filtering can improve " - "debugger performance dramatically by - "reducing the " + "debugger performance dramatically by + "reducing the " "amount of event traffic sent from the " - "target VM to the debugger VM. " + "target VM to the debugger VM. " (Select Modifier (byte modKind "Modifier kind") - (Alt Count=1 - "Limit the requested event to be reported at most once after a " - "given number of occurrences. The event is not reported " - "the first count - 1 times this filter is reached. " - "To request a one-off event, call this method with a count of 1. " - "

    " - "Once the count reaches 0, any subsequent filters in this request " - "are applied. If none of those filters cause the event to be " - "suppressed, the event is reported. Otherwise, the event is not " - "reported. In either case subsequent events are never reported for " - "this request. " - "This modifier can be used with any event kind." - - (int count "Count before event. One for one-off.") + (Alt Count=1 + "Limit the requested event to be reported at most once after a " + "given number of occurrences. The event is not reported " + "the first count - 1 times this filter is reached. " + "To request a one-off event, call this method with a count of 1. " + "

    " + "Once the count reaches 0, any subsequent filters in this request " + "are applied. If none of those filters cause the event to be " + "suppressed, the event is reported. Otherwise, the event is not " + "reported. In either case subsequent events are never reported for " + "this request. " + "This modifier can be used with any event kind." + + (int count "Count before event. One for one-off.") ) (Alt Conditional=2 "Conditional on expression" (int exprID "For the future") ) - (Alt ThreadOnly=3 - "Restricts reported events to " - "those in the given thread. " - "This modifier can be used with any event kind " - "except for class unload. " - + (Alt ThreadOnly=3 + "Restricts reported events to " + "those in the given thread. " + "This modifier can be used with any event kind " + "except for class unload. " + (threadObject thread "Required thread") ) - (Alt ClassOnly=4 - "For class prepare events, restricts the events " - "generated by this request to be the " - "preparation of the given reference type and any subtypes. " - "For monitor wait and waited events, restricts the events " - "generated by this request to those whose monitor object " - "is of the given reference type or any of its subtypes. " - "For other events, restricts the events generated " - "by this request to those " - "whose location is in the given reference type or any of its subtypes. " - "An event will be generated for any location in a reference type that can " - "be safely cast to the given reference type. " - "This modifier can be used with any event kind except " - "class unload, thread start, and thread end. " - + (Alt ClassOnly=4 + "For class prepare events, restricts the events " + "generated by this request to be the " + "preparation of the given reference type and any subtypes. " + "For monitor wait and waited events, restricts the events " + "generated by this request to those whose monitor object " + "is of the given reference type or any of its subtypes. " + "For other events, restricts the events generated " + "by this request to those " + "whose location is in the given reference type or any of its subtypes. " + "An event will be generated for any location in a reference type that can " + "be safely cast to the given reference type. " + "This modifier can be used with any event kind except " + "class unload, thread start, and thread end. " + (referenceType clazz "Required class") ) - (Alt ClassMatch=5 - "Restricts reported events to those for classes whose name " - "matches the given restricted regular expression. " - "For class prepare events, the prepared class name " - "is matched. For class unload events, the " - "unloaded class name is matched. For monitor wait " - "and waited events, the name of the class of the " - "monitor object is matched. For other events, " - "the class name of the event's location is matched. " - "This modifier can be used with any event kind except " - "thread start and thread end. " - + (Alt ClassMatch=5 + "Restricts reported events to those for classes whose name " + "matches the given restricted regular expression. " + "For class prepare events, the prepared class name " + "is matched. For class unload events, the " + "unloaded class name is matched. For monitor wait " + "and waited events, the name of the class of the " + "monitor object is matched. For other events, " + "the class name of the event's location is matched. " + "This modifier can be used with any event kind except " + "thread start and thread end. " + (string classPattern "Required class pattern. " - "Matches are limited to exact matches of the " - "given class pattern and matches of patterns that " - "begin or end with '*'; for example, " - "\"*.Foo\" or \"java.*\". " - ) - + "Matches are limited to exact matches of the " + "given class pattern and matches of patterns that " + "begin or end with '*'; for example, " + "\"*.Foo\" or \"java.*\". " + ) + ) - (Alt ClassExclude=6 - "Restricts reported events to those for classes whose name " - "does not match the given restricted regular expression. " - "For class prepare events, the prepared class name " - "is matched. For class unload events, the " - "unloaded class name is matched. For monitor wait and " - "waited events, the name of the class of the monitor " - "object is matched. For other events, " - "the class name of the event's location is matched. " - "This modifier can be used with any event kind except " - "thread start and thread end. " - + (Alt ClassExclude=6 + "Restricts reported events to those for classes whose name " + "does not match the given restricted regular expression. " + "For class prepare events, the prepared class name " + "is matched. For class unload events, the " + "unloaded class name is matched. For monitor wait and " + "waited events, the name of the class of the monitor " + "object is matched. For other events, " + "the class name of the event's location is matched. " + "This modifier can be used with any event kind except " + "thread start and thread end. " + (string classPattern "Disallowed class pattern. " - "Matches are limited to exact matches of the " - "given class pattern and matches of patterns that " - "begin or end with '*'; for example, " - "\"*.Foo\" or \"java.*\". " - ) + "Matches are limited to exact matches of the " + "given class pattern and matches of patterns that " + "begin or end with '*'; for example, " + "\"*.Foo\" or \"java.*\". " + ) ) - (Alt LocationOnly=7 - "Restricts reported events to those that occur at " - "the given location. " - "This modifier can be used with " - "breakpoint, field access, field modification, " - "step, and exception event kinds. " - + (Alt LocationOnly=7 + "Restricts reported events to those that occur at " + "the given location. " + "This modifier can be used with " + "breakpoint, field access, field modification, " + "step, and exception event kinds. " + (location loc "Required location") ) - (Alt ExceptionOnly=8 - "Restricts reported exceptions by their class and " - "whether they are caught or uncaught. " - "This modifier can be used with " - "exception event kinds only. " - - (referenceType exceptionOrNull + (Alt ExceptionOnly=8 + "Restricts reported exceptions by their class and " + "whether they are caught or uncaught. " + "This modifier can be used with " + "exception event kinds only. " + + (referenceType exceptionOrNull "Exception to report. Null (0) means report " - "exceptions of all types. " - "A non-null type restricts the reported exception " - "events to exceptions of the given type or " - "any of its subtypes. " - ) + "exceptions of all types. " + "A non-null type restricts the reported exception " + "events to exceptions of the given type or " + "any of its subtypes. " + ) (boolean caught "Report caught exceptions") (boolean uncaught "Report uncaught exceptions. " - "Note that it " - "is not always possible to determine whether an " - "exception is caught or uncaught at the time it is " - "thrown. See the exception event catch location under " - "composite events " - "for more information. " - ) - + "Note that it " + "is not always possible to determine whether an " + "exception is caught or uncaught at the time it is " + "thrown. See the exception event catch location under " + "composite events " + "for more information. " + ) + ) - (Alt FieldOnly=9 - "Restricts reported events to those that occur for " - "a given field. " - "This modifier can be used with " - "field access and field modification event kinds only. " - + (Alt FieldOnly=9 + "Restricts reported events to those that occur for " + "a given field. " + "This modifier can be used with " + "field access and field modification event kinds only. " + (referenceType declaring "Type in which field is declared.") (field fieldID "Required field") ) - (Alt Step=10 - "Restricts reported step events " - "to those which satisfy " - "depth and size constraints. " - "This modifier can be used with " - "step event kinds only. " - + (Alt Step=10 + "Restricts reported step events " + "to those which satisfy " + "depth and size constraints. " + "This modifier can be used with " + "step event kinds only. " + (threadObject thread "Thread in which to step") (int size "size of each step. " "See JDWP.StepSize") @@ -2358,38 +2358,38 @@ JDWP "Java(tm) Debug Wire Protocol" "See JDWP.StepDepth") ) (Alt InstanceOnly=11 - "Restricts reported events to those whose " - "active 'this' object is the given object. " - "Match value is the null object for static methods. " - "This modifier can be used with any event kind " - "except class prepare, class unload, thread start, " - "and thread end. Introduced in JDWP version 1.4." - + "Restricts reported events to those whose " + "active 'this' object is the given object. " + "Match value is the null object for static methods. " + "This modifier can be used with any event kind " + "except class prepare, class unload, thread start, " + "and thread end. Introduced in JDWP version 1.4." + (object instance "Required 'this' object") ) (Alt SourceNameMatch=12 - "Restricts reported class prepare events to those " - "for reference types which have a source name " + "Restricts reported class prepare events to those " + "for reference types which have a source name " "which matches the given restricted regular expression. " "The source names are determined by the reference type's " " " "SourceDebugExtension. " - "This modifier can only be used with class prepare " + "This modifier can only be used with class prepare " "events. " "Since JDWP version 1.6. Requires the canUseSourceNameFilters " "capability - see " "CapabilitiesNew." (string sourceNamePattern "Required source name pattern. " - "Matches are limited to exact matches of the " - "given pattern and matches of patterns that " - "begin or end with '*'; for example, " - "\"*.Foo\" or \"java.*\". " + "Matches are limited to exact matches of the " + "given pattern and matches of patterns that " + "begin or end with '*'; for example, " + "\"*.Foo\" or \"java.*\". " ) ) ) - ) + ) ) (Reply (int requestID "ID of created request") @@ -2410,11 +2410,11 @@ JDWP "Java(tm) Debug Wire Protocol" ) (Command Clear=2 "Clear an event request. See JDWP.EventKind " - "for a complete list of events that can be cleared. Only the event request matching " - "the specified event kind and requestID is cleared. If there isn't a matching event " - "request the command is a no-op and does not result in an error. Automatically " - "generated events do not have a corresponding event request and may not be cleared " - "using this command." + "for a complete list of events that can be cleared. Only the event request matching " + "the specified event kind and requestID is cleared. If there isn't a matching event " + "request the command is a no-op and does not result in an error. Automatically " + "generated events do not have a corresponding event request and may not be cleared " + "using this command." (Out (byte eventKind "Event kind to clear") (int requestID "ID of request to clear") @@ -2423,7 +2423,7 @@ JDWP "Java(tm) Debug Wire Protocol" ) (ErrorSet (Error VM_DEAD) - (Error INVALID_EVENT_TYPE) + (Error INVALID_EVENT_TYPE) ) ) (Command ClearAllBreakpoints=3 @@ -2440,26 +2440,26 @@ JDWP "Java(tm) Debug Wire Protocol" (CommandSet StackFrame=16 (Command GetValues=1 "Returns the value of one or more local variables in a " - "given frame. Each variable must be visible at the frame's code index. " - "Even if local variable information is not available, values can " - "be retrieved if the front-end is able to " - "determine the correct local variable index. (Typically, this " - "index can be determined for method arguments from the method " - "signature without access to the local variable table information.) " + "given frame. Each variable must be visible at the frame's code index. " + "Even if local variable information is not available, values can " + "be retrieved if the front-end is able to " + "determine the correct local variable index. (Typically, this " + "index can be determined for method arguments from the method " + "signature without access to the local variable table information.) " (Out (threadObject thread "The frame's thread. ") (frame frame "The frame ID. ") (Repeat slots "The number of values to get. " - (Group SlotInfo + (Group SlotInfo (int slot "The local variable's index in the frame. ") (byte sigbyte "A tag " - "identifying the type of the variable ") + "identifying the type of the variable ") ) - ) + ) ) (Reply (Repeat values "The number of values retrieved, always equal to slots, " - "the number of values to get." + "the number of values to get." (value slotValue "The value of the local variable. ") ) ) @@ -2467,32 +2467,32 @@ JDWP "Java(tm) Debug Wire Protocol" (Error INVALID_THREAD) (Error INVALID_OBJECT) (Error INVALID_FRAMEID) - (Error INVALID_SLOT) + (Error INVALID_SLOT) (Error VM_DEAD) ) ) (Command SetValues=2 "Sets the value of one or more local variables. " - "Each variable must be visible at the current frame code index. " - "For primitive values, the value's type must match the " - "variable's type exactly. For object values, there must be a " - "widening reference conversion from the value's type to the - "variable's type and the variable's type must be loaded. " - "

    " - "Even if local variable information is not available, values can " - "be set, if the front-end is able to " - "determine the correct local variable index. (Typically, this - "index can be determined for method arguments from the method " - "signature without access to the local variable table information.) " + "Each variable must be visible at the current frame code index. " + "For primitive values, the value's type must match the " + "variable's type exactly. For object values, there must be a " + "widening reference conversion from the value's type to the + "variable's type and the variable's type must be loaded. " + "

    " + "Even if local variable information is not available, values can " + "be set, if the front-end is able to " + "determine the correct local variable index. (Typically, this + "index can be determined for method arguments from the method " + "signature without access to the local variable table information.) " (Out (threadObject thread "The frame's thread. ") (frame frame "The frame ID. ") (Repeat slotValues "The number of values to set. " - (Group SlotInfo + (Group SlotInfo (int slot "The slot ID. ") (value slotValue "The value to set. ") ) - ) + ) ) (Reply "none" ) @@ -2521,17 +2521,17 @@ JDWP "Java(tm) Debug Wire Protocol" (Error VM_DEAD) ) ) - (Command PopFrames=4 - "Pop the top-most stack frames of the thread stack, up to, and including 'frame'. " - "The thread must be suspended to perform this command. " - "The top-most stack frames are discarded and the stack frame previous to 'frame' " - "becomes the current frame. The operand stack is restored -- the argument values " - "are added back and if the invoke was not invokestatic, " - "objectref is added back as well. The Java virtual machine " - "program counter is restored to the opcode of the invoke instruction." - "

    " + (Command PopFrames=4 + "Pop the top-most stack frames of the thread stack, up to, and including 'frame'. " + "The thread must be suspended to perform this command. " + "The top-most stack frames are discarded and the stack frame previous to 'frame' " + "becomes the current frame. The operand stack is restored -- the argument values " + "are added back and if the invoke was not invokestatic, " + "objectref is added back as well. The Java virtual machine " + "program counter is restored to the opcode of the invoke instruction." + "

    " "Since JDWP version 1.4. Requires canPopFrames capability - see " - "CapabilitiesNew." + "CapabilitiesNew." (Out (threadObject thread "The thread object ID. ") (frame frame "The frame ID. ") @@ -2557,9 +2557,9 @@ JDWP "Java(tm) Debug Wire Protocol" (classObject classObject "The class object. ") ) (Reply - (byte refTypeTag "Kind " - "of following reference type. ") - (referenceTypeID typeID "reflected reference type") + (byte refTypeTag "Kind " + "of following reference type. ") + (referenceTypeID typeID "reflected reference type") ) (ErrorSet (Error INVALID_OBJECT) @@ -2569,349 +2569,349 @@ JDWP "Java(tm) Debug Wire Protocol" ) (CommandSet Event=64 (Command Composite=100 - "Several events may occur at a given time in the target VM. " - "For example, there may be more than one breakpoint request " - "for a given location " - "or you might single step to the same location as a " - "breakpoint request. These events are delivered " - "together as a composite event. For uniformity, a " - "composite event is always used " - "to deliver events, even if there is only one event to report. " - "

    " - "The events that are grouped in a composite event are restricted in the " - "following ways: " - "

    " - "

      " - "
    • Only with other thread start events for the same thread:" - "
        " - "
      • Thread Start Event" - "
      " - "
    • Only with other thread death events for the same thread:" - "
        " - "
      • Thread Death Event" - "
      " - "
    • Only with other class prepare events for the same class:" - "
        " - "
      • Class Prepare Event" - "
      " - "
    • Only with other class unload events for the same class:" - "
        " - "
      • Class Unload Event" - "
      " - "
    • Only with other access watchpoint events for the same field access:" - "
        " - "
      • Access Watchpoint Event" - "
      " - "
    • Only with other modification watchpoint events for the same field " - "modification:" - "
        " - "
      • Modification Watchpoint Event" - "
      " - "
    • Only with other Monitor contended enter events for the same monitor object: " - "
        " - "
      • Monitor Contended Enter Event" - "
      " - "
    • Only with other Monitor contended entered events for the same monitor object: " - "
        " - "
      • Monitor Contended Entered Event" - "
      " - "
    • Only with other Monitor wait events for the same monitor object: " - "
        " - "
      • Monitor Wait Event" - "
      " - "
    • Only with other Monitor waited events for the same monitor object: " - "
        " - "
      • Monitor Waited Event" - "
      " - "
    • Only with other ExceptionEvents for the same exception occurrance:" - "
        " - "
      • ExceptionEvent" - "
      " - "
    • Only with other members of this group, at the same location " - "and in the same thread: " - "
        " - "
      • Breakpoint Event" - "
      • Step Event" - "
      • Method Entry Event" - "
      • Method Exit Event" - "
      " - "
    " - "

    " - "The VM Start Event and VM Death Event are automatically generated events. " - "This means they do not need to be requested using the " - "EventRequest.Set command. " - "The VM Start event signals the completion of VM initialization. The VM Death " - "event signals the termination of the VM." - "If there is a debugger connected at the time when an automatically generated " - "event occurs it is sent from the target VM. Automatically generated events may " - "also be requested using the EventRequest.Set command and thus multiple events " - "of the same event kind will be sent from the target VM when an event occurs." - "Automatically generated events are sent with the requestID field " - "in the Event Data set to 0. The value of the suspendPolicy field in the " - "Event Data depends on the event. For the automatically generated VM Start " - "Event the value of suspendPolicy is not defined and is therefore implementation " - "or configuration specific. In the Sun implementation, for example, the " - "suspendPolicy is specified as an option to the JDWP agent at launch-time." - "The automatically generated VM Death Event will have the suspendPolicy set to " - "NONE." - + "Several events may occur at a given time in the target VM. " + "For example, there may be more than one breakpoint request " + "for a given location " + "or you might single step to the same location as a " + "breakpoint request. These events are delivered " + "together as a composite event. For uniformity, a " + "composite event is always used " + "to deliver events, even if there is only one event to report. " + "

    " + "The events that are grouped in a composite event are restricted in the " + "following ways: " + "

    " + "

      " + "
    • Only with other thread start events for the same thread:" + "
        " + "
      • Thread Start Event" + "
      " + "
    • Only with other thread death events for the same thread:" + "
        " + "
      • Thread Death Event" + "
      " + "
    • Only with other class prepare events for the same class:" + "
        " + "
      • Class Prepare Event" + "
      " + "
    • Only with other class unload events for the same class:" + "
        " + "
      • Class Unload Event" + "
      " + "
    • Only with other access watchpoint events for the same field access:" + "
        " + "
      • Access Watchpoint Event" + "
      " + "
    • Only with other modification watchpoint events for the same field " + "modification:" + "
        " + "
      • Modification Watchpoint Event" + "
      " + "
    • Only with other Monitor contended enter events for the same monitor object: " + "
        " + "
      • Monitor Contended Enter Event" + "
      " + "
    • Only with other Monitor contended entered events for the same monitor object: " + "
        " + "
      • Monitor Contended Entered Event" + "
      " + "
    • Only with other Monitor wait events for the same monitor object: " + "
        " + "
      • Monitor Wait Event" + "
      " + "
    • Only with other Monitor waited events for the same monitor object: " + "
        " + "
      • Monitor Waited Event" + "
      " + "
    • Only with other ExceptionEvents for the same exception occurrance:" + "
        " + "
      • ExceptionEvent" + "
      " + "
    • Only with other members of this group, at the same location " + "and in the same thread: " + "
        " + "
      • Breakpoint Event" + "
      • Step Event" + "
      • Method Entry Event" + "
      • Method Exit Event" + "
      " + "
    " + "

    " + "The VM Start Event and VM Death Event are automatically generated events. " + "This means they do not need to be requested using the " + "EventRequest.Set command. " + "The VM Start event signals the completion of VM initialization. The VM Death " + "event signals the termination of the VM." + "If there is a debugger connected at the time when an automatically generated " + "event occurs it is sent from the target VM. Automatically generated events may " + "also be requested using the EventRequest.Set command and thus multiple events " + "of the same event kind will be sent from the target VM when an event occurs." + "Automatically generated events are sent with the requestID field " + "in the Event Data set to 0. The value of the suspendPolicy field in the " + "Event Data depends on the event. For the automatically generated VM Start " + "Event the value of suspendPolicy is not defined and is therefore implementation " + "or configuration specific. In the Sun implementation, for example, the " + "suspendPolicy is specified as an option to the JDWP agent at launch-time." + "The automatically generated VM Death Event will have the suspendPolicy set to " + "NONE." + (Event "Generated event" - (byte suspendPolicy + (byte suspendPolicy "Which threads where suspended by this composite event?") (Repeat events "Events in set." (Select Events (byte eventKind "Event kind selector") - (Alt VMStart=JDWP.EventKind.VM_START - "Notification of initialization of a target VM. This event is " - "received before the main thread is started and before any " - "application code has been executed. Before this event occurs " - "a significant amount of system code has executed and a number " - "of system classes have been loaded. " - "This event is always generated by the target VM, even " - "if not explicitly requested." - - (int requestID - "Request that generated event (or 0 if this " - "event is automatically generated.") + (Alt VMStart=JDWP.EventKind.VM_START + "Notification of initialization of a target VM. This event is " + "received before the main thread is started and before any " + "application code has been executed. Before this event occurs " + "a significant amount of system code has executed and a number " + "of system classes have been loaded. " + "This event is always generated by the target VM, even " + "if not explicitly requested." + + (int requestID + "Request that generated event (or 0 if this " + "event is automatically generated.") (threadObject thread "Initial thread") - ) - (Alt SingleStep=JDWP.EventKind.SINGLE_STEP - "Notification of step completion in the target VM. The step event " - "is generated before the code at its location is executed. " - + ) + (Alt SingleStep=JDWP.EventKind.SINGLE_STEP + "Notification of step completion in the target VM. The step event " + "is generated before the code at its location is executed. " + (int requestID "Request that generated event") (threadObject thread "Stepped thread") (location location "Location stepped to") - ) + ) (Alt Breakpoint=JDWP.EventKind.BREAKPOINT - "Notification of a breakpoint in the target VM. The breakpoint event " - "is generated before the code at its location is executed. " - + "Notification of a breakpoint in the target VM. The breakpoint event " + "is generated before the code at its location is executed. " + (int requestID "Request that generated event") (threadObject thread "Thread which hit breakpoint") (location location "Location hit") - ) + ) (Alt MethodEntry=JDWP.EventKind.METHOD_ENTRY - "Notification of a method invocation in the target VM. This event " - "is generated before any code in the invoked method has executed. " - "Method entry events are generated for both native and non-native " - "methods. " - "

    " - "In some VMs method entry events can occur for a particular thread " - "before its thread start event occurs if methods are called " - "as part of the thread's initialization. " + "Notification of a method invocation in the target VM. This event " + "is generated before any code in the invoked method has executed. " + "Method entry events are generated for both native and non-native " + "methods. " + "

    " + "In some VMs method entry events can occur for a particular thread " + "before its thread start event occurs if methods are called " + "as part of the thread's initialization. " (int requestID "Request that generated event") (threadObject thread "Thread which entered method") (location location "The initial executable location in the method.") - ) + ) (Alt MethodExit=JDWP.EventKind.METHOD_EXIT - "Notification of a method return in the target VM. This event " - "is generated after all code in the method has executed, but the " - "location of this event is the last executed location in the method. " - "Method exit events are generated for both native and non-native " - "methods. Method exit events are not generated if the method terminates " - "with a thrown exception. " - + "Notification of a method return in the target VM. This event " + "is generated after all code in the method has executed, but the " + "location of this event is the last executed location in the method. " + "Method exit events are generated for both native and non-native " + "methods. Method exit events are not generated if the method terminates " + "with a thrown exception. " + (int requestID "Request that generated event") (threadObject thread "Thread which exited method") (location location "Location of exit") - ) + ) (Alt MethodExitWithReturnValue=JDWP.EventKind.METHOD_EXIT_WITH_RETURN_VALUE - "Notification of a method return in the target VM. This event " - "is generated after all code in the method has executed, but the " - "location of this event is the last executed location in the method. " - "Method exit events are generated for both native and non-native " - "methods. Method exit events are not generated if the method terminates " - "with a thrown exception.

    Since JDWP version 1.6. " - + "Notification of a method return in the target VM. This event " + "is generated after all code in the method has executed, but the " + "location of this event is the last executed location in the method. " + "Method exit events are generated for both native and non-native " + "methods. Method exit events are not generated if the method terminates " + "with a thrown exception.

    Since JDWP version 1.6. " + (int requestID "Request that generated event") (threadObject thread "Thread which exited method") (location location "Location of exit") (value value "Value that will be returned by the method") ) - (Alt MonitorContendedEnter=JDWP.EventKind.MONITOR_CONTENDED_ENTER - "Notification that a thread in the target VM is attempting " - "to enter a monitor that is already acquired by another thread. " - "Requires canRequestMonitorEvents capability - see " - "CapabilitiesNew. " - "

    Since JDWP version 1.6. " + (Alt MonitorContendedEnter=JDWP.EventKind.MONITOR_CONTENDED_ENTER + "Notification that a thread in the target VM is attempting " + "to enter a monitor that is already acquired by another thread. " + "Requires canRequestMonitorEvents capability - see " + "CapabilitiesNew. " + "

    Since JDWP version 1.6. " - (int requestID + (int requestID "Request that generated event") - (threadObject thread "Thread which is trying to enter the monitor") - (tagged-object object "Monitor object reference") - (location location "Location of contended monitor enter") + (threadObject thread "Thread which is trying to enter the monitor") + (tagged-object object "Monitor object reference") + (location location "Location of contended monitor enter") ) - (Alt MonitorContendedEntered=JDWP.EventKind.MONITOR_CONTENDED_ENTERED - "Notification of a thread in the target VM is entering a monitor " - "after waiting for it to be released by another thread. " - "Requires canRequestMonitorEvents capability - see " - "CapabilitiesNew. " - "

    Since JDWP version 1.6. " + (Alt MonitorContendedEntered=JDWP.EventKind.MONITOR_CONTENDED_ENTERED + "Notification of a thread in the target VM is entering a monitor " + "after waiting for it to be released by another thread. " + "Requires canRequestMonitorEvents capability - see " + "CapabilitiesNew. " + "

    Since JDWP version 1.6. " - (int requestID + (int requestID "Request that generated event") - (threadObject thread "Thread which entered monitor") - (tagged-object object "Monitor object reference") - (location location "Location of contended monitor enter") + (threadObject thread "Thread which entered monitor") + (tagged-object object "Monitor object reference") + (location location "Location of contended monitor enter") ) - (Alt MonitorWait=JDWP.EventKind.MONITOR_WAIT + (Alt MonitorWait=JDWP.EventKind.MONITOR_WAIT "Notification of a thread about to wait on a monitor object. " - "Requires canRequestMonitorEvents capability - see " - "CapabilitiesNew. " - "

    Since JDWP version 1.6. " - - (int requestID - "Request that generated event") - (threadObject thread "Thread which is about to wait") - (tagged-object object "Monitor object reference") - (location location "Location at which the wait will occur") - (long timeout "Thread wait time in milliseconds") - ) - (Alt MonitorWaited=JDWP.EventKind.MONITOR_WAITED - "Notification that a thread in the target VM has finished waiting on " - "Requires canRequestMonitorEvents capability - see " - "CapabilitiesNew. " - "a monitor object. " - "

    Since JDWP version 1.6. " + "Requires canRequestMonitorEvents capability - see " + "CapabilitiesNew. " + "

    Since JDWP version 1.6. " - (int requestID + (int requestID "Request that generated event") - (threadObject thread "Thread which waited") - (tagged-object object "Monitor object reference") - (location location "Location at which the wait occured") - (boolean timed_out "True if timed out") + (threadObject thread "Thread which is about to wait") + (tagged-object object "Monitor object reference") + (location location "Location at which the wait will occur") + (long timeout "Thread wait time in milliseconds") + ) + (Alt MonitorWaited=JDWP.EventKind.MONITOR_WAITED + "Notification that a thread in the target VM has finished waiting on " + "Requires canRequestMonitorEvents capability - see " + "CapabilitiesNew. " + "a monitor object. " + "

    Since JDWP version 1.6. " + + (int requestID + "Request that generated event") + (threadObject thread "Thread which waited") + (tagged-object object "Monitor object reference") + (location location "Location at which the wait occured") + (boolean timed_out "True if timed out") ) (Alt Exception=JDWP.EventKind.EXCEPTION - "Notification of an exception in the target VM. " - "If the exception is thrown from a non-native method, " - "the exception event is generated at the location where the " - "exception is thrown. " - "If the exception is thrown from a native method, the exception event " - "is generated at the first non-native location reached after the exception " - "is thrown. " + "Notification of an exception in the target VM. " + "If the exception is thrown from a non-native method, " + "the exception event is generated at the location where the " + "exception is thrown. " + "If the exception is thrown from a native method, the exception event " + "is generated at the first non-native location reached after the exception " + "is thrown. " (int requestID "Request that generated event") (threadObject thread "Thread with exception") (location location "Location of exception throw " - "(or first non-native location after throw if thrown from a native method)") + "(or first non-native location after throw if thrown from a native method)") (tagged-object exception "Thrown exception") - (location catchLocation - "Location of catch, or 0 if not caught. An exception " - "is considered to be caught if, at the point of the throw, the " - "current location is dynamically enclosed in a try statement that " - "handles the exception. (See the JVM specification for details). " - "If there is such a try statement, the catch location is the " - "first location in the appropriate catch clause. " - "

    " - "If there are native methods in the call stack at the time of the " - "exception, there are important restrictions to note about the " - "returned catch location. In such cases, " - "it is not possible to predict whether an exception will be handled " - "by some native method on the call stack. " - "Thus, it is possible that exceptions considered uncaught " - "here will, in fact, be handled by a native method and not cause " - "termination of the target VM. Furthermore, it cannot be assumed that the " - "catch location returned here will ever be reached by the throwing " - "thread. If there is " - "a native frame between the current location and the catch location, " - "the exception might be handled and cleared in that native method " - "instead. " - "

    " - "Note that compilers can generate try-catch blocks in some cases " - "where they are not explicit in the source code; for example, " - "the code generated for synchronized and " - "finally blocks can contain implicit try-catch blocks. " - "If such an implicitly generated try-catch is " - "present on the call stack at the time of the throw, the exception " - "will be considered caught even though it appears to be uncaught from " - "examination of the source code. " - ) - ) + (location catchLocation + "Location of catch, or 0 if not caught. An exception " + "is considered to be caught if, at the point of the throw, the " + "current location is dynamically enclosed in a try statement that " + "handles the exception. (See the JVM specification for details). " + "If there is such a try statement, the catch location is the " + "first location in the appropriate catch clause. " + "

    " + "If there are native methods in the call stack at the time of the " + "exception, there are important restrictions to note about the " + "returned catch location. In such cases, " + "it is not possible to predict whether an exception will be handled " + "by some native method on the call stack. " + "Thus, it is possible that exceptions considered uncaught " + "here will, in fact, be handled by a native method and not cause " + "termination of the target VM. Furthermore, it cannot be assumed that the " + "catch location returned here will ever be reached by the throwing " + "thread. If there is " + "a native frame between the current location and the catch location, " + "the exception might be handled and cleared in that native method " + "instead. " + "

    " + "Note that compilers can generate try-catch blocks in some cases " + "where they are not explicit in the source code; for example, " + "the code generated for synchronized and " + "finally blocks can contain implicit try-catch blocks. " + "If such an implicitly generated try-catch is " + "present on the call stack at the time of the throw, the exception " + "will be considered caught even though it appears to be uncaught from " + "examination of the source code. " + ) + ) (Alt ThreadStart=JDWP.EventKind.THREAD_START - "Notification of a new running thread in the target VM. " - "The new thread can be the result of a call to " - "java.lang.Thread.start or the result of " - "attaching a new thread to the VM though JNI. The " - "notification is generated by the new thread some time before " - "its execution starts. " - "Because of this timing, it is possible to receive other events " - "for the thread before this event is received. (Notably, " - "Method Entry Events and Method Exit Events might occur " - "during thread initialization. " - "It is also possible for the " - "VirtualMachine AllThreads " - "command to return " - "a thread before its thread start event is received. " - "

    " - "Note that this event gives no information " - "about the creation of the thread object which may have happened " - "much earlier, depending on the VM being debugged. " - + "Notification of a new running thread in the target VM. " + "The new thread can be the result of a call to " + "java.lang.Thread.start or the result of " + "attaching a new thread to the VM though JNI. The " + "notification is generated by the new thread some time before " + "its execution starts. " + "Because of this timing, it is possible to receive other events " + "for the thread before this event is received. (Notably, " + "Method Entry Events and Method Exit Events might occur " + "during thread initialization. " + "It is also possible for the " + "VirtualMachine AllThreads " + "command to return " + "a thread before its thread start event is received. " + "

    " + "Note that this event gives no information " + "about the creation of the thread object which may have happened " + "much earlier, depending on the VM being debugged. " + (int requestID "Request that generated event") (threadObject thread "Started thread") - ) + ) (Alt ThreadDeath=JDWP.EventKind.THREAD_DEATH - "Notification of a completed thread in the target VM. The " - "notification is generated by the dying thread before it terminates. " - "Because of this timing, it is possible " - "for {@link VirtualMachine#allThreads} to return this thread " - "after this event is received. " - "

    " - "Note that this event gives no information " - "about the lifetime of the thread object. It may or may not be collected " - "soon depending on what references exist in the target VM. " - + "Notification of a completed thread in the target VM. The " + "notification is generated by the dying thread before it terminates. " + "Because of this timing, it is possible " + "for {@link VirtualMachine#allThreads} to return this thread " + "after this event is received. " + "

    " + "Note that this event gives no information " + "about the lifetime of the thread object. It may or may not be collected " + "soon depending on what references exist in the target VM. " + (int requestID "Request that generated event") (threadObject thread "Ending thread") - ) + ) (Alt ClassPrepare=JDWP.EventKind.CLASS_PREPARE - "Notification of a class prepare in the target VM. See the JVM " - "specification for a definition of class preparation. Class prepare " - "events are not generated for primtiive classes (for example, " - "java.lang.Integer.TYPE). " - + "Notification of a class prepare in the target VM. See the JVM " + "specification for a definition of class preparation. Class prepare " + "events are not generated for primtiive classes (for example, " + "java.lang.Integer.TYPE). " + (int requestID "Request that generated event") (threadObject thread "Preparing thread. " - "In rare cases, this event may occur in a debugger system " - "thread within the target VM. Debugger threads take precautions " - "to prevent these events, but they cannot be avoided under some " - "conditions, especially for some subclasses of " - "java.lang.Error. " - "If the event was generated by a debugger system thread, the " - "value returned by this method is null, and if the requested " - "suspend policy " - "for the event was EVENT_THREAD " - "all threads will be suspended instead, and the " - "composite event's suspend policy will reflect this change. " - "

    " - "Note that the discussion above does not apply to system threads " - "created by the target VM during its normal (non-debug) operation. " - ) + "In rare cases, this event may occur in a debugger system " + "thread within the target VM. Debugger threads take precautions " + "to prevent these events, but they cannot be avoided under some " + "conditions, especially for some subclasses of " + "java.lang.Error. " + "If the event was generated by a debugger system thread, the " + "value returned by this method is null, and if the requested " + "suspend policy " + "for the event was EVENT_THREAD " + "all threads will be suspended instead, and the " + "composite event's suspend policy will reflect this change. " + "

    " + "Note that the discussion above does not apply to system threads " + "created by the target VM during its normal (non-debug) operation. " + ) (byte refTypeTag "Kind of reference type. " "See JDWP.TypeTag") (referenceTypeID typeID "Type being prepared") (string signature "Type signature") (int status "Status of type. " "See JDWP.ClassStatus") - ) + ) (Alt ClassUnload=JDWP.EventKind.CLASS_UNLOAD - "Notification of a class unload in the target VM. " - "

    " - "There are severe constraints on the debugger back-end during " - "garbage collection, so unload information is greatly limited. " - + "Notification of a class unload in the target VM. " + "

    " + "There are severe constraints on the debugger back-end during " + "garbage collection, so unload information is greatly limited. " + (int requestID "Request that generated event") (string signature "Type signature") ) (Alt FieldAccess=JDWP.EventKind.FIELD_ACCESS - "Notification of a field access in the target VM. " - "Field modifications " - "are not considered field accesses. " - "Requires canWatchFieldAccess capability - see " - "CapabilitiesNew." - + "Notification of a field access in the target VM. " + "Field modifications " + "are not considered field accesses. " + "Requires canWatchFieldAccess capability - see " + "CapabilitiesNew." + (int requestID "Request that generated event") (threadObject thread "Accessing thread") (location location "Location of access") @@ -2923,10 +2923,10 @@ JDWP "Java(tm) Debug Wire Protocol" "Object being accessed (null=0 for statics") ) (Alt FieldModification=JDWP.EventKind.FIELD_MODIFICATION - "Notification of a field modification in the target VM. " - "Requires canWatchFieldModification capability - see " - "CapabilitiesNew." - + "Notification of a field modification in the target VM. " + "Requires canWatchFieldModification capability - see " + "CapabilitiesNew." + (int requestID "Request that generated event") (threadObject thread "Modifying thread") (location location "Location of modify") @@ -2938,10 +2938,10 @@ JDWP "Java(tm) Debug Wire Protocol" "Object being modified (null=0 for statics") (value valueToBe "Value to be assigned") ) - (Alt VMDeath=JDWP.EventKind.VM_DEATH - (int requestID + (Alt VMDeath=JDWP.EventKind.VM_DEATH + (int requestID "Request that generated event") - ) + ) ) ) ) @@ -2950,33 +2950,33 @@ JDWP "Java(tm) Debug Wire Protocol" (ConstantSet Error (Constant NONE =0 "No error has occurred.") (Constant INVALID_THREAD =10 "Passed thread is null, is not a valid thread or has exited.") - (Constant INVALID_THREAD_GROUP =11 "Thread group invalid.") - (Constant INVALID_PRIORITY =12 "Invalid priority.") + (Constant INVALID_THREAD_GROUP =11 "Thread group invalid.") + (Constant INVALID_PRIORITY =12 "Invalid priority.") (Constant THREAD_NOT_SUSPENDED =13 "If the specified thread has not been " - "suspended by an event.") - (Constant THREAD_SUSPENDED =14 "Thread already suspended.") - (Constant THREAD_NOT_ALIVE =15 "Thread has not been started or is now dead.") + "suspended by an event.") + (Constant THREAD_SUSPENDED =14 "Thread already suspended.") + (Constant THREAD_NOT_ALIVE =15 "Thread has not been started or is now dead.") (Constant INVALID_OBJECT =20 "If this reference type has been unloaded " - "and garbage collected.") - (Constant INVALID_CLASS =21 "Invalid class.") - (Constant CLASS_NOT_PREPARED =22 "Class has been loaded but not yet prepared.") - (Constant INVALID_METHODID =23 "Invalid method.") - (Constant INVALID_LOCATION =24 "Invalid location.") - (Constant INVALID_FIELDID =25 "Invalid field.") - (Constant INVALID_FRAMEID =30 "Invalid jframeID.") + "and garbage collected.") + (Constant INVALID_CLASS =21 "Invalid class.") + (Constant CLASS_NOT_PREPARED =22 "Class has been loaded but not yet prepared.") + (Constant INVALID_METHODID =23 "Invalid method.") + (Constant INVALID_LOCATION =24 "Invalid location.") + (Constant INVALID_FIELDID =25 "Invalid field.") + (Constant INVALID_FRAMEID =30 "Invalid jframeID.") (Constant NO_MORE_FRAMES =31 "There are no more Java or JNI frames on the " - "call stack.") - (Constant OPAQUE_FRAME =32 "Information about the frame is not available.") + "call stack.") + (Constant OPAQUE_FRAME =32 "Information about the frame is not available.") (Constant NOT_CURRENT_FRAME =33 "Operation can only be performed on current frame.") (Constant TYPE_MISMATCH =34 "The variable is not an appropriate type for " - "the function used.") - (Constant INVALID_SLOT =35 "Invalid slot.") - (Constant DUPLICATE =40 "Item already set.") - (Constant NOT_FOUND =41 "Desired element not found.") - (Constant INVALID_MONITOR =50 "Invalid monitor.") - (Constant NOT_MONITOR_OWNER =51 "This thread doesn't own the monitor.") - (Constant INTERRUPT =52 "The call has been interrupted before completion.") + "the function used.") + (Constant INVALID_SLOT =35 "Invalid slot.") + (Constant DUPLICATE =40 "Item already set.") + (Constant NOT_FOUND =41 "Desired element not found.") + (Constant INVALID_MONITOR =50 "Invalid monitor.") + (Constant NOT_MONITOR_OWNER =51 "This thread doesn't own the monitor.") + (Constant INTERRUPT =52 "The call has been interrupted before completion.") (Constant INVALID_CLASS_FORMAT =60 "The virtual machine attempted to read a class " "file and determined that the file is malformed " "or otherwise cannot be interpreted as a class file.") @@ -2985,60 +2985,60 @@ JDWP "Java(tm) Debug Wire Protocol" "initializing a class.") (Constant FAILS_VERIFICATION =62 "The verifier detected that a class file, " "though well formed, contained some sort of " - "internal inconsistency or security problem.") + "internal inconsistency or security problem.") (Constant ADD_METHOD_NOT_IMPLEMENTED - =63 "Adding methods has not been implemented.") + =63 "Adding methods has not been implemented.") (Constant SCHEMA_CHANGE_NOT_IMPLEMENTED - =64 "Schema change has not been implemented.") + =64 "Schema change has not been implemented.") (Constant INVALID_TYPESTATE =65 "The state of the thread has been modified, " - "and is now inconsistent.") + "and is now inconsistent.") (Constant HIERARCHY_CHANGE_NOT_IMPLEMENTED =66 "A direct superclass is different for the new class " "version, or the set of directly implemented " "interfaces is different " - "and canUnrestrictedlyRedefineClasses is false.") + "and canUnrestrictedlyRedefineClasses is false.") (Constant DELETE_METHOD_NOT_IMPLEMENTED =67 "The new class version does not declare a method " "declared in the old class version " - "and canUnrestrictedlyRedefineClasses is false.") + "and canUnrestrictedlyRedefineClasses is false.") (Constant UNSUPPORTED_VERSION =68 "A class file has a version number not supported " - "by this VM.") + "by this VM.") (Constant NAMES_DONT_MATCH =69 "The class name defined in the new class file is " - "different from the name in the old class object.") - (Constant CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED + "different from the name in the old class object.") + (Constant CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED =70 "The new class version has different modifiers and " - "and canUnrestrictedlyRedefineClasses is false.") + "and canUnrestrictedlyRedefineClasses is false.") (Constant METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED =71 "A method in the new class version has " "different modifiers " "than its counterpart in the old class version and " - "and canUnrestrictedlyRedefineClasses is false.") + "and canUnrestrictedlyRedefineClasses is false.") (Constant NOT_IMPLEMENTED =99 "The functionality is not implemented in " "this virtual machine.") - (Constant NULL_POINTER =100 "Invalid pointer.") - (Constant ABSENT_INFORMATION =101 "Desired information is not available.") - (Constant INVALID_EVENT_TYPE =102 "The specified event type id is not recognized.") - (Constant ILLEGAL_ARGUMENT =103 "Illegal argument.") + (Constant NULL_POINTER =100 "Invalid pointer.") + (Constant ABSENT_INFORMATION =101 "Desired information is not available.") + (Constant INVALID_EVENT_TYPE =102 "The specified event type id is not recognized.") + (Constant ILLEGAL_ARGUMENT =103 "Illegal argument.") (Constant OUT_OF_MEMORY =110 "The function needed to allocate memory and " - "no more memory was available for allocation.") + "no more memory was available for allocation.") (Constant ACCESS_DENIED =111 "Debugging has not been enabled in this " - "virtual machine. JVMTI cannot be used.") - (Constant VM_DEAD =112 "The virtual machine is not running.") - (Constant INTERNAL =113 "An unexpected internal error has occurred.") + "virtual machine. JVMTI cannot be used.") + (Constant VM_DEAD =112 "The virtual machine is not running.") + (Constant INTERNAL =113 "An unexpected internal error has occurred.") (Constant UNATTACHED_THREAD =115 "The thread being used to call this function " "is not attached to the virtual machine. " - "Calls must be made from attached threads.") - (Constant INVALID_TAG =500 "object type id or class tag.") - (Constant ALREADY_INVOKING =502 "Previous invoke not complete.") - (Constant INVALID_INDEX =503 "Index is invalid.") - (Constant INVALID_LENGTH =504 "The length is invalid.") - (Constant INVALID_STRING =506 "The string is invalid.") - (Constant INVALID_CLASS_LOADER =507 "The class loader is invalid.") - (Constant INVALID_ARRAY =508 "The array is invalid.") - (Constant TRANSPORT_LOAD =509 "Unable to load the transport.") + "Calls must be made from attached threads.") + (Constant INVALID_TAG =500 "object type id or class tag.") + (Constant ALREADY_INVOKING =502 "Previous invoke not complete.") + (Constant INVALID_INDEX =503 "Index is invalid.") + (Constant INVALID_LENGTH =504 "The length is invalid.") + (Constant INVALID_STRING =506 "The string is invalid.") + (Constant INVALID_CLASS_LOADER =507 "The class loader is invalid.") + (Constant INVALID_ARRAY =508 "The array is invalid.") + (Constant TRANSPORT_LOAD =509 "Unable to load the transport.") (Constant TRANSPORT_INIT =510 "Unable to initialize the transport.") (Constant NATIVE_METHOD =511 ) - (Constant INVALID_COUNT =512 "The count is invalid.") + (Constant INVALID_COUNT =512 "The count is invalid.") ) (ConstantSet EventKind (Constant SINGLE_STEP =1 ) @@ -3077,7 +3077,7 @@ JDWP "Java(tm) Debug Wire Protocol" ) (ConstantSet SuspendStatus - (Constant SUSPEND_STATUS_SUSPENDED = 0x1 ) + (Constant SUSPEND_STATUS_SUSPENDED = 0x1 ) ) (ConstantSet ClassStatus (Constant VERIFIED =1 ) @@ -3086,9 +3086,9 @@ JDWP "Java(tm) Debug Wire Protocol" (Constant ERROR =8 ) ) (ConstantSet TypeTag - (Constant CLASS=1 "ReferenceType is a class. ") - (Constant INTERFACE=2 "ReferenceType is an interface. ") - (Constant ARRAY=3 "ReferenceType is an array. ") + (Constant CLASS=1 "ReferenceType is a class. ") + (Constant INTERFACE=2 "ReferenceType is an interface. ") + (Constant ARRAY=3 "ReferenceType is an array. ") ) (ConstantSet Tag (Constant ARRAY = '[' "'[' - an array object (objectID size). ") @@ -3104,39 +3104,39 @@ JDWP "Java(tm) Debug Wire Protocol" (Constant BOOLEAN = 'Z' "'Z' - a boolean value (1 byte).") (Constant STRING = 's' "'s' - a String object (objectID size). ") (Constant THREAD = 't' "'t' - a Thread object (objectID size). ") - (Constant THREAD_GROUP = 'g' + (Constant THREAD_GROUP = 'g' "'g' - a ThreadGroup object (objectID size). ") - (Constant CLASS_LOADER = 'l' + (Constant CLASS_LOADER = 'l' "'l' - a ClassLoader object (objectID size). ") - (Constant CLASS_OBJECT = 'c' + (Constant CLASS_OBJECT = 'c' "'c' - a class object object (objectID size). ") ) (ConstantSet StepDepth - (Constant INTO = 0 + (Constant INTO = 0 "Step into any method calls that occur before the end of the step. ") - (Constant OVER = 1 + (Constant OVER = 1 "Step over any method calls that occur before the end of the step. ") - (Constant OUT = 2 + (Constant OUT = 2 "Step out of the current method. ") ) (ConstantSet StepSize - (Constant MIN = 0 + (Constant MIN = 0 "Step by the minimum possible amount (often a bytecode instruction). ") - (Constant LINE = 1 + (Constant LINE = 1 "Step to the next source line unless there is no line number information in which case a MIN step is done instead.") ) (ConstantSet SuspendPolicy - (Constant NONE = 0 + (Constant NONE = 0 "Suspend no threads when this event is encountered. ") - (Constant EVENT_THREAD = 1 + (Constant EVENT_THREAD = 1 "Suspend the event thread when this event is encountered. ") - (Constant ALL = 2 + (Constant ALL = 2 "Suspend all threads when this event is encountered. ") ) - + (ConstantSet InvokeOptions "The invoke options are a combination of zero or more of the following bit flags:" (Constant INVOKE_SINGLE_THREADED = 0x01 @@ -3144,5 +3144,3 @@ JDWP "Java(tm) Debug Wire Protocol" (Constant INVOKE_NONVIRTUAL = 0x02 "otherwise, normal virtual invoke (instance methods only)") ) - - diff --git a/jdk/makefiles/jprt.gmk b/jdk/makefiles/jprt.gmk index b5e427364cd..00b5f5fa515 100644 --- a/jdk/makefiles/jprt.gmk +++ b/jdk/makefiles/jprt.gmk @@ -25,22 +25,21 @@ # JPRT rule to build this workspace -JPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip +JPRT_ARCHIVE_BUNDLE = $(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip -jprt_build_product: all images +jprt_build_product: all images ( $(CD) $(OUTPUTDIR)/j2sdk-image && \ - $(ZIPEXE) -q -r $(JPRT_ARCHIVE_BUNDLE) . ) + $(ZIPEXE) -q -r $(JPRT_ARCHIVE_BUNDLE) . ) jprt_build_fastdebug: fastdebug images ( $(CD) $(OUTPUTDIR)/j2sdk-image && \ - $(ZIPEXE) -q -r $(JPRT_ARCHIVE_BUNDLE) . ) + $(ZIPEXE) -q -r $(JPRT_ARCHIVE_BUNDLE) . ) -jprt_build_debug: debug images +jprt_build_debug: debug images ( $(CD) $(OUTPUTDIR)/j2sdk-image && \ - $(ZIPEXE) -q -r $(JPRT_ARCHIVE_BUNDLE) . ) + $(ZIPEXE) -q -r $(JPRT_ARCHIVE_BUNDLE) . ) # # Phonies to avoid accidents. # .PHONY: jprt_build_product jprt_build_fastdebug jprt_build_debug - diff --git a/jdk/makefiles/jprt.properties b/jdk/makefiles/jprt.properties index 1051bb34bb7..6dfdf2f248c 100644 --- a/jdk/makefiles/jprt.properties +++ b/jdk/makefiles/jprt.properties @@ -32,278 +32,223 @@ jprt.tools.default.release=jdk8 jprt.build.flavors=product,fastdebug # Standard list of jprt build targets for this source tree -jprt.build.targets= \ - solaris_sparc_5.10-{product|fastdebug}, \ - solaris_sparcv9_5.10-{product|fastdebug}, \ - solaris_i586_5.10-{product|fastdebug}, \ - solaris_x64_5.10-{product|fastdebug}, \ - linux_i586_2.6-{product|fastdebug}, \ - linux_x64_2.6-{product|fastdebug}, \ - windows_i586_6.1-{product|fastdebug}, \ +jprt.build.targets= \ + solaris_sparcv9_5.10-{product|fastdebug}, \ + solaris_x64_5.10-{product|fastdebug}, \ + linux_i586_2.6-{product|fastdebug}, \ + linux_x64_2.6-{product|fastdebug}, \ + windows_i586_6.1-{product|fastdebug}, \ windows_x64_6.1-{product|fastdebug} # User can select the test set with jprt submit "-testset name" option jprt.my.test.set=${jprt.test.set} # Standard vm test target -jprt.vm.default.test.targets= \ - solaris_sparc_5.10-product-c1-jvm98, \ - solaris_sparcv9_5.10-product-c2-jvm98, \ - solaris_i586_5.10-product-c1-jvm98, \ - solaris_x64_5.10-product-c2-jvm98, \ - linux_i586_2.6-product-{c1|c2}-jvm98, \ - linux_x64_2.6-product-c2-jvm98, \ - windows_i586_6.1-product-c1-jvm98, \ +jprt.vm.default.test.targets= \ + solaris_sparcv9_5.10-product-c2-jvm98, \ + solaris_x64_5.10-product-c2-jvm98, \ + linux_i586_2.6-product-{c1|c2}-jvm98, \ + linux_x64_2.6-product-c2-jvm98, \ + windows_i586_6.1-product-c1-jvm98, \ windows_x64_6.1-product-c2-jvm98 # Select vm testlist to use (allow for testset to be empty too) jprt.vm.all.test.targets=${jprt.vm.default.test.targets} -jprt.vm..test.targets=${jprt.vm.default.test.targets} -jprt.test.targets=${jprt.vm.${jprt.my.test.set}.test.targets} +jprt.vm..test.targets=${jprt.vm.default.test.targets} +jprt.test.targets=${jprt.vm.${jprt.my.test.set}.test.targets} # Default jdk test targets in test/Makefile (no fastdebug & limited c2) -jprt.make.rule.default.test.targets= \ - \ - solaris_sparc_5.10-product-c1-jdk_beans1, \ - solaris_sparcv9_5.10-product-c2-jdk_beans1, \ - solaris_i586_5.10-product-c1-jdk_beans1, \ - solaris_x64_5.10-product-c2-jdk_beans1, \ - linux_i586_2.6-product-{c1|c2}-jdk_beans1, \ - linux_x64_2.6-product-c2-jdk_beans1, \ - windows_i586_6.1-product-c1-jdk_beans1, \ - windows_x64_6.1-product-c2-jdk_beans1, \ - \ - solaris_sparc_5.10-product-c1-jdk_io, \ - solaris_sparcv9_5.10-product-c2-jdk_io, \ - solaris_i586_5.10-product-c1-jdk_io, \ - solaris_x64_5.10-product-c2-jdk_io, \ - linux_i586_2.6-product-{c1|c2}-jdk_io, \ - linux_x64_2.6-product-c2-jdk_io, \ - windows_i586_6.1-product-c1-jdk_io, \ - windows_x64_6.1-product-c2-jdk_io, \ - \ - solaris_sparc_5.10-product-c1-jdk_lang, \ - solaris_sparcv9_5.10-product-c2-jdk_lang, \ - solaris_i586_5.10-product-c1-jdk_lang, \ - solaris_x64_5.10-product-c2-jdk_lang, \ - linux_i586_2.6-product-{c1|c2}-jdk_lang, \ - linux_x64_2.6-product-c2-jdk_lang, \ - windows_i586_6.1-product-c1-jdk_lang, \ - windows_x64_6.1-product-c2-jdk_lang, \ - \ - solaris_sparc_5.10-product-c1-jdk_math, \ - solaris_sparcv9_5.10-product-c2-jdk_math, \ - solaris_i586_5.10-product-c1-jdk_math, \ - solaris_x64_5.10-product-c2-jdk_math, \ - linux_i586_2.6-product-{c1|c2}-jdk_math, \ - linux_x64_2.6-product-c2-jdk_math, \ - windows_i586_6.1-product-c1-jdk_math, \ - windows_x64_6.1-product-c2-jdk_math, \ - \ - solaris_sparc_5.10-product-c1-jdk_misc, \ - solaris_sparcv9_5.10-product-c2-jdk_misc, \ - solaris_i586_5.10-product-c1-jdk_misc, \ - solaris_x64_5.10-product-c2-jdk_misc, \ - linux_i586_2.6-product-{c1|c2}-jdk_misc, \ - linux_x64_2.6-product-c2-jdk_misc, \ - windows_i586_6.1-product-c1-jdk_misc, \ - windows_x64_6.1-product-c2-jdk_misc, \ - \ - solaris_sparc_5.10-product-c1-jdk_net, \ - solaris_sparcv9_5.10-product-c2-jdk_net, \ - solaris_i586_5.10-product-c1-jdk_net, \ - solaris_x64_5.10-product-c2-jdk_net, \ - linux_i586_2.6-product-{c1|c2}-jdk_net, \ - linux_x64_2.6-product-c2-jdk_net, \ - windows_i586_6.1-product-c1-jdk_net, \ - windows_x64_6.1-product-c2-jdk_net, \ - \ - solaris_sparc_5.10-product-c1-jdk_nio1, \ - solaris_sparcv9_5.10-product-c2-jdk_nio1, \ - solaris_i586_5.10-product-c1-jdk_nio1, \ - solaris_x64_5.10-product-c2-jdk_nio1, \ - linux_i586_2.6-product-{c1|c2}-jdk_nio1, \ - linux_x64_2.6-product-c2-jdk_nio1, \ - windows_i586_6.1-product-c1-jdk_nio1, \ - windows_x64_6.1-product-c2-jdk_nio1, \ - \ - solaris_sparc_5.10-product-c1-jdk_nio2, \ - solaris_sparcv9_5.10-product-c2-jdk_nio2, \ - solaris_i586_5.10-product-c1-jdk_nio2, \ - solaris_x64_5.10-product-c2-jdk_nio2, \ - linux_i586_2.6-product-{c1|c2}-jdk_nio2, \ - linux_x64_2.6-product-c2-jdk_nio2, \ - windows_i586_6.1-product-c1-jdk_nio2, \ - windows_x64_6.1-product-c2-jdk_nio2, \ - \ - solaris_sparc_5.10-product-c1-jdk_nio3, \ - solaris_sparcv9_5.10-product-c2-jdk_nio3, \ - solaris_i586_5.10-product-c1-jdk_nio3, \ - solaris_x64_5.10-product-c2-jdk_nio3, \ - linux_i586_2.6-product-{c1|c2}-jdk_nio3, \ - linux_x64_2.6-product-c2-jdk_nio3, \ - windows_i586_6.1-product-c1-jdk_nio3, \ - windows_x64_6.1-product-c2-jdk_nio3, \ - \ - solaris_sparc_5.10-product-c1-jdk_security1, \ - solaris_sparcv9_5.10-product-c2-jdk_security1, \ - solaris_i586_5.10-product-c1-jdk_security1, \ - solaris_x64_5.10-product-c2-jdk_security1, \ - linux_i586_2.6-product-{c1|c2}-jdk_security1, \ - linux_x64_2.6-product-c2-jdk_security1, \ - windows_i586_6.1-product-c1-jdk_security1, \ - windows_x64_6.1-product-c2-jdk_security1, \ - \ - solaris_sparc_5.10-product-c1-jdk_text, \ - solaris_sparcv9_5.10-product-c2-jdk_text, \ - solaris_i586_5.10-product-c1-jdk_text, \ - solaris_x64_5.10-product-c2-jdk_text, \ - linux_i586_2.6-product-{c1|c2}-jdk_text, \ - linux_x64_2.6-product-c2-jdk_text, \ - windows_i586_6.1-product-c1-jdk_text, \ - windows_x64_6.1-product-c2-jdk_text, \ - \ - solaris_sparc_5.10-product-c1-jdk_tools1, \ - solaris_sparcv9_5.10-product-c2-jdk_tools1, \ - solaris_i586_5.10-product-c1-jdk_tools1, \ - solaris_x64_5.10-product-c2-jdk_tools1, \ - linux_i586_2.6-product-{c1|c2}-jdk_tools1, \ - linux_x64_2.6-product-c2-jdk_tools1, \ - windows_i586_6.1-product-c1-jdk_tools1, \ - windows_x64_6.1-product-c2-jdk_tools1, \ - \ - solaris_sparc_5.10-product-c1-jdk_util, \ - solaris_sparcv9_5.10-product-c2-jdk_util, \ - solaris_i586_5.10-product-c1-jdk_util, \ - solaris_x64_5.10-product-c2-jdk_util, \ - linux_i586_2.6-product-{c1|c2}-jdk_util, \ - linux_x64_2.6-product-c2-jdk_util, \ - windows_i586_6.1-product-c1-jdk_util, \ +jprt.make.rule.default.test.targets= \ + \ + solaris_sparcv9_5.10-product-c2-jdk_beans1, \ + solaris_x64_5.10-product-c2-jdk_beans1, \ + linux_i586_2.6-product-{c1|c2}-jdk_beans1, \ + linux_x64_2.6-product-c2-jdk_beans1, \ + windows_i586_6.1-product-c1-jdk_beans1, \ + windows_x64_6.1-product-c2-jdk_beans1, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_io, \ + solaris_x64_5.10-product-c2-jdk_io, \ + linux_i586_2.6-product-{c1|c2}-jdk_io, \ + linux_x64_2.6-product-c2-jdk_io, \ + windows_i586_6.1-product-c1-jdk_io, \ + windows_x64_6.1-product-c2-jdk_io, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_lang, \ + solaris_x64_5.10-product-c2-jdk_lang, \ + linux_i586_2.6-product-{c1|c2}-jdk_lang, \ + linux_x64_2.6-product-c2-jdk_lang, \ + windows_i586_6.1-product-c1-jdk_lang, \ + windows_x64_6.1-product-c2-jdk_lang, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_math, \ + solaris_x64_5.10-product-c2-jdk_math, \ + linux_i586_2.6-product-{c1|c2}-jdk_math, \ + linux_x64_2.6-product-c2-jdk_math, \ + windows_i586_6.1-product-c1-jdk_math, \ + windows_x64_6.1-product-c2-jdk_math, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_misc, \ + solaris_x64_5.10-product-c2-jdk_misc, \ + linux_i586_2.6-product-{c1|c2}-jdk_misc, \ + linux_x64_2.6-product-c2-jdk_misc, \ + windows_i586_6.1-product-c1-jdk_misc, \ + windows_x64_6.1-product-c2-jdk_misc, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_net, \ + solaris_x64_5.10-product-c2-jdk_net, \ + linux_i586_2.6-product-{c1|c2}-jdk_net, \ + linux_x64_2.6-product-c2-jdk_net, \ + windows_i586_6.1-product-c1-jdk_net, \ + windows_x64_6.1-product-c2-jdk_net, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_nio1, \ + solaris_x64_5.10-product-c2-jdk_nio1, \ + linux_i586_2.6-product-{c1|c2}-jdk_nio1, \ + linux_x64_2.6-product-c2-jdk_nio1, \ + windows_i586_6.1-product-c1-jdk_nio1, \ + windows_x64_6.1-product-c2-jdk_nio1, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_nio2, \ + solaris_x64_5.10-product-c2-jdk_nio2, \ + linux_i586_2.6-product-{c1|c2}-jdk_nio2, \ + linux_x64_2.6-product-c2-jdk_nio2, \ + windows_i586_6.1-product-c1-jdk_nio2, \ + windows_x64_6.1-product-c2-jdk_nio2, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_nio3, \ + solaris_x64_5.10-product-c2-jdk_nio3, \ + linux_i586_2.6-product-{c1|c2}-jdk_nio3, \ + linux_x64_2.6-product-c2-jdk_nio3, \ + windows_i586_6.1-product-c1-jdk_nio3, \ + windows_x64_6.1-product-c2-jdk_nio3, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_security1, \ + solaris_x64_5.10-product-c2-jdk_security1, \ + linux_i586_2.6-product-{c1|c2}-jdk_security1, \ + linux_x64_2.6-product-c2-jdk_security1, \ + windows_i586_6.1-product-c1-jdk_security1, \ + windows_x64_6.1-product-c2-jdk_security1, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_text, \ + solaris_x64_5.10-product-c2-jdk_text, \ + linux_i586_2.6-product-{c1|c2}-jdk_text, \ + linux_x64_2.6-product-c2-jdk_text, \ + windows_i586_6.1-product-c1-jdk_text, \ + windows_x64_6.1-product-c2-jdk_text, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_tools1, \ + solaris_x64_5.10-product-c2-jdk_tools1, \ + linux_i586_2.6-product-{c1|c2}-jdk_tools1, \ + linux_x64_2.6-product-c2-jdk_tools1, \ + windows_i586_6.1-product-c1-jdk_tools1, \ + windows_x64_6.1-product-c2-jdk_tools1, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_util, \ + solaris_x64_5.10-product-c2-jdk_util, \ + linux_i586_2.6-product-{c1|c2}-jdk_util, \ + linux_x64_2.6-product-c2-jdk_util, \ + windows_i586_6.1-product-c1-jdk_util, \ windows_x64_6.1-product-c2-jdk_util # All jdk test targets in test/Makefile (still no fastdebug & limited c2) -jprt.make.rule.all.test.targets= \ - \ - ${jprt.make.rule.default.test.targets}, \ - \ - solaris_sparc_5.10-product-c1-jdk_awt, \ - solaris_sparcv9_5.10-product-c2-jdk_awt, \ - solaris_i586_5.10-product-c1-jdk_awt, \ - solaris_x64_5.10-product-c2-jdk_awt, \ - linux_i586_2.6-product-{c1|c2}-jdk_awt, \ - linux_x64_2.6-product-c2-jdk_awt, \ - windows_i586_6.1-product-c1-jdk_awt, \ - windows_x64_6.1-product-c2-jdk_awt, \ - \ - solaris_sparc_5.10-product-c1-jdk_beans2, \ - solaris_sparcv9_5.10-product-c2-jdk_beans2, \ - solaris_i586_5.10-product-c1-jdk_beans2, \ - solaris_x64_5.10-product-c2-jdk_beans2, \ - linux_i586_2.6-product-{c1|c2}-jdk_beans2, \ - linux_x64_2.6-product-c2-jdk_beans2, \ - windows_i586_6.1-product-c1-jdk_beans2, \ - windows_x64_6.1-product-c2-jdk_beans2, \ - \ - solaris_sparc_5.10-product-c1-jdk_beans3, \ - solaris_sparcv9_5.10-product-c2-jdk_beans3, \ - solaris_i586_5.10-product-c1-jdk_beans3, \ - solaris_x64_5.10-product-c2-jdk_beans3, \ - linux_i586_2.6-product-{c1|c2}-jdk_beans3, \ - linux_x64_2.6-product-c2-jdk_beans3, \ - windows_i586_6.1-product-c1-jdk_beans3, \ - windows_x64_6.1-product-c2-jdk_beans3, \ - \ - solaris_sparc_5.10-product-c1-jdk_management1, \ - solaris_sparcv9_5.10-product-c2-jdk_management1, \ - solaris_i586_5.10-product-c1-jdk_management1, \ - solaris_x64_5.10-product-c2-jdk_management1, \ - linux_i586_2.6-product-{c1|c2}-jdk_management1, \ - linux_x64_2.6-product-c2-jdk_management1, \ - windows_i586_6.1-product-c1-jdk_management1, \ - windows_x64_6.1-product-c2-jdk_management1, \ - \ - solaris_sparc_5.10-product-c1-jdk_management2, \ - solaris_sparcv9_5.10-product-c2-jdk_management2, \ - solaris_i586_5.10-product-c1-jdk_management2, \ - solaris_x64_5.10-product-c2-jdk_management2, \ - linux_i586_2.6-product-{c1|c2}-jdk_management2, \ - linux_x64_2.6-product-c2-jdk_management2, \ - windows_i586_6.1-product-c1-jdk_management2, \ - windows_x64_6.1-product-c2-jdk_management2, \ - \ - solaris_sparc_5.10-product-c1-jdk_rmi, \ - solaris_sparcv9_5.10-product-c2-jdk_rmi, \ - solaris_i586_5.10-product-c1-jdk_rmi, \ - solaris_x64_5.10-product-c2-jdk_rmi, \ - linux_i586_2.6-product-{c1|c2}-jdk_rmi, \ - linux_x64_2.6-product-c2-jdk_rmi, \ - windows_i586_6.1-product-c1-jdk_rmi, \ - windows_x64_6.1-product-c2-jdk_rmi, \ - \ - solaris_sparc_5.10-product-c1-jdk_security2, \ - solaris_sparcv9_5.10-product-c2-jdk_security2, \ - solaris_i586_5.10-product-c1-jdk_security2, \ - solaris_x64_5.10-product-c2-jdk_security2, \ - linux_i586_2.6-product-{c1|c2}-jdk_security2, \ - linux_x64_2.6-product-c2-jdk_security2, \ - windows_i586_6.1-product-c1-jdk_security2, \ - windows_x64_6.1-product-c2-jdk_security2, \ - \ - solaris_sparc_5.10-product-c1-jdk_security3, \ - solaris_sparcv9_5.10-product-c2-jdk_security3, \ - solaris_i586_5.10-product-c1-jdk_security3, \ - solaris_x64_5.10-product-c2-jdk_security3, \ - linux_i586_2.6-product-{c1|c2}-jdk_security3, \ - linux_x64_2.6-product-c2-jdk_security3, \ - windows_i586_6.1-product-c1-jdk_security3, \ - windows_x64_6.1-product-c2-jdk_security3, \ - \ - solaris_sparc_5.10-product-c1-jdk_sound, \ - solaris_sparcv9_5.10-product-c2-jdk_sound, \ - solaris_i586_5.10-product-c1-jdk_sound, \ - solaris_x64_5.10-product-c2-jdk_sound, \ - linux_i586_2.6-product-{c1|c2}-jdk_sound, \ - linux_x64_2.6-product-c2-jdk_sound, \ - windows_i586_6.1-product-c1-jdk_sound, \ - windows_x64_6.1-product-c2-jdk_sound, \ - \ - solaris_sparc_5.10-product-c1-jdk_swing, \ - solaris_sparcv9_5.10-product-c2-jdk_swing, \ - solaris_i586_5.10-product-c1-jdk_swing, \ - solaris_x64_5.10-product-c2-jdk_swing, \ - linux_i586_2.6-product-{c1|c2}-jdk_swing, \ - linux_x64_2.6-product-c2-jdk_swing, \ - windows_i586_6.1-product-c1-jdk_swing, \ - windows_x64_6.1-product-c2-jdk_swing, \ - \ - solaris_sparc_5.10-product-c1-jdk_tools2, \ - solaris_sparcv9_5.10-product-c2-jdk_tools2, \ - solaris_i586_5.10-product-c1-jdk_tools2, \ - solaris_x64_5.10-product-c2-jdk_tools2, \ - linux_i586_2.6-product-{c1|c2}-jdk_tools2, \ - linux_x64_2.6-product-c2-jdk_tools2, \ - windows_i586_6.1-product-c1-jdk_tools2, \ +jprt.make.rule.all.test.targets= \ + \ + ${jprt.make.rule.default.test.targets}, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_awt, \ + solaris_x64_5.10-product-c2-jdk_awt, \ + linux_i586_2.6-product-{c1|c2}-jdk_awt, \ + linux_x64_2.6-product-c2-jdk_awt, \ + windows_i586_6.1-product-c1-jdk_awt, \ + windows_x64_6.1-product-c2-jdk_awt, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_beans2, \ + solaris_x64_5.10-product-c2-jdk_beans2, \ + linux_i586_2.6-product-{c1|c2}-jdk_beans2, \ + linux_x64_2.6-product-c2-jdk_beans2, \ + windows_i586_6.1-product-c1-jdk_beans2, \ + windows_x64_6.1-product-c2-jdk_beans2, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_beans3, \ + solaris_x64_5.10-product-c2-jdk_beans3, \ + linux_i586_2.6-product-{c1|c2}-jdk_beans3, \ + linux_x64_2.6-product-c2-jdk_beans3, \ + windows_i586_6.1-product-c1-jdk_beans3, \ + windows_x64_6.1-product-c2-jdk_beans3, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_management1, \ + solaris_x64_5.10-product-c2-jdk_management1, \ + linux_i586_2.6-product-{c1|c2}-jdk_management1, \ + linux_x64_2.6-product-c2-jdk_management1, \ + windows_i586_6.1-product-c1-jdk_management1, \ + windows_x64_6.1-product-c2-jdk_management1, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_management2, \ + solaris_x64_5.10-product-c2-jdk_management2, \ + linux_i586_2.6-product-{c1|c2}-jdk_management2, \ + linux_x64_2.6-product-c2-jdk_management2, \ + windows_i586_6.1-product-c1-jdk_management2, \ + windows_x64_6.1-product-c2-jdk_management2, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_rmi, \ + solaris_x64_5.10-product-c2-jdk_rmi, \ + linux_i586_2.6-product-{c1|c2}-jdk_rmi, \ + linux_x64_2.6-product-c2-jdk_rmi, \ + windows_i586_6.1-product-c1-jdk_rmi, \ + windows_x64_6.1-product-c2-jdk_rmi, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_security2, \ + solaris_x64_5.10-product-c2-jdk_security2, \ + linux_i586_2.6-product-{c1|c2}-jdk_security2, \ + linux_x64_2.6-product-c2-jdk_security2, \ + windows_i586_6.1-product-c1-jdk_security2, \ + windows_x64_6.1-product-c2-jdk_security2, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_security3, \ + solaris_x64_5.10-product-c2-jdk_security3, \ + linux_i586_2.6-product-{c1|c2}-jdk_security3, \ + linux_x64_2.6-product-c2-jdk_security3, \ + windows_i586_6.1-product-c1-jdk_security3, \ + windows_x64_6.1-product-c2-jdk_security3, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_sound, \ + solaris_x64_5.10-product-c2-jdk_sound, \ + linux_i586_2.6-product-{c1|c2}-jdk_sound, \ + linux_x64_2.6-product-c2-jdk_sound, \ + windows_i586_6.1-product-c1-jdk_sound, \ + windows_x64_6.1-product-c2-jdk_sound, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_swing, \ + solaris_x64_5.10-product-c2-jdk_swing, \ + linux_i586_2.6-product-{c1|c2}-jdk_swing, \ + linux_x64_2.6-product-c2-jdk_swing, \ + windows_i586_6.1-product-c1-jdk_swing, \ + windows_x64_6.1-product-c2-jdk_swing, \ + \ + solaris_sparcv9_5.10-product-c2-jdk_tools2, \ + solaris_x64_5.10-product-c2-jdk_tools2, \ + linux_i586_2.6-product-{c1|c2}-jdk_tools2, \ + linux_x64_2.6-product-c2-jdk_tools2, \ + windows_i586_6.1-product-c1-jdk_tools2, \ windows_x64_6.1-product-c2-jdk_tools2 # JCK test targets in test/Makefile (no fastdebug & limited c2, windows broken) -jprt.my.jck.test.target.set= \ - solaris_sparc_5.10-product-c1-JCK7TESTRULE, \ - solaris_sparcv9_5.10-product-c2-JCK7TESTRULE, \ - solaris_i586_5.10-product-c1-JCK7TESTRULE, \ - solaris_x64_5.10-product-c2-JCK7TESTRULE, \ - linux_i586_2.6-product-c1-JCK7TESTRULE, \ +jprt.my.jck.test.target.set= \ + solaris_sparcv9_5.10-product-c2-JCK7TESTRULE, \ + solaris_x64_5.10-product-c2-JCK7TESTRULE, \ + linux_i586_2.6-product-c1-JCK7TESTRULE, \ linux_x64_2.6-product-c2-JCK7TESTRULE # JCK testset targets (e.g. jprt submit -testset jck ... ) -jprt.make.rule.jck.test.targets= \ - ${jprt.my.jck.test.target.set:JCK7TESTRULE=jck7devtools}, \ - ${jprt.my.jck.test.target.set:JCK7TESTRULE=jck7runtime}, \ +jprt.make.rule.jck.test.targets= \ + ${jprt.my.jck.test.target.set:JCK7TESTRULE=jck7devtools}, \ + ${jprt.my.jck.test.target.set:JCK7TESTRULE=jck7runtime}, \ ${jprt.my.jck.test.target.set:JCK7TESTRULE=jck7compiler} # Select list to use (allow for testset to be empty too) -jprt.make.rule..test.targets=${jprt.make.rule.default.test.targets} -jprt.make.rule.test.targets=${jprt.make.rule.${jprt.my.test.set}.test.targets} +jprt.make.rule..test.targets=${jprt.make.rule.default.test.targets} +jprt.make.rule.test.targets=${jprt.make.rule.${jprt.my.test.set}.test.targets} # Directories to be excluded from the source bundles jprt.bundle.exclude.src.dirs=build dist webrev - diff --git a/jdk/makefiles/lib/Awt2dLibraries.gmk b/jdk/makefiles/lib/Awt2dLibraries.gmk new file mode 100644 index 00000000000..c58187a2340 --- /dev/null +++ b/jdk/makefiles/lib/Awt2dLibraries.gmk @@ -0,0 +1,1498 @@ +# +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# 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. +# + +# Openwin is defined on Solaris. +OPENWIN_LIB := $(OPENWIN_HOME)/lib + +WIN_AWT_LIB := $(JDK_OUTPUTDIR)/objs/libawt/awt.lib + +########################################################################################## + +BUILD_LIBMLIB_SRC := $(JDK_TOPDIR)/src/share/native/sun/awt/medialib +BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \ + -I$(BUILD_LIBMLIB_SRC) \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/medialib + +BUILD_LIBMLIB_LDLIBS := +BUILD_LIBMLIB_IMAGE_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libmlib_image/mapfile-vers + +BUILD_LIBMLIB_CFLAGS += -DMLIB_NO_LIBSUNMATH + +ifeq ($(OPENJDK_TARGET_CPU_BITS), 64) + BUILD_LIBMLIB_CFLAGS += -DMLIB_OS64BIT +endif + +ifneq ($(OPENJDK_TARGET_OS), windows) + BUILD_LIBMLIB_LDLIBS += $(LIBM) $(LIBDL) +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE, \ + LIBRARY := mlib_image, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(BUILD_LIBMLIB_SRC), \ + EXCLUDE_FILES := awt_ImagingLib.c mlib_c_ImageBlendTable.c, \ + LANG := C, \ + OPTIMIZATION := HIGHEST, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(BUILD_LIBMLIB_CFLAGS), \ + MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := $(BUILD_LIBMLIB_LDLIBS) \ + $(LDFLAGS_JDKLIB_SUFFIX), \ + LDFLAGS_SUFFIX_solaris := -lc, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=mlib_image.dll" \ + -D "JDK_INTERNAL_NAME=mlib_image" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmlib_image, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + +$(BUILD_LIBMLIB_IMAGE): $(BUILD_LIBJAVA) + +BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE) + +########################################################################################## + +ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc) + + BUILD_LIBMLIB_IMAGE_V_FILES := \ + mlib_v_ImageLookUp.c \ + mlib_ImageCreate.c \ + mlib_ImageAffine.c \ + mlib_ImageConvMxN.c \ + mlib_ImageConvKernelConvert.c \ + mlib_sys.c \ + mlib_ImageLookUp_64.c \ + mlib_ImageLookUp_Bit.c \ + mlib_ImageColorTrue2Index.c \ + mlib_c_ImageThresh1_U8.c \ + mlib_v_ImageLookUpS16S16Func.c \ + mlib_v_ImageLookUpS16S32Func.c \ + mlib_v_ImageLookUpS16U16Func.c \ + mlib_v_ImageLookUpS16U8Func.c \ + mlib_v_ImageLookUpS32S16Func.c \ + mlib_v_ImageLookUpS32S32Func.c \ + mlib_v_ImageLookUpS32U16Func.c \ + mlib_v_ImageLookUpS32U8Func.c \ + mlib_v_ImageLookUpSIS16S16Func.c \ + mlib_v_ImageLookUpSIS16S32Func.c \ + mlib_v_ImageLookUpSIS16U16Func.c \ + mlib_v_ImageLookUpSIS16U8Func.c \ + mlib_v_ImageLookUpSIS32S16Func.c \ + mlib_v_ImageLookUpSIS32S32Func.c \ + mlib_v_ImageLookUpSIS32U16Func.c \ + mlib_v_ImageLookUpSIS32U8Func.c \ + mlib_v_ImageLookUpSIU16S16Func.c \ + mlib_v_ImageLookUpSIU16S32Func.c \ + mlib_v_ImageLookUpSIU16U16Func.c \ + mlib_v_ImageLookUpSIU16U8Func.c \ + mlib_v_ImageLookUpSIU8S16Func.c \ + mlib_v_ImageLookUpSIU8S32Func.c \ + mlib_v_ImageLookUpSIU8U16Func.c \ + mlib_v_ImageLookUpSIU8U8Func.c \ + mlib_v_ImageLookUpU16S16Func.c \ + mlib_v_ImageLookUpU16S32Func.c \ + mlib_v_ImageLookUpU16U16Func.c \ + mlib_v_ImageLookUpU16U8Func.c \ + mlib_v_ImageLookUpU8S16Func.c \ + mlib_v_ImageLookUpU8S32Func.c \ + mlib_v_ImageLookUpU8U16Func.c \ + mlib_v_ImageLookUpU8U8Func.c \ + mlib_v_ImageAffineIndex_BC.c \ + mlib_v_ImageAffine_BC.c \ + mlib_v_ImageAffine_BC_S16.c \ + mlib_v_ImageAffine_BC_U16.c \ + mlib_v_ImageAffine_BL.c \ + mlib_v_ImageAffine_BL_S16.c \ + mlib_v_ImageAffine_BL_U16.c \ + mlib_v_ImageAffine_NN.c \ + mlib_v_ImageFilters.c \ + mlib_ImageAffineEdge.c \ + mlib_ImageAffine_BC_D64.c \ + mlib_ImageAffine_BC_F32.c \ + mlib_ImageAffine_BC_S32.c \ + mlib_ImageAffine_BL_D64.c \ + mlib_ImageAffine_BL_F32.c \ + mlib_ImageAffine_BL_S32.c \ + mlib_ImageAffine_NN.c \ + mlib_ImageAffine_NN_Bit.c \ + mlib_ImageFilters.c \ + mlib_ImageScanPoly.c \ + mlib_ImageConv_8nw.c \ + mlib_ImageConv_8ext.c \ + mlib_ImageConv_16nw.c \ + mlib_ImageConv_16ext.c \ + mlib_ImageConv_u16nw.c \ + mlib_ImageConv_u16ext.c \ + mlib_ImageConv_32nw.c \ + mlib_ImageConv_F32nw.c \ + mlib_ImageConvMxN_Fp.c \ + mlib_ImageConvMxN_ext.c \ + mlib_ImageConv_D64nw.c \ + mlib_ImageClipping.c \ + mlib_ImageConvCopyEdge_Bit.c \ + mlib_ImageConvClearEdge_Bit.c \ + mlib_ImageConv2x2_f.c \ + mlib_ImageConvClearEdge_Fp.c \ + mlib_v_ImageConvMxN_8.c \ + mlib_v_ImageConvClearEdge.c \ + mlib_v_ImageConvCopyEdge.c \ + mlib_v_ImageConvMxN_8ext.c \ + mlib_v_ImageConvVersion.c \ + mlib_v_ImageConv_8nw.c \ + mlib_ImageConvCopyEdge_Fp.c \ + mlib_v_ImageChannelInsert_1.c \ + mlib_v_ImageChannelExtract_43.c \ + mlib_v_ImageChannelExtract_1.c \ + mlib_ImageCopy_Bit.c \ + mlib_v_ImageCopy_f.c \ + mlib_ImageUtils.c \ + mlib_ImageDivTables.c + + BUILD_LIBMLIB_V_CFLAGS := $(filter-out -DMLIB_NO_LIBSUNMATH, $(BUILD_LIBMLIB_CFLAGS)) + + $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE_V, \ + LIBRARY := mlib_image_v, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/share/native/sun/awt/medialib \ + $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib, \ + LANG := C, \ + INCLUDE_FILES := $(BUILD_LIBMLIB_IMAGE_V_FILES), \ + OPTIMIZATION := HIGHEST, \ + CFLAGS := -xarch=sparcvis \ + $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(OPENJDK_TARGET_CPU_BITS).il \ + $(BUILD_LIBMLIB_V_CFLAGS) \ + $(CFLAGS_JDKLIB), \ + MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(BUILD_LIBMLIB_LDLIBS) -ljava -ljvm \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_solaris := -lc, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmlib_image_v, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + $(BUILD_LIBMLIB_IMAGE_V): $(BUILD_LIBJAVA) + + BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE_V) + +endif + +########################################################################################## + +LIBAWT_DIRS := \ + $(JDK_TOPDIR)/src/share/native/sun/awt \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \ + $(JDK_TOPDIR)/src/share/native/sun/awt/image \ + $(JDK_TOPDIR)/src/share/native/sun/awt/image/gif \ + $(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \ + $(JDK_TOPDIR)/src/share/native/sun/awt/medialib \ + $(JDK_TOPDIR)/src/share/native/sun/awt/debug \ + $(JDK_TOPDIR)/src/share/native/sun/awt/utility \ + $(JDK_TOPDIR)/src/share/native/sun/java2d \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \ + $(JDK_TOPDIR)/src/share/native/sun/java2d/loops \ + $(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \ + $(JDK_TOPDIR)/src/share/native/sun/awt/image \ + $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/opengl \ + $(JDK_TOPDIR)/src/share/native/sun/font + +ifeq ($(OPENJDK_TARGET_OS), windows) + LIBAWT_DIRS += \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/d3d +else ifneq ($(OPENJDK_TARGET_OS), macosx) + LIBAWT_DIRS += \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11 +endif + +LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES \ + $(X_CFLAGS) \ + $(foreach dir, $(LIBAWT_DIRS), -I$(dir)) + +LIBAWT_FILES := \ + gifdecoder.c \ + imageInitIDs.c \ + img_globals.c \ + SurfaceData.c \ + Region.c \ + BufImgSurfaceData.c \ + Disposer.c \ + Trace.c \ + GraphicsPrimitiveMgr.c \ + Blit.c \ + BlitBg.c \ + ScaledBlit.c \ + FillRect.c \ + FillSpans.c \ + FillParallelogram.c \ + DrawParallelogram.c \ + DrawLine.c \ + DrawRect.c \ + DrawPolygons.c \ + DrawPath.c \ + FillPath.c \ + ProcessPath.c \ + MaskBlit.c \ + MaskFill.c \ + TransformHelper.c \ + AlphaMath.c \ + AlphaMacros.c \ + AnyByte.c \ + ByteBinary1Bit.c \ + ByteBinary2Bit.c \ + ByteBinary4Bit.c \ + ByteIndexed.c \ + ByteGray.c \ + Index8Gray.c \ + Index12Gray.c \ + AnyShort.c \ + Ushort555Rgb.c \ + Ushort565Rgb.c \ + Ushort4444Argb.c \ + Ushort555Rgbx.c \ + UshortGray.c \ + UshortIndexed.c \ + Any3Byte.c \ + ThreeByteBgr.c \ + AnyInt.c \ + IntArgb.c \ + IntArgbPre.c \ + IntArgbBm.c \ + IntRgb.c \ + IntBgr.c \ + IntRgbx.c \ + Any4Byte.c \ + FourByteAbgr.c \ + FourByteAbgrPre.c \ + BufferedMaskBlit.c \ + BufferedRenderPipe.c \ + ShapeSpanIterator.c \ + SpanClipRenderer.c \ + awt_ImageRep.c \ + awt_ImagingLib.c \ + awt_Mlib.c \ + awt_parseImage.c \ + DataBufferNative.c \ + dither.c \ + debug_assert.c \ + debug_mem.c \ + debug_trace.c \ + debug_util.c + +ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris linux)) + LIBAWT_FILES += awt_LoadLibrary.c initIDs.c img_colors.c +endif + +ifeq ($(OPENJDK_TARGET_OS), macosx) + LIBAWT_FILES += awt_LoadLibrary.c img_colors.c + LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks +endif + +ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc) + LIBAWT_CFLAGS += -DMLIB_ADD_SUFF + LIBAWT_CFLAGS += -xarch=sparcvis + LIBAWT_CFLAGS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(OPENJDK_TARGET_CPU_BITS).il + LIBAWT_CFLAGS += \ + -I$(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \ + -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/medialib \ + -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops + + LIBAWT_DIRS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \ + $(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops + + LIBAWT_FILES += \ + vis_FuncArray.c \ + java2d_Mlib.c \ + mlib_ImageCreate.c \ + mlib_ImageZoom_NN.c \ + mlib_ImageCopy_Bit.c \ + mlib_sys.c \ + mlib_v_ImageClear.c \ + mlib_v_ImageClear_f.c \ + mlib_v_ImageConstXor.c \ + mlib_v_ImageCopy.c \ + mlib_v_ImageCopy_f.c \ + mlib_v_ImageXor.c \ + mlib_v_ImageZoom_NN_f.c \ + vis_Interp.c \ + vis_AlphaMacros.c \ + vis_AlphaMaskBlit.c \ + vis_AlphaMaskFill.c \ + vis_ByteGray.c \ + vis_ByteGray_FromRgb.c \ + vis_ByteGray_Mask.c \ + vis_ByteIndexed.c \ + vis_DrawLine.c \ + vis_FourByteAbgr.c \ + vis_IntArgb.c \ + vis_IntArgbPre.c \ + vis_IntArgbPre_Mask.c \ + vis_IntBgr.c \ + vis_IntRgb.c \ + vis_IntRgbx.c \ + vis_SrcMaskFill.c \ + vis_SrcOverMaskBlit.c \ + vis_SrcOverMaskFill.c \ + vis_FourByteAbgrPre.c \ + vis_GlyphList.c \ + vis_GlyphListXor.c \ + vis_IntArgbBm.c \ + vis_ThreeByteBgr.c \ + vis_UshortGray.c \ + vis_UshortGray_FromRgb.c \ + vis_XorBlit.c \ + mlib_v_ImageCopy_blk.s + + ifeq ($(OPENJDK_TARGET_CPU), sparcv9) + LIBAWT_ASFLAGS = -P -xarch=v9a + else + LIBAWT_ASFLAGS = -P -xarch=v8plusa + endif +else + LIBAWT_FILES += MapAccelFunc.c +endif + +ifneq ($(OPENJDK_TARGET_OS), solaris) + LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH +endif + +LIBAWT_LANG := C + +ifeq ($(OPENJDK_TARGET_OS), windows) + LIBAWT_FILES += AccelGlyphCache.c \ + ShaderList.c \ + CmdIDList.cpp \ + Hashtable.cpp \ + GDIHashtable.cpp \ + Devices.cpp \ + ObjectList.cpp \ + GDIBlitLoops.cpp \ + GDIRenderer.cpp \ + GDIWindowSurfaceData.cpp \ + WindowsFlags.cpp \ + WPrinterJob.cpp \ + awt_%.cpp \ + D3DBlitLoops.cpp \ + D3DBufImgOps.cpp \ + D3DContext.cpp \ + D3DGlyphCache.cpp \ + D3DGraphicsDevice.cpp \ + D3DMaskBlit.cpp \ + D3DMaskCache.cpp \ + D3DMaskFill.cpp \ + D3DPipelineManager.cpp \ + D3DPaints.cpp \ + D3DRenderer.cpp \ + D3DRenderQueue.cpp \ + D3DResourceManager.cpp \ + D3DSurfaceData.cpp \ + D3DTextRenderer.cpp \ + D3DVertexCacher.cpp \ + ShellFolder2.cpp \ + ThemeReader.cpp \ + ComCtl32Util.cpp \ + DllUtil.cpp \ + initIDs.cpp \ + MouseInfo.cpp \ + rect.c \ + OGLBlitLoops.c \ + OGLBufImgOps.c \ + OGLContext.c \ + OGLFuncs.c \ + OGLMaskBlit.c \ + OGLMaskFill.c \ + OGLPaints.c \ + OGLRenderQueue.c \ + OGLRenderer.c \ + OGLSurfaceData.c \ + OGLTextRenderer.c \ + OGLVertexCache.c \ + WGLGraphicsConfig.c \ + WGLSurfaceData.c + + LIBAWT_LANG := C++ + LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE + ifeq ($(OPENJDK_TARGET_CPU_BITS), 64) + LIBAWT_CFLAGS += -DMLIB_OS64BIT + endif + + ifdef OPENJDK + LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/windows/resource/icons" + else + LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/closed/windows/native/sun/windows" + endif + LIBAWT_VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/native/sun/windows/awt.rc +endif + +ifeq ($(MILESTONE), internal) + LIBAWT_CFLAGS += -DINTERNAL_BUILD +endif + +LIBAWT_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libawt/mapfile-vers +ifeq ($(OPENJDK_TARGET_OS), linux) + LIBAWT_MAPFILE := +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \ + LIBRARY := awt, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(LIBAWT_DIRS), \ + INCLUDE_FILES := $(LIBAWT_FILES), \ + LANG := $(LIBAWT_LANG), \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \ + ASFLAGS := $(LIBAWT_ASFLAGS), \ + MAPFILE := $(LIBAWT_MAPFILE), \ + LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_solaris := -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \ + LDFLAGS_SUFFIX_linux := -ljvm $(LIBM) $(LIBDL) -ljava, \ + LDFLAGS_SUFFIX_solaris := -ljvm $(LIBM) $(LIBDL) -ljava -lc, \ + LDFLAGS_SUFFIX_macosx := -lmlib_image -ljvm $(LIBM) \ + -framework Cocoa \ + -framework OpenGL \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -framework JavaNativeFoundation \ + -framework JavaRuntimeSupport \ + -framework ApplicationServices \ + -framework AudioToolbox \ + -ljava, \ + LDFLAGS_SUFFIX_windows := kernel32.lib user32.lib gdi32.lib winspool.lib \ + imm32.lib ole32.lib uuid.lib shell32.lib \ + comdlg32.lib winmm.lib comctl32.lib shlwapi.lib \ + delayimp.lib jvm.lib $(WIN_JAVA_LIB) advapi32.lib \ + -DELAYLOAD:user32.dll -DELAYLOAD:gdi32.dll \ + -DELAYLOAD:shell32.dll -DELAYLOAD:winmm.dll \ + -DELAYLOAD:winspool.drv -DELAYLOAD:imm32.dll \ + -DELAYLOAD:ole32.dll -DELAYLOAD:comdlg32.dll \ + -DELAYLOAD:comctl32.dll -DELAYLOAD:shlwapi.dll, \ + VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE), \ + RC_FLAGS := $(RC_FLAGS) $(LIBAWT_RC_FLAGS) \ + -D "JDK_FNAME=awt.dll" \ + -D "JDK_INTERNAL_NAME=awt" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + +$(BUILD_LIBAWT): $(BUILD_LIBJAVA) + +ifeq ($(OPENJDK_TARGET_OS), macosx) + $(BUILD_LIBAWT): $(BUILD_LIBMLIB_IMAGE) +endif + +BUILD_LIBRARIES += $(BUILD_LIBAWT) + +########################################################################################## + +ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),) + ifndef BUILD_HEADLESS_ONLY + + LIBAWT_XAWT_DIRS := \ + $(JDK_TOPDIR)/src/share/native/sun/awt/debug \ + $(JDK_TOPDIR)/src/share/native/sun/awt/utility \ + $(JDK_TOPDIR)/src/share/native/sun/font \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font \ + $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/opengl \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11 \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/xawt \ + + LIBAWT_XAWT_CFLAGS := -DXAWT -DXAWT_HACK \ + -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \ + $(CUPS_CFLAGS) \ + $(foreach dir, $(LIBAWT_XAWT_DIRS), -I$(dir)) \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga + + ifeq ($(OPENJDK_TARGET_OS), solaris) + LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15 + endif + + ifeq ($(OPENJDK_TARGET_OS), linux) + ifndef OPENJDK + include $(JDK_TOPDIR)/make/closed/xawt.gmk + endif + + ifeq ($(DISABLE_XRENDER), true) + LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true + endif + endif + + ifeq ($(MILESTONE), internal) + LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD + endif + + LIBAWT_XAWT_FILES := \ + XlibWrapper.c \ + XWindow.c \ + XToolkit.c \ + X11Color.c \ + X11SurfaceData.c \ + awt_GraphicsEnv.c \ + awt_InputMethod.c \ + robot_common.c \ + awt_Robot.c \ + list.c \ + multiVis.c \ + initIDs.c \ + awt_util.c \ + awt_Desktop.c \ + awt_UNIXToolkit.c \ + X11FontScaler_md.c \ + X11TextRenderer_md.c \ + fontpath.c \ + awt_Insets.c \ + awt_Event.c \ + X11Renderer.c \ + X11PMBlitLoops.c \ + OGLBlitLoops.c \ + OGLBufImgOps.c \ + OGLContext.c \ + OGLFuncs.c \ + OGLMaskBlit.c \ + OGLMaskFill.c \ + OGLPaints.c \ + OGLRenderQueue.c \ + OGLRenderer.c \ + OGLSurfaceData.c \ + OGLTextRenderer.c \ + OGLVertexCache.c \ + GLXGraphicsConfig.c \ + GLXSurfaceData.c \ + AccelGlyphCache.c \ + awt_Font.c \ + multi_font.c \ + awt_AWTEvent.c \ + awt_DrawingSurface.c \ + jawt.c \ + CUPSfuncs.c \ + debug_assert.c \ + debug_mem.c \ + debug_trace.c \ + debug_util.c \ + awt_Plugin.c \ + gnome_interface.c \ + gtk2_interface.c \ + swing_GTKEngine.c \ + swing_GTKStyle.c \ + rect.c \ + sun_awt_X11_GtkFileDialogPeer.c \ + XRSurfaceData.c \ + XRBackendNative.c + + LIBAWT_XAWT_LDFLAGS_SUFFIX := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm -lc + + ifeq ($(OPENJDK_TARGET_OS), linux) + # To match old build, add this to LDFLAGS instead of suffix. + LIBAWT_XAWT_LDFLAGS += -lpthread + endif + + $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \ + LIBRARY := awt_xawt, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(LIBAWT_XAWT_DIRS), \ + INCLUDE_FILES := $(LIBAWT_XAWT_FILES), \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \ + $(X_CFLAGS), \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libawt_xawt/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(X_LIBS) $(LIBAWT_XAWT_LDFLAGS), \ + LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN) \ + $(call SET_SHARED_LIBRARY_ORIGIN,/..), \ + LDFLAGS_solaris := -L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \ + -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \ + -R$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \ + -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \ + -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \ + $(call SET_SHARED_LIBRARY_ORIGIN) \ + $(call SET_SHARED_LIBRARY_ORIGIN,/..), \ + LDFLAGS_SUFFIX := $(LIBAWT_XAWT_LDFLAGS_SUFFIX), \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=xawt.dll" \ + -D "JDK_INTERNAL_NAME=xawt" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_xawt, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + $(BUILD_LIBAWT_XAWT): $(BUILD_LIBJAVA) + + $(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT) + + BUILD_LIBRARIES += $(BUILD_LIBAWT_XAWT) + + endif +endif + +########################################################################################## + +# TODO: Update awt lib path when awt is converted +$(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \ + LIBRARY := lcms, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms, \ + LANG := C, \ + OPTIMIZATION := HIGHEST, \ + CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \ + $(SHARED_LIBRARY_FLAGS) \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \ + CFLAGS_solaris := -xc99=no_lib, \ + CFLAGS_windows := -DCMS_IS_WINDOWS_, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/liblcms/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \ + LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \ + LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc, \ + LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm, \ + LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=lcms.dll" \ + -D "JDK_INTERNAL_NAME=lcms" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/liblcms, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + +BUILD_LIBRARIES += $(BUILD_LIBLCMS) + +$(BUILD_LIBLCMS): $(BUILD_LIBAWT) + +########################################################################################## + +ifdef OPENJDK + BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/mapfile-vers +else + BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/mapfile-vers-closed + BUILD_LIBJPEG_CLOSED_SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg + BUILD_LIBJPEG_CLOSED_INCLUDES := -I$(BUILD_LIBJPEG_CLOSED_SRC) +endif + +BUILD_LIBJPEG_REORDER := +ifeq ($(OPENJDK_TARGET_OS), solaris) + ifneq ($(OPENJDK_TARGET_CPU), x86_64) + BUILD_LIBJPEG_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU) + endif +endif + +# Suppress gcc warnings like "variable might be clobbered by 'longjmp' +# or 'vfork'": this warning indicates that some variable is placed to +# a register by optimized compiler and it's value might be lost on longjmp(). +# Recommended way to avoid such warning is to declare the variable as +# volatile to prevent the optimization. However, this approach does not +# work because we have to declare all variables as volatile in result. +#ifndef CROSS_COMPILE_ARCH +# CC_43_OR_NEWER := \ +# $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \ +# \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) ) +# ifeq ($(CC_43_OR_NEWER), 1) +# BUILD_LIBJPEG_CFLAGS_linux += -Wno-clobbered +# endif +#endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBJPEG, \ + LIBRARY := jpeg, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(BUILD_LIBJPEG_CLOSED_SRC) \ + $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \ + LANG := C, \ + OPTIMIZATION := HIGHEST, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(BUILD_LIBJPEG_CLOSED_INCLUDES) \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \ + MAPFILE := $(BUILD_LIBJPEG_MAPFILE), \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_windows := $(WIN_JAVA_LIB) jvm.lib, \ + LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=jpeg.dll" \ + -D "JDK_INTERNAL_NAME=jpeg" \ + -D "JDK_FTYPE=0x2L", \ + REORDER := $(BUILD_LIBJPEG_REORDER), \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjpeg, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + +$(BUILD_LIBJPEG): $(BUILD_LIBJAVA) + +BUILD_LIBRARIES += $(BUILD_LIBJPEG) + +########################################################################################## + +ifndef OPENJDK + FONT_HEADERS := -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k + BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers + LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c +else + FONT_HEADERS := $(FREETYPE_CFLAGS) + BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk + BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE_LIBS) +endif + +LIBFONTMANAGER_OPTIMIZATION := HIGH + +ifeq ($(OPENJDK_TARGET_OS), windows) + LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \ + X11TextRenderer.c + LIBFONTMANAGER_OPTIMIZATION := HIGHEST +else ifeq ($(OPENJDK_TARGET_OS), macosx) + LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \ + X11TextRenderer.c \ + fontpath.c \ + lcdglyph.c +else + LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \ + lcdglyph.c +endif + +BUILD_LIBFONTMANAGER_CFLAGS_COMMON := \ + $(X_CFLAGS) \ + -DLE_STANDALONE -DHEADLESS \ + $(FONT_HEADERS) \ + -I$(JDK_TOPDIR)/src/share/native/sun/font \ + -I$(JDK_TOPDIR)/src/share/native/sun/font/layout \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d + +# Turn off aliasing with GCC for ExtensionSubtables.cpp +ifeq ($(OPENJDK_TARGET_OS), linux) + BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ + LIBRARY := fontmanager, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/share/native/sun/font \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font, \ + EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \ + AccelGlyphCache.c, \ + LANG := C++, \ + CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \ + CXXFLAGS := $(CXXFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \ + OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \ + CFLAGS_windows = -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \ + -DCC_NOEX, \ + MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \ + LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \ + LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \ + LDFLAGS_SUFFIX_solaris := -lawt -lawt_xawt -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \ + LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \ + -ljava -ljvm, \ + LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \ + $(WIN_AWT_LIB), \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=fontmanager.dll" \ + -D "JDK_INTERNAL_NAME=fontmanager" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfontmanager, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + +$(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT) + +ifeq ($(OPENJDK_TARGET_OS), solaris) + $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_XAWT) +endif + +BUILD_LIBRARIES += $(BUILD_LIBFONTMANAGER) + +########################################################################################## + +ifndef OPENJDK + + #ifeq ($(OPENJDK_TARGET_OS), linux) + # ifeq ("$(CC_VER_MAJOR)", "3") + # OTHER_LDLIBS += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic + # endif + #endif + # + # The resulting size of the t2k lib file is (at least on linux) dependant on the order of + # the input .o files. Because of this the new build will differ in size to the old build. + BUILD_LIBT2K_CFLAGS_COMMON := -I$(JDK_TOPDIR)/src/share/native/sun/font \ + -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \ + -I$(JDK_TOPDIR)/src/closed/share/native/sun/font \ + -I$(JDK_TOPDIR)/src/share/share/native/sun/font \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d + + $(eval $(call SetupNativeCompilation,BUILD_LIBT2K, \ + LIBRARY := t2k, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/font \ + $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \ + $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k/ttHints, \ + EXCLUDE_FILES := orion.c, \ + LANG := C++, \ + OPTIMIZATION := HIGH, \ + CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON), \ + CXXFLAGS := $(CXXFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON), \ + CFLAGS_windows = -DCC_NOEX, \ + CXXFLAGS_windows = -DCC_NOEX, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libt2k/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_windows := user32.lib $(JDK_OUTPUTDIR)/objs/libfontmanager/fontmanager.lib, \ + LDFLAGS_SUFFIX_posix := $(LIBM) $(LIBCXX) -lfontmanager -ljava -ljvm -lc, \ + LDFLAGS_SUFFIX_solaris := -lawt -lawt_xawt, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=t2k.dll" \ + -D "JDK_INTERNAL_NAME=t2k" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libt2k, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + # t2k is linked against fontmanager + $(BUILD_LIBT2K): $(BUILD_LIBFONTMANAGER) + + BUILD_LIBRARIES += $(BUILD_LIBT2K) +endif + +########################################################################################## + +ifeq ($(OPENJDK_TARGET_OS), windows) + ifeq ($(OPENJDK_TARGET_CPU), x86) + KERNEL32_LIB := kernel32.lib + endif + $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \ + LIBRARY := jawt, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows, \ + INCLUDE_FILES := jawt.cpp, \ + LANG := C++, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CXXFLAGS_JDKLIB) \ + -EHsc -DUNICODE -D_UNICODE \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows, \ + LDFLAGS := $(LDFLAGS_JDKLIB) $(KERNEL32_LIB) $(LDFLAGS_CXX_JDK) \ + advapi32.lib $(WIN_AWT_LIB), \ + LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=jawt.dll" \ + -D "JDK_INTERNAL_NAME=jawt" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + $(BUILD_LIBJAWT): $(BUILD_LIBAWT) + + $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT) + $(ECHO) Copying $(@F) + $(CP) $(JDK_OUTPUTDIR)/objs/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@ + + BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) + +else # OPENJDK_TARGET_OS not windows + + ifeq ($(OPENJDK_TARGET_OS), macosx) + JAWT_FILES := jawt.m + JAWT_LIBS := -lawt_lwawt + else + JAWT_FILES := jawt.c + JAWT_LIBS := + ifneq ($(OPENJDK_TARGET_OS), solaris) + JAWT_LIBS += -lawt + endif + ifndef BUILD_HEADLESS_ONLY + JAWT_LIBS += -lawt_xawt + else + JAWT_LIBS += -lawt_headless + HEADLESS_CFLAG += -DHEADLESS + endif + endif + + $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \ + LIBRARY := jawt, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \ + $(JDK_TOPDIR)/src/macosx/native/sun/awt, \ + INCLUDE_FILES := $(JAWT_FILES), \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB), \ + CFLAGS_linux := $(HEADLESS_CFLAG), \ + CFLAGS_macosx := -I$(JDK_TOPDIR)/src/solaris/native/sun/awt, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjawt/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_solaris := -L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \ + LDFLAGS_SUFFIX_linux := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX), \ + LDFLAGS_SUFFIX_solaris := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX) -lXrender, \ + LDFLAGS_SUFFIX_macosx := -Xlinker -rpath -Xlinker @loader_path $(JAWT_LIBS) \ + -framework Cocoa $(LDFLAGS_JDKLIB_SUFFIX), \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + ifndef BUILD_HEADLESS_ONLY + $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT) + else + $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX) + endif + + ifeq ($(OPENJDK_TARGET_OS), macosx) + $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX) + endif + +endif # OPENJDK_TARGET_OS + +BUILD_LIBRARIES += $(BUILD_LIBJAWT) + +########################################################################################## + +ifndef OPENJDK + + BUILD_LIBKCMS_EXCLUDE_FILES := + ifeq ($(OPENJDK_TARGET_OS), windows) + BUILD_LIBKCMS_EXCLUDE_FILES += ukcpmgr.c unixmem.c + else + BUILD_LIBKCMS_EXCLUDE_FILES += cmmdll.c registry.c spxffile.c sysinfo.c winmem.c wkcpmgr.c + endif + + BUILD_LIBKCMS_FLAGS := $(CFLAGS_JDKLIB) + + ifeq ($(OPENJDK_TARGET_OS), solaris) + # This particular library uses a feature called PIC_CODE_SMALL (on solaris) + # implement it like this...since it's only used here + BUILD_LIBKCMS_FLAGS := $(patsubst -KPIC, -Kpic, $(BUILD_LIBKCMS_FLAGS)) + else ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc) + BUILD_LIBKCMS_FLAGS := $(patsubst -fPIC, -fpic, $(BUILD_LIBKCMS_FLAGS)) + endif + + $(eval $(call SetupNativeCompilation,BUILD_LIBKCMS, \ + LIBRARY := kcms, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms, \ + LANG := C, \ + EXCLUDE_FILES := $(BUILD_LIBKCMS_EXCLUDE_FILES), \ + OPTIMIZATION := LOW, \ + CFLAGS := $(BUILD_LIBKCMS_FLAGS) \ + -DJAVACMM -DFUT_CALC_EX -DNO_FUT_GCONST, \ + CFLAGS_linux := -Wno-missing-field-initializers, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libkcms/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_linux := -lc -lpthread, \ + LDFLAGS_SUFFIX_solaris := -lc, \ + LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib version.lib, \ + LDFLAGS_SUFFIX_posix := -lm -ljava -ljvm, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=kcms.dll" \ + -D "JDK_INTERNAL_NAME=kcms" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libkcms, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + $(BUILD_LIBKCMS): $(BUILD_LIBJAVA) + + BUILD_LIBRARIES += $(BUILD_LIBKCMS) + +endif + +########################################################################################## + +ifndef OPENJDK + ifeq ($(OPENJDK_TARGET_OS), solaris) + ifneq ($(OPENJDK_TARGET_CPU), x86_64) + + ifeq ($(shell if test "$(OS_VERSION_MAJOR)" -eq 5 -a "$(OS_VERSION_MINOR)" -le 10; then $(ECHO) ok; fi), ok) + + SUNWJDGA_MAPFILE := + ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc) + SUNWJDGA_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjdga/mapfile-vers + endif + + $(eval $(call SetupNativeCompilation,BUILD_LIBSUNWJDGA, \ + LIBRARY := sunwjdga, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/solaris/native/sun/jdga, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/share/javavm/export \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export \ + -I$(OPENWIN_HOME)/include, \ + MAPFILE := $(SUNWJDGA_MAPFILE), \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -ldga -lX11 $(LIBDL) -lc, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsunwjdga, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + BUILD_LIBRARIES += $(BUILD_LIBSUNWJDGA) + + endif + endif + endif +endif + +########################################################################################## + +ifeq ($(BUILD_HEADLESS), true) + # Mac and Windows only use the native AWT lib, do not build libawt_headless + ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),) + + LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/share/native/sun/font \ + $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \ + $(JDK_TOPDIR)/src/solaris/native/sun/font \ + $(JDK_TOPDIR)/src/solaris/native/sun/awt \ + $(JDK_TOPDIR)/src/solaris/native/sun/java2d/opengl \ + $(JDK_TOPDIR)/src/solaris/native/sun/java2d/x11 + + ifeq ($(OPENJDK_TARGET_OS), macosx) + LIBAWT_HEADLESS_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/font + endif + + LIBAWT_HEADLESS_CFLAGS := -DHEADLESS=true \ + -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \ + $(CUPS_CFLAGS) \ + $(X_CFLAGS) \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga \ + $(foreach dir, $(LIBAWT_HEADLESS_DIRS), -I$(dir)) + + ifeq ($(OPENJDK_TARGET_OS), macosx) + LIBAWT_HEADLESS_CFLAGS += \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks + endif + + LIBAWT_HEADLESS_FILES := \ + awt_Font.c \ + HeadlessToolkit.c \ + fontpath.c \ + VDrawingArea.c \ + X11Color.c \ + X11Renderer.c \ + X11PMBlitLoops.c \ + X11SurfaceData.c \ + X11FontScaler_md.c \ + X11TextRenderer_md.c \ + OGLBlitLoops.c \ + OGLBufImgOps.c \ + OGLContext.c \ + OGLFuncs.c \ + OGLMaskBlit.c \ + OGLMaskFill.c \ + OGLPaints.c \ + OGLRenderQueue.c \ + OGLRenderer.c \ + OGLSurfaceData.c \ + OGLTextRenderer.c \ + OGLVertexCache.c \ + GLXGraphicsConfig.c \ + GLXSurfaceData.c \ + AccelGlyphCache.c \ + CUPSfuncs.c + + LIBAWT_HEADLESS_REORDER := + ifeq ($(OPENJDK_TARGET_OS), solaris) + ifneq ($(OPENJDK_TARGET_CPU), x86_64) + LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU) + endif + endif + + $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \ + LIBRARY := awt_headless, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(LIBAWT_HEADLESS_DIRS), \ + INCLUDE_FILES := $(LIBAWT_HEADLESS_FILES), \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_HEADLESS_CFLAGS), \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libawt_headless/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \ + LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..) \ + -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \ + -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \ + LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN)., \ + REORDER := $(LIBAWT_HEADLESS_REORDER), \ + LDFLAGS_SUFFIX_linux := -ljvm -lawt -lm $(LIBDL) -ljava, \ + LDFLAGS_SUFFIX_solaris := $(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_headless, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT) + + BUILD_LIBRARIES += $(BUILD_LIBAWT_HEADLESS) + + endif +endif + +########################################################################################## + +ifndef BUILD_HEADLESS_ONLY + LIBSPLASHSCREEN_DIRS := \ + $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \ + $(JDK_TOPDIR)/src/share/native/sun/awt/libpng \ + $(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen + + ifeq ($(USE_EXTERNAL_LIBGIF), true) + GIFLIB_LDFLAGS := -lgif + else + LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/giflib + GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib + endif + + ifneq ($(OPENJDK_TARGET_OS), macosx) + LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen + else + LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen + endif + + LIBSPLASHSCREEN_CFLAGS := -DSPLASHSCREEN -DPNG_NO_MMX_CODE \ + $(foreach dir, $(LIBSPLASHSCREEN_DIRS), -I$(dir)) + + ifeq ($(OPENJDK_TARGET_OS), macosx) + LIBSPLASHSCREEN_CFLAGS := -I$(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen \ + $(LIBSPLASHSCREEN_CFLAGS) \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks + LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX + LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp + + LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0 + LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0 + LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0 + LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0 + LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0 + LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0 + LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0 + + else ifeq ($(OPENJDK_TARGET_OS), windows) + LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32 + else ifeq ($(OPENJDK_TARGET_OS), solaris) + LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions + else + LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS) + endif + + LIBSPLASHSCREEN_LDFLAGS_SUFFIX := + + ifneq ($(USE_EXTERNAL_LIBZ), true) + LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5 + LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS) + endif + + ifeq ($(OPENJDK_TARGET_OS), macosx) + LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(LIBM) -lpthread -liconv -losxapp \ + -framework ApplicationServices \ + -framework Foundation \ + -framework Cocoa \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -framework JavaNativeFoundation + else ifeq ($(OPENJDK_TARGET_OS), windows) + LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll + else ifeq ($(OPENJDK_TARGET_OS), solaris) + # Solaris still uses OPENWIN_LIB .. + LIBSPLASHSCREEN_LDFLAGS_SUFFIX += -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -lX11 -lXext $(LIBM) -lpthread + else # .. all other Unixes can use X_LIBS + LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread + endif + + $(eval $(call SetupNativeCompilation,LIBSPLASHSCREEN, \ + LIBRARY := splashscreen, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(LIBSPLASHSCREEN_DIRS), \ + EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS), \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libsplashscreen/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) $(GIFLIB_LDFLAGS), \ + LDFLAGS_SUFFIX_solaris := -lc, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=splashscreen.dll" \ + -D "JDK_INTERNAL_NAME=splashscreen" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsplashscreen, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + BUILD_LIBRARIES += $(LIBSPLASHSCREEN) + + ifeq ($(OPENJDK_TARGET_OS), macosx) + $(LIBSPLASHSCREEN): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX) + endif + +endif + +########################################################################################## + +ifndef OPENJDK + + LIBDCPR_SRC_DIRS := \ + $(JDK_TOPDIR)/src/closed/share/native/sun/dc/doe \ + $(JDK_TOPDIR)/src/closed/share/native/sun/dc/path \ + $(JDK_TOPDIR)/src/closed/share/native/sun/dc/pr \ + $(JDK_TOPDIR)/src/closed/share/native/sun/dc/util + + LIBDCPR_CFLAGS := $(foreach dir, $(LIBDCPR_SRC_DIRS), -I$(dir)) \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe + + $(eval $(call SetupNativeCompilation,BUILD_LIBDCPR, \ + LIBRARY := dcpr, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(LIBDCPR_SRC_DIRS), \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(LIBDCPR_CFLAGS), \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libdcpr/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := $(LIBM) $(LDFLAGS_JDKLIB_SUFFIX), \ + LDFLAGS_SUFFIX_posix := -lm, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=dcpr.dll" \ + -D "JDK_INTERNAL_NAME=dcpr" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libdcpr, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + $(BUILD_LIBDCPR): $(BUILD_LIBJAVA) + + BUILD_LIBRARIES += $(BUILD_LIBDCPR) + +endif + +########################################################################################## + +ifeq ($(OPENJDK_TARGET_OS), macosx) + + LIBAWT_LWAWT_FILES := \ + awt.m \ + ApplicationDelegate.m \ + CFRetainedResource.m \ + CGLGraphicsConfig.m \ + CGLSurfaceData.m \ + CGLLayer.m \ + CGraphicsConfig.m \ + CGraphicsDevice.m \ + CGraphicsEnv.m \ + CCharToGlyphMapper.m \ + CSystemColors.m \ + AWTFont.m \ + CGGlyphOutlines.m \ + CGGlyphImages.m \ + CoreTextSupport.m \ + AWTStrike.m \ + InitIDs.m \ + AWTEvent.m \ + AWTView.m \ + AWTWindow.m \ + AWTSurfaceLayers.m \ + CCursorManager.m \ + CClipboard.m \ + CDataTransferer.m \ + CDragSource.m \ + CDragSourceContextPeer.m \ + CDropTarget.m \ + CDropTargetContextPeer.m \ + CInputMethod.m \ + CDesktopPeer.m \ + OSVersion.m \ + DnDUtilities.m \ + CFileDialog.m \ + CImage.m \ + CMenu.m \ + CMenuBar.m \ + CMenuComponent.m \ + CMenuItem.m \ + CPopupMenu.m \ + CRobot.m \ + CTrayIcon.m \ + CWrapper.m \ + JavaAccessibilityAction.m \ + JavaAccessibilityUtilities.m \ + JavaComponentAccessibility.m \ + JavaTextAccessibility.m \ + LWCToolkit.m \ + GeomUtilities.m \ + CPrinterJob.m \ + PrintModel.m \ + PrinterSurfaceData.m \ + PrinterView.m \ + QuartzSurfaceData.m \ + QuartzRenderer.m \ + CTextPipe.m \ + ImageSurfaceData.m \ + awt_DrawingSurface.m \ + \ + OGLBlitLoops.c \ + OGLBufImgOps.c \ + OGLContext.c \ + OGLFuncs.c \ + OGLMaskBlit.c \ + OGLMaskFill.c \ + OGLPaints.c \ + OGLRenderQueue.c \ + OGLRenderer.c \ + OGLSurfaceData.c \ + OGLTextRenderer.c \ + OGLVertexCache.c \ + AccelGlyphCache.c \ + CUPSfuncs.c + + + LIBAWT_LWAWT_DIRS := \ + $(JDK_TOPDIR)/src/macosx/native/sun/awt \ + $(JDK_TOPDIR)/src/macosx/native/sun/font \ + $(JDK_TOPDIR)/src/macosx/native/sun/java2d/opengl \ + $(JDK_TOPDIR)/src/solaris/native/sun/awt \ + $(JDK_TOPDIR)/src/share/native/sun/font \ + $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \ + + $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT, \ + LIBRARY := awt_lwawt, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(LIBAWT_LWAWT_DIRS), \ + LANG := C, \ + INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(X_CFLAGS) \ + $(X_LIBS) \ + $(foreach dir, $(LIBAWT_LWAWT_DIRS), -I$(dir)) \ + -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d \ + -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \ + -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \ + -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_macosx := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \ + -framework Accelerate \ + -framework ApplicationServices \ + -framework AudioToolbox \ + -framework Carbon \ + -framework Cocoa \ + -framework Security \ + -framework ExceptionHandling \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -framework JavaNativeFoundation \ + -framework JavaRuntimeSupport \ + -framework OpenGL \ + -framework QuartzCore -ljava, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_lwawt, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + BUILD_LIBRARIES += $(BUILD_LIBAWT_LWAWT) + + $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBAWT) + + $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE) + + $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBOSXAPP) + + $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBJAVA) + +endif + +########################################################################################## + +ifeq ($(OPENJDK_TARGET_OS), macosx) + + $(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI, \ + LIBRARY := osxui, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/macosx/native/com/apple/laf, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/macosx/native/com/apple/laf \ + -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \ + -I$(JDK_TOPDIR)/src/macosx/native/sun/awt \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN) \ + -Xlinker -rpath -Xlinker @loader_path, \ + LDFLAGS_SUFFIX_macosx := -lawt -losxapp -lawt_lwawt \ + -framework Cocoa \ + -framework Carbon \ + -framework ApplicationServices \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -framework JavaNativeFoundation \ + -framework JavaRuntimeSupport \ + -ljava -ljvm, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosxui, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + BUILD_LIBRARIES += $(BUILD_LIBOSXUI) + + $(BUILD_LIBOSXUI): $(BUILD_LIBAWT) + + $(BUILD_LIBOSXUI): $(BUILD_LIBOSXAPP) + + $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT) + + #$(BUILD_LIBOSXUI): $(BUILD_LIBJAVA) + +endif diff --git a/jdk/makefiles/lib/CoreLibraries.gmk b/jdk/makefiles/lib/CoreLibraries.gmk new file mode 100644 index 00000000000..29c1d5fc08a --- /dev/null +++ b/jdk/makefiles/lib/CoreLibraries.gmk @@ -0,0 +1,510 @@ +# +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# 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. +# + +WIN_VERIFY_LIB := $(JDK_OUTPUTDIR)/objs/libverify/verify.lib + +########################################################################################## + +BUILD_LIBFDLIBM_OPTIMIZATION := HIGH + +ifneq ($(OPENJDK_TARGET_OS), solaris) + BUILD_LIBFDLIBM_OPTIMIZATION := NONE +endif + +ifneq ($(OPENJDK_TARGET_OS), macosx) + $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM, \ + STATIC_LIBRARY := fdlibm, \ + OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \ + SRC := $(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src, \ + LANG := C, \ + OPTIMIZATION := $(BUILD_LIBFDLIBM_OPTIMIZATION), \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include, \ + CFLAGS_windows_debug := -DLOGGING, \ + ARFLAGS := $(ARFLAGS), \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + +else + + # 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, \ + LANG := C, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include, \ + LDFLAGS := -nostdlib -r -arch x86_64, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + BUILD_LIBFDLIBM := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) + $(BUILD_LIBFDLIBM): $(BUILD_LIBFDLIBM_MAC) + $(call install-file) + +endif + +BUILD_LIBRARIES += $(BUILD_LIBFDLIBM) + +########################################################################################## + +BUILD_LIBVERIFY_SRC := check_code.c check_format.c + +ifeq ($(OPENJDK_TARGET_OS), solaris) + ifneq ($(OPENJDK_TARGET_CPU), x86_64) + BUILD_LIBVERIFY_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libverify/reorder-$(OPENJDK_TARGET_CPU) + endif +endif + +LIBVERIFY_OPTIMIZATION := HIGH +ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), ) + ifeq ($(ENABLE_DEBUG_SYMBOLS), true) + LIBVERIFY_OPTIMIZATION := LOW + endif +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \ + LIBRARY := verify, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/share/native/common, \ + INCLUDE_FILES := $(BUILD_LIBVERIFY_SRC), \ + LANG := C, \ + OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \ + CFLAGS := $(CFLAGS_JDKLIB), \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libverify/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_posix := -ljvm -lc, \ + LDFLAGS_SUFFIX_windows := jvm.lib, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=verify.dll" \ + -D "JDK_INTERNAL_NAME=verify" \ + -D "JDK_FTYPE=0x2L", \ + REORDER := $(BUILD_LIBVERIFY_REORDER), \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libverify, \ + DEBUG_SYMBOLS := true)) + +BUILD_LIBRARIES += $(BUILD_LIBVERIFY) + +########################################################################################## + +LIBJAVA_SRC_DIRS := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/lang \ + $(JDK_TOPDIR)/src/share/native/java/lang \ + $(JDK_TOPDIR)/src/share/native/java/lang/ref \ + $(JDK_TOPDIR)/src/share/native/java/lang/reflect \ + $(JDK_TOPDIR)/src/share/native/java/io \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io \ + $(JDK_TOPDIR)/src/share/native/java/nio \ + $(JDK_TOPDIR)/src/share/native/java/security \ + $(JDK_TOPDIR)/src/share/native/common \ + $(JDK_TOPDIR)/src/share/native/sun/misc \ + $(JDK_TOPDIR)/src/share/native/sun/reflect \ + $(JDK_TOPDIR)/src/share/native/java/util \ + $(JDK_TOPDIR)/src/share/native/java/util/concurrent/atomic \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/util + +ifneq ($(OPENJDK_TARGET_OS), macosx) + LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/util/locale/provider +else + LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/util/locale/provider +endif + +ifeq ($(OPENJDK_TARGET_OS), windows) + LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/provider \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/io +endif + +LIBJAVA_CFLAGS := $(foreach dir, $(LIBJAVA_SRC_DIRS), -I$(dir)) \ + -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include \ + -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"' + +LIBJAVA_CFLAGS += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \ + -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \ + -DJDK_MICRO_VERSION='"$(JDK_MICRO_VERSION)"' \ + -DJDK_BUILD_NUMBER='"$(JDK_BUILD_NUMBER)"' + +ifneq (, $(JDK_UPDATE_VERSION)) + LIBJAVA_CFLAGS += -DJDK_UPDATE_VERSION='"$(JDK_UPDATE_VERSION)"' +endif + +LIBJAVA_EXCLUDE_FILES := check_code.c check_format.c jspawnhelper.c + +ifneq ($(OPENJDK_TARGET_OS), macosx) + LIBJAVA_EXCLUDE_FILES += java_props_macosx.c +else + BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c + BUILD_LIBJAVA_java_props_macosx.c_CFLAGS := -x objective-c +endif + +ifeq ($(OPENJDK_TARGET_OS), windows) + LIBJAVA_EXCLUDE_FILES += \ + UNIXProcess_md.c \ + UnixFileSystem_md.c \ + FileSystemPreferences.c +else + LIBJAVA_EXCLUDE_FILES += \ + ProcessImpl_md.c \ + WinNTFileSystem_md.c \ + dirent_md.c \ + WindowsPreferences.c \ + sun/security/provider/WinCAPISeedGenerator.c \ + sun/io/Win32ErrorMode.c +endif + +ifeq ($(OPENJDK_TARGET_OS), solaris) + ifneq ($(OPENJDK_TARGET_CPU), x86_64) + LIBJAVA_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libjava/reorder-$(OPENJDK_TARGET_CPU) + endif +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \ + LIBRARY := java, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(LIBJAVA_SRC_DIRS), \ + EXCLUDES := fdlibm/src zip, \ + EXCLUDE_FILES := $(LIBJAVA_EXCLUDE_FILES), \ + LANG := C, \ + OPTIMIZATION := HIGH, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(LIBJAVA_CFLAGS), \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjava/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_posix := -ljvm -lverify, \ + LDFLAGS_SUFFIX_solaris := -lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc, \ + LDFLAGS_SUFFIX_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \ + LDFLAGS_SUFFIX_macosx := -L$(JDK_OUTPUTDIR)/objs/ -lfdlibm \ + -framework CoreFoundation \ + -framework Foundation \ + -framework Security -framework SystemConfiguration, \ + LDFLAGS_SUFFIX_windows := -export:winFileHandleOpen -export:handleLseek \ + jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \ + shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \ + advapi32.lib, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=java.dll" \ + -D "JDK_INTERNAL_NAME=java" \ + -D "JDK_FTYPE=0x2L", \ + REORDER := $(LIBJAVA_REORDER), \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjava, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + +BUILD_LIBRARIES += $(BUILD_LIBJAVA) + +$(BUILD_LIBJAVA): $(LIBJLI_BINARY) + +$(BUILD_LIBJAVA): $(BUILD_LIBVERIFY) + +$(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM) + +########################################################################################## + +BUILD_LIBZIP_EXCLUDES := +ifeq ($(USE_EXTERNAL_LIBZ), true) + LIBZ := -lz + LIBZIP_EXCLUDES += zlib-1.2.5 +else + ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5 +endif + +BUILD_LIBZIP_REORDER := +ifeq ($(OPENJDK_TARGET_OS), solaris) + ifneq ($(OPENJDK_TARGET_CPU), x86_64) + BUILD_LIBZIP_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libzip/reorder-$(OPENJDK_TARGET_CPU) + endif +endif + +ifeq ($(LIBZIP_CAN_USE_MMAP), true) + BUILD_LIBZIP_MMAP := -DUSE_MMAP +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \ + LIBRARY := zip, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + LANG := C, \ + OPTIMIZATION := LOW, \ + SRC := $(JDK_TOPDIR)/src/share/native/java/util/zip, \ + EXCLUDES := $(LIBZIP_EXCLUDES), \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(ZLIB_CPPFLAGS) \ + -I$(JDK_TOPDIR)/src/share/native/java/io \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io, \ + CFLAGS_posix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libzip/mapfile-vers, \ + REORDER := $(BUILD_LIBZIP_REORDER), \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN) \ + $(EXPORT_ZIP_FUNCS), \ + LDFLAGS_windows := -export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \ + -export:ZIP_ReadEntry -export:ZIP_GetNextEntry jvm.lib \ + $(WIN_JAVA_LIB), \ + LDFLAGS_SUFFIX_linux := -ljvm -ljava $(LIBZ), \ + LDFLAGS_SUFFIX_solaris := -ljvm -ljava $(LIBZ) -lc, \ + LDFLAGS_SUFFIX_macosx := $(LIBZ) -ljava -ljvm, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=zip.dll" \ + -D "JDK_INTERNAL_NAME=zip" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libzip, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + +$(BUILD_LIBZIP): $(BUILD_LIBJAVA) + +BUILD_LIBRARIES += $(BUILD_LIBZIP) + +########################################################################################## + +$(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \ + LIBRARY := unpack, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack, \ + EXCLUDE_FILES := main.cpp, \ + LANG := C++, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CXXFLAGS_JDKLIB) \ + -DNO_ZLIB -DUNPACK_JNI -DFULL, \ + CFLAGS_release := -DPRODUCT, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_windows := -map:$(JDK_OUTPUTDIR)/objs/unpack.map -debug \ + jvm.lib $(WIN_JAVA_LIB), \ + LDFLAGS_SUFFIX_posix := -ljvm $(LIBCXX) -ljava -lc, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libunpack, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=unpack.dll" \ + -D "JDK_INTERNAL_NAME=unpack" \ + -D "JDK_FTYPE=0x2L", \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + +$(BUILD_LIBUNPACK): $(BUILD_LIBJAVA) + +BUILD_LIBRARIES += $(BUILD_LIBUNPACK) + +ifeq ($(OPENJDK_TARGET_OS), windows) + $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.map: $(BUILD_LIBUNPACK) + $(ECHO) Copying $(@F) + $(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX), %.map, $<) $@ + + $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.pdb: $(BUILD_LIBUNPACK) + $(ECHO) Copying $(@F) + $(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX), %.pdb, $<) $@ +endif + +########################################################################################## + +BUILD_LIBJLI_SRC_DIRS := $(JDK_TOPDIR)/src/share/bin $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin +LIBJLI_CFLAGS := $(CFLAGS_JDKLIB) $(foreach dir, $(BUILD_LIBJLI_SRC_DIRS), -I$(dir)) + +BUILD_LIBJLI_FILES := \ + java.c \ + splashscreen_stubs.c \ + parse_manifest.c \ + version_comp.c \ + wildcard.c \ + jli_util.c + +ifeq ($(JVM_VARIANT_ZERO), true) + ERGO_FAMILY := zero +else + ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86) + ERGO_FAMILY := i586 + else + ERGO_FAMILY := $(OPENJDK_TARGET_CPU_ARCH) + endif +endif + +ifeq ($(OPENJDK_TARGET_OS), macosx) + LIBJLI_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/bin + BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/bin + BUILD_LIBJLI_FILES += java_md_common.c java_md_macosx.c + + BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c + BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS := -x objective-c +endif + +ifeq ($(OPENJDK_TARGET_OS), windows) + BUILD_LIBJLI_FILES += java_md.c \ + cmdtoargs.c + # Staticically link with c runtime on windows. + LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS)) +else ifneq ($(OPENJDK_TARGET_OS), macosx) + + BUILD_LIBJLI_FILES += java_md_common.c + BUILD_LIBJLI_FILES += java_md_solinux.c ergo.c + + ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c + + # if the architecture specific ergo file exists then + # use it, else use the generic definitions from ergo.c + ifneq ($(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/$(ERGO_ARCH_FILE)), ) + BUILD_LIBJLI_FILES += $(ERGO_ARCH_FILE) + else # !ERGO_ARCH_FILE + LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO + endif # ERGO_ARCH_FILE +endif #WINDOWS + +# Append defines depending on target platform +LIBJLI_CFLAGS += $(OPENJDK_TARGET_CPU_JLI_CFLAGS) + +ifeq ($(OPENJDK_TARGET_OS), macosx) + LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" +endif + +ifneq ($(USE_EXTERNAL_LIBZ), true) + BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5 + LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS) + BUILD_LIBJLI_FILES += \ + inflate.c \ + inftrees.c \ + inffast.c \ + zadler32.c \ + zcrc32.c \ + zutil.c +endif + +ifeq ($(OPENJDK_TARGET_OS), windows) + LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE) +else + LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \ + LIBRARY := jli, \ + OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \ + SRC := $(BUILD_LIBJLI_SRC_DIRS), \ + INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \ + LANG := C, \ + OPTIMIZATION := HIGH, \ + CFLAGS := $(LIBJLI_CFLAGS), \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjli/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \ + LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \ + LDFLAGS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \ + LDFLAGS_SUFFIX_solaris := $(LIBZ) $(LIBDL) -lc, \ + LDFLAGS_SUFFIX_linux := $(LIBZ) $(LIBDL) -lc -lpthread, \ + LDFLAGS_SUFFIX_macosx := $(LIBZ), \ + LDFLAGS_SUFFIX_windows := \ + -export:JLI_Launch \ + -export:JLI_ManifestIterate \ + -export:JLI_SetTraceLauncher \ + -export:JLI_ReportErrorMessage \ + -export:JLI_ReportErrorMessageSys \ + -export:JLI_ReportMessage \ + -export:JLI_ReportExceptionDescription \ + -export:JLI_MemAlloc \ + -export:JLI_CmdToArgs \ + -export:JLI_GetStdArgc \ + -export:JLI_GetStdArgs \ + advapi32.lib \ + comctl32.lib \ + user32.lib, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=jli.dll" \ + -D "JDK_INTERNAL_NAME=jli" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + +BUILD_LIBRARIES += $(BUILD_LIBJLI) + +# On windows, the static library has the same suffix as the import library created by +# with the shared library, so the static library is given a different name. No harm +# in doing it for all platform to reduce complexity. +ifeq ($(OPENJDK_TARGET_OS), windows) + $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \ + STATIC_LIBRARY := jli_static, \ + OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \ + SRC := $(BUILD_LIBJLI_SRC_DIRS), \ + INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \ + LANG := C, \ + OPTIMIZATION := HIGH, \ + CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \ + ARFLAGS := $(ARFLAGS), \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + BUILD_LIBRARIES += $(BUILD_LIBJLI_STATIC) + +else ifeq ($(OPENJDK_TARGET_OS), macosx) + # + # On macosx they do partial (incremental) linking of libjli_static.a + # code it here...rather than add support to NativeCompilation + # as this is first time I see it + $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \ + LIBRARY := jli_static, \ + OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \ + SRC := $(BUILD_LIBJLI_SRC_DIRS), \ + INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \ + LANG := C, \ + OPTIMIZATION := HIGH, \ + CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \ + LDFLAGS := -nostdlib -r, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + $(JDK_OUTPUTDIR)/objs/libjli_static.a: $(BUILD_LIBJLI_STATIC) + $(call install-file) + + BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a +endif + +########################################################################################## + +$(eval $(call SetupNativeCompilation,BUILD_LIBNPT, \ + LIBRARY := npt, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/share/npt $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/share/npt \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnpt/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_macosx := -liconv, \ + LDFLAGS_SUFFIX_windows := -export:nptInitialize -export:nptTerminate, \ + LDFLAGS_SUFFIX_solaris := -lc, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=npt.dll" \ + -D "JDK_INTERNAL_NAME=npt" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libnpt, \ + DEBUG_SYMBOLS := true)) + +BUILD_LIBRARIES += $(BUILD_LIBNPT) diff --git a/jdk/makefiles/lib/NetworkingLibraries.gmk b/jdk/makefiles/lib/NetworkingLibraries.gmk new file mode 100644 index 00000000000..546565af91b --- /dev/null +++ b/jdk/makefiles/lib/NetworkingLibraries.gmk @@ -0,0 +1,98 @@ +# +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# 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. +# + +LIBNET_SRC_DIRS := $(JDK_TOPDIR)/src/share/native/java/net \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/dns \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/spi + +ifeq ($(OPENJDK_TARGET_OS), windows) + LIBNET_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/www/protocol/http/ntlm +else + LIBNET_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/sdp +endif + +LIBNET_CFLAGS := $(foreach dir, $(LIBNET_SRC_DIRS), -I$(dir)) + +LIBNET_EXCLUDE_FILES := +ifneq ($(OPENJDK_TARGET_OS), linux) + LIBNET_EXCLUDE_FILES += linux_close.c +endif + +ifneq ($(OPENJDK_TARGET_OS), macosx) + LIBNET_EXCLUDE_FILES += bsd_close.c +endif + +ifeq ($(OPENJDK_TARGET_OS), windows) + LIBNET_EXCLUDE_FILES += PlainSocketImpl.c PlainDatagramSocketImpl.c SdpSupport.c +else + LIBNET_EXCLUDE_FILES += TwoStacksPlainSocketImpl.c DualStackPlainSocketImpl.c \ + TwoStacksPlainDatagramSocketImpl.c DualStackPlainDatagramSocketImpl.c \ + NTLMAuthSequence.c NetworkInterface_winXP.c +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBNET, \ + LIBRARY := net, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(LIBNET_SRC_DIRS), \ + EXCLUDE_FILES := $(LIBNET_EXCLUDE_FILES), \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(LIBNET_CFLAGS), \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnet/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_macosx := -ljvm -ljava, \ + LDFLAGS_SUFFIX_solaris := -ljvm -ljava -lnsl -lsocket $(LIBDL) -lc, \ + LDFLAGS_SUFFIX_linux := $(LIBDL) -ljvm -lpthread -ljava, \ + LDFLAGS_SUFFIX_windows := ws2_32.lib jvm.lib secur32.lib iphlpapi.lib \ + delayimp.lib $(WIN_JAVA_LIB) advapi32.lib \ + -DELAYLOAD:secur32.dll -DELAYLOAD:iphlpapi.dll, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=net.dll" \ + -D "JDK_INTERNAL_NAME=net" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libnet, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + +$(BUILD_LIBNET): $(BUILD_LIBJAVA) + +BUILD_LIBRARIES += $(BUILD_LIBNET) + +$(JDK_OUTPUTDIR)/lib/net.properties: $(JDK_TOPDIR)/src/share/lib/net.properties + $(ECHO) $(LOG_INFO) Copying $(@F) + $(call install-file) + +COPY_FILES += $(JDK_OUTPUTDIR)/lib/net.properties + +ifeq ($(OPENJDK_TARGET_OS), solaris) + $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template: $(JDK_TOPDIR)/src/${OPENJDK_TARGET_OS_API_DIR}/lib/sdp/sdp.conf.template + $(ECHO) $(LOG_INFO) Copying $(@F) + $(call install-file) + + COPY_FILES += $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template +endif diff --git a/jdk/makefiles/lib/NioLibraries.gmk b/jdk/makefiles/lib/NioLibraries.gmk new file mode 100644 index 00000000000..afab1c9c29c --- /dev/null +++ b/jdk/makefiles/lib/NioLibraries.gmk @@ -0,0 +1,186 @@ +# +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# 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. +# + +BUILD_LIBNIO_SRC := \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/nio \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs + +BUILD_LIBNIO_CFLAGS := \ + -I$(JDK_TOPDIR)/src/share/native/sun/nio/ch \ + -I$(JDK_TOPDIR)/src/share/native/java/io \ + -I$(JDK_TOPDIR)/src/share/native/java/net \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net + +BUILD_LIBNIO_FILES := \ + DatagramChannelImpl.c \ + DatagramDispatcher.c \ + FileChannelImpl.c \ + FileDispatcherImpl.c \ + FileKey.c \ + IOUtil.c \ + MappedByteBuffer.c \ + Net.c \ + ServerSocketChannelImpl.c \ + SocketChannelImpl.c \ + SocketDispatcher.c + +ifeq ($(OPENJDK_TARGET_OS), windows) + BUILD_LIBNIO_FILES += \ + Iocp.c \ + RegistryFileTypeDetector.c \ + WindowsAsynchronousFileChannelImpl.c \ + WindowsAsynchronousServerSocketChannelImpl.c \ + WindowsAsynchronousSocketChannelImpl.c \ + WindowsNativeDispatcher.c \ + WindowsSelectorImpl.c +endif + +ifeq ($(OPENJDK_TARGET_OS), linux) + BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS) + BUILD_LIBNIO_FILES += \ + EPoll.c \ + EPollArrayWrapper.c \ + EPollPort.c \ + InheritedChannel.c \ + NativeThread.c \ + PollArrayWrapper.c \ + UnixAsynchronousServerSocketChannelImpl.c \ + UnixAsynchronousSocketChannelImpl.c \ + GnomeFileTypeDetector.c \ + MagicFileTypeDetector.c \ + LinuxNativeDispatcher.c \ + LinuxWatchService.c \ + UnixCopyFile.c \ + UnixNativeDispatcher.c +endif + +ifeq ($(OPENJDK_TARGET_OS), macosx) + BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS) + BUILD_LIBNIO_SRC += $(JDK_TOPDIR)/src/macosx/native/sun/nio/ch + BUILD_LIBNIO_FILES += \ + InheritedChannel.c \ + NativeThread.c \ + PollArrayWrapper.c \ + UnixAsynchronousServerSocketChannelImpl.c \ + UnixAsynchronousSocketChannelImpl.c \ + BsdNativeDispatcher.c \ + MacOSXNativeDispatcher.c \ + UnixCopyFile.c \ + UnixNativeDispatcher.c \ + KQueue.c \ + KQueuePort.c \ + KQueueArrayWrapper.c +endif + +ifeq ($(OPENJDK_TARGET_OS), solaris) + BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS) + BUILD_LIBNIO_FILES += \ + DevPollArrayWrapper.c \ + InheritedChannel.c \ + NativeThread.c \ + PollArrayWrapper.c \ + SolarisEventPort.c \ + UnixAsynchronousServerSocketChannelImpl.c \ + UnixAsynchronousSocketChannelImpl.c \ + GnomeFileTypeDetector.c \ + SolarisNativeDispatcher.c \ + SolarisWatchService.c \ + UnixCopyFile.c \ + UnixNativeDispatcher.c +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \ + LIBRARY := nio, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(BUILD_LIBNIO_SRC), \ + INCLUDE_FILES := $(BUILD_LIBNIO_FILES), \ + LANG := C, \ + OPTIMIZATION := HIGH, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(BUILD_LIBNIO_CFLAGS), \ + MAPFILE := $(BUILD_LIBNIO_MAPFILE), \ + LDFLAGS := $(LDFLAGS_JDKLIB) $(BUILD_LIBNIO_LDFLAGS) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_linux := -ljava -lnet -lpthread $(LIBDL), \ + LDFLAGS_SUFFIX_solaris := -ljvm -lsocket -lposix4 $(LIBDL) \ + -lsendfile -ljava -lnet -lc, \ + LDFLAGS_SUFFIX_windows := jvm.lib ws2_32.lib $(WIN_JAVA_LIB) \ + $(JDK_OUTPUTDIR)/objs/libnet/net.lib \ + advapi32.lib, \ + LDFLAGS_SUFFIX_macosx := -ljava -lnet -pthread -framework CoreFoundation, \ + LDFLAGS_SUFFIX :=, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=nio.dll" \ + -D "JDK_INTERNAL_NAME=nio" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libnio, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + +BUILD_LIBRARIES += $(BUILD_LIBNIO) + +$(BUILD_LIBNIO): $(BUILD_LIBNET) + +########################################################################################## + +ifeq ($(OPENJDK_TARGET_OS_API), posix) + + ifneq ($(OPENJDK_TARGET_OS), macosx) + + # Suppress unused parameters required by exported JNI functions. + SCTP_WERROR := -Werror -Wno-error=unused-parameter + ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc) + SCTP_WERROR := + endif + + $(eval $(call SetupNativeCompilation,BUILD_LIBSCTP, \ + LIBRARY := sctp, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch/sctp, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/share/native/sun/nio/ch \ + -I$(JDK_TOPDIR)/src/share/native/sun/nio/ch/sctp \ + -I$(JDK_TOPDIR)/src/share/native/java/net \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net, \ + CFLAGS_linux := $(SCTP_WERROR), \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libsctp/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_linux := -lpthread $(LIBDL) -ljava -ljvm, \ + LDFLAGS_SUFFIX_posix := -lnio -lnet, \ + LDFLAGS_SUFFIX_solaris := -lsocket -ljava -ljvm -lc, \ + LDFLAGS_SUFFIX_macosx := -ljava -ljvm, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsctp, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + BUILD_LIBRARIES += $(BUILD_LIBSCTP) + + $(BUILD_LIBSCTP): $(BUILD_LIBNIO) + endif +endif diff --git a/jdk/makefiles/lib/PlatformLibraries.gmk b/jdk/makefiles/lib/PlatformLibraries.gmk new file mode 100644 index 00000000000..7684bddeece --- /dev/null +++ b/jdk/makefiles/lib/PlatformLibraries.gmk @@ -0,0 +1,283 @@ +# +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# 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. +# + +ifeq ($(OPENJDK_TARGET_OS), macosx) + + $(eval $(call SetupNativeCompilation,BUILD_LIBAPPLESCRIPTENGINE, \ + LIBRARY := AppleScriptEngine, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/macosx/native/apple/applescript, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/macosx/native/apple/applescript \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := -framework Cocoa \ + -framework Carbon \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -framework JavaNativeFoundation \ + $(LDFLAGS_JDKLIB_SUFFIX), \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libAppleScriptEngine, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + $(BUILD_LIBAPPLESCRIPTENGINE): $(BUILD_LIBJAVA) + + BUILD_LIBRARIES += $(BUILD_LIBAPPLESCRIPTENGINE) + +endif + +########################################################################################## + +ifeq ($(OPENJDK_TARGET_OS), macosx) + + $(eval $(call SetupNativeCompilation,BUILD_LIBOSXAPP, \ + LIBRARY := osxapp, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/macosx/native/sun/osxapp, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \ + -I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_macosx := \ + -framework Accelerate \ + -framework ApplicationServices \ + -framework AudioToolbox \ + -framework Carbon \ + -framework Cocoa \ + -framework Security \ + -framework ExceptionHandling \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -framework JavaNativeFoundation \ + -framework JavaRuntimeSupport \ + -framework OpenGL \ + -framework IOSurface \ + -framework QuartzCore, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosxapp, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + BUILD_LIBRARIES += $(BUILD_LIBOSXAPP) + +endif + +########################################################################################## + +ifeq ($(OPENJDK_TARGET_OS), macosx) + + LIBOSX_DIRS := \ + $(JDK_TOPDIR)/src/macosx/native/com/apple/concurrent \ + $(JDK_TOPDIR)/src/macosx/native/java/util \ + $(JDK_TOPDIR)/src/macosx/native/com/apple/eio \ + $(JDK_TOPDIR)/src/macosx/native/apple/security \ + $(JDK_TOPDIR)/src/macosx/native/apple/launcher + + $(eval $(call SetupNativeCompilation,BUILD_LIBOSX, \ + LIBRARY := osx, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(LIBOSX_DIRS), \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(foreach dir, $(LIBOSX_DIRS), -I$(dir)) \ + -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_macosx := \ + -losxapp \ + -framework Cocoa \ + -framework ApplicationServices \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -framework JavaNativeFoundation \ + -framework JavaRuntimeSupport \ + -framework Security \ + -framework SystemConfiguration \ + $(LDFLAGS_JDKLIB_SUFFIX), \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosx, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + BUILD_LIBRARIES += $(BUILD_LIBOSX) + + $(BUILD_LIBOSX): $(BUILD_LIBOSXAPP) + + $(BUILD_LIBOSX): $(BUILD_LIBJAVA) + +endif + +########################################################################################## + +ifeq ($(OPENJDK_TARGET_OS), macosx) + + $(eval $(call SetupNativeCompilation,BUILD_LIBJOBJC32, \ + LIBRARY := JObjC, \ + OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc32, \ + SRC := $(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/native \ + $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/native, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := -fpascal-strings \ + -fobjc-gc \ + -gdwarf-2 \ + $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers_jobjc \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -m32, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + -m32, \ + LDFLAGS_SUFFIX := -framework Foundation -framework JavaVM \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -framework JavaNativeFoundation \ + -lffi, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc32, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + $(eval $(call SetupNativeCompilation,BUILD_LIBJOBJC64, \ + LIBRARY := JObjC, \ + OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc64, \ + SRC := $(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/native \ + $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/native, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := -fpascal-strings \ + -fobjc-gc \ + -gdwarf-2 \ + $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers_jobjc \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + , \ + LDFLAGS := -fpascal-strings \ + -fobjc-gc \ + -gdwarf-2 \ + $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := -framework Foundation -framework JavaVM \ + -F/System/Library/Frameworks/JavaVM.framework/Frameworks \ + -framework JavaNativeFoundation \ + -lffi, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc64, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)JObjC$(SHARED_LIBRARY_SUFFIX): $(BUILD_LIBJOBJC32) $(BUILD_LIBJOBJC64) + $(LIPO) -create -output $@ $(BUILD_LIBJOBJC32) $(BUILD_LIBJOBJC64) + + BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)JObjC$(SHARED_LIBRARY_SUFFIX) + +endif + +########################################################################################## + +ifndef OPENJDK + ifeq ($(OPENJDK_TARGET_OS), windows) + + ACCESSBRIDGE_SRCDIR := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge + + define SetupAccessBridge + # Parameter 1 Suffix + # Parameter 2 Machine + # Parameter 3 ACCESSBRIDGE_ARCH_ suffix + + $(call SetupNativeCompilation,BUILD_JAWTACCESSBRIDGE$1, \ + LIBRARY = JAWTAccessBridge$1, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(ACCESSBRIDGE_SRCDIR), \ + INCLUDE_FILES := JAWTAccessBridge.cpp, \ + LANG := C++, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -DACCESSBRIDGE_ARCH_$3, \ + LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \ + winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \ + ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \ + -subsystem:windows -machine:$2 \ + -def:$(ACCESSBRIDGE_SRCDIR)/JAWTAccessBridge.DEF, \ + VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \ + RC_FLAGS := $(RC_FLAGS), \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawtaccessbridge$1, \ + DEBUG_SYMBOLS := true) + + $$(BUILD_JAWTACCESSBRIDGE$1): $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) + + $(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1, \ + LIBRARY = JavaAccessBridge$1, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(ACCESSBRIDGE_SRCDIR), \ + INCLUDE_FILES := AccessBridgeATInstance.cpp AccessBridgeDebug.cpp \ + AccessBridgeJavaEntryPoints.cpp \ + AccessBridgeMessages.cpp JavaAccessBridge.cpp, \ + LANG := C++, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -DACCESSBRIDGE_ARCH_$3, \ + LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \ + winspool.lib comdlg32.lib advapi32.lib shell32.lib \ + ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \ + -subsystem:windows -machine:$2 \ + -def:$(ACCESSBRIDGE_SRCDIR)/JavaAccessBridge.DEF, \ + VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \ + RC_FLAGS := $(RC_FLAGS), \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjavaaccessbridge$1, \ + DEBUG_SYMBOLS := true) + + $(call SetupNativeCompilation,BUILD_WINDOWSACCESSBRIDGE$1, \ + LIBRARY = WindowsAccessBridge$1, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(ACCESSBRIDGE_SRCDIR), \ + INCLUDE_FILES := AccessBridgeJavaVMInstance.cpp AccessBridgeMessageQueue.cpp \ + AccessBridgeMessages.cpp AccessBridgeWindowsEntryPoints.cpp \ + WinAccessBridge.cpp AccessBridgeDebug.cpp \ + AccessBridgeEventHandler.cpp, \ + LANG := C++, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT \ + -DACCESSBRIDGE_ARCH_$3, \ + LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \ + winspool.lib comdlg32.lib advapi32.lib shell32.lib \ + ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \ + -subsystem:windows -machine:$2 \ + -def:$(ACCESSBRIDGE_SRCDIR)/WinAccessBridge.DEF, \ + VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \ + RC_FLAGS := $(RC_FLAGS), \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libwindowsaccessbridge$1, \ + DEBUG_SYMBOLS := true) + + BUILD_LIBRARIES += $$(BUILD_JAWTACCESSBRIDGE$1) $$(BUILD_JAVAACCESSBRIDGE$1) \ + $$(BUILD_WINDOWSACCESSBRIDGE$1) + + endef + + ifeq ($(OPENJDK_TARGET_CPU_BITS), 32) + $(eval $(call SetupAccessBridge,-32,I386,32)) + $(eval $(call SetupAccessBridge,,I386,LEGACY)) + else + $(eval $(call SetupAccessBridge,-64,X64,64)) + endif + endif +endif diff --git a/jdk/makefiles/lib/SecurityLibraries.gmk b/jdk/makefiles/lib/SecurityLibraries.gmk new file mode 100644 index 00000000000..779504f5f84 --- /dev/null +++ b/jdk/makefiles/lib/SecurityLibraries.gmk @@ -0,0 +1,289 @@ +# +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# 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. +# + +LIBJAAS_MAPFILE := +ifneq ($(OPENJDK_TARGET_OS), solaris) + LIBJAAS_EXCLUDE_FILES := Solaris.c +else + # only on solaris...wonder why + LIBJAAS_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjaas/mapfile-vers +endif + +LIBJAAS_NAME := jaas_unix +ifeq ($(OPENJDK_TARGET_OS), windows) + LIBJAAS_NAME := jaas_nt +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBJAAS, \ + LIBRARY := $(LIBJAAS_NAME), \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/security/auth/module, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB), \ + MAPFILE := $(LIBJAAS_MAPFILE), \ + LDFLAGS := $(filter-out -ljava, $(LDFLAGS_JDKLIB)) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_windows := netapi32.lib user32.lib mpr.lib advapi32.lib, \ + LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX), \ + LDFLAGS_SUFFIX_solaris := -lc, \ + EXCLUDE_FILES := $(LIBJAAS_EXCLUDE_FILES), \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=$(LIBJAAS_NAME).dll" \ + -D "JDK_INTERNAL_NAME=$(LIBJAAS_NAME)" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjaas, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + +$(BUILD_LIBJAAS): $(BUILD_LIBJAVA) + +BUILD_LIBRARIES += $(BUILD_LIBJAAS) + +########################################################################################## + +$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC, \ + LIBRARY := j2pcsc, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio, \ + LANG := C, \ + CFLAGS_posix := -D__sun_jdk, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio/MUSCLE, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2pcsc/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_posix := $(LIBDL), \ + LDFLAGS_SUFFIX_windows := winscard.lib, \ + LDFLAGS_SUFFIX_solaris := -lc, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=j2pcsc.dll" \ + -D "JDK_INTERNAL_NAME=j2pcsc" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2pcsc, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + +BUILD_LIBRARIES += $(BUILD_LIBJ2PCSC) + +########################################################################################## + +ifneq ($(OPENJDK_TARGET_OS), windows) + $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS, \ + LIBRARY := j2gss, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2gss/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := $(LIBDL), \ + LDFLAGS_SUFFIX_solaris := -lc, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2gss, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + BUILD_LIBRARIES += $(BUILD_LIBJ2GSS) +endif + +########################################################################################## + +ifneq ($(BUILD_CRYPTO), no) + BUILD_LIBKRB5_NAME := + ifeq ($(OPENJDK_TARGET_OS), windows) + BUILD_LIBKRB5_NAME := w2k_lsa_auth + BUILD_LIBKRB5_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/krb5 + BUILD_LIBKRB5_LIBS := advapi32.lib Secur32.lib netapi32.lib kernel32.lib user32.lib \ + gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib \ + ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib + else ifeq ($(OPENJDK_TARGET_OS), macosx) + BUILD_LIBKRB5_NAME := osxkrb5 + BUILD_LIBKRB5_SRC := $(JDK_TOPDIR)/src/share/native/sun/security/krb5 + BUILD_LIBKRB5_LIBS := -framework Kerberos + endif + + ifneq ($(BUILD_LIBKRB5_NAME), ) + $(eval $(call SetupNativeCompilation,BUILD_LIBKRB5, \ + LIBRARY := $(BUILD_LIBKRB5_NAME), \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(BUILD_LIBKRB5_SRC), \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/share/native/sun/security/krb5 \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/krb5, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := $(BUILD_LIBKRB5_LIBS), \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=$(BUILD_LIBKRB5_NAME).dll" \ + -D "JDK_INTERNAL_NAME=$(BUILD_LIBKRB5_NAME)" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libkrb5, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + BUILD_LIBRARIES += $(BUILD_LIBKRB5) + endif +endif + +########################################################################################## + +ifeq ($(OPENJDK_TARGET_OS), windows) + + $(eval $(call SetupNativeCompilation,BUILD_LIBSUNMSCAPI, \ + LIBRARY := sunmscapi, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/mscapi, \ + LANG := C++, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/mscapi, \ + LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := Crypt32.Lib advapi32.lib, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=sunmscapi.dll" \ + -D "JDK_INTERNAL_NAME=sunmscapi" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsunmscapi, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + BUILD_LIBRARIES += $(BUILD_LIBSUNMSCAPI) +endif + +########################################################################################## + +$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11, \ + LIBRARY := j2pkcs11, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11 \ + $(JDK_TOPDIR)/src/share/native/sun/security/pkcs11/wrapper \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11/wrapper, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11 \ + -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11/wrapper \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11/wrapper, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2pkcs11/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_posix := $(LIBDL), \ + LDFLAGS_SUFFIX_solaris := -lc, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=j2pkcs11.dll" \ + -D "JDK_INTERNAL_NAME=j2pkcs11" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2pkcs11, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + +BUILD_LIBRARIES += $(BUILD_LIBJ2PKCS11) + +########################################################################################## + +ifeq ($(ENABLE_INTREE_EC), yes) + + BUILD_LIBSUNEC_FLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/security/ec \ + -I$(JDK_TOPDIR)/src/share/native/sun/security/ec/impl + + # + # On sol-sparc...all libraries are compiled with -xregs=no%appl + # (set in CFLAGS_REQUIRED_sparc) + # + # except!!! libsunec.so + # + ECC_JNI_SOLSPARC_FILTER := + ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc) + ECC_JNI_SOLSPARC_FILTER := -xregs=no%appl + endif + + $(eval $(call SetupNativeCompilation,BUILD_LIBSUNEC, \ + LIBRARY := sunec, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/share/native/sun/security/ec \ + $(JDK_TOPDIR)/src/share/native/sun/security/ec/impl, \ + LANG := C++, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CFLAGS_JDKLIB)) \ + $(BUILD_LIBSUNEC_FLAGS) \ + -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B, \ + CXXFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CXXFLAGS_JDKLIB)) \ + $(BUILD_LIBSUNEC_FLAGS), \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libsunec/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \ + LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := $(LIBCXX), \ + LDFLAGS_SUFFIX_linux := -lc, \ + LDFLAGS_SUFFIX_solaris := -lc, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=sunec.dll" \ + -D "JDK_INTERNAL_NAME=sunec" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsunec, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + BUILD_LIBRARIES += $(BUILD_LIBSUNEC) +endif + +########################################################################################## + +ifeq ($(OPENJDK_TARGET_OS), solaris) + ifndef OPENJDK + + $(eval $(call SetupNativeCompilation,BUILD_LIBJ2UCRYPTO, \ + LIBRARY := j2ucrypto, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2ucrypto/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB), \ + LDFLAGS_SUFFIX := $(LIBDL), \ + LDFLAGS_SUFFIX_solaris := -lc, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2ucrypto, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + $(BUILD_LIBJ2UCRYPTO): $(BUILD_LIBJAVA) + + BUILD_LIBRARIES += $(BUILD_LIBJ2UCRYPTO) + + endif +endif diff --git a/jdk/makefiles/lib/ServiceabilityLibraries.gmk b/jdk/makefiles/lib/ServiceabilityLibraries.gmk new file mode 100644 index 00000000000..0cc5ad96a88 --- /dev/null +++ b/jdk/makefiles/lib/ServiceabilityLibraries.gmk @@ -0,0 +1,431 @@ +# +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# 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. +# + +LIBATTACH_EXCLUDE_FILES := +ifneq ($(OPENJDK_TARGET_OS), solaris) + LIBATTACH_EXCLUDE_FILES += SolarisVirtualMachine.c +endif +ifneq ($(OPENJDK_TARGET_OS), linux) + LIBATTACH_EXCLUDE_FILES += LinuxVirtualMachine.c +endif +ifneq ($(OPENJDK_TARGET_OS), macosx) + LIBATTACH_EXCLUDE_FILES += BsdVirtualMachine.c +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBATTACH, \ + LIBRARY := attach, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/tools/attach, \ + EXCLUDE_FILES := $(LIBATTACH_EXCLUDE_FILES), \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB), \ + CFLAGS_windows := /Gy, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libattach/mapfile-$(OPENJDK_TARGET_OS), \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=attach.dll" \ + -D "JDK_INTERNAL_NAME=attach" \ + -D "JDK_FTYPE=0x2L", \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_solaris := -ldoor, \ + LDFLAGS_windows := /ORDER:@$(JDK_TOPDIR)/makefiles/mapfiles/libattach/reorder-windows-$(OPENJDK_TARGET_CPU), \ + LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \ + LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib psapi.lib, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libattach, \ + DEBUG_SYMBOLS := true)) + +$(BUILD_LIBATTACH): $(BUILD_LIBJAVA) + +BUILD_LIBRARIES += $(BUILD_LIBATTACH) + +########################################################################################## + +$(eval $(call SetupNativeCompilation,BUILD_LIBDT_SOCKET, \ + LIBRARY := dt_socket, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/share/transport/socket \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/socket, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \ + -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \ + -I$(JDK_TOPDIR)/src/share/transport/socket \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/socket \ + -I$(JDK_TOPDIR)/src/share/back/export \ + -I$(JDK_TOPDIR)/src/share/back, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libdt_socket/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_linux := -lpthread, \ + LDFLAGS_SUFFIX_solaris := -lnsl -lsocket -lc, \ + LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX) -export:jdwpTransport_OnLoad ws2_32.lib, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=dt_socket.dll" \ + -D "JDK_INTERNAL_NAME=dt_socket" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libdt_socket, \ + DEBUG_SYMBOLS := true)) + +$(BUILD_LIBDT_SOCKET): $(BUILD_LIBJAVA) + +BUILD_LIBRARIES += $(BUILD_LIBDT_SOCKET) + +########################################################################################## + +ifeq ($(OPENJDK_TARGET_OS), windows) + + $(eval $(call SetupNativeCompilation,BUILD_LIBDT_SHMEM, \ + LIBRARY := dt_shmem, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/share/native/com/sun/tools/jdi \ + $(JDK_TOPDIR)/src/share/transport/shmem \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/shmem, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \ + -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \ + -I$(JDK_TOPDIR)/src/share/transport/shmem \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/shmem \ + -I$(JDK_TOPDIR)/src/share/back/export, \ + LDFLAGS := $(LDFLAGS_JDKLIB), \ + LDFLAGS_windows := -export:jdwpTransport_OnLoad, \ + LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=dt_shmem.dll" \ + -D "JDK_INTERNAL_NAME=dt_shmem" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libdt_shmem, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + BUILD_LIBRARIES += $(BUILD_LIBDT_SHMEM) + +endif # OPENJDK_TARGET_OS + +########################################################################################## + +# JDWP_LOGGING causes log messages to be compiled into the library. +$(eval $(call SetupNativeCompilation,BUILD_LIBJDWP, \ + LIBRARY := jdwp, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/share/back $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/back, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) -DJDWP_LOGGING \ + -I$(JDK_TOPDIR)/src/share/transport/export \ + -I$(JDK_TOPDIR)/src/share/back/export \ + -I$(JDK_TOPDIR)/src/share/npt \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \ + -I$(JDK_TOPDIR)/src/share/back \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/back \ + -I$(JDK_OUTPUTDIR)/gensrc_jdwp_headers, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjdwp/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_linux := $(LIBDL), \ + LDFLAGS_SUFFIX_solaris := $(LIBDL) -lc, \ + LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX), \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=jdwp.dll" \ + -D "JDK_INTERNAL_NAME=jdwp" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjdwp, \ + DEBUG_SYMBOLS := true)) + +$(BUILD_LIBJDWP): $(BUILD_LIBJAVA) + +BUILD_LIBRARIES += $(BUILD_LIBJDWP) + +########################################################################################## + +$(eval $(call SetupNativeCompilation,BUILD_LIBJSDT, \ + LIBRARY := jsdt, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/tracing/dtrace, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjsdt/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_linux := $(LIBDL), \ + LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX) $(LIBDL), \ + LDFLAGS_SUFFIX_macosx := $(LIBDL), \ + LDFLAGS_SUFFIX_solaris := -lc, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=jsdt.dll" \ + -D "JDK_INTERNAL_NAME=jsdt" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsdt, \ + DEBUG_SYMBOLS := true)) + +$(BUILD_LIBJSDT): $(BUILD_LIBJAVA) + +BUILD_LIBRARIES += $(BUILD_LIBJSDT) + +########################################################################################## + +LIBINSTRUMENT_SRC := $(JDK_TOPDIR)/src/share/instrument \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/instrument + +LIBINSTRUMENT_FILES := \ + EncodingSupport.c \ + EncodingSupport_md.c \ + FileSystemSupport_md.c \ + InstrumentationImplNativeMethods.c \ + InvocationAdapter.c \ + JarFacade.c \ + JPLISAgent.c \ + JPLISAssert.c \ + JavaExceptions.c \ + PathCharsValidator.c \ + Reentrancy.c \ + Utilities.c \ + canonicalize_md.c + +LIBINSTRUMENT_DIR := $(JDK_OUTPUTDIR)/objs/libinstrument +LIBINSTRUMENT_CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/share/instrument \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/instrument \ + -I$(JDK_TOPDIR)/src/share/bin + +LIBINSTRUMENT_LDFLAGS := +LIBINSTRUMENT_LDFLAGS_SUFFIX := + +ifeq ($(OPENJDK_TARGET_OS), windows) + LIBINSTRUMENT_LDFLAGS += $(JDK_OUTPUTDIR)/objs/jli_static.lib $(WIN_JAVA_LIB) \ + -export:Agent_OnAttach advapi32.lib + # Statically link the C runtime so that there are not dependencies on modules + # not on the search patch when invoked from the Windows system directory + # (or elsewhere). + LIBINSTRUMENT_CFLAGS := $(filter-out -MD, $(LIBINSTRUMENT_CFLAGS)) + # equivalent of strcasecmp is stricmp on Windows + LIBINSTRUMENT_CFLAGS += -Dstrcasecmp=stricmp +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \ + LIBRARY := instrument, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(LIBINSTRUMENT_SRC), \ + INCLUDE_FILES := $(LIBINSTRUMENT_FILES), \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(LIBINSTRUMENT_CFLAGS), \ + CFLAGS_debug := -DJPLIS_LOGGING, \ + CFLAGS_release := -DNO_JPLIS_LOGGING, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libinstrument/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN) \ + $(LIBINSTRUMENT_LDFLAGS), \ + LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/jli), \ + LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/jli), \ + LDFLAGS_macosx := -Xlinker -all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \ + -framework Cocoa -framework Security -framework ApplicationServices, \ + LDFLAGS_SUFFIX := $(LIBINSTRUMENT_LDFLAGS_SUFFIX), \ + LDFLAGS_SUFFIX_macosx := -liconv $(LIBZ), \ + LDFLAGS_SUFFIX_solaris := $(LIBZ) -L $(INSTALL_LIBRARIES_HERE)/jli -ljli $(LIBDL) -lc, \ + LDFLAGS_SUFFIX_linux := $(LIBZ) -L $(INSTALL_LIBRARIES_HERE)/jli -ljli $(LIBDL), \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=instrument.dll" \ + -D "JDK_INTERNAL_NAME=instrument" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(LIBINSTRUMENT_DIR), \ + DEBUG_SYMBOLS := true)) + +ifneq (, $(findstring $(OPENJDK_TARGET_OS), macosx windows)) + $(BUILD_LIBINSTRUMENT): $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jli_static$(STATIC_LIBRARY_SUFFIX) +else + $(BUILD_LIBINSTRUMENT): $(INSTALL_LIBRARIES_HERE)/jli/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) +endif +$(BUILD_LIBINSTRUMENT): $(BUILD_LIBJAVA) + +BUILD_LIBRARIES += $(BUILD_LIBINSTRUMENT) + +########################################################################################## + +BUILD_LIBMANAGEMENT_SRC := $(JDK_TOPDIR)/src/share/native/sun/management \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/management \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/management + +BUILD_LIBMANAGEMENT_EXCLUDES := + +BUILD_LIBMANAGEMENT_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/management + +ifneq ($(OPENJDK_TARGET_OS), windows) + BUILD_LIBMANAGEMENT_EXCLUDES += OperatingSystem_md.c +else + BUILD_LIBMANAGEMENT_EXCLUDES += UnixOperatingSystem_md.c +endif + +ifneq ($(OPENJDK_TARGET_OS), solaris) + BUILD_LIBMANAGEMENT_EXCLUDES += SolarisOperatingSystem.c +endif + +ifneq ($(OPENJDK_TARGET_OS), linux) + BUILD_LIBMANAGEMENT_EXCLUDES += LinuxOperatingSystem.c +endif + +ifneq ($(OPENJDK_TARGET_OS), macosx) + BUILD_LIBMANAGEMENT_EXCLUDES += MacosxOperatingSystem.c +endif + +LIBMANAGEMENT_OPTIMIZATION := HIGH +ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), ) + ifeq ($(ENABLE_DEBUG_SYMBOLS), true) + LIBMANAGEMENT_OPTIMIZATION := LOW + endif +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT, \ + LIBRARY := management, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(BUILD_LIBMANAGEMENT_SRC), \ + EXCLUDE_FILES := $(BUILD_LIBMANAGEMENT_EXCLUDES), \ + LANG := C, \ + OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \ + CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBMANAGEMENT_CFLAGS), \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libmanagement/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_solaris := -lkstat, \ + LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \ + LDFLAGS_SUFFIX_windows := jvm.lib psapi.lib $(WIN_JAVA_LIB) advapi32.lib, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=management.dll" \ + -D "JDK_INTERNAL_NAME=management" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmanagement, \ + DEBUG_SYMBOLS := true)) + +$(BUILD_LIBMANAGEMENT): $(BUILD_LIBJAVA) + +BUILD_LIBRARIES += $(BUILD_LIBMANAGEMENT) + +########################################################################################## + +BUILD_LIBHPROF_SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/hprof $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/demo/jvmti/hprof +BUILD_LIBHPROF_CFLAGS := -I$(JDK_TOPDIR)/src/share/demo/jvmti/hprof \ + -I$(JDK_TOPDIR)/src/share/npt \ + -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \ + -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo + +BUILD_LIBHPROF_LDFLAGS := + +LIBHPROF_OPTIMIZATION := HIGHEST +ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), ) + ifeq ($(ENABLE_DEBUG_SYMBOLS), true) + LIBHPROF_OPTIMIZATION := LOW + endif +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBHPROF, \ + LIBRARY := hprof, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(BUILD_LIBHPROF_SRC), \ + LANG := C, \ + OPTIMIZATION := $(LIBHPROF_OPTIMIZATION), \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(BUILD_LIBHPROF_CFLAGS), \ + CFLAGS_debug := -DHPROF_LOGGING, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libhprof/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_windows := wsock32.lib winmm.lib advapi32.lib, \ + LDFLAGS_SUFFIX_linux := $(LIBDL), \ + LDFLAGS_SUFFIX_macosx := $(LIBDL), \ + LDFLAGS_SUFFIX_solaris := -lsocket -lnsl $(LIBDL) -lc, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=hprof.dll" \ + -D "JDK_INTERNAL_NAME=hprof" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libhprof_jvmti, \ + DEBUG_SYMBOLS := true)) + +BUILD_LIBRARIES += $(BUILD_LIBHPROF) + +########################################################################################## + +$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA_CRW_DEMO, \ + LIBRARY := java_crw_demo, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjava_crw_demo/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_solaris := -lc, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=java_crw_demo.dll" \ + -D "JDK_INTERNAL_NAME=java_crw_demo" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjava_crw_demo, \ + DEBUG_SYMBOLS := true)) + +BUILD_LIBRARIES += $(BUILD_LIBJAVA_CRW_DEMO) + +########################################################################################## + +ifndef OPENJDK + ifeq ($(ENABLE_JFR), true) + + $(eval $(call SetupNativeCompilation,BUILD_LIBJFR, \ + LIBRARY := jfr, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(JDK_TOPDIR)/src/closed/share/native/oracle/jfr, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + -I$(JDK_TOPDIR)/src/closed/share/javavm/export, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjfr/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX_solaris := -lc, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=jfr.dll" \ + -D "JDK_INTERNAL_NAME=jfr" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjfr, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + BUILD_LIBRARIES += $(BUILD_LIBJFR) + + endif +endif diff --git a/jdk/makefiles/lib/SoundLibraries.gmk b/jdk/makefiles/lib/SoundLibraries.gmk new file mode 100644 index 00000000000..dc507ab58cf --- /dev/null +++ b/jdk/makefiles/lib/SoundLibraries.gmk @@ -0,0 +1,237 @@ +# +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# 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. +# + +LIBJSOUND_SRC_DIRS := \ + $(JDK_TOPDIR)/src/share/native/com/sun/media/sound \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/media/sound + +LIBJSOUND_SRC_FILES := Utilities.c Platform.c + +LIBJSOUND_LANG := C +LIBJSOUND_CFLAGS := $(foreach dir, $(LIBJSOUND_SRC_DIRS), -I$(dir)) + +EXTRA_SOUND_JNI_LIBS := + +LIBJSOUND_MIDIFILES := \ + MidiInDevice.c \ + MidiInDeviceProvider.c \ + MidiOutDevice.c \ + MidiOutDeviceProvider.c \ + PlatformMidi.c + +# files needed for ports +LIBJSOUND_PORTFILES := \ + PortMixerProvider.c \ + PortMixer.c + +# files needed for direct audio +LIBJSOUND_DAUDIOFILES := \ + DirectAudioDeviceProvider.c \ + DirectAudioDevice.c + +ifeq ($(OPENJDK_TARGET_OS), windows) + EXTRA_SOUND_JNI_LIBS += jsoundds + LIBJSOUND_CFLAGS += -DX_PLATFORM=X_WINDOWS \ + -DUSE_PLATFORM_MIDI_OUT=TRUE \ + -DUSE_PLATFORM_MIDI_IN=TRUE \ + -DUSE_PORTS=TRUE + LIBJSOUND_SRC_FILES += \ + PLATFORM_API_WinOS_MidiIn.cpp \ + PLATFORM_API_WinOS_MidiOut.c \ + PLATFORM_API_WinOS_Util.c \ + PLATFORM_API_WinOS_Ports.c + LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES) + LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES) +endif # OPENJDK_TARGET_OS windows + +ifeq ($(OPENJDK_TARGET_OS), linux) + EXTRA_SOUND_JNI_LIBS += jsoundalsa + LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX +endif # OPENJDK_TARGET_OS linux + +ifeq ($(OPENJDK_TARGET_OS), macosx) + LIBJSOUND_LANG := C++ + LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX \ + -DUSE_PORTS=TRUE \ + -DUSE_DAUDIO=TRUE \ + -DUSE_PLATFORM_MIDI_OUT=TRUE \ + -DUSE_PLATFORM_MIDI_IN=TRUE + LIBJSOUND_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/com/sun/media/sound + LIBJSOUND_SRC_FILES += \ + PLATFORM_API_MacOSX_Utils.cpp \ + PLATFORM_API_MacOSX_PCM.cpp \ + PLATFORM_API_MacOSX_Ports.cpp \ + PLATFORM_API_MacOSX_MidiIn.c \ + PLATFORM_API_MacOSX_MidiOut.c \ + PLATFORM_API_MacOSX_MidiUtils.c + LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES) + LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES) + LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES) +endif # OPENJDK_TARGET_OS macosx + +ifeq ($(OPENJDK_TARGET_OS), solaris) + LIBJSOUND_CFLAGS += -DX_PLATFORM=X_SOLARIS \ + -DUSE_PORTS=TRUE \ + -DUSE_DAUDIO=TRUE + LIBJSOUND_SRC_FILES += \ + PLATFORM_API_SolarisOS_Utils.c \ + PLATFORM_API_SolarisOS_Ports.c \ + PLATFORM_API_SolarisOS_PCM.c + LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES) + LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES) + LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES) +endif # OPENJDK_TARGET_OS solaris + + +ifeq ($(JVM_VARIANT_ZERO), true) + LIBJSOUND_CFLAGS += -DX_ARCH=X_ZERO +else + ifeq ($(OPENJDK_TARGET_CPU), x86) + LIBJSOUND_CFLAGS += -DX_ARCH=X_I586 + endif + + ifeq ($(OPENJDK_TARGET_CPU), sparc) + LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARC + endif + + ifeq ($(OPENJDK_TARGET_CPU), sparcv9) + LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARCV9 + endif + + ifeq ($(OPENJDK_TARGET_CPU), x86_64) + LIBJSOUND_CFLAGS += -DX_ARCH=X_AMD64 + endif + + ifeq ($(OPENJDK_TARGET_CPU), arm) + LIBJSOUND_CFLAGS += -DX_ARCH=X_ARM + endif + + ifeq ($(OPENJDK_TARGET_CPU), ppc) + LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC + endif +endif + +LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"' + +$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \ + LIBRARY := jsound, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(LIBJSOUND_SRC_DIRS), \ + INCLUDE_FILES := $(LIBJSOUND_SRC_FILES), \ + LANG := $(LIBJSOUND_LANG), \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(LIBJSOUND_CFLAGS), \ + CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjsound/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_macosx := -framework CoreAudio -framework CoreFoundation \ + -framework CoreServices -framework AudioUnit $(LIBCXX) \ + -framework CoreMIDI -framework AudioToolbox, \ + LDFLAGS_windows := $(WIN_JAVA_LIB) advapi32.lib winmm.lib, \ + LDFLAGS_SUFFIX_posix := -ljava -ljvm, \ + LDFLAGS_SUFFIX_solaris := -lc, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=jsound.dll" \ + -D "JDK_INTERNAL_NAME=jsound" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsound, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + +$(BUILD_LIBJSOUND): $(BUILD_LIBJAVA) + +BUILD_LIBRARIES += $(BUILD_LIBJSOUND) + +########################################################################################## + +ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)), ) + + $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA, \ + LIBRARY := jsoundalsa, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(LIBJSOUND_SRC_DIRS), \ + INCLUDE_FILES := Utilities.c $(LIBJSOUND_MIDIFILES) $(LIBJSOUND_PORTFILES) \ + $(LIBJSOUND_DAUDIOFILES) \ + PLATFORM_API_LinuxOS_ALSA_CommonUtils.c \ + PLATFORM_API_LinuxOS_ALSA_PCM.c \ + PLATFORM_API_LinuxOS_ALSA_PCMUtils.c \ + PLATFORM_API_LinuxOS_ALSA_MidiIn.c \ + PLATFORM_API_LinuxOS_ALSA_MidiOut.c \ + PLATFORM_API_LinuxOS_ALSA_MidiUtils.c \ + PLATFORM_API_LinuxOS_ALSA_Ports.c, \ + LANG := C, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) $(ALSA_CFLAGS) \ + $(LIBJSOUND_CFLAGS) \ + -DUSE_DAUDIO=TRUE \ + -DUSE_PORTS=TRUE \ + -DUSE_PLATFORM_MIDI_OUT=TRUE \ + -DUSE_PLATFORM_MIDI_IN=TRUE, \ + MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjsoundalsa/mapfile-vers, \ + LDFLAGS := $(LDFLAGS_JDKLIB) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := $(ALSA_LIBS) -ljava -ljvm, \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsoundalsa, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + $(BUILD_LIBJSOUNDALSA): $(BUILD_LIBJAVA) + + BUILD_LIBRARIES += $(BUILD_LIBJSOUNDALSA) + +endif + +########################################################################################## + +ifneq ($(filter jsoundds, $(EXTRA_SOUND_JNI_LIBS)), ) + + $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDDS, \ + LIBRARY := jsoundds, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(LIBJSOUND_SRC_DIRS), \ + INCLUDE_FILES := Utilities.c $(LIBJSOUND_DAUDIOFILES) \ + PLATFORM_API_WinOS_DirectSound.cpp, \ + LANG := C++, \ + OPTIMIZATION := LOW, \ + CFLAGS := $(CFLAGS_JDKLIB) \ + $(LIBJSOUND_CFLAGS) \ + -DUSE_DAUDIO=TRUE, \ + LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX) dsound.lib winmm.lib user32.lib ole32.lib, \ + VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=jsoundds.dll" \ + -D "JDK_INTERNAL_NAME=jsoundds" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsoundds, \ + DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) + + $(BUILD_LIBJSOUNDDS): $(BUILD_LIBJAVA) + + BUILD_LIBRARIES += $(BUILD_LIBJSOUNDDS) + +endif diff --git a/jdk/makefiles/mapfiles/libawt/mapfile-mawt-vers b/jdk/makefiles/mapfiles/libawt/mapfile-mawt-vers index 09beb068a40..b21eada3af1 100644 --- a/jdk/makefiles/mapfiles/libawt/mapfile-mawt-vers +++ b/jdk/makefiles/mapfiles/libawt/mapfile-mawt-vers @@ -201,7 +201,7 @@ SUNWprivate_1.1 { Java_sun_print_CUPSPrinter_initIDs; Java_sun_print_CUPSPrinter_getCupsServer; Java_sun_print_CUPSPrinter_getCupsPort; - Java_sun_print_CUPSPrinter_canConnect; + Java_sun_print_CUPSPrinter_canConnect; Java_sun_print_CUPSPrinter_getMedia; Java_sun_print_CUPSPrinter_getPageSizes; @@ -230,7 +230,7 @@ SUNWprivate_1.1 { Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetColorForState; Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetClassValue; Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetPangoFontName; - + awt_display; awt_Lock; awt_Unlock; @@ -253,7 +253,7 @@ SUNWprivate_1.1 { getAwtLockFunctions; getAwtData; getAwtDisplay; - + # libfontmanager entry points AWTIsHeadless; AWTCountFonts; @@ -282,4 +282,3 @@ SUNWprivate_1.1 { local: *; }; - diff --git a/jdk/makefiles/mapfiles/libawt/mapfile-vers b/jdk/makefiles/mapfiles/libawt/mapfile-vers index 8af9d14dd57..da1385075b9 100644 --- a/jdk/makefiles/mapfiles/libawt/mapfile-vers +++ b/jdk/makefiles/mapfiles/libawt/mapfile-vers @@ -46,9 +46,9 @@ SUNWprivate_1.1 { Java_java_awt_MenuBar_initIDs; Java_java_awt_ScrollPaneAdjustable_initIDs; Java_java_awt_Toolkit_initIDs; - Java_sun_awt_DebugSettings_setCTracingOn__Z; - Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2; - Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2I; + Java_sun_awt_DebugSettings_setCTracingOn__Z; + Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2; + Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2I; Java_sun_awt_image_ByteComponentRaster_initIDs; Java_sun_awt_image_GifImageDecoder_initIDs; Java_sun_awt_image_GifImageDecoder_parseImage; @@ -156,7 +156,7 @@ SUNWprivate_1.1 { colorValueID; mul8table; jvm; - + # ProcessPath entry points and data doDrawPath; doFillPath; @@ -195,4 +195,3 @@ SUNWprivate_1.1 { local: *; }; - diff --git a/jdk/makefiles/mapfiles/libawt/mapfile-vers-linux b/jdk/makefiles/mapfiles/libawt/mapfile-vers-linux index b0bfb1ca91a..519271b1948 100644 --- a/jdk/makefiles/mapfiles/libawt/mapfile-vers-linux +++ b/jdk/makefiles/mapfiles/libawt/mapfile-vers-linux @@ -47,9 +47,9 @@ SUNWprivate_1.1 { Java_java_awt_ScrollPaneAdjustable_initIDs; Java_java_awt_Toolkit_initIDs; Java_java_awt_TrayIcon_initIDs; - Java_sun_awt_DebugSettings_setCTracingOn__Z; - Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2; - Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2I; + Java_sun_awt_DebugSettings_setCTracingOn__Z; + Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2; + Java_sun_awt_DebugSettings_setCTracingOn__ZLjava_lang_String_2I; Java_sun_awt_image_ByteComponentRaster_initIDs; Java_sun_awt_image_GifImageDecoder_initIDs; Java_sun_awt_image_GifImageDecoder_parseImage; @@ -223,8 +223,8 @@ SUNWprivate_1.1 { Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama; Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint; Java_sun_awt_X11GraphicsEnvironment_initXRender; - - + + Java_java_awt_AWTEvent_initIDs; Java_java_awt_Button_initIDs; @@ -287,7 +287,7 @@ SUNWprivate_1.1 { getAwtLockFunctions; getAwtData; getAwtDisplay; - + # libfontmanager entry points AWTIsHeadless; AWTCountFonts; @@ -314,4 +314,3 @@ SUNWprivate_1.1 { local: *; }; - diff --git a/jdk/makefiles/mapfiles/libawt_headless/mapfile-vers b/jdk/makefiles/mapfiles/libawt_headless/mapfile-vers index 0947ddc6ec9..a5a7413d25d 100644 --- a/jdk/makefiles/mapfiles/libawt_headless/mapfile-vers +++ b/jdk/makefiles/mapfiles/libawt_headless/mapfile-vers @@ -73,7 +73,7 @@ SUNWprivate_1.1 { Java_sun_print_CUPSPrinter_initIDs; Java_sun_print_CUPSPrinter_getCupsServer; Java_sun_print_CUPSPrinter_getCupsPort; - Java_sun_print_CUPSPrinter_canConnect; + Java_sun_print_CUPSPrinter_canConnect; Java_sun_print_CUPSPrinter_getMedia; Java_sun_print_CUPSPrinter_getPageSizes; @@ -106,4 +106,3 @@ SUNWprivate_1.1 { local: *; }; - diff --git a/jdk/makefiles/mapfiles/libawt_xawt/mapfile-vers b/jdk/makefiles/mapfiles/libawt_xawt/mapfile-vers index 7a1a8117a3d..b872003db4c 100644 --- a/jdk/makefiles/mapfiles/libawt_xawt/mapfile-vers +++ b/jdk/makefiles/mapfiles/libawt_xawt/mapfile-vers @@ -305,6 +305,7 @@ SUNWprivate_1.1 { Java_sun_awt_X11_XlibWrapper_XkbGetUpdatedMap; Java_sun_awt_X11_XlibWrapper_XkbFreeKeyboard; Java_sun_awt_X11_XlibWrapper_XkbTranslateKeyCode; + Java_sun_awt_X11_XlibWrapper_XkbSetDetectableAutoRepeat; Java_sun_awt_X11_XlibWrapper_XGetModifierMapping; Java_sun_awt_X11_XlibWrapper_XFreeModifiermap; Java_sun_awt_X11_XlibWrapper_XRefreshKeyboardMapping; @@ -438,7 +439,7 @@ SUNWprivate_1.1 { Java_sun_print_CUPSPrinter_initIDs; Java_sun_print_CUPSPrinter_getCupsServer; Java_sun_print_CUPSPrinter_getCupsPort; - Java_sun_print_CUPSPrinter_canConnect; + Java_sun_print_CUPSPrinter_canConnect; Java_sun_print_CUPSPrinter_getMedia; Java_sun_print_CUPSPrinter_getPageSizes; diff --git a/jdk/makefiles/mapfiles/libfontmanager/mapfile-vers b/jdk/makefiles/mapfiles/libfontmanager/mapfile-vers index b4fd96ecdce..b19d64646de 100644 --- a/jdk/makefiles/mapfiles/libfontmanager/mapfile-vers +++ b/jdk/makefiles/mapfiles/libfontmanager/mapfile-vers @@ -28,7 +28,7 @@ SUNWprivate_1.1 { global: getSunFontIDs; - newLayoutTableCache; + newLayoutTableCache; freeLayoutTableCache; isNullScalerContext; Java_sun_font_NullFontScaler_getNullScalerContext; diff --git a/jdk/makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk b/jdk/makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk index 044cf8f2755..6af4fd002d1 100644 --- a/jdk/makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk +++ b/jdk/makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk @@ -30,7 +30,7 @@ SUNWprivate_1.1 { global: getSunFontIDs; - newLayoutTableCache; + newLayoutTableCache; freeLayoutTableCache; isNullScalerContext; Java_sun_font_NullFontScaler_getNullScalerContext; diff --git a/jdk/makefiles/mapfiles/libj2pcsc/mapfile-vers b/jdk/makefiles/mapfiles/libj2pcsc/mapfile-vers index 44b91b308ef..bac7f8750d8 100644 --- a/jdk/makefiles/mapfiles/libj2pcsc/mapfile-vers +++ b/jdk/makefiles/mapfiles/libj2pcsc/mapfile-vers @@ -39,7 +39,7 @@ SUNWprivate_1.1 { Java_sun_security_smartcardio_PCSC_SCardBeginTransaction; Java_sun_security_smartcardio_PCSC_SCardEndTransaction; Java_sun_security_smartcardio_PCSC_SCardControl; - + local: *; }; diff --git a/jdk/makefiles/mapfiles/libjava/mapfile-vers b/jdk/makefiles/mapfiles/libjava/mapfile-vers index bb06a3d6036..7b4d5472b14 100644 --- a/jdk/makefiles/mapfiles/libjava/mapfile-vers +++ b/jdk/makefiles/mapfiles/libjava/mapfile-vers @@ -190,6 +190,8 @@ SUNWprivate_1.1 { Java_java_lang_reflect_Array_setLong; Java_java_lang_reflect_Array_setShort; Java_java_lang_reflect_Executable_getParameters0; + Java_java_lang_reflect_Executable_getTypeAnnotationBytes0; + Java_java_lang_reflect_Field_getTypeAnnotationBytes0; Java_java_lang_Runtime_freeMemory; Java_java_lang_Runtime_maxMemory; Java_java_lang_Runtime_gc; @@ -265,7 +267,8 @@ SUNWprivate_1.1 { Java_sun_misc_GC_maxObjectInspectionAge; Java_sun_reflect_NativeConstructorAccessorImpl_newInstance0; Java_sun_reflect_NativeMethodAccessorImpl_invoke0; - Java_sun_reflect_Reflection_getCallerClass; + Java_sun_reflect_Reflection_getCallerClass__; + Java_sun_reflect_Reflection_getCallerClass__I; Java_sun_reflect_Reflection_getClassAccessFlags; Java_sun_misc_Version_getJdkVersionInfo; Java_sun_misc_Version_getJdkSpecialVersion; diff --git a/jdk/makefiles/mapfiles/libjava/reorder-sparc b/jdk/makefiles/mapfiles/libjava/reorder-sparc index b64537e3edd..16573052576 100644 --- a/jdk/makefiles/mapfiles/libjava/reorder-sparc +++ b/jdk/makefiles/mapfiles/libjava/reorder-sparc @@ -27,7 +27,8 @@ text: .text%Java_java_io_FileInputStream_initIDs; text: .text%Java_java_io_FileDescriptor_initIDs; text: .text%Java_java_io_FileOutputStream_initIDs; text: .text%Java_java_lang_System_setIn0; -text: .text%Java_sun_reflect_Reflection_getCallerClass; +text: .text%Java_sun_reflect_Reflection_getCallerClass__; +text: .text%Java_sun_reflect_Reflection_getCallerClass__I; text: .text%Java_java_lang_Class_forName0; text: .text%Java_java_lang_Object_getClass; text: .text%Java_sun_reflect_Reflection_getClassAccessFlags; diff --git a/jdk/makefiles/mapfiles/libjava/reorder-sparcv9 b/jdk/makefiles/mapfiles/libjava/reorder-sparcv9 index 8e6d249a440..fe80fca8b59 100644 --- a/jdk/makefiles/mapfiles/libjava/reorder-sparcv9 +++ b/jdk/makefiles/mapfiles/libjava/reorder-sparcv9 @@ -26,7 +26,8 @@ text: .text%Java_java_io_FileInputStream_initIDs; text: .text%Java_java_io_FileDescriptor_initIDs; text: .text%Java_java_io_FileOutputStream_initIDs; text: .text%Java_java_lang_System_setIn0; -text: .text%Java_sun_reflect_Reflection_getCallerClass; +text: .text%Java_sun_reflect_Reflection_getCallerClass__; +text: .text%Java_sun_reflect_Reflection_getCallerClass__I; text: .text%Java_java_lang_Class_forName0; text: .text%Java_java_lang_String_intern; text: .text%Java_java_lang_Float_floatToIntBits; diff --git a/jdk/makefiles/mapfiles/libjava/reorder-x86 b/jdk/makefiles/mapfiles/libjava/reorder-x86 index ff4836f4612..839ee50caa8 100644 --- a/jdk/makefiles/mapfiles/libjava/reorder-x86 +++ b/jdk/makefiles/mapfiles/libjava/reorder-x86 @@ -28,7 +28,8 @@ text: .text%Java_java_io_FileInputStream_initIDs; text: .text%Java_java_io_FileDescriptor_initIDs; text: .text%Java_java_io_FileOutputStream_initIDs; text: .text%Java_java_lang_System_setIn0; -text: .text%Java_sun_reflect_Reflection_getCallerClass; +text: .text%Java_sun_reflect_Reflection_getCallerClass__; +text: .text%Java_sun_reflect_Reflection_getCallerClass__I; text: .text%Java_java_lang_Class_forName0; text: .text%Java_java_lang_String_intern; text: .text%Java_sun_reflect_NativeConstructorAccessorImpl_newInstance0; diff --git a/jdk/makefiles/mapfiles/libjdga/mapfile-vers b/jdk/makefiles/mapfiles/libjdga/mapfile-vers index 86dae13add7..8d51ce239d0 100644 --- a/jdk/makefiles/mapfiles/libjdga/mapfile-vers +++ b/jdk/makefiles/mapfiles/libjdga/mapfile-vers @@ -27,7 +27,7 @@ SUNWprivate_1.1 { global: - JDgaLibInit; + JDgaLibInit; local: *; }; diff --git a/jdk/makefiles/mapfiles/libjli/mapfile-vers b/jdk/makefiles/mapfiles/libjli/mapfile-vers index a12d96fecef..77d8ff8de92 100644 --- a/jdk/makefiles/mapfiles/libjli/mapfile-vers +++ b/jdk/makefiles/mapfiles/libjli/mapfile-vers @@ -36,7 +36,7 @@ SUNWprivate_1.1 { JLI_ReportExceptionDescription; JLI_GetStdArgs; JLI_GetStdArgc; - + local: *; }; diff --git a/jdk/makefiles/mapfiles/libmanagement/mapfile-vers b/jdk/makefiles/mapfiles/libmanagement/mapfile-vers index b934fe8b748..724f7bb7100 100644 --- a/jdk/makefiles/mapfiles/libmanagement/mapfile-vers +++ b/jdk/makefiles/mapfiles/libmanagement/mapfile-vers @@ -57,7 +57,7 @@ SUNWprivate_1.1 { Java_sun_management_GcInfoBuilder_fillGcAttributeInfo; Java_sun_management_GcInfoBuilder_getLastGcInfo0; Java_sun_management_GcInfoBuilder_getNumGcExtAttributes; - Java_sun_management_HotSpotDiagnostic_dumpHeap; + Java_sun_management_HotSpotDiagnostic_dumpHeap0; Java_sun_management_HotspotThread_getInternalThreadCount; Java_sun_management_HotspotThread_getInternalThreadTimes0; Java_sun_management_MemoryImpl_getMemoryManagers0; diff --git a/jdk/makefiles/mapfiles/libverify/mapfile-vers b/jdk/makefiles/mapfiles/libverify/mapfile-vers index f8cb44d965e..f4f8a3c7589 100644 --- a/jdk/makefiles/mapfiles/libverify/mapfile-vers +++ b/jdk/makefiles/mapfiles/libverify/mapfile-vers @@ -22,7 +22,7 @@ # or visit www.oracle.com if you need additional information or have any # questions. # - + SUNWprivate_1.1 { global: VerifyClass; diff --git a/jdk/makefiles/profile-includes.txt b/jdk/makefiles/profile-includes.txt index fe2f13e2be8..105f9d36689 100644 --- a/jdk/makefiles/profile-includes.txt +++ b/jdk/makefiles/profile-includes.txt @@ -33,8 +33,6 @@ PROFILE_1_JRE_LIB_FILES := \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsig.diz \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)net$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)nio$(SHARED_LIBRARY_SUFFIX) \ - $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt$(SHARED_LIBRARY_SUFFIX) \ - $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt.diz \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)sunec$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)verify$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)verify.diz \ @@ -107,14 +105,14 @@ PROFILE_2_JRE_BIN_FILES := \ rmid$(EXE_SUFFIX) \ rmiregistry$(EXE_SUFFIX) -PROFILE_2_JRE_LIB_FILES := +PROFILE_2_JRE_LIB_FILES := -PROFILE_2_JRE_OTHER_FILES := +PROFILE_2_JRE_OTHER_FILES := -PROFILE_2_JRE_JAR_FILES := +PROFILE_2_JRE_JAR_FILES := -PROFILE_3_JRE_BIN_FILES := +PROFILE_3_JRE_BIN_FILES := PROFILE_3_JRE_LIB_FILES := \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)hprof$(SHARED_LIBRARY_SUFFIX) \ @@ -130,6 +128,8 @@ PROFILE_3_JRE_LIB_FILES := \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsdt.diz \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management.diz \ + $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt$(SHARED_LIBRARY_SUFFIX) \ + $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt.diz \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)sctp$(SHARED_LIBRARY_SUFFIX) \ jvm.hprof.txt \ management-agent.jar \ @@ -138,7 +138,7 @@ PROFILE_3_JRE_LIB_FILES := \ management/management.properties \ management/snmp.acl.template -PROFILE_3_JRE_OTHER_FILES := +PROFILE_3_JRE_OTHER_FILES := PROFILE_3_JRE_JAR_FILES := \ management-agent.jar @@ -171,7 +171,6 @@ FULL_JRE_LIB_FILES := \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)splashscreen$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)t2k$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX) \ - alt-rt.jar \ charsets.jar \ cmm/CIEXYZ.pf \ cmm/GRAY.pf \ @@ -248,11 +247,9 @@ FULL_JRE_OTHER_FILES := \ man/man1/unpack200.1 FULL_JRE_JAR_FILES := \ - alt-rt.jar \ charsets.jar \ ext/cldrdata.jar \ ext/dnsns.jar \ ext/nashorn.jar \ ext/zipfs.jar \ jfr.jar - diff --git a/jdk/makefiles/profile-rtjar-includes.txt b/jdk/makefiles/profile-rtjar-includes.txt index d740e01abe8..3f0934cf428 100644 --- a/jdk/makefiles/profile-rtjar-includes.txt +++ b/jdk/makefiles/profile-rtjar-includes.txt @@ -24,22 +24,22 @@ # # Included or excluded types must take one of two forms -# - *.class to indicate all classes; or else +# - *.class to indicate all classes; or else # - a full single type name e.g. -# com/sun/security/auth/callback/DialogCallbackHandler$$1.class +# com/sun/security/auth/callback/DialogCallbackHandler$$1.class # You can not use arbitrary wildcards like DialogCallbackHandler*.class. # # Notes: -# - Nested types must use $$ in place of $ as $ is the make meta-character -# - If a package is not listed in any profile's inclusion list then it will -# not appear in any profile. But if a package is also missing from the -# full JRE's inclusion list then it will still be part of the full JRE. -# This is because the full JRE's inclusion lists are only used to define -# the exclusion lists for profiles; they are not used to define the full -# JRE contents - that is still done with the pre-profile legacy mechanism -# (all packagesthat can be found, less those not intended for rt.jar). -# This was done to minimize the impact of profiles on the regular -# non-profile build. +# - Nested types must use $$ in place of $ as $ is the make meta-character +# - If a package is not listed in any profile's inclusion list then it will +# not appear in any profile. But if a package is also missing from the +# full JRE's inclusion list then it will still be part of the full JRE. +# This is because the full JRE's inclusion lists are only used to define +# the exclusion lists for profiles; they are not used to define the full +# JRE contents - that is still done with the pre-profile legacy mechanism +# (all packagesthat can be found, less those not intended for rt.jar). +# This was done to minimize the impact of profiles on the regular +# non-profile build. # PROFILE_1_RTJAR_INCLUDE_PACKAGES := \ com/sun/demo/jvmti/hprof \ @@ -71,11 +71,11 @@ PROFILE_1_RTJAR_INCLUDE_PACKAGES := \ sun/usagetracker \ sun/util -PROFILE_1_RTJAR_INCLUDE_TYPES := +PROFILE_1_RTJAR_INCLUDE_TYPES := -PROFILE_1_RTJAR_EXCLUDE_TYPES := +PROFILE_1_RTJAR_EXCLUDE_TYPES := -PROFILE_1_INCLUDE_METAINF_SERVICES := +PROFILE_1_INCLUDE_METAINF_SERVICES := PROFILE_2_RTJAR_INCLUDE_PACKAGES := \ @@ -96,12 +96,12 @@ PROFILE_2_RTJAR_INCLUDE_PACKAGES := \ sun/rmi \ sun/util/xml -PROFILE_2_RTJAR_INCLUDE_TYPES := +PROFILE_2_RTJAR_INCLUDE_TYPES := -PROFILE_2_RTJAR_EXCLUDE_TYPES := +PROFILE_2_RTJAR_EXCLUDE_TYPES := PROFILE_2_INCLUDE_METAINF_SERVICES := \ - META-INF/services/sun.util.spi.XmlPropertiesProvider + META-INF/services/sun.util.spi.XmlPropertiesProvider PROFILE_3_RTJAR_INCLUDE_PACKAGES := \ @@ -146,7 +146,7 @@ PROFILE_3_RTJAR_INCLUDE_PACKAGES := \ sun/security/smartcardio \ sun/tracing -PROFILE_3_RTJAR_INCLUDE_TYPES := +PROFILE_3_RTJAR_INCLUDE_TYPES := PROFILE_3_RTJAR_EXCLUDE_TYPES := \ com/sun/security/auth/callback/DialogCallbackHandler$$1.class \ @@ -237,22 +237,20 @@ FULL_JRE_RTJAR_INCLUDE_TYPES := \ javax/management/remote/rmi/_RMIServer_Stub.class \ javax/rmi/*.class -FULL_JRE_RTJAR_EXCLUDE_TYPES := +FULL_JRE_RTJAR_EXCLUDE_TYPES := FULL_JRE_INCLUDE_METAINF_SERVICES := \ - META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \ - META-INF/services/com.sun.tools.internal.xjc.Plugin \ - META-INF/services/javax.print.PrintServiceLookup \ - META-INF/services/javax.print.StreamPrintServiceFactory \ - META-INF/services/javax.sound.midi.spi.MidiDeviceProvider \ - META-INF/services/javax.sound.midi.spi.MidiFileReader \ - META-INF/services/javax.sound.midi.spi.MidiFileWriter \ - META-INF/services/javax.sound.midi.spi.SoundbankReader \ - META-INF/services/javax.sound.sampled.spi.AudioFileReader \ - META-INF/services/javax.sound.sampled.spi.AudioFileWriter \ - META-INF/services/javax.sound.sampled.spi.FormatConversionProvider \ - META-INF/services/javax.sound.sampled.spi.MixerProvider \ - META-INF/services/sun.java2d.cmm.PCMM \ - META-INF/services/sun.java2d.pipe.RenderingEngine - - + META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \ + META-INF/services/com.sun.tools.internal.xjc.Plugin \ + META-INF/services/javax.print.PrintServiceLookup \ + META-INF/services/javax.print.StreamPrintServiceFactory \ + META-INF/services/javax.sound.midi.spi.MidiDeviceProvider \ + META-INF/services/javax.sound.midi.spi.MidiFileReader \ + META-INF/services/javax.sound.midi.spi.MidiFileWriter \ + META-INF/services/javax.sound.midi.spi.SoundbankReader \ + META-INF/services/javax.sound.sampled.spi.AudioFileReader \ + META-INF/services/javax.sound.sampled.spi.AudioFileWriter \ + META-INF/services/javax.sound.sampled.spi.FormatConversionProvider \ + META-INF/services/javax.sound.sampled.spi.MixerProvider \ + META-INF/services/sun.java2d.cmm.PCMM \ + META-INF/services/sun.java2d.pipe.RenderingEngine diff --git a/jdk/makefiles/scripts/addNotices.sh b/jdk/makefiles/scripts/addNotices.sh index cad3879a5a0..6e0cdf916af 100644 --- a/jdk/makefiles/scripts/addNotices.sh +++ b/jdk/makefiles/scripts/addNotices.sh @@ -25,7 +25,7 @@ # # Parse the first contiguous comment block in this script and generate -# a java comment block. If this script is invoked with a copyright +# a java comment block. If this script is invoked with a copyright # year/year range, the java comment block will contain a Sun copyright. COPYRIGHT_YEARS="$1" @@ -41,5 +41,5 @@ __END__ fi $NAWK ' /^#.*Copyright.*Oracle/ { next } - /^#([^!]|$)/ { sub(/^#/, " *"); print } - /^$/ { print " */"; exit } ' $0 + /^#([^!]|$)/ { sub(/^#/, " *"); print } + /^$/ { print " */"; exit } ' $0 diff --git a/jdk/makefiles/scripts/genCharsetProvider.sh b/jdk/makefiles/scripts/genCharsetProvider.sh index 45033493f98..d14527483a4 100644 --- a/jdk/makefiles/scripts/genCharsetProvider.sh +++ b/jdk/makefiles/scripts/genCharsetProvider.sh @@ -28,17 +28,17 @@ # Generate a charset provider class # Required environment variables -# NAWK awk tool -# TEMPDIR temporary directory -# HASHER Hasher program +# NAWK awk tool +# TEMPDIR temporary directory +# HASHER Hasher program SPEC=$1; shift DST=$1; shift eval `$NAWK <$SPEC ' - /^[ \t]*copyright / { printf "COPYRIGHT_YEARS=\"%s %s\"\n", $2, $3; } - /^[ \t]*package / { printf "PKG=%s\n", $2; } - /^[ \t]*class / { printf "CLASS=%s\n", $2; } + /^[ \t]*copyright / { printf "COPYRIGHT_YEARS=\"%s %s\"\n", $2, $3; } + /^[ \t]*package / { printf "PKG=%s\n", $2; } + /^[ \t]*class / { printf "CLASS=%s\n", $2; } '` OUT=$DST/$CLASS.java @@ -69,50 +69,50 @@ __END__ # Alias tables # $NAWK <$SPEC >>$OUT ' - BEGIN { n = 1; m = 1; } + BEGIN { n = 1; m = 1; } - /^[ \t]*charset / { - csn = $2; cln = $3; - lcsn = tolower(csn); - lcsns[n++] = lcsn; - csns[lcsn] = csn; - classMap[lcsn] = cln; - if (n > 2) + /^[ \t]*charset / { + csn = $2; cln = $3; + lcsn = tolower(csn); + lcsns[n++] = lcsn; + csns[lcsn] = csn; + classMap[lcsn] = cln; + if (n > 2) + printf " };\n\n"; + printf " static final String[] aliases_%s = new String[] {\n", cln; + } + + /^[ \t]*alias / { + acsns[m++] = tolower($2); + aliasMap[tolower($2)] = lcsn; + printf " \"%s\",\n", $2; + } + + END { printf " };\n\n"; - printf " static final String[] aliases_%s = new String[] {\n", cln; - } - - /^[ \t]*alias / { - acsns[m++] = tolower($2); - aliasMap[tolower($2)] = lcsn; - printf " \"%s\",\n", $2; - } - - END { - printf " };\n\n"; - } + } ' # Prehashed alias and class maps # $NAWK <$SPEC >$TEMPDIR/aliases ' - /^[ \t]*charset / { - csn = $2; - lcsn = tolower(csn); - } - /^[ \t]*alias / { - an = tolower($2); - printf "%-20s \"%s\"\n", an, lcsn; - } + /^[ \t]*charset / { + csn = $2; + lcsn = tolower(csn); + } + /^[ \t]*alias / { + an = tolower($2); + printf "%-20s \"%s\"\n", an, lcsn; + } ' $NAWK <$SPEC >$TEMPDIR/classes ' - /^[ \t]*charset / { - csn = $2; cln = $3; - lcsn = tolower(csn); - printf "%-20s \"%s\"\n", lcsn, cln; - } + /^[ \t]*charset / { + csn = $2; cln = $3; + lcsn = tolower(csn); + printf "%-20s \"%s\"\n", lcsn, cln; + } ' ${HASHER} -i Aliases <$TEMPDIR/aliases >>$OUT diff --git a/jdk/makefiles/scripts/genExceptions.sh b/jdk/makefiles/scripts/genExceptions.sh index 698e14518e8..66ef8056919 100644 --- a/jdk/makefiles/scripts/genExceptions.sh +++ b/jdk/makefiles/scripts/genExceptions.sh @@ -32,7 +32,7 @@ DST=$2 gen() { ID=$1 WHAT=$2 - SVUID=$3 + SVUID=$3 ARG_TYPE=$4 ARG_ID=$5 ARG_PROP=$6 @@ -43,7 +43,7 @@ gen() { $SH ${SCRIPTS}/addNotices.sh "$COPYRIGHT_YEARS" > $out -cat >>$out <<__END__ + cat >>$out <<__END__ // -- This file was mechanically generated: Do not edit! -- // diff --git a/jdk/makefiles/scripts/localelist.sh b/jdk/makefiles/scripts/localelist.sh index 467f321bcb4..96fa02b0c9f 100644 --- a/jdk/makefiles/scripts/localelist.sh +++ b/jdk/makefiles/scripts/localelist.sh @@ -40,70 +40,67 @@ JAVA_LOCALES= toJavaLocale() { - NewLocale=`echo $1 | $NAWK ' - BEGIN { - # The following values have to be consistent with java.util.Locale. - javalocales["en"] = "ENGLISH"; - javalocales["fr"] = "FRENCH"; - javalocales["de"] = "GERMAN"; - javalocales["it"] = "ITALIAN"; - javalocales["ja"] = "JAPANESE"; - javalocales["ko"] = "KOREAN"; - javalocales["zh"] = "CHINESE"; - javalocales["zh_CN"] = "SIMPLIFIED_CHINESE"; - javalocales["zh_TW"] = "TRADITIONAL_CHINESE"; - javalocales["fr_FR"] = "FRANCE"; - javalocales["de_DE"] = "GERMANY"; - javalocales["it_IT"] = "ITALY"; - javalocales["ja_JP"] = "JAPAN"; - javalocales["ko_KR"] = "KOREA"; - javalocales["en_GB"] = "UK"; - javalocales["en_US"] = "US"; - javalocales["en_CA"] = "CANADA"; - javalocales["fr_CA"] = "CANADA_FRENCH"; - } - { - if ($0 in javalocales) { - print " Locale." javalocales[$0]; - } else { - split($0, a, "_"); - if (a[3] != "") { - print " new Locale(\"" a[1] "\", \"" a[2] "\", \"" a[3] "\")"; - } else if (a[2] != "") { - print " new Locale(\"" a[1] "\", \"" a[2] "\")"; - } else { - print " new Locale(\"" a[1] "\")"; - } - } - }'` + NewLocale=`echo $1 | $NAWK ' + BEGIN { + # The following values have to be consistent with java.util.Locale. + javalocales["en"] = "ENGLISH"; + javalocales["fr"] = "FRENCH"; + javalocales["de"] = "GERMAN"; + javalocales["it"] = "ITALIAN"; + javalocales["ja"] = "JAPANESE"; + javalocales["ko"] = "KOREAN"; + javalocales["zh"] = "CHINESE"; + javalocales["zh_CN"] = "SIMPLIFIED_CHINESE"; + javalocales["zh_TW"] = "TRADITIONAL_CHINESE"; + javalocales["fr_FR"] = "FRANCE"; + javalocales["de_DE"] = "GERMANY"; + javalocales["it_IT"] = "ITALY"; + javalocales["ja_JP"] = "JAPAN"; + javalocales["ko_KR"] = "KOREA"; + javalocales["en_GB"] = "UK"; + javalocales["en_US"] = "US"; + javalocales["en_CA"] = "CANADA"; + javalocales["fr_CA"] = "CANADA_FRENCH"; + } + { + if ($0 in javalocales) { + print " Locale." javalocales[$0]; + } else { + split($0, a, "_"); + if (a[3] != "") { + print " new Locale(\"" a[1] "\", \"" a[2] "\", \"" a[3] "\")"; + } else if (a[2] != "") { + print " new Locale(\"" a[1] "\", \"" a[2] "\")"; + } else { + print " new Locale(\"" a[1] "\")"; + } + } + }'` - JAVA_LOCALES=$JAVA_LOCALES$NewLocale + JAVA_LOCALES=$JAVA_LOCALES$NewLocale } # count the number of locales counter=0 for i in $LOCALES do - counter=`expr $counter + 1` + counter=`expr $counter + 1` done index=0 for locale in $LOCALES do - index=`expr $index + 1`; - if [ $index != $counter ] - then - toJavaLocale $locale - JAVA_LOCALES=$JAVA_LOCALES"," - else - toJavaLocale $locale - fi + index=`expr $index + 1`; + if [ $index != $counter ] + then + toJavaLocale $locale + JAVA_LOCALES=$JAVA_LOCALES"," + else + toJavaLocale $locale + fi done # replace the #LOCALE_LIST# in the precompiled CoreResourceBundleControl.java file. $SED -e "s@^#warn .*@// -- This file was mechanically generated: Do not edit! -- //@" \ - -e "s/#LOCALE_LIST#/$JAVA_LOCALES/g" $2 > $3 - - - + -e "s/#LOCALE_LIST#/$JAVA_LOCALES/g" $2 > $3 diff --git a/jdk/makefiles/sun/awt/ToBin.java b/jdk/makefiles/sun/awt/ToBin.java index db97240e432..5f915422043 100644 --- a/jdk/makefiles/sun/awt/ToBin.java +++ b/jdk/makefiles/sun/awt/ToBin.java @@ -36,7 +36,7 @@ public class ToBin { BufferedImage bi = null; int iconWidth = im.getWidth(null); int iconHeight = im.getHeight(null); - if (im != null && iconHeight != 0 && iconWidth != 0) { + if (im != null && iconHeight != 0 && iconWidth != 0) { bi = new BufferedImage(iconWidth, iconHeight, BufferedImage.TYPE_INT_ARGB); Graphics g = bi.getGraphics(); try { diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m b/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m index dabaac740b6..e2d904122ba 100644 --- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m +++ b/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m @@ -163,7 +163,7 @@ NSString *GetJavaRoot(NSDictionary *jvmInfoDict) { if ([[jvmInfo objectForKey:@"StartOnFirstThread"] boolValue]) { self.startOnFirstThread = YES; } else if ([[jvmInfo objectForKey:@"StartOnMainThread"] boolValue]) { - // for key compatability with the Apple JavaApplicationStub's 'Java' dictionary + // for key compatibility with the Apple JavaApplicationStub's 'Java' dictionary self.startOnFirstThread = YES; } diff --git a/jdk/src/macosx/classes/apple/applescript/AppleScriptEngine.java b/jdk/src/macosx/classes/apple/applescript/AppleScriptEngine.java index 917037b7998..e50f218ef7f 100644 --- a/jdk/src/macosx/classes/apple/applescript/AppleScriptEngine.java +++ b/jdk/src/macosx/classes/apple/applescript/AppleScriptEngine.java @@ -155,7 +155,7 @@ public class AppleScriptEngine implements ScriptEngine { TRACE("init()"); // set up our context /* TODO -- name of current executable? bad java documentation at: - * http://java.sun.com/javase/6/docs/api/javax/script/ScriptEngine.html#FILENAME */ + * http://docs.oracle.com/javase/6/docs/api/javax/script/ScriptEngine.html#FILENAME */ put(ScriptEngine.FILENAME, ""); put(ScriptEngine.ENGINE, getEngine()); put(ScriptEngine.ENGINE_VERSION, getEngineVersion()); diff --git a/jdk/src/macosx/classes/apple/applescript/AppleScriptEngineFactory.java b/jdk/src/macosx/classes/apple/applescript/AppleScriptEngineFactory.java index 564dfe063f7..8c50b9d9301 100644 --- a/jdk/src/macosx/classes/apple/applescript/AppleScriptEngineFactory.java +++ b/jdk/src/macosx/classes/apple/applescript/AppleScriptEngineFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,14 +30,9 @@ import java.util.*; import javax.script.*; public class AppleScriptEngineFactory implements ScriptEngineFactory { - private static native void initNative(); + private static volatile boolean initialized = false; - static { - java.awt.Toolkit.getDefaultToolkit(); - System.loadLibrary("AppleScriptEngine"); - initNative(); - TRACE(""); - } + private static native void initNative(); static void TRACE(final String str) { // System.out.println(AppleScriptEngineFactory.class.getName() + "." + str); @@ -80,6 +75,7 @@ public class AppleScriptEngineFactory implements ScriptEngineFactory { * * @return full name of the ScriptEngine */ + @Override public String getEngineName() { TRACE("getEngineName()"); return ENGINE_NAME; @@ -90,6 +86,7 @@ public class AppleScriptEngineFactory implements ScriptEngineFactory { * * @return version of the ScriptEngine */ + @Override public String getEngineVersion() { TRACE("getEngineVersion()"); return ENGINE_VERSION; @@ -100,6 +97,7 @@ public class AppleScriptEngineFactory implements ScriptEngineFactory { * * @return name of the language supported by the ScriptEngine(Factory) */ + @Override public String getLanguageName() { TRACE("getLanguageName()"); return LANGUAGE; @@ -110,11 +108,12 @@ public class AppleScriptEngineFactory implements ScriptEngineFactory { * * @return language version supported by the ScriptEngine(Factory) */ + @Override public String getLanguageVersion() { TRACE("getLanguageVersion()"); return AccessController.doPrivileged(new PrivilegedAction() { public String run() { - final AppleScriptEngine engine = new AppleScriptEngine(AppleScriptEngineFactory.this); + final AppleScriptEngine engine = getScriptEngine(); return engine.getLanguageVersion(); } }); @@ -126,6 +125,7 @@ public class AppleScriptEngineFactory implements ScriptEngineFactory { * * @return ArrayList of file extensions AppleScript associates with */ + @Override public List getExtensions() { TRACE("getExtensions()"); return Arrays.asList("scpt", "applescript", "app"); @@ -137,6 +137,7 @@ public class AppleScriptEngineFactory implements ScriptEngineFactory { * * @return ArrayList of mimetypes that AppleScript associates with */ + @Override public List getMimeTypes() { TRACE("getMimeTypes()"); return Arrays.asList("application/x-applescript", "text/plain", "text/applescript"); @@ -148,6 +149,7 @@ public class AppleScriptEngineFactory implements ScriptEngineFactory { * * @return */ + @Override public List getNames() { TRACE("getNames()"); return Arrays.asList("AppleScriptEngine", "AppleScript", "OSA"); @@ -165,6 +167,7 @@ public class AppleScriptEngineFactory implements ScriptEngineFactory { * arguments to the function * @return the AppleScript string calling the method */ + @Override public String getMethodCallSyntax(final String obj, final String fname, final String ... args) { // StringBuilder builder = new StringBuilder(); // builder.append("my " + fname + "("); @@ -181,6 +184,7 @@ public class AppleScriptEngineFactory implements ScriptEngineFactory { * @param toDisplay * @return */ + @Override public String getOutputStatement(final String toDisplay) { // TODO -- this might even be good enough? XD return getMethodCallSyntax(null, "print", toDisplay); @@ -193,8 +197,9 @@ public class AppleScriptEngineFactory implements ScriptEngineFactory { * the key to look up * @return the static preseeded value for the key in the ScriptEngine, if it exists, otherwise null */ + @Override public Object getParameter(final String key) { - final AppleScriptEngine engine = new AppleScriptEngine(this); + final AppleScriptEngine engine = getScriptEngine(); if (!engine.getBindings(ScriptContext.ENGINE_SCOPE).containsKey(key)) return null; return engine.getBindings(ScriptContext.ENGINE_SCOPE).get(key); } @@ -205,6 +210,7 @@ public class AppleScriptEngineFactory implements ScriptEngineFactory { * @param statements * @return */ + @Override public String getProgram(final String ... statements) { final StringBuilder program = new StringBuilder(); for (final String statement : statements) { @@ -218,8 +224,21 @@ public class AppleScriptEngineFactory implements ScriptEngineFactory { * * @return new AppleScriptEngine with this factory as it's parent */ - public ScriptEngine getScriptEngine() { + @Override + public AppleScriptEngine getScriptEngine() { AppleScriptEngine.checkSecurity(); + ensureInitialized(); + return new AppleScriptEngine(this); } + + private static synchronized void ensureInitialized() { + if (!initialized) { + initialized = true; + + java.awt.Toolkit.getDefaultToolkit(); + System.loadLibrary("AppleScriptEngine"); + initNative(); + } + } } diff --git a/jdk/src/macosx/classes/apple/security/AppleProvider.java b/jdk/src/macosx/classes/apple/security/AppleProvider.java index e1e3e2fb682..654af3c5345 100644 --- a/jdk/src/macosx/classes/apple/security/AppleProvider.java +++ b/jdk/src/macosx/classes/apple/security/AppleProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ public final class AppleProvider extends Provider { public AppleProvider() { /* We are the Apple provider */ - super("Apple", 1.1, info); + super("Apple", 1.8d, info); AccessController.doPrivileged(new java.security.PrivilegedAction() { public Object run() { diff --git a/jdk/src/macosx/classes/com/apple/eawt/_AppEventLegacyHandler.java b/jdk/src/macosx/classes/com/apple/eawt/_AppEventLegacyHandler.java index c870f797839..493999c226c 100644 --- a/jdk/src/macosx/classes/com/apple/eawt/_AppEventLegacyHandler.java +++ b/jdk/src/macosx/classes/com/apple/eawt/_AppEventLegacyHandler.java @@ -31,10 +31,6 @@ import java.util.*; import com.apple.eawt.AppEvent.*; -interface _OpenAppHandler { - void handleOpenApp(); -} - @SuppressWarnings("deprecation") class _AppEventLegacyHandler implements AboutHandler, PreferencesHandler, _OpenAppHandler, AppReOpenedListener, OpenFilesHandler, PrintFilesHandler, QuitHandler { final _AppEventHandler parent; diff --git a/jdk/src/macosx/classes/sun/lwawt/SelectionClearListener.java b/jdk/src/macosx/classes/com/apple/eawt/_OpenAppHandler.java similarity index 84% rename from jdk/src/macosx/classes/sun/lwawt/SelectionClearListener.java rename to jdk/src/macosx/classes/com/apple/eawt/_OpenAppHandler.java index 4b378484240..97daaad65c7 100644 --- a/jdk/src/macosx/classes/sun/lwawt/SelectionClearListener.java +++ b/jdk/src/macosx/classes/com/apple/eawt/_OpenAppHandler.java @@ -23,12 +23,8 @@ * questions. */ -package sun.lwawt; +package com.apple.eawt; -/* - * Every time the TextField (or TextArea) change selection, every other text components - * must immediately clear their selections. - */ -interface SelectionClearListener { - void clearSelection(); -} +interface _OpenAppHandler { + void handleOpenApp(); +} \ No newline at end of file diff --git a/jdk/src/macosx/classes/com/apple/eawt/event/package.html b/jdk/src/macosx/classes/com/apple/eawt/event/package.html index 9c05d88c821..0946e60f309 100644 --- a/jdk/src/macosx/classes/com/apple/eawt/event/package.html +++ b/jdk/src/macosx/classes/com/apple/eawt/event/package.html @@ -1,5 +1,7 @@ + + Classes for receiving gesture events. diff --git a/jdk/src/macosx/classes/com/apple/eawt/package.html b/jdk/src/macosx/classes/com/apple/eawt/package.html index e11ed40ba3f..81bc1a8d3f8 100644 --- a/jdk/src/macosx/classes/com/apple/eawt/package.html +++ b/jdk/src/macosx/classes/com/apple/eawt/package.html @@ -1,5 +1,7 @@ + + Provides classes for integrating Java applications with the native application environment. diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java index 4b31dfff19d..fc60e533c6e 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java @@ -25,141 +25,11 @@ package com.apple.laf; -import java.awt.*; - import javax.swing.*; import javax.swing.plaf.UIResource; -import sun.swing.SwingUtilities2; - class AquaComboBoxRenderer extends AquaComboBoxRendererInternal implements UIResource { public AquaComboBoxRenderer(final JComboBox comboBox) { super(comboBox); } } - -class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { - final JComboBox fComboBox; - boolean fSelected; - boolean fChecked; - boolean fInList; - boolean fEditable; - boolean fDrawCheckedItem = true; - - // Provides space for a checkbox, and is translucent - public AquaComboBoxRendererInternal(final JComboBox comboBox) { - super(); - fComboBox = comboBox; - } - - // Don't include checkIcon space, because this is also used for button size calculations - // - the popup-size calc will get checkIcon space from getInsets - public Dimension getPreferredSize() { - // From BasicComboBoxRenderer - trick to avoid zero-height items - final Dimension size; - - final String text = getText(); - if ((text == null) || ("".equals(text))) { - setText(" "); - size = super.getPreferredSize(); - setText(""); - } else { - size = super.getPreferredSize(); - } - return size; - } - - // Don't paint the border here, it gets painted by the UI - protected void paintBorder(final Graphics g) { - - } - - public int getBaseline(int width, int height) { - return super.getBaseline(width, height) - 1; - } - - // Really means is the one with the mouse over it - public Component getListCellRendererComponent(final JList list, final Object value, int index, final boolean isSelected, final boolean cellHasFocus) { - fInList = (index >= 0); // When the button wants the item painted, it passes in -1 - fSelected = isSelected; - if (index < 0) { - index = fComboBox.getSelectedIndex(); - } - - // changed this to not ask for selected index but directly compare the current item and selected item - // different from basic because basic has no concept of checked, just has the last one selected, - // and the user changes selection. We have selection and a check mark. - // we used to call fComboBox.getSelectedIndex which ends up being a very bad call for large checkboxes - // it does a linear compare of every object in the checkbox until it finds the selected one, so if - // we have a 5000 element list we will 5000 * (selected index) .equals() of objects. - // See Radar #3141307 - - // Fix for Radar # 3204287 where we ask for an item at a negative index! - if (index >= 0) { - final Object item = fComboBox.getItemAt(index); - fChecked = fInList && item != null && item.equals(fComboBox.getSelectedItem()); - } else { - fChecked = false; - } - - fEditable = fComboBox.isEditable(); - if (isSelected) { - if (fEditable) { - setBackground(UIManager.getColor("List.selectionBackground")); - setForeground(UIManager.getColor("List.selectionForeground")); - } else { - setBackground(list.getSelectionBackground()); - setForeground(list.getSelectionForeground()); - } - } else { - if (fEditable) { - setBackground(UIManager.getColor("List.background")); - setForeground(UIManager.getColor("List.foreground")); - } else { - setBackground(list.getBackground()); - setForeground(list.getForeground()); - } - } - - setFont(list.getFont()); - - if (value instanceof Icon) { - setIcon((Icon)value); - } else { - setText((value == null) ? " " : value.toString()); - } - return this; - } - - public Insets getInsets(Insets insets) { - if (insets == null) insets = new Insets(0, 0, 0, 0); - insets.top = 1; - insets.bottom = 1; - insets.right = 5; - insets.left = (fInList && !fEditable ? 16 + 7 : 5); - return insets; - } - - protected void setDrawCheckedItem(final boolean drawCheckedItem) { - this.fDrawCheckedItem = drawCheckedItem; - } - - // Paint this component, and a checkbox if it's the selected item and not in the button - protected void paintComponent(final Graphics g) { - if (fInList) { - if (fSelected && !fEditable) { - AquaMenuPainter.instance().paintSelectedMenuItemBackground(g, getWidth(), getHeight()); - } else { - g.setColor(getBackground()); - g.fillRect(0, 0, getWidth(), getHeight()); - } - - if (fChecked && !fEditable && fDrawCheckedItem) { - final int y = getHeight() - 4; - g.setColor(getForeground()); - SwingUtilities2.drawString(fComboBox, g, "\u2713", 6, y); - } - } - super.paintComponent(g); - } -} diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java new file mode 100644 index 00000000000..a93560a1f71 --- /dev/null +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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.apple.laf; + +import sun.swing.SwingUtilities2; + +import javax.swing.*; +import java.awt.*; + +class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { + final JComboBox fComboBox; + boolean fSelected; + boolean fChecked; + boolean fInList; + boolean fEditable; + boolean fDrawCheckedItem = true; + + // Provides space for a checkbox, and is translucent + public AquaComboBoxRendererInternal(final JComboBox comboBox) { + super(); + fComboBox = comboBox; + } + + // Don't include checkIcon space, because this is also used for button size calculations + // - the popup-size calc will get checkIcon space from getInsets + public Dimension getPreferredSize() { + // From BasicComboBoxRenderer - trick to avoid zero-height items + final Dimension size; + + final String text = getText(); + if ((text == null) || ("".equals(text))) { + setText(" "); + size = super.getPreferredSize(); + setText(""); + } else { + size = super.getPreferredSize(); + } + return size; + } + + // Don't paint the border here, it gets painted by the UI + protected void paintBorder(final Graphics g) { + + } + + public int getBaseline(int width, int height) { + return super.getBaseline(width, height) - 1; + } + + // Really means is the one with the mouse over it + public Component getListCellRendererComponent(final JList list, final Object value, int index, final boolean isSelected, final boolean cellHasFocus) { + fInList = (index >= 0); // When the button wants the item painted, it passes in -1 + fSelected = isSelected; + if (index < 0) { + index = fComboBox.getSelectedIndex(); + } + + // changed this to not ask for selected index but directly compare the current item and selected item + // different from basic because basic has no concept of checked, just has the last one selected, + // and the user changes selection. We have selection and a check mark. + // we used to call fComboBox.getSelectedIndex which ends up being a very bad call for large checkboxes + // it does a linear compare of every object in the checkbox until it finds the selected one, so if + // we have a 5000 element list we will 5000 * (selected index) .equals() of objects. + // See Radar #3141307 + + // Fix for Radar # 3204287 where we ask for an item at a negative index! + if (index >= 0) { + final Object item = fComboBox.getItemAt(index); + fChecked = fInList && item != null && item.equals(fComboBox.getSelectedItem()); + } else { + fChecked = false; + } + + fEditable = fComboBox.isEditable(); + if (isSelected) { + if (fEditable) { + setBackground(UIManager.getColor("List.selectionBackground")); + setForeground(UIManager.getColor("List.selectionForeground")); + } else { + setBackground(list.getSelectionBackground()); + setForeground(list.getSelectionForeground()); + } + } else { + if (fEditable) { + setBackground(UIManager.getColor("List.background")); + setForeground(UIManager.getColor("List.foreground")); + } else { + setBackground(list.getBackground()); + setForeground(list.getForeground()); + } + } + + setFont(list.getFont()); + + if (value instanceof Icon) { + setIcon((Icon)value); + } else { + setText((value == null) ? " " : value.toString()); + } + return this; + } + + public Insets getInsets(Insets insets) { + if (insets == null) insets = new Insets(0, 0, 0, 0); + insets.top = 1; + insets.bottom = 1; + insets.right = 5; + insets.left = (fInList && !fEditable ? 16 + 7 : 5); + return insets; + } + + protected void setDrawCheckedItem(final boolean drawCheckedItem) { + this.fDrawCheckedItem = drawCheckedItem; + } + + // Paint this component, and a checkbox if it's the selected item and not in the button + protected void paintComponent(final Graphics g) { + if (fInList) { + if (fSelected && !fEditable) { + AquaMenuPainter.instance().paintSelectedMenuItemBackground(g, getWidth(), getHeight()); + } else { + g.setColor(getBackground()); + g.fillRect(0, 0, getWidth(), getHeight()); + } + + if (fChecked && !fEditable && fDrawCheckedItem) { + final int y = getHeight() - 4; + g.setColor(getForeground()); + SwingUtilities2.drawString(fComboBox, g, "\u2713", 6, y); + } + } + super.paintComponent(g); + } +} diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java index 8e8527f6541..4b9c78b3dcd 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java @@ -281,12 +281,16 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { actionMap.put("aquaSelectPageUp", highlightPageUpAction); actionMap.put("aquaSelectPageDown", highlightPageDownAction); + actionMap.put("aquaHidePopup", hideAction); + SwingUtilities.replaceUIActionMap(comboBox, actionMap); } - abstract class ComboBoxAction extends AbstractAction { + private abstract class ComboBoxAction extends AbstractAction { public void actionPerformed(final ActionEvent e) { - if (!comboBox.isEnabled() || !comboBox.isShowing()) return; + if (!comboBox.isEnabled() || !comboBox.isShowing()) { + return; + } if (comboBox.isPopupVisible()) { final AquaComboBoxUI ui = (AquaComboBoxUI)comboBox.getUI(); @@ -302,7 +306,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { /** * Hilight _but do not select_ the next item in the list. */ - Action highlightNextAction = new ComboBoxAction() { + private Action highlightNextAction = new ComboBoxAction() { @Override public void performComboBoxAction(AquaComboBoxUI ui) { final int si = listBox.getSelectedIndex(); @@ -318,7 +322,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { /** * Hilight _but do not select_ the previous item in the list. */ - Action highlightPreviousAction = new ComboBoxAction() { + private Action highlightPreviousAction = new ComboBoxAction() { @Override void performComboBoxAction(final AquaComboBoxUI ui) { final int si = listBox.getSelectedIndex(); @@ -330,7 +334,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } }; - Action highlightFirstAction = new ComboBoxAction() { + private Action highlightFirstAction = new ComboBoxAction() { @Override void performComboBoxAction(final AquaComboBoxUI ui) { listBox.setSelectedIndex(0); @@ -338,7 +342,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } }; - Action highlightLastAction = new ComboBoxAction() { + private Action highlightLastAction = new ComboBoxAction() { @Override void performComboBoxAction(final AquaComboBoxUI ui) { final int size = listBox.getModel().getSize(); @@ -347,7 +351,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } }; - Action highlightPageUpAction = new ComboBoxAction() { + private Action highlightPageUpAction = new ComboBoxAction() { @Override void performComboBoxAction(final AquaComboBoxUI ui) { final int current = listBox.getSelectedIndex(); @@ -367,7 +371,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } }; - Action highlightPageDownAction = new ComboBoxAction() { + private Action highlightPageDownAction = new ComboBoxAction() { @Override void performComboBoxAction(final AquaComboBoxUI ui) { final int current = listBox.getSelectedIndex(); @@ -482,13 +486,13 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { // This is somewhat messy. The difference here from BasicComboBoxUI.EnterAction is that // arrow up or down does not automatically select the - static final Action triggerSelectionAction = new AbstractAction() { + private static final Action triggerSelectionAction = new AbstractAction() { public void actionPerformed(final ActionEvent e) { triggerSelectionEvent((JComboBox)e.getSource(), e); } }; - static final Action toggleSelectionAction = new AbstractAction() { + private static final Action toggleSelectionAction = new AbstractAction() { public void actionPerformed(final ActionEvent e) { final JComboBox comboBox = (JComboBox)e.getSource(); if (!comboBox.isEnabled()) return; @@ -506,6 +510,18 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } }; + private static Action hideAction = new AbstractAction() { + @Override + public void actionPerformed(final ActionEvent e) { + final JComboBox comboBox = (JComboBox)e.getSource(); + + if (comboBox.isPopupVisible()) { + comboBox.firePopupMenuCanceled(); + comboBox.setPopupVisible(false); + } + } + }; + public void applySizeFor(final JComponent c, final Size size) { if (arrowButton == null) return; final Border border = arrowButton.getBorder(); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java index b7598f99d6d..be4b5b72a32 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java @@ -42,6 +42,7 @@ import javax.swing.filechooser.*; import javax.swing.plaf.*; import javax.swing.table.*; +import sun.swing.AbstractFilterComboBoxModel; import sun.swing.SwingUtilities2; public class AquaFileChooserUI extends FileChooserUI { @@ -1266,64 +1267,9 @@ public class AquaFileChooserUI extends FileChooserUI { /** * Data model for a type-face selection combo-box. */ - protected class FilterComboBoxModel extends DefaultListModel implements ComboBoxModel, PropertyChangeListener { - int selectedIndex = -1; - - protected FilterComboBoxModel() { - super(); - final FileFilter filters[] = getFileChooser().getChoosableFileFilters(); - for (int i = 0; i < filters.length; i++) { - this.add(i, filters[i]); - } - } - - public void propertyChange(final PropertyChangeEvent e) { - final String prop = e.getPropertyName(); - if (prop == JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) { - this.clear(); - final FileFilter filters[] = (FileFilter[])e.getNewValue(); - - for (int i = 0; i < filters.length; i++) { - this.add(i, filters[i]); - } - - fireContentsChanged(this, -1, -1); - } else if (prop == JFileChooser.FILE_FILTER_CHANGED_PROPERTY) { - final FileFilter currentFilter = (FileFilter)e.getNewValue(); - FileFilter filters[] = getFileChooser().getChoosableFileFilters(); - - boolean found = false; - if (currentFilter != null) { - for (final FileFilter element : filters) { - if (element == currentFilter) { - found = true; - } - } - if (found == false) { - getFileChooser().addChoosableFileFilter(currentFilter); - } - } - - filters = getFileChooser().getChoosableFileFilters(); - setSelectedItem(e.getNewValue()); - } - } - - public void setSelectedItem(final Object filter) { - if (filter != null) { - selectedIndex = this.indexOf(filter); - fireContentsChanged(this, -1, -1); - } - } - - public Object getSelectedItem() { - final Object returnValue = null; - - if (this.size() > 0) { - if ((selectedIndex != -1) && (selectedIndex < size())) { return this.get(selectedIndex); } - } - - return returnValue; + protected class FilterComboBoxModel extends AbstractFilterComboBoxModel { + protected JFileChooser getFileChooser() { + return AquaFileChooserUI.this.getFileChooser(); } } diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaKeyBindings.java b/jdk/src/macosx/classes/com/apple/laf/AquaKeyBindings.java index 88db59f0b9f..98048262b80 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaKeyBindings.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaKeyBindings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -209,7 +209,7 @@ public class AquaKeyBindings { LateBoundInputMap getComboBoxInputMap() { return new LateBoundInputMap(new SimpleBinding(new String[] { - "ESCAPE", "hidePopup", + "ESCAPE", "aquaHidePopup", "PAGE_UP", "aquaSelectPageUp", "PAGE_DOWN", "aquaSelectPageDown", "HOME", "aquaSelectHome", diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java b/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java index 457b82d36a3..b2cf557ce89 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java @@ -37,8 +37,6 @@ import javax.swing.plaf.basic.BasicLookAndFeel; import sun.swing.*; import apple.laf.*; -import com.apple.resources.MacOSXResourceBundle; - public class AquaLookAndFeel extends BasicLookAndFeel { static final String sOldPropertyPrefix = "com.apple.macos."; // old prefix for things like 'useScreenMenuBar' static final String sPropertyPrefix = "apple.laf."; // new prefix for things like 'useScreenMenuBar' @@ -246,13 +244,13 @@ public class AquaLookAndFeel extends BasicLookAndFeel { * used for getting localized defaults. Also initialize the default * locale used when no locale is passed into UIDefaults.get(). The * default locale should generally not be relied upon. It is here for - * compatability with releases prior to 1.4. + * compatibility with releases prior to 1.4. */ private void initResourceBundle(final UIDefaults table) { table.setDefaultLocale(Locale.getDefault()); table.addResourceBundle(PKG_PREFIX + "resources.aqua"); try { - final ResourceBundle aquaProperties = MacOSXResourceBundle.getMacResourceBundle(PKG_PREFIX + "resources.aqua"); + final ResourceBundle aquaProperties = ResourceBundle.getBundle(PKG_PREFIX + "resources.aqua"); final Enumeration propertyKeys = aquaProperties.getKeys(); while (propertyKeys.hasMoreElements()) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaMenuBarUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaMenuBarUI.java index da6a01e0348..e2a4caf5ad9 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaMenuBarUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaMenuBarUI.java @@ -73,8 +73,9 @@ public class AquaMenuBarUI extends BasicMenuBarUI implements ScreenMenuBarProvid public Dimension getPreferredSize(final JComponent c) { if (isScreenMenuBar((JMenuBar)c)) { - if (setScreenMenuBar((JFrame)(c.getTopLevelAncestor()))) ; - return new Dimension(0, 0); + if (setScreenMenuBar((JFrame)(c.getTopLevelAncestor()))) { + return new Dimension(0, 0); + } } return null; } diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaMenuPainter.java b/jdk/src/macosx/classes/com/apple/laf/AquaMenuPainter.java index a6b7de64e08..57e51e2d61f 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaMenuPainter.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaMenuPainter.java @@ -406,7 +406,7 @@ public class AquaMenuPainter { } /** Draw a string with the graphics g at location (x,y) just like g.drawString() would. - * The first occurence of underlineChar in text will be underlined. The matching is + * The first occurrence of underlineChar in text will be underlined. The matching is * not case sensitive. */ public void drawString(final Graphics g, final JComponent c, final String text, final int underlinedChar, final int x, final int y, final boolean isEnabled, final boolean isSelected) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java index 5a1cf0cdeb7..353eb10bc3f 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java @@ -3514,7 +3514,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing * Instantiate it only within subclasses of BasicTabbedPaneUI. */ public class PropertyChangeHandler implements PropertyChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -3528,7 +3528,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing * Instantiate it only within subclasses of BasicTabbedPaneUI. */ public class TabSelectionHandler implements ChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -3542,7 +3542,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing * Instantiate it only within subclasses of BasicTabbedPaneUI. */ public class MouseHandler extends MouseAdapter { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -3556,7 +3556,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing * Instantiate it only within subclasses of BasicTabbedPaneUI. */ public class FocusHandler extends FocusAdapter { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTreeUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTreeUI.java index 93bcf7aafbc..0caf12d0eca 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaTreeUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaTreeUI.java @@ -179,7 +179,7 @@ public class AquaTreeUI extends BasicTreeUI { } /** - * Paints the expand (toggle) part of a row. The reciever should NOT modify clipBounds, or + * Paints the expand (toggle) part of a row. The receiver should NOT modify clipBounds, or * insets. */ protected void paintExpandControl(final Graphics g, final Rectangle clipBounds, final Insets insets, final Rectangle bounds, final TreePath path, final int row, final boolean isExpanded, final boolean hasBeenExpanded, final boolean isLeaf) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java index 0592da714a2..a5f5501cb35 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,7 @@ import java.awt.*; import java.awt.image.*; import java.lang.ref.SoftReference; import java.lang.reflect.Method; +import java.security.AccessController; import java.security.PrivilegedAction; import java.util.*; @@ -41,56 +42,68 @@ import sun.awt.AppContext; import sun.lwawt.macosx.CImage; import sun.lwawt.macosx.CImage.Creator; import sun.lwawt.macosx.CPlatformWindow; +import sun.misc.Launcher; +import sun.reflect.misc.ReflectUtil; +import sun.security.action.GetPropertyAction; import sun.swing.SwingUtilities2; import com.apple.laf.AquaImageFactory.SlicedImageControl; -public class AquaUtils { - final static String ANIMATIONS_SYSTEM_PROPERTY = "swing.enableAnimations"; +final class AquaUtils { - /* + private static final String ANIMATIONS_PROPERTY = "swing.enableAnimations"; + + /** + * Suppresses default constructor, ensuring non-instantiability. + */ + private AquaUtils() { + } + + /** * Convenience function for determining ComponentOrientation. Helps us * avoid having Munge directives throughout the code. */ - public static boolean isLeftToRight(final Component c) { + static boolean isLeftToRight(final Component c) { return c.getComponentOrientation().isLeftToRight(); } - public static void enforceComponentOrientation(Component c, ComponentOrientation orientation) { + static void enforceComponentOrientation(final Component c, final ComponentOrientation orientation) { c.setComponentOrientation(orientation); if (c instanceof Container) { - for (Component child : ((Container)c).getComponents()) { + for (final Component child : ((Container)c).getComponents()) { enforceComponentOrientation(child, orientation); } } } - private static CImage.Creator getCImageCreatorInternal() { - return java.security.AccessController.doPrivileged(new PrivilegedAction() { + private static Creator getCImageCreatorInternal() { + return AccessController.doPrivileged(new PrivilegedAction() { + @Override public Creator run() { try { final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {}); getCreatorMethod.setAccessible(true); - return (CImage.Creator)getCreatorMethod.invoke(null, new Object[] {}); - } catch (final Exception e) { + return (Creator)getCreatorMethod.invoke(null, new Object[] {}); + } catch (final Exception ignored) { return null; } } }); } - private static final RecyclableSingleton cImageCreator = new RecyclableSingleton() { + private static final RecyclableSingleton cImageCreator = new RecyclableSingleton() { @Override protected Creator getInstance() { return getCImageCreatorInternal(); } }; - static CImage.Creator getCImageCreator() { + static Creator getCImageCreator() { return cImageCreator.get(); } - protected static Image generateSelectedDarkImage(final Image image) { + static Image generateSelectedDarkImage(final Image image) { final ImageProducer prod = new FilteredImageSource(image.getSource(), new IconImageFilter() { + @Override int getGreyFor(final int gray) { return gray * 75 / 100; } @@ -98,8 +111,9 @@ public class AquaUtils { return Toolkit.getDefaultToolkit().createImage(prod); } - protected static Image generateDisabledImage(final Image image) { + static Image generateDisabledImage(final Image image) { final ImageProducer prod = new FilteredImageSource(image.getSource(), new IconImageFilter() { + @Override int getGreyFor(final int gray) { return 255 - ((255 - gray) * 65 / 100); } @@ -107,19 +121,20 @@ public class AquaUtils { return Toolkit.getDefaultToolkit().createImage(prod); } - protected static Image generateLightenedImage(final Image image, final int percent) { + static Image generateLightenedImage(final Image image, final int percent) { final GrayFilter filter = new GrayFilter(true, percent); final ImageProducer prod = new FilteredImageSource(image.getSource(), filter); return Toolkit.getDefaultToolkit().createImage(prod); } - static abstract class IconImageFilter extends RGBImageFilter { - public IconImageFilter() { + private abstract static class IconImageFilter extends RGBImageFilter { + IconImageFilter() { super(); canFilterIndexColorModel = true; } - public int filterRGB(final int x, final int y, final int rgb) { + @Override + public final int filterRGB(final int x, final int y, final int rgb) { final int red = (rgb >> 16) & 0xff; final int green = (rgb >> 8) & 0xff; final int blue = rgb & 0xff; @@ -135,14 +150,14 @@ public class AquaUtils { return result; } - abstract int getGreyFor(final int gray); + abstract int getGreyFor(int gray); } - public abstract static class RecyclableObject { - protected SoftReference objectRef = null; + abstract static class RecyclableObject { + private SoftReference objectRef; - public T get() { - T referent = null; + T get() { + T referent; if (objectRef != null && (referent = objectRef.get()) != null) return referent; referent = create(); objectRef = new SoftReference(referent); @@ -152,8 +167,8 @@ public class AquaUtils { protected abstract T create(); } - public abstract static class RecyclableSingleton { - public T get() { + abstract static class RecyclableSingleton { + final T get() { final AppContext appContext = AppContext.getAppContext(); SoftReference ref = (SoftReference) appContext.get(this); if (ref != null) { @@ -166,38 +181,36 @@ public class AquaUtils { return object; } - public void reset() { - AppContext appContext = AppContext.getAppContext(); - appContext.remove(this); + void reset() { + AppContext.getAppContext().remove(this); } - protected abstract T getInstance(); + abstract T getInstance(); } - public static class RecyclableSingletonFromDefaultConstructor extends RecyclableSingleton { - protected final Class clazz; + static class RecyclableSingletonFromDefaultConstructor extends RecyclableSingleton { + private final Class clazz; - public RecyclableSingletonFromDefaultConstructor(final Class clazz) { + RecyclableSingletonFromDefaultConstructor(final Class clazz) { this.clazz = clazz; } - protected T getInstance() { + @Override + T getInstance() { try { + ReflectUtil.checkPackageAccess(clazz); return clazz.newInstance(); - } catch (final InstantiationException e) { - e.printStackTrace(); - } catch (final IllegalAccessException e) { - e.printStackTrace(); + } catch (InstantiationException | IllegalAccessException ignored) { } return null; } } - public abstract static class LazyKeyedSingleton { - protected Map refs; + abstract static class LazyKeyedSingleton { + private Map refs; - public V get(final K key) { - if (refs == null) refs = new HashMap(); + V get(final K key) { + if (refs == null) refs = new HashMap<>(); final V cachedValue = refs.get(key); if (cachedValue != null) return cachedValue; @@ -207,44 +220,45 @@ public class AquaUtils { return value; } - protected abstract V getInstance(final K key); + protected abstract V getInstance(K key); } - static final RecyclableSingleton enableAnimations = new RecyclableSingleton() { + private static final RecyclableSingleton enableAnimations = new RecyclableSingleton() { @Override protected Boolean getInstance() { - final String sizeProperty = (String)java.security.AccessController.doPrivileged((PrivilegedAction)new sun.security.action.GetPropertyAction(ANIMATIONS_SYSTEM_PROPERTY)); - return new Boolean(!"false".equals(sizeProperty)); // should be true by default + final String sizeProperty = (String) AccessController.doPrivileged((PrivilegedAction)new GetPropertyAction( + ANIMATIONS_PROPERTY)); + return !"false".equals(sizeProperty); // should be true by default } }; - static boolean animationsEnabled() { + private static boolean animationsEnabled() { return enableAnimations.get(); } - static final int MENU_BLINK_DELAY = 50; // 50ms == 3/60 sec, according to the spec - protected static void blinkMenu(final Selectable selectable) { + private static final int MENU_BLINK_DELAY = 50; // 50ms == 3/60 sec, according to the spec + static void blinkMenu(final Selectable selectable) { if (!animationsEnabled()) return; try { selectable.paintSelected(false); Thread.sleep(MENU_BLINK_DELAY); selectable.paintSelected(true); Thread.sleep(MENU_BLINK_DELAY); - } catch (final InterruptedException e) { } + } catch (final InterruptedException ignored) { } } interface Selectable { - void paintSelected(final boolean selected); + void paintSelected(boolean selected); } interface JComponentPainter { - public void paint(JComponent c, Graphics g, int x, int y, int w, int h); + void paint(JComponent c, Graphics g, int x, int y, int w, int h); } interface Painter { - public void paint(final Graphics g, int x, int y, int w, int h); + void paint(Graphics g, int x, int y, int w, int h); } - public static void paintDropShadowText(final Graphics g, final JComponent c, final Font font, final FontMetrics metrics, final int x, final int y, final int offsetX, final int offsetY, final Color textColor, final Color shadowColor, final String text) { + static void paintDropShadowText(final Graphics g, final JComponent c, final Font font, final FontMetrics metrics, final int x, final int y, final int offsetX, final int offsetY, final Color textColor, final Color shadowColor, final String text) { g.setFont(font); g.setColor(shadowColor); SwingUtilities2.drawString(c, g, text, x + offsetX, y + offsetY + metrics.getAscent()); @@ -252,22 +266,22 @@ public class AquaUtils { SwingUtilities2.drawString(c, g, text, x, y + metrics.getAscent()); } - public static class ShadowBorder implements Border { - final Painter prePainter; - final Painter postPainter; + static class ShadowBorder implements Border { + private final Painter prePainter; + private final Painter postPainter; - final int offsetX; - final int offsetY; - final float distance; - final int blur; - final Insets insets; - final ConvolveOp blurOp; + private final int offsetX; + private final int offsetY; + private final float distance; + private final int blur; + private final Insets insets; + private final ConvolveOp blurOp; - public ShadowBorder(final Painter prePainter, final Painter postPainter, final int offsetX, final int offsetY, final float distance, final float intensity, final int blur) { + ShadowBorder(final Painter prePainter, final Painter postPainter, final int offsetX, final int offsetY, final float distance, final float intensity, final int blur) { this.prePainter = prePainter; this.postPainter = postPainter; this.offsetX = offsetX; this.offsetY = offsetY; this.distance = distance; this.blur = blur; final int halfBlur = blur / 2; - this.insets = new Insets(halfBlur - offsetY, halfBlur - offsetX, halfBlur + offsetY, halfBlur + offsetX); + insets = new Insets(halfBlur - offsetY, halfBlur - offsetX, halfBlur + offsetY, halfBlur + offsetX); final float blurry = intensity / (blur * blur); final float[] blurKernel = new float[blur * blur]; @@ -275,14 +289,17 @@ public class AquaUtils { blurOp = new ConvolveOp(new Kernel(blur, blur, blurKernel)); } - public boolean isBorderOpaque() { + @Override + public final boolean isBorderOpaque() { return false; } - public Insets getBorderInsets(final Component c) { + @Override + public final Insets getBorderInsets(final Component c) { return insets; } + @Override public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int width, final int height) { final BufferedImage img = new BufferedImage(width + blur * 2, height + blur * 2, BufferedImage.TYPE_INT_ARGB_PRE); paintToImage(img, x, y, width, height); @@ -290,7 +307,7 @@ public class AquaUtils { g.drawImage(img, -blur, -blur, null); } - protected void paintToImage(final BufferedImage img, final int x, final int y, final int width, final int height) { + private void paintToImage(final BufferedImage img, final int x, final int y, final int width, final int height) { // clear the prior image Graphics2D imgG = (Graphics2D)img.getGraphics(); imgG.setComposite(AlphaComposite.Clear); @@ -319,10 +336,10 @@ public class AquaUtils { } } - public static class SlicedShadowBorder extends ShadowBorder { - final SlicedImageControl slices; + static class SlicedShadowBorder extends ShadowBorder { + private final SlicedImageControl slices; - public SlicedShadowBorder(final Painter prePainter, final Painter postPainter, final int offsetX, final int offsetY, final float distance, final float intensity, final int blur, final int templateWidth, final int templateHeight, final int leftCut, final int topCut, final int rightCut, final int bottomCut) { + SlicedShadowBorder(final Painter prePainter, final Painter postPainter, final int offsetX, final int offsetY, final float distance, final float intensity, final int blur, final int templateWidth, final int templateHeight, final int leftCut, final int topCut, final int rightCut, final int bottomCut) { super(prePainter, postPainter, offsetX, offsetY, distance, intensity, blur); final BufferedImage i = new BufferedImage(templateWidth, templateHeight, BufferedImage.TYPE_INT_ARGB_PRE); @@ -331,15 +348,12 @@ public class AquaUtils { slices = new SlicedImageControl(i, leftCut, topCut, rightCut, bottomCut, false); } + @Override public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int width, final int height) { slices.paint(g, x, y, width, height); } } - public interface NineSliceMetricsProvider { - - } - // static void debugFrame(String name, Image image) { // JFrame f = new JFrame(name); // f.setContentPane(new JLabel(new ImageIcon(image))); @@ -350,28 +364,30 @@ public class AquaUtils { // special casing naughty applications, like InstallAnywhere // REGR: JButton: Myst IV: the buttons of 1.0.3 updater have redraw issue static boolean shouldUseOpaqueButtons() { - final ClassLoader launcherClassLoader = sun.misc.Launcher.getLauncher().getClassLoader(); + final ClassLoader launcherClassLoader = Launcher.getLauncher().getClassLoader(); if (classExists(launcherClassLoader, "com.installshield.wizard.platform.macosx.MacOSXUtils")) return true; return false; } - static boolean classExists(final ClassLoader classLoader, final String clazzName) { + private static boolean classExists(final ClassLoader classLoader, final String clazzName) { try { return Class.forName(clazzName, false, classLoader) != null; - } catch (final Throwable e) { } + } catch (final Throwable ignored) { } return false; } - private static RecyclableSingleton getJComponentGetFlagMethod = new RecyclableSingleton() { + private static final RecyclableSingleton getJComponentGetFlagMethod = new RecyclableSingleton() { + @Override protected Method getInstance() { - return java.security.AccessController.doPrivileged( + return AccessController.doPrivileged( new PrivilegedAction() { + @Override public Method run() { try { final Method method = JComponent.class.getDeclaredMethod("getFlag", new Class[] { int.class }); method.setAccessible(true); return method; - } catch (final Throwable e) { + } catch (final Throwable ignored) { return null; } } @@ -380,18 +396,18 @@ public class AquaUtils { } }; - private static final Integer OPAQUE_SET_FLAG = new Integer(24); // private int JComponent.OPAQUE_SET - protected static boolean hasOpaqueBeenExplicitlySet(final JComponent c) { + private static final Integer OPAQUE_SET_FLAG = 24; // private int JComponent.OPAQUE_SET + static boolean hasOpaqueBeenExplicitlySet(final JComponent c) { final Method method = getJComponentGetFlagMethod.get(); if (method == null) return false; try { return Boolean.TRUE.equals(method.invoke(c, OPAQUE_SET_FLAG)); - } catch (final Throwable e) { + } catch (final Throwable ignored) { return false; } } - protected static boolean isWindowTextured(final Component c) { + private static boolean isWindowTextured(final Component c) { if (!(c instanceof JComponent)) { return false; } @@ -412,13 +428,12 @@ public class AquaUtils { return new Color(color.getRed(), color.getGreen(), color.getBlue(), 0); } - protected static void fillRect(final Graphics g, final Component c) { + static void fillRect(final Graphics g, final Component c) { fillRect(g, c, c.getBackground(), 0, 0, c.getWidth(), c.getHeight()); } - protected static void fillRect(final Graphics g, final Component c, - final Color color, final int x, final int y, - final int w, final int h) { + static void fillRect(final Graphics g, final Component c, final Color color, + final int x, final int y, final int w, final int h) { if (!(g instanceof Graphics2D)) { return; } diff --git a/jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java b/jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java index 5f78ff6e061..87393408487 100644 --- a/jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java +++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java @@ -36,7 +36,10 @@ import sun.awt.SunToolkit; import sun.lwawt.LWToolkit; import sun.lwawt.macosx.*; -class ScreenMenu extends Menu implements ContainerListener, ComponentListener, ScreenMenuPropertyHandler { +final class ScreenMenu extends Menu + implements ContainerListener, ComponentListener, + ScreenMenuPropertyHandler { + static { java.security.AccessController.doPrivileged( new java.security.PrivilegedAction() { @@ -48,20 +51,22 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S } // screen menu stuff - public static native long addMenuListeners(ScreenMenu listener, long nativeMenu); - public static native void removeMenuListeners(long modelPtr); + private static native long addMenuListeners(ScreenMenu listener, long nativeMenu); + private static native void removeMenuListeners(long modelPtr); - long fModelPtr = 0; + private transient long fModelPtr; - Hashtable fItems; - JMenu fInvoker; + private final Hashtable fItems; + private final JMenu fInvoker; - Component fLastMouseEventTarget; - Rectangle fLastTargetRect; + private Component fLastMouseEventTarget; + private Rectangle fLastTargetRect; private volatile Rectangle[] fItemBounds; + private ScreenMenuPropertyListener fPropertyListener; + // Array of child hashes used to see if we need to recreate the Menu. - int childHashArray[]; + private int childHashArray[]; ScreenMenu(final JMenu invoker) { super(invoker.getText()); @@ -74,25 +79,12 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S updateItems(); } - // I'm always 'visible', but never on screen - static class ScreenMenuComponent extends Container { - public boolean isVisible() { return true; } - public boolean isShowing() { return true; } - public void setVisible(final boolean b) {} - public void show() {} - } - - ScreenMenuComponent makeScreenMenuComponent() { - return new ScreenMenuComponent(); - } - - /** * Determine if we need to tear down the Menu and re-create it, since the contents may have changed in the Menu opened listener and * we do not get notified of it, because EDT is busy in our code. We only need to update if the menu contents have changed in some * way, such as the number of menu items, the text of the menuitems, icon, shortcut etc. */ - static boolean needsUpdate(final Component items[], final int childHashArray[]) { + private static boolean needsUpdate(final Component items[], final int childHashArray[]) { if (items == null || childHashArray == null) { return true; } @@ -112,7 +104,7 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S * Used to recreate the AWT based Menu structure that implements the Screen Menu. * Also computes hashcode and stores them so that we can compare them later in needsUpdate. */ - void updateItems() { + private void updateItems() { final int count = fInvoker.getMenuComponentCount(); final Component[] items = fInvoker.getMenuComponents(); if (needsUpdate(items, childHashArray)) { @@ -163,16 +155,14 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S LWCToolkit.invokeAndWait(new Runnable() { public void run() { invoker.setSelected(false); - - // Null out the tracking rectangles and the array. + // Null out the tracking rectangles and the array. if (fItemBounds != null) { - for (int i = 0; i < fItemBounds.length; i++) { - fItemBounds[i] = null; - } + for (int i = 0; i < fItemBounds.length; i++) { + fItemBounds[i] = null; + } } - - fItemBounds = null; - } + fItemBounds = null; + } }, invoker); } catch (final Exception e) { e.printStackTrace(); @@ -237,49 +227,56 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S }); } - ScreenMenuPropertyListener fPropertyListener; + @Override public void addNotify() { - super.addNotify(); - if (fModelPtr == 0) { - fInvoker.addContainerListener(this); - fInvoker.addComponentListener(this); - fPropertyListener = new ScreenMenuPropertyListener(this); - fInvoker.addPropertyChangeListener(fPropertyListener); + synchronized (getTreeLock()) { + super.addNotify(); + if (fModelPtr == 0) { + fInvoker.addContainerListener(this); + fInvoker.addComponentListener(this); + fPropertyListener = new ScreenMenuPropertyListener(this); + fInvoker.addPropertyChangeListener(fPropertyListener); - final Icon icon = fInvoker.getIcon(); - if (icon != null) { - this.setIcon(icon); - } + final Icon icon = fInvoker.getIcon(); + if (icon != null) { + setIcon(icon); + } - final String tooltipText = fInvoker.getToolTipText(); - if (tooltipText != null) { - this.setToolTipText(tooltipText); - } - final MenuComponentPeer peer = getPeer(); - if (peer instanceof CMenu) { - final CMenu menu = (CMenu)peer; - final long nativeMenu = menu.getNativeMenu(); - fModelPtr = addMenuListeners(this, nativeMenu); + final String tooltipText = fInvoker.getToolTipText(); + if (tooltipText != null) { + setToolTipText(tooltipText); + } + final MenuComponentPeer peer = getPeer(); + if (peer instanceof CMenu) { + final CMenu menu = (CMenu) peer; + final long nativeMenu = menu.getNativeMenu(); + fModelPtr = addMenuListeners(this, nativeMenu); + } } } } + @Override public void removeNotify() { - // Call super so that the NSMenu has been removed, before we release the delegate in removeMenuListeners - super.removeNotify(); - fItems.clear(); - if (fModelPtr != 0) { - removeMenuListeners(fModelPtr); - fModelPtr = 0; - fInvoker.removeContainerListener(this); - fInvoker.removeComponentListener(this); - fInvoker.removePropertyChangeListener(fPropertyListener); + synchronized (getTreeLock()) { + // Call super so that the NSMenu has been removed, before we release + // the delegate in removeMenuListeners + super.removeNotify(); + fItems.clear(); + if (fModelPtr != 0) { + removeMenuListeners(fModelPtr); + fModelPtr = 0; + fInvoker.removeContainerListener(this); + fInvoker.removeComponentListener(this); + fInvoker.removePropertyChangeListener(fPropertyListener); + } } } /** * Invoked when a component has been added to the container. */ + @Override public void componentAdded(final ContainerEvent e) { addItem(e.getChild()); } @@ -287,23 +284,26 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S /** * Invoked when a component has been removed from the container. */ + @Override public void componentRemoved(final ContainerEvent e) { final Component child = e.getChild(); final MenuItem sm = fItems.get(child); if (sm == null) return; - remove(sm); - fItems.remove(sm); - } + remove(sm); + fItems.remove(sm); + } /** * Invoked when the component's size changes. */ + @Override public void componentResized(final ComponentEvent e) {} /** * Invoked when the component's position changes. */ + @Override public void componentMoved(final ComponentEvent e) {} /** @@ -311,6 +311,7 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S * See componentHidden - we should still have a MenuItem * it just isn't inserted */ + @Override public void componentShown(final ComponentEvent e) { setVisible(true); } @@ -321,11 +322,12 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S * so we remove the ScreenMenuItem from the ScreenMenu * but leave it in fItems */ + @Override public void componentHidden(final ComponentEvent e) { setVisible(false); } - public void setVisible(final boolean b) { + private void setVisible(final boolean b) { // Tell our parent to add/remove us final MenuContainer parent = getParent(); @@ -333,20 +335,24 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S if (parent instanceof ScreenMenu) { final ScreenMenu sm = (ScreenMenu)parent; sm.setChildVisible(fInvoker, b); - } + } } } + @Override public void setChildVisible(final JMenuItem child, final boolean b) { fItems.remove(child); updateItems(); } + @Override public void setAccelerator(final KeyStroke ks) {} // only check and radio items can be indeterminate + @Override public void setIndeterminate(boolean indeterminate) { } + @Override public void setToolTipText(final String text) { final MenuComponentPeer peer = getPeer(); if (!(peer instanceof CMenuItem)) return; @@ -355,6 +361,7 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S cmi.setToolTipText(text); } + @Override public void setIcon(final Icon i) { final MenuComponentPeer peer = getPeer(); if (!(peer instanceof CMenuItem)) return; @@ -374,9 +381,8 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S /** * Gets a hashCode for a JMenu or JMenuItem or subclass so that we can compare for * changes in the Menu. - * */ - static int getHashCode(final Component m) { + private static int getHashCode(final Component m) { int hashCode = m.hashCode(); if (m instanceof JMenuItem) { @@ -408,7 +414,7 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S return hashCode; } - void addItem(final Component m) { + private void addItem(final Component m) { if (!m.isVisible()) return; MenuItem sm = fItems.get(m); diff --git a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java index 644eaccc79d..bd922f3e143 100644 --- a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java +++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java @@ -93,9 +93,9 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis } if (fMenuItem instanceof JCheckBoxMenuItem) { - setState(((JCheckBoxMenuItem)fMenuItem).isSelected()); + forceSetState(fMenuItem.isSelected()); } else { - setState(fMenuItem.getModel().isSelected()); + forceSetState(fMenuItem.getModel().isSelected()); } } @@ -196,10 +196,10 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis switch (e.getStateChange()) { case ItemEvent.SELECTED: - setState(true); + forceSetState(true); break; case ItemEvent.DESELECTED: - setState(false); + forceSetState(false); break; } } @@ -210,4 +210,20 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis ((CCheckboxMenuItem)peer).setIsIndeterminate(indeterminate); } } + + /* + * The CCheckboxMenuItem peer is calling setState unconditionally every time user clicks the menu + * However for Swing controls in the screen menu bar it is wrong - the state should be changed only + * in response to the ITEM_STATE_CHANGED event. So the setState is overridden to no-op and all the + * correct state changes are made with forceSetState + */ + + @Override + public synchronized void setState(boolean b) { + // No Op + } + + private void forceSetState(boolean b) { + super.setState(b); + } } diff --git a/jdk/src/macosx/classes/com/apple/laf/resources/aqua_ko.properties b/jdk/src/macosx/classes/com/apple/laf/resources/aqua_ko.properties index 3fbfbe7e76e..82c4ce2f2dc 100644 --- a/jdk/src/macosx/classes/com/apple/laf/resources/aqua_ko.properties +++ b/jdk/src/macosx/classes/com/apple/laf/resources/aqua_ko.properties @@ -46,7 +46,7 @@ FileChooser.saveButton.textAndMnemonic=\uC800\uC7A5 FileChooser.openButton.textAndMnemonic=\uC5F4\uAE30 FileChooser.saveDialogTitle.textAndMnemonic=\uC800\uC7A5 FileChooser.openDialogTitle.textAndMnemonic=\uC5F4\uAE30 -FileChooser.updateButton.textAndMnemonic=\uAC31\uC2E0 +FileChooser.updateButton.textAndMnemonic=\uC5C5\uB370\uC774\uD2B8 FileChooser.helpButton.textAndMnemonic=\uB3C4\uC6C0\uB9D0 FileChooser.directoryOpenButton.textAndMnemonic=\uC5F4\uAE30 diff --git a/jdk/src/macosx/classes/com/apple/resources/MacOSXResourceBundle.java b/jdk/src/macosx/classes/com/apple/resources/MacOSXResourceBundle.java deleted file mode 100644 index 143584b0b87..00000000000 --- a/jdk/src/macosx/classes/com/apple/resources/MacOSXResourceBundle.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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 - * 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.apple.resources; - -import java.security.*; -import java.util.PropertyResourceBundle; -import java.util.ResourceBundle; -import java.io.*; - -public class MacOSXResourceBundle extends PropertyResourceBundle { - MacOSXResourceBundle(InputStream stream) throws IOException { - super(stream); - } - - void setItsParent(ResourceBundle rb) { - setParent(rb); - } - - public static ResourceBundle getMacResourceBundle(String baseJavaBundle) throws Exception { - return getMacResourceBundle(baseJavaBundle, null); - } - - public static ResourceBundle getMacResourceBundle(String baseJavaBundle, String filename) throws Exception { - LoadNativeBundleAction lnba = new LoadNativeBundleAction(baseJavaBundle, filename); - return (ResourceBundle)java.security.AccessController.doPrivileged(lnba); - } -} - -class LoadNativeBundleAction implements PrivilegedExceptionAction { - String mBaseJavaBundle; - String mFilenameOverride; - - LoadNativeBundleAction(String baseJavaBundle, String filenameOverride) { - mBaseJavaBundle = baseJavaBundle; - mFilenameOverride = filenameOverride; - } - - public Object run() { - java.util.ResourceBundle returnValue = null; - MacOSXResourceBundle macOSrb = null; - - // Load the Mac OS X resources. - // Use a base filename if we were given one. Otherwise, we will look for the last piece of the bundle path - // with '.properties' appended. Either way, the native method will take care of the extension. - String filename = mFilenameOverride; - - if (filename == null) { - filename = mBaseJavaBundle.substring(mBaseJavaBundle.lastIndexOf('.') + 1); - } - - File propsFile = null; - String propertyFileName = getPathToBundleFile(filename); - InputStream stream = null; - - try { - propsFile = new File(propertyFileName); - stream = new FileInputStream(propsFile); - stream = new java.io.BufferedInputStream(stream); - macOSrb = new MacOSXResourceBundle(stream); - } catch (Exception e) { - //e.printStackTrace(); - //System.out.println("Failed to create resources from application bundle. Using Java-based resources."); - } finally { - try { - if (stream != null) stream.close(); - stream = null; - } catch (Exception e) { - e.printStackTrace(); - } - } - - returnValue = ResourceBundle.getBundle(mBaseJavaBundle); - - // If we have a platform-specific bundle, make it the parent of the generic bundle, so failures propagate up to the parent. - if (returnValue != null) { - if (macOSrb != null) { - macOSrb.setItsParent(returnValue); - returnValue = macOSrb; - } - } - - return returnValue; - } - - private static native String getPathToBundleFile(String filename); -} - diff --git a/jdk/src/macosx/classes/java/net/DefaultInterface.java b/jdk/src/macosx/classes/java/net/DefaultInterface.java index 638ca3a7648..ba032cf448f 100644 --- a/jdk/src/macosx/classes/java/net/DefaultInterface.java +++ b/jdk/src/macosx/classes/java/net/DefaultInterface.java @@ -26,7 +26,7 @@ package java.net; /** - * Choose a network inteface to be the default for + * Choose a network interface to be the default for * outgoing IPv6 traffic that does not specify a scope_id (and which needs one). * We choose the first interface that is up and is (in order of preference): * 1. neither loopback nor point to point diff --git a/jdk/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java b/jdk/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java index 4ff6a170267..ce63833da81 100644 --- a/jdk/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java +++ b/jdk/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java @@ -122,7 +122,7 @@ class MacOSXPreferencesFile { long user() { return user; } long host() { return host; } - // private contructor - use factory method getFile() instead + // private constructor - use factory method getFile() instead private MacOSXPreferencesFile(String newName, long newUser, long newHost) { appName = newName; diff --git a/jdk/src/macosx/classes/sun/awt/CGraphicsEnvironment.java b/jdk/src/macosx/classes/sun/awt/CGraphicsEnvironment.java index a2319e675f0..a117d99f42c 100644 --- a/jdk/src/macosx/classes/sun/awt/CGraphicsEnvironment.java +++ b/jdk/src/macosx/classes/sun/awt/CGraphicsEnvironment.java @@ -181,6 +181,9 @@ public final class CGraphicsEnvironment extends SunGraphicsEnvironment { initDevices(); d = devices.get(mainDisplayID); + if (d == null) { + throw new AWTError("no screen devices"); + } } return d; } diff --git a/jdk/src/macosx/classes/sun/awt/resources/awtosx.properties b/jdk/src/macosx/classes/sun/awt/resources/awtosx.properties new file mode 100644 index 00000000000..bfc3bd01b3b --- /dev/null +++ b/jdk/src/macosx/classes/sun/awt/resources/awtosx.properties @@ -0,0 +1,71 @@ +# +# OS X specific AWT properties +# + +# Modifier names +AWT.shift=\u21e7 +AWT.control=\u2303 +AWT.alt=\u2325 +AWT.meta=\u2318 +AWT.altGraph=\u2325 + +# Key names +AWT.enter=\u23ce +AWT.backSpace=\u232b +AWT.tab=\u21e5 +AWT.cancel=\u238b +AWT.clear=\u2327 +AWT.capsLock=\u21ea +AWT.escape=\u238b +AWT.space=\u2423 +AWT.pgup=\u21de +AWT.pgdn=\u21df +AWT.end=\u2198 +AWT.home=\u2196 +AWT.left=\u2190 +AWT.up=\u2191 +AWT.right=\u2192 +AWT.down=\u2193 +AWT.comma=, +AWT.period=. +AWT.slash=/ +AWT.semicolon=; +AWT.equals=\u003d +AWT.openBracket=[ +AWT.backSlash=\\ +AWT.closeBracket=] +AWT.multiply=\u2328 * +AWT.add=\u2328 + +AWT.separator=\u2328 , +AWT.separater=\u2328 , +AWT.subtract=\u2328 - +AWT.decimal=\u2328 . +AWT.divide=\u2328 / +AWT.delete=\u2326 +AWT.printScreen=\u2399 +AWT.backQuote=` +AWT.quote=' +AWT.ampersand=& +AWT.asterisk=* +AWT.quoteDbl=" +AWT.Less=< +AWT.greater=> +AWT.braceLeft=[ +AWT.braceRight=] +AWT.at=@ +AWT.colon=: +AWT.circumflex=^ +AWT.dollar=$ +AWT.euro=\u20ac +AWT.exclamationMark=! +AWT.invertedExclamationMark=\u00a1 +AWT.leftParenthesis=( +AWT.numberSign=# +AWT.plus=+ +AWT.minus=- +AWT.rightParenthesis=) +AWT.underscore=_ + +# Numeric Keypad +AWT.numpad=\u2328 + diff --git a/jdk/src/macosx/classes/sun/font/CFontManager.java b/jdk/src/macosx/classes/sun/font/CFontManager.java index a37fd81c0c4..e3e216e7a33 100644 --- a/jdk/src/macosx/classes/sun/font/CFontManager.java +++ b/jdk/src/macosx/classes/sun/font/CFontManager.java @@ -342,7 +342,7 @@ public class CFontManager extends SunFontManager { @Override public String getFontPath(boolean noType1Fonts) { - // In the case of the Cocoa toolkit, since we go through NSFont, we dont need to register /Library/Fonts + // In the case of the Cocoa toolkit, since we go through NSFont, we don't need to register /Library/Fonts Toolkit tk = Toolkit.getDefaultToolkit(); if (tk instanceof HeadlessToolkit) { tk = ((HeadlessToolkit)tk).getUnderlyingToolkit(); diff --git a/jdk/src/macosx/classes/sun/lwawt/LWButtonPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWButtonPeer.java index e5f8838c8cd..f4b46c7639a 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWButtonPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWButtonPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,10 @@ import java.awt.peer.ButtonPeer; import javax.swing.JButton; +/** + * Lightweight implementation of {@link ButtonPeer}. Delegates most of the work + * to the {@link JButton}. + */ final class LWButtonPeer extends LWComponentPeer implements ButtonPeer, ActionListener { @@ -42,7 +46,7 @@ final class LWButtonPeer extends LWComponentPeer } @Override - protected JButton createDelegate() { + JButton createDelegate() { return new JButtonDelegate(); } @@ -74,6 +78,7 @@ final class LWButtonPeer extends LWComponentPeer return true; } + @SuppressWarnings("serial")// Safe: outer class is non-serializable. private final class JButtonDelegate extends JButton { // Empty non private constructor was added because access to this diff --git a/jdk/src/macosx/classes/sun/lwawt/LWCanvasPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWCanvasPeer.java index 0c80ff0af0d..c7559c216c6 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWCanvasPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWCanvasPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,10 @@ import java.awt.peer.CanvasPeer; import javax.swing.JComponent; +/** + * Lightweight implementation of {@link CanvasPeer}. This peer is empty, because + * all the components in lwawt use graphic object from the top level window. + */ class LWCanvasPeer extends LWComponentPeer implements CanvasPeer { diff --git a/jdk/src/macosx/classes/sun/lwawt/LWCheckboxPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWCheckboxPeer.java index de1c378b860..c3b91a2fa86 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWCheckboxPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWCheckboxPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,6 +41,11 @@ import javax.swing.JRadioButton; import javax.swing.JToggleButton; import javax.swing.SwingUtilities; +/** + * Lightweight implementation of {@link CheckboxPeer}. Delegates most of the + * work to the {@link JCheckBox} and {@link JRadioButton}, which are placed + * inside an empty {@link JComponent}. + */ final class LWCheckboxPeer extends LWComponentPeer implements CheckboxPeer, ItemListener { @@ -51,12 +56,12 @@ final class LWCheckboxPeer } @Override - protected CheckboxDelegate createDelegate() { + CheckboxDelegate createDelegate() { return new CheckboxDelegate(); } @Override - protected Component getDelegateFocusOwner() { + Component getDelegateFocusOwner() { return getDelegate().getCurrentButton(); } @@ -137,6 +142,7 @@ final class LWCheckboxPeer return true; } + @SuppressWarnings("serial")// Safe: outer class is non-serializable. final class CheckboxDelegate extends JComponent { private final JCheckBox cb; diff --git a/jdk/src/macosx/classes/sun/lwawt/LWChoicePeer.java b/jdk/src/macosx/classes/sun/lwawt/LWChoicePeer.java index dc781d3d682..5b78e74b6a2 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWChoicePeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWChoicePeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,14 +26,18 @@ package sun.lwawt; -import java.awt.Choice; -import java.awt.Point; +import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.peer.ChoicePeer; -import javax.swing.JComboBox; +import javax.accessibility.Accessible; +import javax.swing.*; +/** + * Lightweight implementation of {@link ChoicePeer}. Delegates most of the work + * to the {@link JComboBox}. + */ final class LWChoicePeer extends LWComponentPeer> implements ChoicePeer, ItemListener { @@ -50,7 +54,7 @@ final class LWChoicePeer extends LWComponentPeer> } @Override - protected JComboBox createDelegate() { + JComboBox createDelegate() { return new JComboBoxDelegate(); } @@ -128,6 +132,7 @@ final class LWChoicePeer extends LWComponentPeer> return true; } + @SuppressWarnings("serial")// Safe: outer class is non-serializable. private final class JComboBoxDelegate extends JComboBox { // Empty non private constructor was added because access to this @@ -159,5 +164,32 @@ final class LWChoicePeer extends LWComponentPeer> } super.setSelectedItem(anObject); } + + @Override + public void firePopupMenuWillBecomeVisible() { + super.firePopupMenuWillBecomeVisible(); + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + JPopupMenu popupMenu = getPopupMenu(); + if (popupMenu != null) { + if (popupMenu.getInvoker() != LWChoicePeer.this.getTarget()) { + popupMenu.setVisible(false); + popupMenu.show(LWChoicePeer.this.getTarget(), 0, 0); + } + } + } + }); + } + + private JPopupMenu getPopupMenu() { + for (int i = 0; i < getAccessibleContext().getAccessibleChildrenCount(); i++) { + Accessible child = getAccessibleContext().getAccessibleChild(i); + if (child instanceof JPopupMenu) { + return (JPopupMenu) child; + } + } + return null; + } } } diff --git a/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java index 05d1d5d1fad..0ab1d1e9ad2 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -72,19 +72,23 @@ public abstract class LWComponentPeer { private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.lwawt.focus.LWComponentPeer"); - // State lock is to be used for modifications to this - // peer's fields (e.g. bounds, background, font, etc.) - // It should be the last lock in the lock chain - private final Object stateLock = - new StringBuilder("LWComponentPeer.stateLock"); + /** + * State lock is to be used for modifications to this peer's fields (e.g. + * bounds, background, font, etc.) It should be the last lock in the lock + * chain + */ + private final Object stateLock = new Object(); - // The lock to operate with the peers hierarchy. AWT tree - // lock is not used as there are many peers related ops - // to be done on the toolkit thread, and we don't want to - // depend on a public lock on this thread - private static final Object peerTreeLock = - new StringBuilder("LWComponentPeer.peerTreeLock"); + /** + * The lock to operate with the peers hierarchy. AWT tree lock is not used + * as there are many peers related ops to be done on the toolkit thread, and + * we don't want to depend on a public lock on this thread + */ + private static final Object peerTreeLock = new Object(); + /** + * The associated AWT object. + */ private final T target; /** @@ -95,7 +99,7 @@ public abstract class LWComponentPeer * the hierarchy. The exception is LWWindowPeers: their containers are * always null */ - private final LWContainerPeer containerPeer; + private final LWContainerPeer containerPeer; /** * Handy reference to the top-level window peer. Window peer is borrowed @@ -147,11 +151,18 @@ public abstract class LWComponentPeer */ private Image backBuffer; + /** + * All Swing delegates use delegateContainer as a parent. This container + * intentionally do not use parent of the peer. + */ + @SuppressWarnings("serial")// Safe: outer class is non-serializable. private final class DelegateContainer extends Container { { enableEvents(0xFFFFFFFF); } + // Empty non private constructor was added because access to this + // class shouldn't be emulated by a synthetic accessor method. DelegateContainer() { super(); } @@ -182,7 +193,7 @@ public abstract class LWComponentPeer } } - public LWComponentPeer(T target, PlatformComponent platformComponent) { + LWComponentPeer(final T target, final PlatformComponent platformComponent) { targetPaintArea = new LWRepaintArea(); this.target = target; this.platformComponent = platformComponent; @@ -276,15 +287,18 @@ public abstract class LWComponentPeer * This method is called under getDelegateLock(). * Overridden in subclasses. */ - protected D createDelegate() { + D createDelegate() { return null; } - protected final D getDelegate() { + final D getDelegate() { return delegate; } - protected Component getDelegateFocusOwner() { + /** + * This method should be called under getDelegateLock(). + */ + Component getDelegateFocusOwner() { return getDelegate(); } @@ -356,7 +370,7 @@ public abstract class LWComponentPeer } // Just a helper method - protected final LWContainerPeer getContainerPeer() { + protected final LWContainerPeer getContainerPeer() { return containerPeer; } @@ -371,11 +385,6 @@ public abstract class LWComponentPeer // ---- PEER METHODS ---- // - @Override - public Toolkit getToolkit() { - return LWToolkit.getLWToolkit(); - } - // Just a helper method public LWToolkit getLWToolkit() { return LWToolkit.getLWToolkit(); @@ -390,7 +399,7 @@ public abstract class LWComponentPeer protected void disposeImpl() { destroyBuffers(); - LWContainerPeer cp = getContainerPeer(); + LWContainerPeer cp = getContainerPeer(); if (cp != null) { cp.removeChildPeer(this); } @@ -462,12 +471,13 @@ public abstract class LWComponentPeer sg2d.constrain(size.x, size.y, size.width, size.height, getVisibleRegion()); } - public Region getVisibleRegion() { + Region getVisibleRegion() { return computeVisibleRect(this, getRegion()); } - static final Region computeVisibleRect(LWComponentPeer c, Region region) { - final LWContainerPeer p = c.getContainerPeer(); + static final Region computeVisibleRect(final LWComponentPeer c, + Region region) { + final LWContainerPeer p = c.getContainerPeer(); if (p != null) { final Rectangle r = c.getBounds(); region = region.getTranslatedRegion(r.x, r.y); @@ -612,7 +622,7 @@ public abstract class LWComponentPeer * @param p Point relative to the peer. * @return Cursor of the peer or null if default cursor should be used. */ - protected Cursor getCursor(final Point p) { + Cursor getCursor(final Point p) { return getTarget().getCursor(); } @@ -717,7 +727,7 @@ public abstract class LWComponentPeer @Override public void setEnabled(final boolean e) { boolean status = e; - final LWComponentPeer cp = getContainerPeer(); + final LWComponentPeer cp = getContainerPeer(); if (cp != null) { status &= cp.isEnabled(); } @@ -802,12 +812,12 @@ public abstract class LWComponentPeer } @Override - public void setZOrder(ComponentPeer above) { - LWContainerPeer cp = getContainerPeer(); + public void setZOrder(final ComponentPeer above) { + LWContainerPeer cp = getContainerPeer(); // Don't check containerPeer for null as it can only happen // for windows, but this method is overridden in // LWWindowPeer and doesn't call super() - cp.setChildPeerZOrder(this, (LWComponentPeer) above); + cp.setChildPeerZOrder(this, (LWComponentPeer) above); } @Override @@ -923,7 +933,9 @@ public abstract class LWComponentPeer LWKeyboardFocusManagerPeer.removeLastFocusRequest(getTarget()); return false; } - LWWindowPeer parentPeer = (LWWindowPeer) parentWindow.getPeer(); + final LWWindowPeer parentPeer = + (LWWindowPeer) AWTAccessor.getComponentAccessor() + .getPeer(parentWindow); if (parentPeer == null) { focusLog.fine("request rejected, parentPeer is null"); LWKeyboardFocusManagerPeer.removeLastFocusRequest(getTarget()); @@ -993,13 +1005,13 @@ public abstract class LWComponentPeer @Override public boolean prepareImage(Image img, int w, int h, ImageObserver o) { // TODO: is it a right/complete implementation? - return getToolkit().prepareImage(img, w, h, o); + return Toolkit.getDefaultToolkit().prepareImage(img, w, h, o); } @Override public int checkImage(Image img, int w, int h, ImageObserver o) { // TODO: is it a right/complete implementation? - return getToolkit().checkImage(img, w, h, o); + return Toolkit.getDefaultToolkit().checkImage(img, w, h, o); } @Override @@ -1138,7 +1150,7 @@ public abstract class LWComponentPeer } protected final void repaintParent(final Rectangle oldB) { - final LWContainerPeer cp = getContainerPeer(); + final LWContainerPeer cp = getContainerPeer(); if (cp != null) { // Repaint unobscured part of the parent cp.repaintPeer(cp.getContentSize().intersection(oldB)); @@ -1254,6 +1266,8 @@ public abstract class LWComponentPeer KeyEvent ke = (KeyEvent) e; delegateEvent = new KeyEvent(getDelegateFocusOwner(), ke.getID(), ke.getWhen(), ke.getModifiers(), ke.getKeyCode(), ke.getKeyChar(), ke.getKeyLocation()); + AWTAccessor.getKeyEventAccessor().setExtendedKeyCode((KeyEvent) delegateEvent, + ke.getExtendedKeyCode()); } else if (e instanceof FocusEvent) { FocusEvent fe = (FocusEvent) e; delegateEvent = new FocusEvent(getDelegateFocusOwner(), fe.getID(), fe.isTemporary()); @@ -1273,7 +1287,7 @@ public abstract class LWComponentPeer /** * Handler for FocusEvents. */ - protected void handleJavaFocusEvent(FocusEvent e) { + void handleJavaFocusEvent(final FocusEvent e) { // Note that the peer receives all the FocusEvents from // its lightweight children as well KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance(); @@ -1309,7 +1323,7 @@ public abstract class LWComponentPeer * Finds a top-most visible component for the given point. The location is * specified relative to the peer's parent. */ - public LWComponentPeer findPeerAt(final int x, final int y) { + LWComponentPeer findPeerAt(final int x, final int y) { final Rectangle r = getBounds(); final Region sh = getRegion(); final boolean found = isVisible() && sh.contains(x - r.x, y - r.y); @@ -1326,7 +1340,7 @@ public abstract class LWComponentPeer } public Point windowToLocal(Point p, LWWindowPeer wp) { - LWComponentPeer cp = this; + LWComponentPeer cp = this; while (cp != wp) { Rectangle cpb = cp.getBounds(); p.x -= cpb.x; @@ -1347,7 +1361,7 @@ public abstract class LWComponentPeer } public Point localToWindow(Point p) { - LWComponentPeer cp = getContainerPeer(); + LWComponentPeer cp = getContainerPeer(); Rectangle r = getBounds(); while (cp != null) { p.x += r.x; @@ -1368,7 +1382,7 @@ public abstract class LWComponentPeer repaintPeer(getSize()); } - public void repaintPeer(final Rectangle r) { + void repaintPeer(final Rectangle r) { final Rectangle toPaint = getSize().intersection(r); if (!isShowing() || toPaint.isEmpty()) { return; @@ -1387,7 +1401,7 @@ public abstract class LWComponentPeer protected final boolean isShowing() { synchronized (getPeerTreeLock()) { if (isVisible()) { - final LWContainerPeer container = getContainerPeer(); + final LWContainerPeer container = getContainerPeer(); return (container == null) || container.isShowing(); } } @@ -1395,8 +1409,7 @@ public abstract class LWComponentPeer } /** - * Paints the peer. Overridden in subclasses to delegate the actual painting - * to Swing components. + * Paints the peer. Delegate the actual painting to Swing components. */ protected final void paintPeer(final Graphics g) { final D delegate = getDelegate(); diff --git a/jdk/src/macosx/classes/sun/lwawt/LWContainerPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWContainerPeer.java index c213664b8ce..3069d3c2a3b 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWContainerPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWContainerPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,32 +41,25 @@ import java.util.List; import javax.swing.JComponent; abstract class LWContainerPeer - extends LWCanvasPeer - implements ContainerPeer -{ - // List of child peers sorted by z-order from bottom-most - // to top-most - private List childPeers = - new LinkedList(); + extends LWCanvasPeer implements ContainerPeer { - LWContainerPeer(T target, PlatformComponent platformComponent) { + /** + * List of child peers sorted by z-order from bottom-most to top-most. + */ + private final List> childPeers = new LinkedList<>(); + + LWContainerPeer(final T target, final PlatformComponent platformComponent) { super(target, platformComponent); } - void addChildPeer(LWComponentPeer child) { + final void addChildPeer(final LWComponentPeer child) { synchronized (getPeerTreeLock()) { - addChildPeer(child, childPeers.size()); + childPeers.add(childPeers.size(), child); + // TODO: repaint } } - void addChildPeer(LWComponentPeer child, int index) { - synchronized (getPeerTreeLock()) { - childPeers.add(index, child); - } - // TODO: repaint - } - - void removeChildPeer(LWComponentPeer child) { + final void removeChildPeer(final LWComponentPeer child) { synchronized (getPeerTreeLock()) { childPeers.remove(child); } @@ -74,7 +67,8 @@ abstract class LWContainerPeer } // Used by LWComponentPeer.setZOrder() - void setChildPeerZOrder(LWComponentPeer peer, LWComponentPeer above) { + final void setChildPeerZOrder(final LWComponentPeer peer, + final LWComponentPeer above) { synchronized (getPeerTreeLock()) { childPeers.remove(peer); int index = (above != null) ? childPeers.indexOf(above) : childPeers.size(); @@ -98,25 +92,27 @@ abstract class LWContainerPeer } @Override - public void beginValidate() { - // TODO: it seems that begin/endValidate() is only useful - // for heavyweight windows, when a batch movement for - // child windows occurs. That's why no-op - } - @Override - public void endValidate() { + public final void beginValidate() { // TODO: it seems that begin/endValidate() is only useful // for heavyweight windows, when a batch movement for // child windows occurs. That's why no-op } @Override - public void beginLayout() { + public final void endValidate() { + // TODO: it seems that begin/endValidate() is only useful + // for heavyweight windows, when a batch movement for + // child windows occurs. That's why no-op + } + + @Override + public final void beginLayout() { // Skip all painting till endLayout() setLayouting(true); } + @Override - public void endLayout() { + public final void endLayout() { setLayouting(false); // Post an empty event to flush all the pending target paints @@ -125,18 +121,19 @@ abstract class LWContainerPeer // ---- PEER NOTIFICATIONS ---- // - /* + /** * Returns a copy of the childPeer collection. */ - protected List getChildren() { + @SuppressWarnings("unchecked") + final List> getChildren() { synchronized (getPeerTreeLock()) { - Object copy = ((LinkedList)childPeers).clone(); - return (List)copy; + Object copy = ((LinkedList) childPeers).clone(); + return (List>) copy; } } @Override - public final Region getVisibleRegion() { + final Region getVisibleRegion() { return cutChildren(super.getVisibleRegion(), null); } @@ -144,9 +141,9 @@ abstract class LWContainerPeer * Removes bounds of children above specific child from the region. If above * is null removes all bounds of children. */ - protected final Region cutChildren(Region r, final LWComponentPeer above) { + final Region cutChildren(Region r, final LWComponentPeer above) { boolean aboveFound = above == null; - for (final LWComponentPeer child : getChildren()) { + for (final LWComponentPeer child : getChildren()) { if (!aboveFound && child == above) { aboveFound = true; continue; @@ -170,8 +167,8 @@ abstract class LWContainerPeer * specified relative to the peer's parent. */ @Override - public final LWComponentPeer findPeerAt(int x, int y) { - LWComponentPeer peer = super.findPeerAt(x, y); + final LWComponentPeer findPeerAt(int x, int y) { + LWComponentPeer peer = super.findPeerAt(x, y); final Rectangle r = getBounds(); // Translate to this container's coordinates to pass to children x -= r.x; @@ -179,7 +176,7 @@ abstract class LWContainerPeer if (peer != null && getContentSize().contains(x, y)) { synchronized (getPeerTreeLock()) { for (int i = childPeers.size() - 1; i >= 0; --i) { - LWComponentPeer p = childPeers.get(i).findPeerAt(x, y); + LWComponentPeer p = childPeers.get(i).findPeerAt(x, y); if (p != null) { peer = p; break; @@ -195,7 +192,7 @@ abstract class LWContainerPeer * peers should be repainted */ @Override - public final void repaintPeer(final Rectangle r) { + final void repaintPeer(final Rectangle r) { final Rectangle toPaint = getSize().intersection(r); if (!isShowing() || toPaint.isEmpty()) { return; @@ -208,13 +205,13 @@ abstract class LWContainerPeer repaintChildren(toPaint); } - /* - * Paints all the child peers in the straight z-order, so the - * bottom-most ones are painted first. - */ + /** + * Paints all the child peers in the straight z-order, so the + * bottom-most ones are painted first. + */ private void repaintChildren(final Rectangle r) { final Rectangle content = getContentSize(); - for (final LWComponentPeer child : getChildren()) { + for (final LWComponentPeer child : getChildren()) { final Rectangle childBounds = child.getBounds(); Rectangle toPaint = r.intersection(childBounds); toPaint = toPaint.intersection(content); @@ -223,21 +220,21 @@ abstract class LWContainerPeer } } - protected Rectangle getContentSize() { + Rectangle getContentSize() { return getSize(); } @Override public void setEnabled(final boolean e) { super.setEnabled(e); - for (final LWComponentPeer child : getChildren()) { + for (final LWComponentPeer child : getChildren()) { child.setEnabled(e && child.getTarget().isEnabled()); } } @Override public void setBackground(final Color c) { - for (final LWComponentPeer child : getChildren()) { + for (final LWComponentPeer child : getChildren()) { if (!child.getTarget().isBackgroundSet()) { child.setBackground(c); } @@ -247,7 +244,7 @@ abstract class LWContainerPeer @Override public void setForeground(final Color c) { - for (final LWComponentPeer child : getChildren()) { + for (final LWComponentPeer child : getChildren()) { if (!child.getTarget().isForegroundSet()) { child.setForeground(c); } @@ -257,7 +254,7 @@ abstract class LWContainerPeer @Override public void setFont(final Font f) { - for (final LWComponentPeer child : getChildren()) { + for (final LWComponentPeer child : getChildren()) { if (!child.getTarget().isFontSet()) { child.setFont(f); } diff --git a/jdk/src/macosx/classes/sun/lwawt/LWCursorManager.java b/jdk/src/macosx/classes/sun/lwawt/LWCursorManager.java index de1b537856a..e17cced7021 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWCursorManager.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWCursorManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ import java.awt.Point; import java.util.concurrent.atomic.AtomicBoolean; +import sun.awt.AWTAccessor; import sun.awt.SunToolkit; public abstract class LWCursorManager { @@ -105,11 +106,13 @@ public abstract class LWCursorManager { c = peer.getTarget(); if (c instanceof Container) { final Point p = peer.getLocationOnScreen(); - c = ((Container) c).findComponentAt(cursorPos.x - p.x, - cursorPos.y - p.y); + c = AWTAccessor.getContainerAccessor().findComponentAt( + (Container) c, cursorPos.x - p.x, cursorPos.y - p.y, false); + } while (c != null) { - if (c.isVisible() && c.isEnabled() && (c.getPeer() != null)) { + final Object p = AWTAccessor.getComponentAccessor().getPeer(c); + if (c.isVisible() && c.isEnabled() && p != null) { break; } c = c.getParent(); diff --git a/jdk/src/macosx/classes/sun/lwawt/LWLabelPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWLabelPeer.java index 19743da74a3..68af14af333 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWLabelPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWLabelPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ final class LWLabelPeer extends LWComponentPeer } @Override - protected JLabel createDelegate() { + JLabel createDelegate() { return new JLabel(); } diff --git a/jdk/src/macosx/classes/sun/lwawt/LWLightweightFramePeer.java b/jdk/src/macosx/classes/sun/lwawt/LWLightweightFramePeer.java index 90e2e88c441..624be6bfc10 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWLightweightFramePeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWLightweightFramePeer.java @@ -34,6 +34,8 @@ import java.awt.dnd.DropTarget; import sun.awt.CausedFocusEvent; import sun.awt.LightweightFrame; +import sun.swing.JLightweightFrame; +import sun.swing.SwingAccessor; public class LWLightweightFramePeer extends LWWindowPeer { @@ -90,11 +92,6 @@ public class LWLightweightFramePeer extends LWWindowPeer { setBounds(x, y, w, h, op, true, false); } - @Override - public void updateCursorImmediately() { - // TODO: tries to switch to the awt/fx toolkit thread and causes a deadlock on macosx - } - @Override public void addDropTarget(DropTarget dt) { } @@ -112,4 +109,9 @@ public class LWLightweightFramePeer extends LWWindowPeer { public void ungrab() { getLwTarget().ungrabFocus(); } + + @Override + public void updateCursorImmediately() { + SwingAccessor.getJLightweightFrameAccessor().updateCursor((JLightweightFrame)getLwTarget()); + } } diff --git a/jdk/src/macosx/classes/sun/lwawt/LWListPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWListPeer.java index 5edb8e16cd0..e6e1ec38c3d 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWListPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWListPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,8 @@ import java.awt.peer.ListPeer; import java.util.Arrays; /** - * Lightweight implementation of {@link ListPeer}. + * Lightweight implementation of {@link ListPeer}. Delegates most of the work to + * the {@link JList}, which is placed inside {@link JScrollPane}. */ final class LWListPeer extends LWComponentPeer implements ListPeer { @@ -56,7 +57,7 @@ final class LWListPeer extends LWComponentPeer } @Override - protected ScrollableJList createDelegate() { + ScrollableJList createDelegate() { return new ScrollableJList(); } @@ -78,7 +79,7 @@ final class LWListPeer extends LWComponentPeer } @Override - protected Component getDelegateFocusOwner() { + Component getDelegateFocusOwner() { return getDelegate().getView(); } @@ -193,6 +194,7 @@ final class LWListPeer extends LWComponentPeer } } + @SuppressWarnings("serial")// Safe: outer class is non-serializable. final class ScrollableJList extends JScrollPane implements ListSelectionListener { private boolean skipStateChangedEvent; @@ -234,9 +236,10 @@ final class LWListPeer extends LWComponentPeer } @Override + @SuppressWarnings("unchecked") public void valueChanged(final ListSelectionEvent e) { if (!e.getValueIsAdjusting() && !isSkipStateChangedEvent()) { - final JList source = (JList) e.getSource(); + final JList source = (JList) e.getSource(); for(int i = 0 ; i < source.getModel().getSize(); i++) { final boolean wasSelected = Arrays.binarySearch(oldSelectedIndices, i) >= 0; @@ -255,6 +258,7 @@ final class LWListPeer extends LWComponentPeer } } + @SuppressWarnings("unchecked") public JList getView() { return (JList) getViewport().getView(); } @@ -289,7 +293,7 @@ final class LWListPeer extends LWComponentPeer private final class JListDelegate extends JList { JListDelegate() { - super(ScrollableJList.this.model); + super(model); } @Override diff --git a/jdk/src/macosx/classes/sun/lwawt/LWMouseInfoPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWMouseInfoPeer.java index 2cce1b17269..1920a73d3b0 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWMouseInfoPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWMouseInfoPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,10 +30,9 @@ import java.awt.Window; import java.awt.peer.MouseInfoPeer; -public class LWMouseInfoPeer implements MouseInfoPeer { +import sun.awt.AWTAccessor; - public LWMouseInfoPeer() { - } +public class LWMouseInfoPeer implements MouseInfoPeer { @Override public int fillPointWithCoords(Point point) { @@ -52,7 +51,7 @@ public class LWMouseInfoPeer implements MouseInfoPeer { return false; } - LWWindowPeer windowPeer = (LWWindowPeer)w.getPeer(); + final Object windowPeer = AWTAccessor.getComponentAccessor().getPeer(w); return LWWindowPeer.getWindowUnderCursor() == windowPeer; } diff --git a/jdk/src/macosx/classes/sun/lwawt/LWPanelPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWPanelPeer.java index 6b1f48b08ad..ef1e93e8b11 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWPanelPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWPanelPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,10 @@ import java.awt.peer.PanelPeer; import javax.swing.JPanel; +/** + * Lightweight implementation of {@link PanelPeer}. Delegates most of the work + * to the {@link JPanel}. + */ final class LWPanelPeer extends LWContainerPeer implements PanelPeer { @@ -39,7 +43,7 @@ final class LWPanelPeer extends LWContainerPeer } @Override - public JPanel createDelegate() { + JPanel createDelegate() { return new JPanel(); } } diff --git a/jdk/src/macosx/classes/sun/lwawt/LWRepaintArea.java b/jdk/src/macosx/classes/sun/lwawt/LWRepaintArea.java index e67b2fa435e..7b7c7e8b67d 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWRepaintArea.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWRepaintArea.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,39 +26,38 @@ package sun.lwawt; -import sun.awt.RepaintArea; - import java.awt.Component; import java.awt.Graphics; +import sun.awt.AWTAccessor; +import sun.awt.RepaintArea; + /** + * Emulates appearance of heavyweight components before call of the user code. + * * @author Sergey Bylokhov */ final class LWRepaintArea extends RepaintArea { @Override protected void updateComponent(final Component comp, final Graphics g) { + // We shouldn't paint native component as a result of UPDATE events, + // just flush onscreen back-buffer. if (comp != null) { super.updateComponent(comp, g); - flushBuffers((LWComponentPeer) comp.getPeer()); + LWComponentPeer.flushOnscreenGraphics(); } } @Override protected void paintComponent(final Component comp, final Graphics g) { if (comp != null) { - final LWComponentPeer peer = (LWComponentPeer) comp.getPeer(); + Object peer = AWTAccessor.getComponentAccessor().getPeer(comp); if (peer != null) { - peer.paintPeer(g); + ((LWComponentPeer) peer).paintPeer(g); } super.paintComponent(comp, g); - flushBuffers(peer); - } - } - - private static void flushBuffers(final LWComponentPeer peer) { - if (peer != null) { - peer.flushOnscreenGraphics(); + LWComponentPeer.flushOnscreenGraphics(); } } } diff --git a/jdk/src/macosx/classes/sun/lwawt/LWScrollBarPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWScrollBarPeer.java index f5cb0d576e6..6fce0d58461 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWScrollBarPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWScrollBarPeer.java @@ -34,10 +34,14 @@ import java.awt.peer.ScrollbarPeer; import javax.swing.JScrollBar; +/** + * Lightweight implementation of {@link ScrollbarPeer}. Delegates most of the + * work to the {@link JScrollBar}. + */ final class LWScrollBarPeer extends LWComponentPeer implements ScrollbarPeer, AdjustmentListener { - //JScrollBar fires two changes with firePropertyChange (one for old value + // JScrollBar fires two changes with firePropertyChange (one for old value // and one for new one. // We save the last value and don't fire event if not changed. private int currentValue; @@ -48,7 +52,7 @@ final class LWScrollBarPeer extends LWComponentPeer } @Override - protected JScrollBar createDelegate() { + JScrollBar createDelegate() { return new JScrollBar(); } diff --git a/jdk/src/macosx/classes/sun/lwawt/LWScrollPanePeer.java b/jdk/src/macosx/classes/sun/lwawt/LWScrollPanePeer.java index 723a9dd8da7..4db7cac124a 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWScrollPanePeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWScrollPanePeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,10 @@ import java.awt.event.MouseWheelEvent; import java.awt.peer.ScrollPanePeer; import java.util.List; +/** + * Lightweight implementation of {@link ScrollPanePeer}. Delegates most of the + * work to the {@link JScrollPane}. + */ final class LWScrollPanePeer extends LWContainerPeer implements ScrollPanePeer, ChangeListener { @@ -41,7 +45,8 @@ final class LWScrollPanePeer extends LWContainerPeer super(target, platformComponent); } - protected JScrollPane createDelegate() { + @Override + JScrollPane createDelegate() { final JScrollPane sp = new JScrollPane(); final JPanel panel = new JPanel(); panel.setOpaque(false); @@ -72,7 +77,7 @@ final class LWScrollPanePeer extends LWContainerPeer SwingUtilities.invokeLater(new Runnable() { @Override public void run() { - final LWComponentPeer viewPeer = getViewPeer(); + final LWComponentPeer viewPeer = getViewPeer(); if (viewPeer != null) { final Rectangle r; synchronized (getDelegateLock()) { @@ -96,14 +101,13 @@ final class LWScrollPanePeer extends LWContainerPeer } } - LWComponentPeer getViewPeer() { - List peerList = getChildren(); + LWComponentPeer getViewPeer() { + final List> peerList = getChildren(); return peerList.isEmpty() ? null : peerList.get(0); } - @Override - protected Rectangle getContentSize() { + Rectangle getContentSize() { Rectangle viewRect = getDelegate().getViewport().getViewRect(); return new Rectangle(viewRect.width, viewRect.height); } @@ -112,7 +116,7 @@ final class LWScrollPanePeer extends LWContainerPeer public void layout() { super.layout(); synchronized (getDelegateLock()) { - LWComponentPeer viewPeer = getViewPeer(); + final LWComponentPeer viewPeer = getViewPeer(); if (viewPeer != null) { Component view = getDelegate().getViewport().getView(); view.setBounds(viewPeer.getBounds()); diff --git a/jdk/src/macosx/classes/sun/lwawt/LWTextAreaPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWTextAreaPeer.java index 98032e20c29..5db1b6ca296 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWTextAreaPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWTextAreaPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ import javax.swing.text.JTextComponent; /** * Lightweight implementation of {@link TextAreaPeer}. Delegates most of the - * work to the {@link JTextArea} inside JScrollPane. + * work to the {@link JTextArea} inside {@link JScrollPane}. */ final class LWTextAreaPeer extends LWTextComponentPeer @@ -66,7 +66,7 @@ final class LWTextAreaPeer } @Override - protected ScrollableJTextArea createDelegate() { + ScrollableJTextArea createDelegate() { return new ScrollableJTextArea(); } @@ -85,7 +85,7 @@ final class LWTextAreaPeer } @Override - protected Cursor getCursor(final Point p) { + Cursor getCursor(final Point p) { final boolean isContains; synchronized (getDelegateLock()) { isContains = getDelegate().getViewport().getBounds().contains(p); @@ -94,7 +94,7 @@ final class LWTextAreaPeer } @Override - protected Component getDelegateFocusOwner() { + Component getDelegateFocusOwner() { return getTextComponent(); } @@ -200,7 +200,7 @@ final class LWTextAreaPeer } } - @SuppressWarnings("serial") + @SuppressWarnings("serial")// Safe: outer class is non-serializable. final class ScrollableJTextArea extends JScrollPane { ScrollableJTextArea() { @@ -218,7 +218,6 @@ final class LWTextAreaPeer super.setEnabled(enabled); } - @SuppressWarnings("serial") private final class JTextAreaDelegate extends JTextArea { // Empty non private constructor was added because access to this diff --git a/jdk/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java index aab0baf43e0..d1df8e7abd1 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,11 +44,14 @@ import javax.swing.event.DocumentListener; import javax.swing.text.Document; import javax.swing.text.JTextComponent; +/** + * Lightweight implementation of {@link TextComponentPeer}. Provides useful + * methods for {@link LWTextAreaPeer} and {@link LWTextFieldPeer} + */ abstract class LWTextComponentPeer extends LWComponentPeer implements DocumentListener, TextComponentPeer, InputMethodListener { - private volatile boolean firstChangeSkipped; LWTextComponentPeer(final T target, @@ -68,13 +71,14 @@ abstract class LWTextComponentPeer start) { + // Should be called after setText() and setCaretPosition() select(start, end); } - setCaretPosition(getTarget().getCaretPosition()); firstChangeSkipped = true; } @@ -119,7 +123,7 @@ abstract class LWTextComponentPeer implements TextFieldPeer, ActionListener { @@ -47,7 +51,7 @@ final class LWTextFieldPeer } @Override - protected JPasswordField createDelegate() { + JPasswordField createDelegate() { return new JPasswordFieldDelegate(); } @@ -107,7 +111,7 @@ final class LWTextFieldPeer * @param e the focus event */ @Override - protected void handleJavaFocusEvent(final FocusEvent e) { + void handleJavaFocusEvent(final FocusEvent e) { if (e.getID() == FocusEvent.FOCUS_LOST) { // In order to de-select the selection setCaretPosition(0); @@ -115,6 +119,7 @@ final class LWTextFieldPeer super.handleJavaFocusEvent(e); } + @SuppressWarnings("serial")// Safe: outer class is non-serializable. private final class JPasswordFieldDelegate extends JPasswordField { // Empty non private constructor was added because access to this diff --git a/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java b/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java index 9765066d9d2..f98dffbf3f1 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java @@ -557,16 +557,18 @@ public abstract class LWToolkit extends SunToolkit implements Runnable { } @Override - public void grab(Window w) { - if (w.getPeer() != null) { - ((LWWindowPeer)w.getPeer()).grab(); + public void grab(final Window w) { + final Object peer = AWTAccessor.getComponentAccessor().getPeer(w); + if (peer != null) { + ((LWWindowPeer) peer).grab(); } } @Override - public void ungrab(Window w) { - if (w.getPeer() != null) { - ((LWWindowPeer)w.getPeer()).ungrab(false); + public void ungrab(final Window w) { + final Object peer = AWTAccessor.getComponentAccessor().getPeer(w); + if (peer != null) { + ((LWWindowPeer) peer).ungrab(false); } } diff --git a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java index 2be41cf3b0d..7b3cff536ad 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java @@ -43,7 +43,7 @@ public class LWWindowPeer extends LWContainerPeer implements FramePeer, DialogPeer, FullScreenCapable, DisplayChangedListener, PlatformEventNotifier { - public static enum PeerType { + public enum PeerType { SIMPLEWINDOW, FRAME, DIALOG, @@ -56,15 +56,6 @@ public class LWWindowPeer private final PlatformWindow platformWindow; - // Window bounds reported by the native system (as opposed to - // regular bounds inherited from LWComponentPeer which are - // requested by user and may haven't been applied yet because - // of asynchronous requests to the windowing system) - private int sysX; - private int sysY; - private int sysW; - private int sysH; - private static final int MINIMUM_WIDTH = 1; private static final int MINIMUM_HEIGHT = 1; @@ -83,15 +74,15 @@ public class LWWindowPeer // A peer where the last mouse event came to. Used by cursor manager to // find the component under cursor - private static volatile LWComponentPeer lastCommonMouseEventPeer = null; + private static volatile LWComponentPeer lastCommonMouseEventPeer; // A peer where the last mouse event came to. Used to generate // MOUSE_ENTERED/EXITED notifications - private volatile LWComponentPeer lastMouseEventPeer; + private volatile LWComponentPeer lastMouseEventPeer; // Peers where all dragged/released events should come to, // depending on what mouse button is being dragged according to Cocoa - private static LWComponentPeer mouseDownTarget[] = new LWComponentPeer[3]; + private static final LWComponentPeer[] mouseDownTarget = new LWComponentPeer[3]; // A bitmask that indicates what mouse buttons produce MOUSE_CLICKED events // on MOUSE_RELEASE. Click events are only generated if there were no drag @@ -129,7 +120,8 @@ public class LWWindowPeer this.peerType = peerType; Window owner = target.getOwner(); - LWWindowPeer ownerPeer = (owner != null) ? (LWWindowPeer)owner.getPeer() : null; + LWWindowPeer ownerPeer = owner == null ? null : + (LWWindowPeer) AWTAccessor.getComponentAccessor().getPeer(owner); PlatformWindow ownerDelegate = (ownerPeer != null) ? ownerPeer.getPlatformWindow() : null; // The delegate.initialize() needs a non-null GC on X11. @@ -163,10 +155,10 @@ public class LWWindowPeer // Init warning window(for applets) SecurityWarningWindow warn = null; - if (((Window)target).getWarningString() != null) { + if (target.getWarningString() != null) { // accessSystemTray permission allows to display TrayIcon, TrayIcon tooltip // and TrayIcon balloon windows without a warning window. - if (!AWTAccessor.getWindowAccessor().isTrayIconWindow((Window)target)) { + if (!AWTAccessor.getWindowAccessor().isTrayIconWindow(target)) { LWToolkit toolkit = (LWToolkit)Toolkit.getDefaultToolkit(); warn = toolkit.createSecurityWarning(target, this); } @@ -210,6 +202,7 @@ public class LWWindowPeer } // Just a helper method + @Override public PlatformWindow getPlatformWindow() { return platformWindow; } @@ -315,9 +308,33 @@ public class LWWindowPeer op |= SET_SIZE; } + // Don't post ComponentMoved/Resized and Paint events + // until we've got a notification from the delegate + Rectangle cb = constrainBounds(x, y, w, h); + + Rectangle newBounds = new Rectangle(getBounds()); + if ((op & (SET_LOCATION | SET_BOUNDS)) != 0) { + newBounds.x = cb.x; + newBounds.y = cb.y; + } + if ((op & (SET_SIZE | SET_BOUNDS)) != 0) { + newBounds.width = cb.width; + newBounds.height = cb.height; + } + // Native system could constraint bounds, so the peer wold be updated in the callback + platformWindow.setBounds(newBounds.x, newBounds.y, newBounds.width, newBounds.height); + } + + public Rectangle constrainBounds(Rectangle bounds) { + return constrainBounds(bounds.x, bounds.y, bounds.width, bounds.height); + } + + public Rectangle constrainBounds(int x, int y, int w, int h) { + if (w < MINIMUM_WIDTH) { w = MINIMUM_WIDTH; } + if (h < MINIMUM_HEIGHT) { h = MINIMUM_HEIGHT; } @@ -332,12 +349,7 @@ public class LWWindowPeer h = maxH; } - // Don't post ComponentMoved/Resized and Paint events - // until we've got a notification from the delegate - setBounds(x, y, w, h, op, false, false); - // Get updated bounds, so we don't have to handle 'op' here manually - Rectangle r = getBounds(); - platformWindow.setBounds(r.x, r.y, r.width, r.height); + return new Rectangle(x, y, w, h); } @Override @@ -391,7 +403,12 @@ public class LWWindowPeer @Override public void setModalBlocked(Dialog blocker, boolean blocked) { synchronized (getPeerTreeLock()) { - this.blocker = blocked ? (LWWindowPeer)blocker.getPeer() : null; + ComponentPeer peer = AWTAccessor.getComponentAccessor().getPeer(blocker); + if (blocked && (peer instanceof LWWindowPeer)) { + this.blocker = (LWWindowPeer) peer; + } else { + this.blocker = null; + } } platformWindow.setModalBlocked(blocked); @@ -458,6 +475,7 @@ public class LWWindowPeer textured = isTextured; } + @Override public final boolean isTranslucent() { synchronized (getStateLock()) { /* @@ -537,7 +555,8 @@ public class LWWindowPeer public void blockWindows(List windows) { //TODO: LWX will probably need some collectJavaToplevels to speed this up for (Window w : windows) { - WindowPeer wp = (WindowPeer)w.getPeer(); + WindowPeer wp = + (WindowPeer) AWTAccessor.getComponentAccessor().getPeer(w); if (wp != null) { wp.setModalBlocked((Dialog)getTarget(), true); } @@ -594,17 +613,10 @@ public class LWWindowPeer */ @Override public void notifyReshape(int x, int y, int w, int h) { - final boolean moved; - final boolean resized; + Rectangle oldBounds = getBounds(); final boolean invalid = updateInsets(platformWindow.getInsets()); - synchronized (getStateLock()) { - moved = (x != sysX) || (y != sysY); - resized = (w != sysW) || (h != sysH); - sysX = x; - sysY = y; - sysW = w; - sysH = h; - } + final boolean moved = (x != oldBounds.x) || (y != oldBounds.y); + final boolean resized = (w != oldBounds.width) || (h != oldBounds.height); // Check if anything changed if (!moved && !resized && !invalid) { @@ -694,7 +706,7 @@ public class LWWindowPeer // TODO: fill "bdata" member of AWTEvent Rectangle r = getBounds(); // findPeerAt() expects parent coordinates - LWComponentPeer targetPeer = findPeerAt(r.x + x, r.y + y); + LWComponentPeer targetPeer = findPeerAt(r.x + x, r.y + y); if (id == MouseEvent.MOUSE_EXITED) { isMouseOver = false; @@ -743,7 +755,7 @@ public class LWWindowPeer screenX, screenY, modifiers, clickCount, popupTrigger, targetPeer); } else { - LWComponentPeer topmostTargetPeer = + LWComponentPeer topmostTargetPeer = topmostWindowPeer != null ? topmostWindowPeer.findPeerAt(r.x + x, r.y + y) : null; topmostWindowPeer.generateMouseEnterExitEventsForComponents(when, button, x, y, screenX, screenY, modifiers, clickCount, popupTrigger, @@ -840,7 +852,7 @@ public class LWWindowPeer private void generateMouseEnterExitEventsForComponents(long when, int button, int x, int y, int screenX, int screenY, int modifiers, int clickCount, boolean popupTrigger, - LWComponentPeer targetPeer) { + final LWComponentPeer targetPeer) { if (!isMouseOver || targetPeer == lastMouseEventPeer) { return; @@ -899,7 +911,7 @@ public class LWWindowPeer // TODO: could we just use the last mouse event target here? Rectangle r = getBounds(); // findPeerAt() expects parent coordinates - final LWComponentPeer targetPeer = findPeerAt(r.x + x, r.y + y); + final LWComponentPeer targetPeer = findPeerAt(r.x + x, r.y + y); if (targetPeer == null || !targetPeer.isEnabled()) { return; } @@ -933,7 +945,12 @@ public class LWWindowPeer focusOwner = this.getTarget(); } } - postEvent(new KeyEvent(focusOwner, id, when, modifiers, keyCode, keyChar, keyLocation)); + + KeyEvent keyEvent = new KeyEvent(focusOwner, id, when, modifiers, + keyCode, keyChar, keyLocation); + AWTAccessor.getKeyEventAccessor().setExtendedKeyCode(keyEvent, + ExtendedKeyCodes.getExtendedKeyCodeForChar(keyChar)); + postEvent(keyEvent); } // ---- UTILITY METHODS ---- // @@ -1136,8 +1153,11 @@ public class LWWindowPeer return false; } - Window currentActive = KeyboardFocusManager. - getCurrentKeyboardFocusManager().getActiveWindow(); + AppContext targetAppContext = AWTAccessor.getComponentAccessor().getAppContext(getTarget()); + KeyboardFocusManager kfm = AWTAccessor.getKeyboardFocusManagerAccessor() + .getCurrentKeyboardFocusManager(targetAppContext); + Window currentActive = kfm.getActiveWindow(); + Window opposite = LWKeyboardFocusManagerPeer.getInstance(). getCurrentFocusedWindow(); @@ -1152,8 +1172,9 @@ public class LWWindowPeer if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("requesting native focus to the owner " + owner); } - LWWindowPeer currentActivePeer = (currentActive != null ? - (LWWindowPeer)currentActive.getPeer() : null); + LWWindowPeer currentActivePeer = currentActive == null ? null : + (LWWindowPeer) AWTAccessor.getComponentAccessor().getPeer( + currentActive); // Ensure the opposite is natively active and suppress sending events. if (currentActivePeer != null && currentActivePeer.platformWindow.isActive()) { @@ -1265,7 +1286,8 @@ public class LWWindowPeer while (owner != null && !(owner instanceof Frame || owner instanceof Dialog)) { owner = owner.getOwner(); } - return owner != null ? (LWWindowPeer)owner.getPeer() : null; + return owner == null ? null : + (LWWindowPeer) AWTAccessor.getComponentAccessor().getPeer(owner); } /** @@ -1284,11 +1306,13 @@ public class LWWindowPeer } } + @Override public void enterFullScreenMode() { platformWindow.enterFullScreenMode(); updateSecurityWarningVisibility(); } + @Override public void exitFullScreenMode() { platformWindow.exitFullScreenMode(); updateSecurityWarningVisibility(); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTargetContextPeer.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTargetContextPeer.java index ad6171fe67a..4c71a224996 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTargetContextPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTargetContextPeer.java @@ -26,6 +26,7 @@ package sun.lwawt.macosx; import java.awt.*; +import java.awt.dnd.DropTarget; import sun.awt.dnd.SunDropTargetContextPeer; import sun.awt.dnd.SunDropTargetEvent; @@ -38,7 +39,7 @@ final class CDropTargetContextPeer extends SunDropTargetContextPeer { private long fNativeDropTransfer = 0; private long fNativeDataAvailable = 0; private Object fNativeData = null; - private boolean insideTarget = true; + private DropTarget insideTarget = null; Object awtLockAccess = new Object(); @@ -88,26 +89,19 @@ final class CDropTargetContextPeer extends SunDropTargetContextPeer { return fNativeData; } - // We need to take care of dragExit message because for some reason it is not being - // generated for lightweight components + // We need to take care of dragEnter and dragExit messages because + // native system generates them only for heavyweights @Override protected void processMotionMessage(SunDropTargetEvent event, boolean operationChanged) { - Component eventSource = (Component)event.getComponent(); - Point screenPoint = event.getPoint(); - SwingUtilities.convertPointToScreen(screenPoint, eventSource); - Rectangle screenBounds = new Rectangle(eventSource.getLocationOnScreen().x, - eventSource.getLocationOnScreen().y, - eventSource.getWidth(), eventSource.getHeight()); - if(insideTarget) { - if(!screenBounds.contains(screenPoint)) { + boolean eventInsideTarget = isEventInsideTarget(event); + if (event.getComponent().getDropTarget() == insideTarget) { + if (!eventInsideTarget) { processExitMessage(event); - insideTarget = false; return; } } else { - if(screenBounds.contains(screenPoint)) { + if (eventInsideTarget) { processEnterMessage(event); - insideTarget = true; } else { return; } @@ -115,17 +109,52 @@ final class CDropTargetContextPeer extends SunDropTargetContextPeer { super.processMotionMessage(event, operationChanged); } + /** + * Could be called when DnD enters a heavyweight or synthesized in processMotionMessage + */ + @Override + protected void processEnterMessage(SunDropTargetEvent event) { + Component c = event.getComponent(); + DropTarget dt = event.getComponent().getDropTarget(); + if (isEventInsideTarget(event) + && dt != insideTarget + && c.isShowing() + && dt != null + && dt.isActive()) { + insideTarget = dt; + super.processEnterMessage(event); + } + } + + /** + * Could be called when DnD exits a heavyweight or synthesized in processMotionMessage + */ + @Override + protected void processExitMessage(SunDropTargetEvent event) { + if (event.getComponent().getDropTarget() == insideTarget) { + insideTarget = null; + super.processExitMessage(event); + } + } + @Override protected void processDropMessage(SunDropTargetEvent event) { - Component eventSource = (Component)event.getComponent(); + if (isEventInsideTarget(event)) { + super.processDropMessage(event); + insideTarget = null; + } + } + + private boolean isEventInsideTarget(SunDropTargetEvent event) { + Component eventSource = event.getComponent(); Point screenPoint = event.getPoint(); SwingUtilities.convertPointToScreen(screenPoint, eventSource); - Rectangle screenBounds = new Rectangle(eventSource.getLocationOnScreen().x, - eventSource.getLocationOnScreen().y, - eventSource.getWidth(), eventSource.getHeight()); - if(screenBounds.contains(screenPoint)) { - super.processDropMessage(event); - } + Point locationOnScreen = eventSource.getLocationOnScreen(); + Rectangle screenBounds = new Rectangle(locationOnScreen.x, + locationOnScreen.y, + eventSource.getWidth(), + eventSource.getHeight()); + return screenBounds.contains(screenPoint); } @Override diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java index 29129394a37..4702cecc5ac 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java @@ -326,11 +326,6 @@ class CFileDialog implements FileDialogPeer { return getMinimumSize(); } - @Override - public Toolkit getToolkit() { - return Toolkit.getDefaultToolkit(); - } - @Override public void handleEvent(AWTEvent e) { } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java index ecb2d5217f6..3f6109a4120 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java @@ -620,8 +620,7 @@ public class CInputMethod extends InputMethodAdapter { retString[0] = new String(selectedText); }} }, fAwtFocussedComponent); - } catch (InterruptedException ie) { ie.printStackTrace(); } - catch (InvocationTargetException ite) { ite.printStackTrace(); } + } catch (InvocationTargetException ite) { ite.printStackTrace(); } synchronized(retString) { return retString[0]; } } @@ -669,8 +668,7 @@ public class CInputMethod extends InputMethodAdapter { }} }, fAwtFocussedComponent); - } catch (InterruptedException ie) { ie.printStackTrace(); } - catch (InvocationTargetException ite) { ite.printStackTrace(); } + } catch (InvocationTargetException ite) { ite.printStackTrace(); } synchronized(returnValue) { return returnValue; } } @@ -695,8 +693,7 @@ public class CInputMethod extends InputMethodAdapter { returnValue[0] = fIMContext.getInsertPositionOffset(); }} }, fAwtFocussedComponent); - } catch (InterruptedException ie) { ie.printStackTrace(); } - catch (InvocationTargetException ite) { ite.printStackTrace(); } + } catch (InvocationTargetException ite) { ite.printStackTrace(); } returnValue[1] = fCurrentTextLength; synchronized(returnValue) { return returnValue; } @@ -743,8 +740,7 @@ public class CInputMethod extends InputMethodAdapter { } }} }, fAwtFocussedComponent); - } catch (InterruptedException ie) { ie.printStackTrace(); } - catch (InvocationTargetException ite) { ite.printStackTrace(); } + } catch (InvocationTargetException ite) { ite.printStackTrace(); } synchronized(rect) { return rect; } } @@ -764,8 +760,7 @@ public class CInputMethod extends InputMethodAdapter { insertPositionOffset[0] = fIMContext.getInsertPositionOffset(); }} }, fAwtFocussedComponent); - } catch (InterruptedException ie) { ie.printStackTrace(); } - catch (InvocationTargetException ite) { ite.printStackTrace(); } + } catch (InvocationTargetException ite) { ite.printStackTrace(); } // This bit of gymnastics ensures that the returned location is within the composed text. // If it falls outside that region, the input method will commit the text, which is inconsistent with native diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CMenu.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CMenu.java index 56a7061325e..cad1b36aa9c 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CMenu.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CMenu.java @@ -26,9 +26,11 @@ package sun.lwawt.macosx; import java.awt.*; +import java.awt.peer.MenuItemPeer; import java.awt.peer.MenuPeer; public class CMenu extends CMenuItem implements MenuPeer { + public CMenu(Menu target) { super(target); } @@ -40,6 +42,20 @@ public class CMenu extends CMenuItem implements MenuPeer { setEnabled(target.isEnabled()); } + @Override + public final void setEnabled(final boolean b) { + super.setEnabled(b); + final Menu target = (Menu) getTarget(); + final int count = target.getItemCount(); + for (int i = 0; i < count; ++i) { + MenuItem item = target.getItem(i); + MenuItemPeer p = (MenuItemPeer) LWCToolkit.targetToPeer(item); + if (p != null) { + p.setEnabled(b && item.isEnabled()); + } + } + } + @Override protected long createModel() { CMenuComponent parent = (CMenuComponent) diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CMenuItem.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CMenuItem.java index ac3bea392a1..b1492bd0a43 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CMenuItem.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CMenuItem.java @@ -28,17 +28,20 @@ package sun.lwawt.macosx; import sun.awt.SunToolkit; import sun.lwawt.LWToolkit; +import java.awt.MenuContainer; import java.awt.MenuItem; import java.awt.MenuShortcut; import java.awt.event.*; import java.awt.peer.MenuItemPeer; +import java.util.concurrent.atomic.AtomicBoolean; public class CMenuItem extends CMenuComponent implements MenuItemPeer { + private final AtomicBoolean enabled = new AtomicBoolean(true); + public CMenuItem(MenuItem target) { super(target); initialize(target); - } // This way we avoiding invocation of the setters twice @@ -124,9 +127,19 @@ public class CMenuItem extends CMenuComponent implements MenuItemPeer { setEnabled(false); } + public final boolean isEnabled() { + return enabled.get(); + } + @Override public void setEnabled(boolean b) { - nativeSetEnabled(getModel(), b); + final Object parent = LWToolkit.targetToPeer(getTarget().getParent()); + if (parent instanceof CMenuItem) { + b &= ((CMenuItem) parent).isEnabled(); + } + if (enabled.compareAndSet(!b, b)) { + nativeSetEnabled(getModel(), b); + } } private native long nativeCreate(long parentMenu, boolean isSeparator); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformLWView.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformLWView.java index e5d99678b18..d09f1571d08 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformLWView.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformLWView.java @@ -53,14 +53,6 @@ public class CPlatformLWView extends CPlatformView { public void setBounds(int x, int y, int width, int height) { } - @Override - public void enterFullScreenMode() { - } - - @Override - public void exitFullScreenMode() { - } - @Override public SurfaceData replaceSurfaceData() { return null; diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java index b287e7745b7..ba05ab0b6c3 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java @@ -96,14 +96,6 @@ public class CPlatformView extends CFRetainedResource { return peer; } - public void enterFullScreenMode() { - CWrapper.NSView.enterFullScreenMode(ptr); - } - - public void exitFullScreenMode() { - CWrapper.NSView.exitFullScreenMode(ptr); - } - public void setToolTip(String msg) { CWrapper.NSView.setToolTip(ptr, msg); } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java index d38946d4376..f0eebfcdcb1 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java @@ -63,6 +63,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo private static native void nativeSynthesizeMouseEnteredExitedEvents(); private static native void nativeDispose(long nsWindowPtr); private static native CPlatformWindow nativeGetTopmostPlatformWindowUnderMouse(); + private static native void nativeEnterFullScreenMode(long nsWindowPtr); + private static native void nativeExitFullScreenMode(long nsWindowPtr); // Loger to report issues happened during execution but that do not affect functionality private static final PlatformLogger logger = PlatformLogger.getLogger("sun.lwawt.macosx.CPlatformWindow"); @@ -210,7 +212,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo private boolean undecorated; // initialized in getInitialStyleBits() private Rectangle normalBounds = null; // not-null only for undecorated maximized windows private CPlatformResponder responder; - private volatile boolean zoomed = false; // from native perspective public CPlatformWindow() { super(0, true); @@ -231,7 +232,16 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo contentView.initialize(peer, responder); final long ownerPtr = owner != null ? owner.getNSWindowPtr() : 0L; - final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(), ownerPtr, styleBits, 0, 0, 0, 0); + Rectangle bounds; + if (!IS(DECORATED, styleBits)) { + // For undecorated frames the move/resize event does not come if the frame is centered on the screen + // so we need to set a stub location to force an initial move/resize. Real bounds would be set later. + bounds = new Rectangle(0, 0, 1, 1); + } else { + bounds = _peer.constrainBounds(_target.getBounds()); + } + final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(), + ownerPtr, styleBits, bounds.x, bounds.y, bounds.width, bounds.height); setPtr(nativeWindowPtr); if (target instanceof javax.swing.RootPaneContainer) { @@ -432,10 +442,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo @Override // PlatformWindow public Insets getInsets() { - if (!isFullScreenMode) { - return nativeGetNSWindowInsets(getNSWindowPtr()); - } - return new Insets(0, 0, 0, 0); + return nativeGetNSWindowInsets(getNSWindowPtr()); } @Override // PlatformWindow @@ -466,7 +473,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo } private boolean isMaximized() { - return undecorated ? this.normalBounds != null : zoomed; + return undecorated ? this.normalBounds != null + : CWrapper.NSWindow.isZoomed(getNSWindowPtr()); } private void maximize() { @@ -474,7 +482,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo return; } if (!undecorated) { - zoomed = true; CWrapper.NSWindow.zoom(getNSWindowPtr()); } else { deliverZoom(true); @@ -496,7 +503,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo return; } if (!undecorated) { - zoomed = false; CWrapper.NSWindow.zoom(getNSWindowPtr()); } else { deliverZoom(false); @@ -538,6 +544,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo updateIconImages(); updateFocusabilityForAutoRequestFocus(false); + boolean wasMaximized = isMaximized(); + // Actually show or hide the window LWWindowPeer blocker = (peer == null)? null : peer.getBlocker(); if (blocker == null || !visible) { @@ -571,16 +579,21 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo if (visible) { // Apply the extended state as expected in shared code if (target instanceof Frame) { - switch (((Frame)target).getExtendedState()) { - case Frame.ICONIFIED: - CWrapper.NSWindow.miniaturize(nsWindowPtr); - break; - case Frame.MAXIMIZED_BOTH: - maximize(); - break; - default: // NORMAL - unmaximize(); // in case it was maximized, otherwise this is a no-op - break; + if (!wasMaximized && isMaximized()) { + // setVisible could have changed the native maximized state + deliverZoom(true); + } else { + switch (((Frame)target).getExtendedState()) { + case Frame.ICONIFIED: + CWrapper.NSWindow.miniaturize(nsWindowPtr); + break; + case Frame.MAXIMIZED_BOTH: + maximize(); + break; + default: // NORMAL + unmaximize(); // in case it was maximized, otherwise this is a no-op + break; + } } } } @@ -750,18 +763,12 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo @Override public void enterFullScreenMode() { isFullScreenMode = true; - contentView.enterFullScreenMode(); - // the move/size notification from the underlying system comes - // but it contains a bounds smaller than the whole screen - // and therefore we need to create the synthetic notifications - Rectangle screenBounds = getPeer().getGraphicsConfiguration().getBounds(); - peer.notifyReshape(screenBounds.x, screenBounds.y, screenBounds.width, - screenBounds.height); + nativeEnterFullScreenMode(getNSWindowPtr()); } @Override public void exitFullScreenMode() { - contentView.exitFullScreenMode(); + nativeExitFullScreenMode(getNSWindowPtr()); isFullScreenMode = false; } @@ -820,6 +827,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo } nativeSetEnabled(getNSWindowPtr(), !blocked); + checkBlockingAndOrder(); } public final void invalidateShadow(){ @@ -883,7 +891,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo //Posting an empty to flush the EventQueue without blocking the main thread } }, target); - } catch (InterruptedException | InvocationTargetException e) { + } catch (InvocationTargetException e) { e.printStackTrace(); } } @@ -918,13 +926,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo protected void deliverMoveResizeEvent(int x, int y, int width, int height, boolean byUser) { - // when the content view enters the full-screen mode, the native - // move/resize notifications contain a bounds smaller than - // the whole screen and therefore we ignore the native notifications - // and the content view itself creates correct synthetic notifications - if (isFullScreenMode) { - return; - } + checkZoom(); final Rectangle oldB = nativeBounds; nativeBounds = new Rectangle(x, y, width, height); @@ -956,6 +958,17 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo } } + private void checkZoom() { + if (target instanceof Frame && isVisible()) { + Frame targetFrame = (Frame)target; + if (targetFrame.getExtendedState() != Frame.MAXIMIZED_BOTH && isMaximized()) { + deliverZoom(true); + } else if (targetFrame.getExtendedState() == Frame.MAXIMIZED_BOTH && !isMaximized()) { + deliverZoom(false); + } + } + } + private void deliverNCMouseDown() { if (peer != null) { peer.notifyNCMouseDown(); @@ -984,7 +997,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo setStyleBits(SHOULD_BECOME_KEY | SHOULD_BECOME_MAIN, isFocusable); // set both bits at once } - private boolean checkBlocking() { + private boolean checkBlockingAndOrder() { LWWindowPeer blocker = (peer == null)? null : peer.getBlocker(); if (blocker == null) { return false; @@ -1040,7 +1053,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo private void windowDidBecomeMain() { assert CThreading.assertAppKit(); - if (checkBlocking()) return; + if (checkBlockingAndOrder()) return; // If it's not blocked, make sure it's above its siblings orderAboveSiblings(); } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java index b54a1baa2c5..0743c00ae63 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java @@ -233,6 +233,10 @@ public class CPrinterJob extends RasterPrinterJob { setAttributes(attributes); + // throw exception for invalid destination + if (destinationAttr != null) { + validateDestination(destinationAttr); + } /* Get the range of pages we are to print. If the * last page to print is unknown, then we print to diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java index 28acc26f6cc..6d843b88295 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java @@ -97,6 +97,6 @@ public class CViewEmbeddedFrame extends EmbeddedFrame { setVisible(true); } }, this); - } catch (InterruptedException | InvocationTargetException ex) {} + } catch (InvocationTargetException ex) {} } } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java index 7dc421e26b1..a9c55237eee 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java @@ -68,6 +68,7 @@ public final class CWrapper { public static native void miniaturize(long window); public static native void deminiaturize(long window); + public static native boolean isZoomed(long window); public static native void zoom(long window); public static native void makeFirstResponder(long window, long responder); @@ -81,9 +82,6 @@ public final class CWrapper { public static native Rectangle2D frame(long view); public static native long window(long view); - public static native void enterFullScreenMode(long view); - public static native void exitFullScreenMode(long view); - public static native void setHidden(long view, boolean hidden); public static native void setToolTip(long view, String msg); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java index 943dbe2fe47..959b03868fb 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java @@ -44,6 +44,8 @@ import sun.lwawt.*; import sun.lwawt.LWWindowPeer.PeerType; import sun.security.action.GetBooleanAction; +import sun.util.CoreResourceBundleControl; + class NamedCursor extends Cursor { NamedCursor(String name) { super(name); @@ -67,13 +69,28 @@ public final class LWCToolkit extends LWToolkit { static { System.err.flush(); - java.security.AccessController.doPrivileged(new java.security.PrivilegedAction() { - public Object run() { + + ResourceBundle platformResources = java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public ResourceBundle run() { + ResourceBundle platformResources = null; + try { + platformResources = + ResourceBundle.getBundle("sun.awt.resources.awtosx", + CoreResourceBundleControl.getRBControlInstance()); + } catch (MissingResourceException e) { + // No resource file; defaults will be used. + } + System.loadLibrary("awt"); System.loadLibrary("fontmanager"); - return null; + + return platformResources; } }); + + AWTAccessor.getToolkitAccessor().setPlatformResources(platformResources); + if (!GraphicsEnvironment.isHeadless()) { initIDs(); } @@ -207,9 +224,9 @@ public final class LWCToolkit extends LWToolkit { @Override public MenuBarPeer createMenuBar(MenuBar target) { - MenuBarPeer peer = new CMenuBar(target); - targetCreatedPeer(target, peer); - return peer; + MenuBarPeer peer = new CMenuBar(target); + targetCreatedPeer(target, peer); + return peer; } @Override @@ -302,11 +319,6 @@ public final class LWCToolkit extends LWToolkit { return new OSXPlatformFont(name, style); } - @Override - protected MouseInfoPeer createMouseInfoPeerImpl() { - return new CMouseInfoPeer(); - } - @Override protected int getScreenHeight() { return GraphicsEnvironment.getLocalGraphicsEnvironment() @@ -536,22 +548,18 @@ public final class LWCToolkit extends LWToolkit { // Any selector invoked using ThreadUtilities performOnMainThread will be processed in doAWTRunLoop // The InvocationEvent will call LWCToolkit.stopAWTRunLoop() when finished, which will stop our manual runloop // Does not dispatch native events while in the loop - public static void invokeAndWait(Runnable event, Component component) throws InterruptedException, InvocationTargetException { + public static void invokeAndWait(Runnable runnable, Component component) throws InvocationTargetException { final long mediator = createAWTRunLoopMediator(); InvocationEvent invocationEvent = - new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), event) { - @Override - public void dispatch() { - try { - super.dispatch(); - } finally { + new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), + runnable, + () -> { if (mediator != 0) { stopAWTRunLoop(mediator); } - } - } - }; + }, + true); if (component != null) { AppContext appContext = SunToolkit.targetToAppContext(component); diff --git a/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpChannelImpl.java b/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpChannelImpl.java new file mode 100644 index 00000000000..8a147203402 --- /dev/null +++ b/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpChannelImpl.java @@ -0,0 +1,150 @@ +/* + * 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. 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 sun.nio.ch.sctp; + +import java.net.SocketAddress; +import java.net.InetAddress; +import java.io.IOException; +import java.util.Set; +import java.nio.ByteBuffer; +import java.nio.channels.spi.SelectorProvider; +import com.sun.nio.sctp.Association; +import com.sun.nio.sctp.MessageInfo; +import com.sun.nio.sctp.NotificationHandler; +import com.sun.nio.sctp.SctpChannel; +import com.sun.nio.sctp.SctpSocketOption; + +/** + * Unimplemented. + */ +public class SctpChannelImpl extends SctpChannel +{ + private static final String message = "SCTP not supported on this platform"; + + public SctpChannelImpl(SelectorProvider provider) { + super(provider); + throw new UnsupportedOperationException(message); + } + + @Override + public Association association() { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel bind(SocketAddress local) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel bindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel unbindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean connect(SocketAddress remote) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean connect(SocketAddress remote, int maxOutStreams, + int maxInStreams) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean isConnectionPending() { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean finishConnect() throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set getAllLocalAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set getRemoteAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel shutdown() throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public T getOption(SctpSocketOption name) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel setOption(SctpSocketOption name, T value) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set> supportedOptions() { + throw new UnsupportedOperationException(message); + } + + @Override + public MessageInfo receive(ByteBuffer dst, T attachment, + NotificationHandler handler) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public int send(ByteBuffer src, MessageInfo messageInfo) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + protected void implConfigureBlocking(boolean block) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public void implCloseSelectableChannel() throws IOException { + throw new UnsupportedOperationException(message); + } +} diff --git a/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java b/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java new file mode 100644 index 00000000000..c2c1d968307 --- /dev/null +++ b/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java @@ -0,0 +1,137 @@ +/* + * 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. 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 sun.nio.ch.sctp; + +import java.net.SocketAddress; +import java.net.InetAddress; +import java.io.IOException; +import java.util.Set; +import java.nio.ByteBuffer; +import java.nio.channels.spi.SelectorProvider; +import com.sun.nio.sctp.Association; +import com.sun.nio.sctp.SctpChannel; +import com.sun.nio.sctp.MessageInfo; +import com.sun.nio.sctp.NotificationHandler; +import com.sun.nio.sctp.SctpMultiChannel; +import com.sun.nio.sctp.SctpSocketOption; + +/** + * Unimplemented. + */ +public class SctpMultiChannelImpl extends SctpMultiChannel +{ + private static final String message = "SCTP not supported on this platform"; + + public SctpMultiChannelImpl(SelectorProvider provider) { + super(provider); + throw new UnsupportedOperationException(message); + } + + @Override + public Set associations() { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel bind(SocketAddress local, + int backlog) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel bindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel unbindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set getAllLocalAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set getRemoteAddresses + (Association association) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel shutdown(Association association) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public T getOption(SctpSocketOption name, + Association association) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel setOption(SctpSocketOption name, + T value, Association association) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set> supportedOptions() { + throw new UnsupportedOperationException(message); + } + + @Override + public MessageInfo receive(ByteBuffer buffer, T attachment, + NotificationHandler handler) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public int send(ByteBuffer buffer, MessageInfo messageInfo) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel branch(Association association) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + protected void implConfigureBlocking(boolean block) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public void implCloseSelectableChannel() throws IOException { + throw new UnsupportedOperationException(message); + } +} diff --git a/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java b/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java new file mode 100644 index 00000000000..1e224afd13f --- /dev/null +++ b/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java @@ -0,0 +1,102 @@ +/* + * 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. 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 sun.nio.ch.sctp; + +import java.net.SocketAddress; +import java.net.InetAddress; +import java.io.IOException; +import java.util.Set; +import java.nio.channels.spi.SelectorProvider; +import com.sun.nio.sctp.SctpChannel; +import com.sun.nio.sctp.SctpServerChannel; +import com.sun.nio.sctp.SctpSocketOption; + +/** + * Unimplemented. + */ +public class SctpServerChannelImpl extends SctpServerChannel +{ + private static final String message = "SCTP not supported on this platform"; + + public SctpServerChannelImpl(SelectorProvider provider) { + super(provider); + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel accept() throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpServerChannel bind(SocketAddress local, + int backlog) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpServerChannel bindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpServerChannel unbindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set getAllLocalAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public T getOption(SctpSocketOption name) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpServerChannel setOption(SctpSocketOption name, + T value) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set> supportedOptions() { + throw new UnsupportedOperationException(message); + } + + @Override + protected void implConfigureBlocking(boolean block) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public void implCloseSelectableChannel() throws IOException { + throw new UnsupportedOperationException(message); + } +} diff --git a/jdk/src/macosx/javavm/export/jawt_md.h b/jdk/src/macosx/javavm/export/jawt_md.h new file mode 100644 index 00000000000..1d66461bf42 --- /dev/null +++ b/jdk/src/macosx/javavm/export/jawt_md.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 1999, 2013 Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +#ifndef _JAVASOFT_JAWT_MD_H_ +#define _JAVASOFT_JAWT_MD_H_ + +#include "jawt.h" + +#ifdef __OBJC__ +#import +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Mac OS X specific declarations for AWT native interface. + * See notes in jawt.h for an example of use. + */ + +/* + * When calling JAWT_GetAWT with a JAWT version less than 1.7, you must pass this + * flag or you will not be able to get a valid drawing surface and JAWT_GetAWT will + * return false. This is to maintain compatibility with applications that used the + * interface with Java 6 which had multiple rendering models. This flag is not necessary + * when JAWT version 1.7 or greater is used as this is the only supported rendering mode. + * + * Example: + * JAWT awt; + * awt.version = JAWT_VERSION_1_4 | JAWT_MACOSX_USE_CALAYER; + * jboolean success = JAWT_GetAWT(env, &awt); + */ +#define JAWT_MACOSX_USE_CALAYER 0x80000000 + +/* + * When the native Cocoa toolkit is in use, the pointer stored in + * JAWT_DrawingSurfaceInfo->platformInfo points to a NSObject that conforms to the + * JAWT_SurfaceLayers protocol. Setting the layer property of this object will cause the + * specified layer to be overlaid on the Components rectangle. If the window the + * Component belongs to has a CALayer attached to it, this layer will be accessible via + * the windowLayer property. + */ +#ifdef __OBJC__ +@protocol JAWT_SurfaceLayers +@property (readwrite, retain) CALayer *layer; +@property (readonly) CALayer *windowLayer; +@end +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* !_JAVASOFT_JAWT_MD_H_ */ diff --git a/jdk/src/macosx/javavm/export/jni_md.h b/jdk/src/macosx/javavm/export/jni_md.h new file mode 100644 index 00000000000..9e47bedd61a --- /dev/null +++ b/jdk/src/macosx/javavm/export/jni_md.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +#ifndef _JAVASOFT_JNI_MD_H_ +#define _JAVASOFT_JNI_MD_H_ + +#define JNIEXPORT __attribute__((visibility("default"))) +#define JNIIMPORT __attribute__((visibility("default"))) +#define JNICALL + +typedef int jint; +#ifdef _LP64 /* 64-bit */ +typedef long jlong; +#else +typedef long long jlong; +#endif + +typedef signed char jbyte; + +#endif /* !_JAVASOFT_JNI_MD_H_ */ diff --git a/jdk/src/macosx/javavm/export/jvm_md.h b/jdk/src/macosx/javavm/export/jvm_md.h new file mode 100644 index 00000000000..012bb1babe2 --- /dev/null +++ b/jdk/src/macosx/javavm/export/jvm_md.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +#ifndef _JAVASOFT_JVM_MD_H_ +#define _JAVASOFT_JVM_MD_H_ + +/* + * This file is currently collecting system-specific dregs for the + * JNI conversion, which should be sorted out later. + */ + +#include /* For DIR */ +#include /* For MAXPATHLEN */ +#include /* For F_OK, R_OK, W_OK */ +#include /* For ptrdiff_t */ +#include /* For uintptr_t */ + +#define JNI_ONLOAD_SYMBOLS {"JNI_OnLoad"} +#define JNI_ONUNLOAD_SYMBOLS {"JNI_OnUnload"} + +#define JNI_LIB_PREFIX "lib" +#define JNI_LIB_SUFFIX ".dylib" +#define VERSIONED_JNI_LIB_NAME(NAME, VERSION) JNI_LIB_PREFIX NAME "." VERSION JNI_LIB_SUFFIX +#define JNI_LIB_NAME(NAME) JNI_LIB_PREFIX NAME JNI_LIB_SUFFIX + +#define JVM_MAXPATHLEN MAXPATHLEN + +#define JVM_R_OK R_OK +#define JVM_W_OK W_OK +#define JVM_X_OK X_OK +#define JVM_F_OK F_OK + +/* + * File I/O + */ + +#include +#include +#include +#include +#include + +/* O Flags */ + +#define JVM_O_RDONLY O_RDONLY +#define JVM_O_WRONLY O_WRONLY +#define JVM_O_RDWR O_RDWR +#define JVM_O_O_APPEND O_APPEND +#define JVM_O_EXCL O_EXCL +#define JVM_O_CREAT O_CREAT +#define JVM_O_DELETE 0x10000 + +/* Signals */ + +#define JVM_SIGINT SIGINT +#define JVM_SIGTERM SIGTERM + + +#endif /* !_JAVASOFT_JVM_MD_H_ */ diff --git a/jdk/src/macosx/lib/flavormap.properties b/jdk/src/macosx/lib/flavormap.properties index 4a9f5fe3ffe..b00f2c2c3a6 100644 --- a/jdk/src/macosx/lib/flavormap.properties +++ b/jdk/src/macosx/lib/flavormap.properties @@ -76,5 +76,6 @@ FILE_NAME=application/x-java-file-list;class=java.util.List text/uri-list=application/x-java-file-list;class=java.util.List PNG=image/x-java-image;class=java.awt.Image JFIF=image/x-java-image;class=java.awt.Image +TIFF=image/x-java-image;class=java.awt.Image RICH_TEXT=text/rtf HTML=text/html;charset=utf-8;eoln="\r\n";terminators=1 diff --git a/jdk/src/macosx/native/com/apple/resources/MacOSXResourceBundle.m b/jdk/src/macosx/native/com/apple/resources/MacOSXResourceBundle.m deleted file mode 100644 index 0b98d2b0588..00000000000 --- a/jdk/src/macosx/native/com/apple/resources/MacOSXResourceBundle.m +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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 - * 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. - */ - -#import -#import -#import - -#ifndef MAXPATHLEN -#define MAXPATHLEN PATH_MAX -#endif - -static jboolean -GetPathFromCurrentBinary(char *buf, jint bufsize) -{ - Dl_info dlinfo; - dladdr((void *)GetPathFromCurrentBinary, &dlinfo); - if (realpath(dlinfo.dli_fname, buf) == NULL) { -// fprintf(stderr, "Error: realpath(`%s') failed.\n", dlinfo.dli_fname); - return JNI_FALSE; - } - - const char *libawt = "lib/libawt.dylib"; - int strLen, libawtLen; - - strLen = strlen(buf); - libawtLen = strlen(libawt); - - if (strLen < libawtLen || - strcmp(buf + strLen - libawtLen, libawt) != 0) { - return JNI_FALSE; - } - - buf[strLen - libawtLen] = '\0'; - - return JNI_TRUE; -} - -#define JAVA_DLL "libjava.dylib" - -static jboolean -GetJREPath(char *buf, jint bufsize) -{ - /* try to get the path from the current binary, if not, bail to the framework */ - if (GetPathFromCurrentBinary(buf, bufsize) == JNI_TRUE) { - /* does the rest of the JRE exist? */ - char libjava[MAXPATHLEN]; - snprintf(libjava, MAXPATHLEN, "%s/lib/" JAVA_DLL, buf); - if (access(libjava, F_OK) == 0) { - return JNI_TRUE; - } - } - - return JNI_FALSE; -} - -static NSString *getRunningJavaBundle() -{ - char path[MAXPATHLEN]; - GetJREPath(path, MAXPATHLEN); - return [[NSString alloc] initWithFormat:@"%@/bundle", [NSString stringWithUTF8String:path]]; -} - -/* - * Class: com_apple_resources_LoadNativeBundleAction - * Method: getPathToBundleFile - * Signature: (Ljava/lang/String)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL -Java_com_apple_resources_LoadNativeBundleAction_getPathToBundleFile - (JNIEnv *env, jclass klass, jstring filename) -{ - jstring returnVal = NULL; - if (filename == NULL) { - return NULL; - } - -JNF_COCOA_ENTER(env); - NSBundle *javaBundle = [NSBundle bundleWithPath:getRunningJavaBundle()]; - NSString *baseFilename = JNFJavaToNSString(env, filename); - NSString *propertyFilePath = [javaBundle pathForResource:baseFilename ofType:@"properties"]; - - if (propertyFilePath != nil) { - returnVal = JNFNSToJavaString(env, propertyFilePath); - } -JNF_COCOA_EXIT(env); - - return returnVal; -} diff --git a/jdk/src/macosx/native/sun/awt/AWTEvent.m b/jdk/src/macosx/native/sun/awt/AWTEvent.m index b2d54f7e705..c6bda77d172 100644 --- a/jdk/src/macosx/native/sun/awt/AWTEvent.m +++ b/jdk/src/macosx/native/sun/awt/AWTEvent.m @@ -759,7 +759,7 @@ JNF_COCOA_EXIT(env); */ JNIEXPORT jint JNICALL Java_sun_lwawt_macosx_event_NSEvent_nsToJavaChar -(JNIEnv *env, jclass cls, char nsChar, jint modifierFlags) +(JNIEnv *env, jclass cls, jchar nsChar, jint modifierFlags) { jchar javaChar = 0; diff --git a/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.h b/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.h index 820be377358..58aec0b6126 100644 --- a/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.h +++ b/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.h @@ -23,8 +23,7 @@ * questions. */ -// REMIND: import -#import +#import /* * The CALayer-based rendering model returns an object conforming diff --git a/jdk/src/macosx/native/sun/awt/AWTView.m b/jdk/src/macosx/native/sun/awt/AWTView.m index 7e1f248c7ed..8fd088f426c 100644 --- a/jdk/src/macosx/native/sun/awt/AWTView.m +++ b/jdk/src/macosx/native/sun/awt/AWTView.m @@ -126,7 +126,7 @@ AWT_ASSERT_APPKIT_THREAD; self.cglLayer = nil; - JNIEnv *env = [ThreadUtilities getJNIEnv]; + JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; (*env)->DeleteGlobalRef(env, m_cPlatformView); m_cPlatformView = NULL; @@ -272,7 +272,6 @@ AWT_ASSERT_APPKIT_THREAD; */ - (void) keyDown: (NSEvent *)event { - fProcessingKeystroke = YES; fKeyEventsNeeded = YES; @@ -308,6 +307,23 @@ AWT_ASSERT_APPKIT_THREAD; - (BOOL) performKeyEquivalent: (NSEvent *) event { [self deliverJavaKeyEventHelper: event]; + + // Workaround for 8020209: special case for "Cmd =" and "Cmd ." + // because Cocoa calls performKeyEquivalent twice for these keystrokes + NSUInteger modFlags = [event modifierFlags] & + (NSCommandKeyMask | NSAlternateKeyMask | NSShiftKeyMask | NSControlKeyMask); + if (modFlags == NSCommandKeyMask) { + NSString *eventChars = [event charactersIgnoringModifiers]; + if ([eventChars length] == 1) { + unichar ch = [eventChars characterAtIndex:0]; + if (ch == '=' || ch == '.') { + [[NSApp mainMenu] performKeyEquivalent: event]; + return YES; + } + } + + } + return NO; } @@ -387,7 +403,7 @@ AWT_ASSERT_APPKIT_THREAD; [rolloverTrackingArea release]; } - int options = (NSTrackingActiveInActiveApp | NSTrackingMouseEnteredAndExited | + int options = (NSTrackingActiveAlways | NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved | NSTrackingEnabledDuringMouseDrag); rolloverTrackingArea = [[NSTrackingArea alloc] initWithRect:[self visibleRect] @@ -580,7 +596,7 @@ AWT_ASSERT_APPKIT_THREAD; // --- Services menu support for lightweights --- -// finds the focused accessable element, and if it's a text element, obtains the text from it +// finds the focused accessible element, and if it is a text element, obtains the text from it - (NSString *)accessibleSelectedText { id focused = [self accessibilityFocusedUIElement]; @@ -598,7 +614,7 @@ AWT_ASSERT_APPKIT_THREAD; return rtfdData; } -// finds the focused accessable element, and if it's a text element, sets the text in it +// finds the focused accessible element, and if it is a text element, sets the text in it - (BOOL)replaceAccessibleTextSelection:(NSString *)text { id focused = [self accessibilityFocusedUIElement]; diff --git a/jdk/src/macosx/native/sun/awt/AWTWindow.h b/jdk/src/macosx/native/sun/awt/AWTWindow.h index 698820ade4d..7f7bac777bc 100644 --- a/jdk/src/macosx/native/sun/awt/AWTWindow.h +++ b/jdk/src/macosx/native/sun/awt/AWTWindow.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,6 +45,7 @@ BOOL isEnabled; NSWindow *nsWindow; AWTWindow *ownerWindow; + jint preFullScreenLevel; } // An instance of either AWTWindow_Normal or AWTWindow_Panel @@ -57,6 +58,7 @@ @property (nonatomic) NSSize javaMaxSize; @property (nonatomic) jint styleBits; @property (nonatomic) BOOL isEnabled; +@property (nonatomic) jint preFullScreenLevel; - (id) initWithPlatformWindow:(JNFWeakJObjectWrapper *)javaPlatformWindow diff --git a/jdk/src/macosx/native/sun/awt/AWTWindow.m b/jdk/src/macosx/native/sun/awt/AWTWindow.m index 5608b4ad98c..687fa6b4d01 100644 --- a/jdk/src/macosx/native/sun/awt/AWTWindow.m +++ b/jdk/src/macosx/native/sun/awt/AWTWindow.m @@ -122,6 +122,7 @@ AWT_NS_WINDOW_IMPLEMENTATION @synthesize styleBits; @synthesize isEnabled; @synthesize ownerWindow; +@synthesize preFullScreenLevel; - (void) updateMinMaxSize:(BOOL)resizable { if (resizable) { @@ -350,7 +351,7 @@ AWT_ASSERT_APPKIT_THREAD; - (void) dealloc { AWT_ASSERT_APPKIT_THREAD; - JNIEnv *env = [ThreadUtilities getJNIEnv]; + JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; [self.javaPlatformWindow setJObject:nil withEnv:env]; self.nsWindow = nil; @@ -366,6 +367,22 @@ AWT_ASSERT_APPKIT_THREAD; - (BOOL) canBecomeMainWindow { AWT_ASSERT_APPKIT_THREAD; + if (!self.isEnabled) { + // Native system can bring up the NSWindow to + // the top even if the window is not main. + // We should bring up the modal dialog manually + [AWTToolkit eventCountPlusPlus]; + + JNIEnv *env = [ThreadUtilities getJNIEnv]; + jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; + if (platformWindow != NULL) { + static JNF_MEMBER_CACHE(jm_checkBlockingAndOrder, jc_CPlatformWindow, + "checkBlockingAndOrder", "()Z"); + JNFCallBooleanMethod(env, platformWindow, jm_checkBlockingAndOrder); + (*env)->DeleteLocalRef(env, platformWindow); + } + } + return self.isEnabled && IS(self.styleBits, SHOULD_BECOME_MAIN); } @@ -485,20 +502,6 @@ AWT_ASSERT_APPKIT_THREAD; // window exposing in _setVisible:(BOOL) } -- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)proposedFrame { -AWT_ASSERT_APPKIT_THREAD; - - [AWTToolkit eventCountPlusPlus]; - JNIEnv *env = [ThreadUtilities getJNIEnv]; - jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; - if (platformWindow != NULL) { - static JNF_MEMBER_CACHE(jm_deliverZoom, jc_CPlatformWindow, "deliverZoom", "(Z)V"); - JNFCallVoidMethod(env, platformWindow, jm_deliverZoom, ![window isZoomed]); - (*env)->DeleteLocalRef(env, platformWindow); - } - return YES; -} - - (void) _deliverIconify:(BOOL)iconify { AWT_ASSERT_APPKIT_THREAD; @@ -1210,3 +1213,58 @@ JNF_COCOA_ENTER(env); JNF_COCOA_EXIT(env); } +JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeEnterFullScreenMode +(JNIEnv *env, jclass clazz, jlong windowPtr) +{ +JNF_COCOA_ENTER(env); + + NSWindow *nsWindow = OBJC(windowPtr); + [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ + AWTWindow *window = (AWTWindow*)[nsWindow delegate]; + NSNumber* screenID = [AWTWindow getNSWindowDisplayID_AppKitThread: nsWindow]; + CGDirectDisplayID aID = [screenID intValue]; + + if (CGDisplayCapture(aID) == kCGErrorSuccess) { + // remove window decoration + NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:window.styleBits]; + [nsWindow setStyleMask:(styleMask & ~NSTitledWindowMask) | NSBorderlessWindowMask]; + + int shieldLevel = CGShieldingWindowLevel(); + window.preFullScreenLevel = [nsWindow level]; + [nsWindow setLevel: shieldLevel]; + + NSRect screenRect = [[nsWindow screen] frame]; + [nsWindow setFrame:screenRect display:YES]; + } else { + [JNFException raise:env as:kRuntimeException reason:"Failed to enter full screen."]; + } + }]; + +JNF_COCOA_EXIT(env); +} + +JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeExitFullScreenMode +(JNIEnv *env, jclass clazz, jlong windowPtr) +{ +JNF_COCOA_ENTER(env); + + NSWindow *nsWindow = OBJC(windowPtr); + [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ + AWTWindow *window = (AWTWindow*)[nsWindow delegate]; + NSNumber* screenID = [AWTWindow getNSWindowDisplayID_AppKitThread: nsWindow]; + CGDirectDisplayID aID = [screenID intValue]; + + if (CGDisplayRelease(aID) == kCGErrorSuccess) { + NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:window.styleBits]; + [nsWindow setStyleMask:styleMask]; + [nsWindow setLevel: window.preFullScreenLevel]; + + // GraphicsDevice takes care of restoring pre full screen bounds + } else { + [JNFException raise:env as:kRuntimeException reason:"Failed to exit full screen."]; + } + }]; + +JNF_COCOA_EXIT(env); +} + diff --git a/jdk/src/macosx/native/sun/awt/CDropTarget.m b/jdk/src/macosx/native/sun/awt/CDropTarget.m index 260bbdec82e..a1c47f8adcd 100644 --- a/jdk/src/macosx/native/sun/awt/CDropTarget.m +++ b/jdk/src/macosx/native/sun/awt/CDropTarget.m @@ -477,6 +477,8 @@ extern JNFClassInfo jc_CDropTargetContextPeer; sDraggingExited = FALSE; sDraggingLocation = [sender draggingLocation]; NSPoint javaLocation = [fView convertPoint:sDraggingLocation fromView:nil]; + javaLocation.y = fView.window.frame.size.height - javaLocation.y; + DLog5(@"+ dragEnter: loc native %f, %f, java %f, %f\n", sDraggingLocation.x, sDraggingLocation.y, javaLocation.x, javaLocation.y); ////////// BEGIN Calculate the current drag actions ////////// @@ -570,8 +572,7 @@ extern JNFClassInfo jc_CDropTargetContextPeer; // Should we notify Java things have changed? if (sDraggingError == FALSE && notifyJava) { NSPoint javaLocation = [fView convertPoint:sDraggingLocation fromView:nil]; - // For some reason even after the convertPoint drag events come with the y coordinate reverted - javaLocation.y = fView.window.frame.size.height - javaLocation.y; + javaLocation.y = fView.window.frame.size.height - javaLocation.y; //DLog5(@" : dragMoved: loc native %f, %f, java %f, %f\n", sDraggingLocation.x, sDraggingLocation.y, javaLocation.x, javaLocation.y); jlongArray formats = sDraggingFormats; diff --git a/jdk/src/macosx/native/sun/awt/CFileDialog.m b/jdk/src/macosx/native/sun/awt/CFileDialog.m index be7cadc64fb..74ea1fb6883 100644 --- a/jdk/src/macosx/native/sun/awt/CFileDialog.m +++ b/jdk/src/macosx/native/sun/awt/CFileDialog.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -93,6 +93,14 @@ canChooseDirectories:(BOOL)inChooseDirectories - (void)safeSaveOrLoad { NSSavePanel *thePanel = nil; + /* + * 8013553: turns off extension hiding for the native file dialog. + * This way is used because setExtensionHidden(NO) doesn't work + * as expected. + */ + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + [defaults setBool:NO forKey:@"NSNavLastUserSetHideExtensionButtonState"]; + if (fMode == java_awt_FileDialog_SAVE) { thePanel = [NSSavePanel savePanel]; [thePanel setAllowsOtherFileTypes:YES]; @@ -110,7 +118,7 @@ canChooseDirectories:(BOOL)inChooseDirectories if (fMode == java_awt_FileDialog_LOAD) { NSOpenPanel *openPanel = (NSOpenPanel *)thePanel; [openPanel setAllowsMultipleSelection:fMultipleMode]; - [openPanel setCanChooseFiles:YES]; + [openPanel setCanChooseFiles:!fChooseDirectories]; [openPanel setCanChooseDirectories:fChooseDirectories]; [openPanel setCanCreateDirectories:YES]; } diff --git a/jdk/src/macosx/native/sun/awt/CMenuComponent.h b/jdk/src/macosx/native/sun/awt/CMenuComponent.h index 2e0a6454285..e5aff96c48b 100644 --- a/jdk/src/macosx/native/sun/awt/CMenuComponent.h +++ b/jdk/src/macosx/native/sun/awt/CMenuComponent.h @@ -24,7 +24,7 @@ */ #import -#import +#import @interface CMenuComponent : NSObject { diff --git a/jdk/src/macosx/native/sun/awt/CPrinterJob.m b/jdk/src/macosx/native/sun/awt/CPrinterJob.m index 3935240ff78..2b92c2250fb 100644 --- a/jdk/src/macosx/native/sun/awt/CPrinterJob.m +++ b/jdk/src/macosx/native/sun/awt/CPrinterJob.m @@ -359,7 +359,11 @@ static void javaPrinterJobToNSPrintInfo(JNIEnv* env, jobject srcPrinterJob, jobj static JNF_CLASS_CACHE(jc_Pageable, "java/awt/print/Pageable"); static JNF_MEMBER_CACHE(jm_getCopies, sjc_CPrinterJob, "getCopiesInt", "()I"); static JNF_MEMBER_CACHE(jm_isCollated, sjc_CPrinterJob, "isCollated", "()Z"); + static JNF_MEMBER_CACHE(jm_getFromPage, sjc_CPrinterJob, "getFromPageAttrib", "()I"); + static JNF_MEMBER_CACHE(jm_getToPage, sjc_CPrinterJob, "getToPageAttrib", "()I"); + static JNF_MEMBER_CACHE(jm_getSelectAttrib, sjc_CPrinterJob, "getSelectAttrib", "()I"); static JNF_MEMBER_CACHE(jm_getNumberOfPages, jc_Pageable, "getNumberOfPages", "()I"); + static JNF_MEMBER_CACHE(jm_getPageFormat, sjc_CPrinterJob, "getPageFormatFromAttributes", "()Ljava/awt/print/PageFormat;"); NSMutableDictionary* printingDictionary = [dst dictionary]; @@ -368,19 +372,35 @@ static void javaPrinterJobToNSPrintInfo(JNIEnv* env, jobject srcPrinterJob, jobj jboolean collated = JNFCallBooleanMethod(env, srcPrinterJob, jm_isCollated); // AWT_THREADING Safe (known object) [printingDictionary setObject:[NSNumber numberWithBool:collated ? YES : NO] forKey:NSPrintMustCollate]; - jint jNumPages = JNFCallIntMethod(env, srcPageable, jm_getNumberOfPages); // AWT_THREADING Safe (!appKit) if (jNumPages != java_awt_print_Pageable_UNKNOWN_NUMBER_OF_PAGES) { - [printingDictionary setObject:[NSNumber numberWithBool:NO] forKey:NSPrintAllPages]; + jint selectID = JNFCallIntMethod(env, srcPrinterJob, jm_getSelectAttrib); + if (selectID ==0) { + [printingDictionary setObject:[NSNumber numberWithBool:YES] forKey:NSPrintAllPages]; + } else if (selectID == 2) { + // In Mac 10.7, Print ALL is deselected if PrintSelection is YES whether + // NSPrintAllPages is YES or NO + [printingDictionary setObject:[NSNumber numberWithBool:NO] forKey:NSPrintAllPages]; + [printingDictionary setObject:[NSNumber numberWithBool:YES] forKey:NSPrintSelectionOnly]; + } else { + [printingDictionary setObject:[NSNumber numberWithBool:NO] forKey:NSPrintAllPages]; + } - [printingDictionary setObject:[NSNumber numberWithInteger:1] forKey:NSPrintFirstPage]; - [printingDictionary setObject:[NSNumber numberWithInteger:jNumPages] forKey:NSPrintLastPage]; + jint fromPage = JNFCallIntMethod(env, srcPrinterJob, jm_getFromPage); + jint toPage = JNFCallIntMethod(env, srcPrinterJob, jm_getToPage); + // setting fromPage and toPage will not be shown in the dialog if printing All pages + [printingDictionary setObject:[NSNumber numberWithInteger:fromPage] forKey:NSPrintFirstPage]; + [printingDictionary setObject:[NSNumber numberWithInteger:toPage] forKey:NSPrintLastPage]; } else { [printingDictionary setObject:[NSNumber numberWithBool:YES] forKey:NSPrintAllPages]; } + jobject page = JNFCallObjectMethod(env, srcPrinterJob, jm_getPageFormat); + if (page != NULL) { + javaPageFormatToNSPrintInfo(env, NULL, page, dst); + } } /* diff --git a/jdk/src/macosx/native/sun/awt/CTextPipe.m b/jdk/src/macosx/native/sun/awt/CTextPipe.m index f6510f204ae..aaa5f1ee3b1 100644 --- a/jdk/src/macosx/native/sun/awt/CTextPipe.m +++ b/jdk/src/macosx/native/sun/awt/CTextPipe.m @@ -322,7 +322,7 @@ static void DrawTextContext Each stage of the pipeline is responsible for doing only one major thing, like allocating buffers, aquiring transform arrays from JNI, filling buffers, or striking glyphs. All resources or memory - aquired at a given stage, must be released in that stage. Any error that occurs (like a failed malloc) + acquired at a given stage, must be released in that stage. Any error that occurs (like a failed malloc) is to be handled in the stage it occurs in, and is to return immediatly after freeing it's resources. -----------------------------------*/ diff --git a/jdk/src/macosx/native/sun/awt/CWrapper.m b/jdk/src/macosx/native/sun/awt/CWrapper.m index ccc688e802d..e5847bea960 100644 --- a/jdk/src/macosx/native/sun/awt/CWrapper.m +++ b/jdk/src/macosx/native/sun/awt/CWrapper.m @@ -435,6 +435,29 @@ JNF_COCOA_ENTER(env); JNF_COCOA_EXIT(env); } +/* + * Class: sun_lwawt_macosx_CWrapper$NSWindow + * Method: isZoomed + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_sun_lwawt_macosx_CWrapper_00024NSWindow_isZoomed +(JNIEnv *env, jclass cls, jlong windowPtr) +{ + __block jboolean isZoomed = JNI_FALSE; + +JNF_COCOA_ENTER(env); + + NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); + [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ + isZoomed = [window isZoomed]; + }]; + +JNF_COCOA_EXIT(env); + + return isZoomed; +} + /* * Class: sun_lwawt_macosx_CWrapper$NSWindow * Method: zoom @@ -562,46 +585,6 @@ JNF_COCOA_EXIT(env); return jRect; } -/* - * Class: sun_lwawt_macosx_CWrapper$NSView - * Method: enterFullScreenMode - * Signature: (J)V - */ -JNIEXPORT void JNICALL -Java_sun_lwawt_macosx_CWrapper_00024NSView_enterFullScreenMode -(JNIEnv *env, jclass cls, jlong viewPtr) -{ -JNF_COCOA_ENTER(env); - - NSView *view = (NSView *)jlong_to_ptr(viewPtr); - [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ - NSScreen *screen = [[view window] screen]; - NSDictionary *opts = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], NSFullScreenModeAllScreens, nil]; - [view enterFullScreenMode:screen withOptions:opts]; - }]; - -JNF_COCOA_EXIT(env); -} - -/* - * Class: sun_lwawt_macosx_CWrapper$NSView - * Method: exitFullScreenMode - * Signature: (J)V - */ -JNIEXPORT void JNICALL -Java_sun_lwawt_macosx_CWrapper_00024NSView_exitFullScreenMode -(JNIEnv *env, jclass cls, jlong viewPtr) -{ -JNF_COCOA_ENTER(env); - - NSView *view = (NSView *)jlong_to_ptr(viewPtr); - [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ - [view exitFullScreenModeWithOptions:nil]; - }]; - -JNF_COCOA_EXIT(env); -} - /* * Class: sun_lwawt_macosx_CWrapper$NSView * Method: window diff --git a/jdk/src/macosx/native/sun/awt/awt.m b/jdk/src/macosx/native/sun/awt/awt.m index 5e7942aa016..0a491fd44f2 100644 --- a/jdk/src/macosx/native/sun/awt/awt.m +++ b/jdk/src/macosx/native/sun/awt/awt.m @@ -227,7 +227,7 @@ static void AWT_NSUncaughtExceptionHandler(NSException *exception) { id jrsAppKitAWTClass = objc_getClass("JRSAppKitAWT"); SEL markAppSel = @selector(markAppIsDaemon); if (![jrsAppKitAWTClass respondsToSelector:markAppSel]) return NO; - return (BOOL)[jrsAppKitAWTClass performSelector:markAppSel]; + return [jrsAppKitAWTClass performSelector:markAppSel] ? YES : NO; } + (void)appKitIsRunning:(id)arg { @@ -312,15 +312,17 @@ AWT_ASSERT_APPKIT_THREAD; if (verbose) AWT_DEBUG_LOG(@"got out of the AppKit startup mutex"); } - // Don't set the delegate until the NSApplication has been created and - // its finishLaunching has initialized it. - // ApplicationDelegate is the support code for com.apple.eawt. - [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ - id delegate = [ApplicationDelegate sharedDelegate]; - if (delegate != nil) { - OSXAPP_SetApplicationDelegate(delegate); - } - }]; + if (!headless) { + // Don't set the delegate until the NSApplication has been created and + // its finishLaunching has initialized it. + // ApplicationDelegate is the support code for com.apple.eawt. + [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ + id delegate = [ApplicationDelegate sharedDelegate]; + if (delegate != nil) { + OSXAPP_SetApplicationDelegate(delegate); + } + }]; + } } - (void)starter:(NSArray*)args { @@ -337,6 +339,8 @@ AWT_ASSERT_APPKIT_THREAD; // Headless mode trumps either ordinary AWT or SWT-in-AWT mode. Declare us a daemon and return. if (headless) { + // Note that we don't install run loop observers in headless mode + // because we don't need them (see 7174704) if (!forceEmbeddedMode) { setUpAppKitThreadName(); } diff --git a/jdk/src/macosx/native/sun/awt/jawt.m b/jdk/src/macosx/native/sun/awt/jawt.m index c295665fbf6..96669ef6e52 100644 --- a/jdk/src/macosx/native/sun/awt/jawt.m +++ b/jdk/src/macosx/native/sun/awt/jawt.m @@ -25,8 +25,7 @@ #import -// REMIND: import -#import +#import #import "awt_DrawingSurface.h" diff --git a/jdk/src/macosx/native/sun/font/CoreTextSupport.h b/jdk/src/macosx/native/sun/font/CoreTextSupport.h index 03735449266..467694d577a 100644 --- a/jdk/src/macosx/native/sun/font/CoreTextSupport.h +++ b/jdk/src/macosx/native/sun/font/CoreTextSupport.h @@ -24,7 +24,7 @@ */ #import -#import +#import #import #include "AWTFont.h" diff --git a/jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m b/jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m index 141a8c21ade..5c21b3f6394 100644 --- a/jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m +++ b/jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m @@ -341,6 +341,10 @@ AWT_ASSERT_APPKIT_THREAD; if ([event type] == NSApplicationDefined && TS_EQUAL([event timestamp], dummyEventTimestamp)) { [seenDummyEventLock lockWhenCondition:NO]; [seenDummyEventLock unlockWithCondition:YES]; + } else if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask)) { + // Cocoa won't send us key up event when releasing a key while Cmd is down, + // so we have to do it ourselves. + [[self keyWindow] sendEvent:event]; } else { [super sendEvent:event]; } diff --git a/jdk/src/share/back/ThreadGroupReferenceImpl.c b/jdk/src/share/back/ThreadGroupReferenceImpl.c index 06ae01065d8..47b894a5894 100644 --- a/jdk/src/share/back/ThreadGroupReferenceImpl.c +++ b/jdk/src/share/back/ThreadGroupReferenceImpl.c @@ -47,7 +47,7 @@ name(PacketInputStream *in, PacketOutputStream *out) (void)memset(&info, 0, sizeof(info)); threadGroupInfo(group, &info); - (void)outStream_writeString(out, info.name); + (void)outStream_writeString(out, info.name == NULL ? "" : info.name); if ( info.name != NULL ) jvmtiDeallocate(info.name); diff --git a/jdk/src/share/back/commonRef.c b/jdk/src/share/back/commonRef.c index 8cb534a90cf..ce9c75eeace 100644 --- a/jdk/src/share/back/commonRef.c +++ b/jdk/src/share/back/commonRef.c @@ -52,7 +52,7 @@ * the number times an object has been referenced through * commonRef_refToID. A RefNode is freed once the reference * count is decremented to 0 (with commonRef_release*), even if the - * correspoding object has not been collected. + * corresponding object has not been collected. * * One hash table is maintained. The mapping of ID to jobject (or RefNode*) * is handled with one hash table that will re-size itself as the number diff --git a/jdk/src/share/back/eventFilter.c b/jdk/src/share/back/eventFilter.c index dd05758d6c9..d67aa96ba5b 100644 --- a/jdk/src/share/back/eventFilter.c +++ b/jdk/src/share/back/eventFilter.c @@ -644,7 +644,7 @@ eventFilter_predictFiltering(HandlerNode *node, jclass clazz, char *classname) case JDWP_REQUEST_MODIFIER(Count): { /* - * If preceeding filters have determined that events will + * If preceding filters have determined that events will * be filtered out, that is fine and we won't get here. * However, the count must be decremented - even if * subsequent filters will filter these events. We diff --git a/jdk/src/share/back/outStream.c b/jdk/src/share/back/outStream.c index 8eeebc4c66e..b48d5591c20 100644 --- a/jdk/src/share/back/outStream.c +++ b/jdk/src/share/back/outStream.c @@ -298,17 +298,15 @@ jdwpError outStream_writeString(PacketOutputStream *stream, char *string) { jdwpError error; - jint length; + jint length = string != NULL ? (int)strlen(string) : 0; /* Options utf8=y/n controls if we want Standard UTF-8 or Modified */ if ( gdata->modifiedUtf8 ) { - length = (int)strlen(string); (void)outStream_writeInt(stream, length); error = writeBytes(stream, (jbyte *)string, length); } else { jint new_length; - length = (int)strlen(string); new_length = (gdata->npt->utf8mToUtf8sLength) (gdata->npt->utf, (jbyte*)string, length); if ( new_length == length ) { diff --git a/jdk/src/share/back/util.c b/jdk/src/share/back/util.c index 315815caa43..40cca3c0fe8 100644 --- a/jdk/src/share/back/util.c +++ b/jdk/src/share/back/util.c @@ -1092,7 +1092,7 @@ debugMonitorWait(jrawMonitorID monitor) * we don't want to consume it. It came from * user code and is intended for user code, not us. * So, we will remember that the interrupt has - * occured and re-activate it when this thread + * occurred and re-activate it when this thread * goes back into user code. * That being said, what do we do here? Since * we could have been notified too, here we will diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_de.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_de.properties index fe0f918d9bf..45148664672 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_de.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_de.properties @@ -102,7 +102,7 @@ horizontal=horizontal # # accessible actions # -toggleexpand=ein-/ausblenden +toggleexpand=einblenden umschalten # new relations, roles and states for J2SE 1.5.0 diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_es.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_es.properties index c3f90416a30..ce185a10dd1 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_es.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_es.properties @@ -102,7 +102,7 @@ horizontal=horizontal # # accessible actions # -toggleexpand=activar/desactivar ampliaci\u00F3n +toggleexpand=conmutar ampliaci\u00F3n # new relations, roles and states for J2SE 1.5.0 diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_fr.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_fr.properties index c399d9a0b32..88e8ae304b4 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_fr.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_fr.properties @@ -102,7 +102,7 @@ horizontal=horizontal # # accessible actions # -toggleexpand=basculer le d\u00E9veloppement +toggleexpand=activer/d\u00E9sactiver d\u00E9veloppement # new relations, roles and states for J2SE 1.5.0 diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_it.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_it.properties index 94eefb0a2a3..a8af9705d19 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_it.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_it.properties @@ -102,7 +102,7 @@ horizontal=orizzontale # # accessible actions # -toggleexpand=abilita/disabilita espansione +toggleexpand=attiva/disattiva espansione # new relations, roles and states for J2SE 1.5.0 diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties index f8aaf355040..638b46a7219 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties @@ -102,7 +102,7 @@ horizontal=horizontal # # accessible actions # -toggleexpand=alternar expans\u00E3o +toggleexpand=alternar expandir # new relations, roles and states for J2SE 1.5.0 diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties index 962b9d35dc5..3261b2c9be3 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties @@ -102,7 +102,7 @@ horizontal=horisontell # # accessible actions # -toggleexpand=v\u00E4xla ut\u00F6ka +toggleexpand=v\u00E4xla expandering # new relations, roles and states for J2SE 1.5.0 diff --git a/jdk/src/share/classes/com/sun/beans/decoder/AccessorElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/AccessorElementHandler.java index 93511bc5885..e2714f869e1 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/AccessorElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/AccessorElementHandler.java @@ -40,7 +40,7 @@ abstract class AccessorElementHandler extends ElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
    *
    name *
    the name of the accessible entity diff --git a/jdk/src/share/classes/com/sun/beans/decoder/ArrayElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/ArrayElementHandler.java index 5406891efbf..9a6d2284516 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/ArrayElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/ArrayElementHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,7 +57,7 @@ import java.lang.reflect.Array; * <int>456</int> * </array> * is equivalent to {@code int[] array = {123, 456}} in Java code. - *

    The following atributes are supported: + *

    The following attributes are supported: *

    *
    length *
    the array length @@ -76,7 +76,7 @@ final class ArrayElementHandler extends NewElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
    *
    length *
    the array length @@ -109,6 +109,20 @@ final class ArrayElementHandler extends NewElementHandler { } } + /** + * Tests whether the value of this element can be used + * as an argument of the element that contained in this one. + * + * @return {@code true} if the value of this element can be used + * as an argument of the element that contained in this one, + * {@code false} otherwise + */ + @Override + protected boolean isArgument() { + return true; // hack for compatibility + } + + /** * Creates an instance of the array. * diff --git a/jdk/src/share/classes/com/sun/beans/decoder/BooleanElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/BooleanElementHandler.java index e00af8c4c45..a88aa164693 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/BooleanElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/BooleanElementHandler.java @@ -37,7 +37,7 @@ package com.sun.beans.decoder; * <string>true</string> * </method> * which is equivalent to {@code Boolean.valueOf("true")} in Java code. - *

    The following atribute is supported: + *

    The following attribute is supported: *

    *
    id *
    the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/ByteElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/ByteElementHandler.java index a5347591793..a24f106fa9a 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/ByteElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/ByteElementHandler.java @@ -37,7 +37,7 @@ package com.sun.beans.decoder; * <string>127</string> * </method> * which is equivalent to {@code Byte.decode("127")} in Java code. - *

    The following atribute is supported: + *

    The following attribute is supported: *

    *
    id *
    the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/CharElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/CharElementHandler.java index 6e257d6c72a..e75a865e5ee 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/CharElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/CharElementHandler.java @@ -33,7 +33,7 @@ package com.sun.beans.decoder; * For example:
      * <char>X</char>
    * which is equivalent to {@code Character.valueOf('X')} in Java code. - *

    The following atributes are supported: + *

    The following attributes are supported: *

    *
    code *
    this attribute specifies character code @@ -52,7 +52,7 @@ final class CharElementHandler extends StringElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
    *
    code *
    this attribute specifies character code diff --git a/jdk/src/share/classes/com/sun/beans/decoder/ClassElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/ClassElementHandler.java index 9decb9f2d6a..63ebafd64c8 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/ClassElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/ClassElementHandler.java @@ -36,7 +36,7 @@ package com.sun.beans.decoder; * <string>java.lang.Class</string> * </method> * which is equivalent to {@code Class.forName("java.lang.Class")} in Java code. - *

    The following atribute is supported: + *

    The following attribute is supported: *

    *
    id *
    the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/DoubleElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/DoubleElementHandler.java index f8292aeea68..1fce298594b 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/DoubleElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/DoubleElementHandler.java @@ -37,7 +37,7 @@ package com.sun.beans.decoder; * <string>1.23e45</string> * </method> * which is equivalent to {@code Double.valueOf("1.23e45")} in Java code. - *

    The following atribute is supported: + *

    The following attribute is supported: *

    *
    id *
    the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/ElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/ElementHandler.java index dc24b011b15..f408223f3c3 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/ElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/ElementHandler.java @@ -126,7 +126,7 @@ public abstract class ElementHandler { /** * Parses attributes of the element. - * By default, the following atribute is supported: + * By default, the following attribute is supported: *
    *
    id *
    the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/FalseElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/FalseElementHandler.java index 608a827baed..c34c4a3ee24 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/FalseElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/FalseElementHandler.java @@ -31,7 +31,7 @@ package com.sun.beans.decoder; * For example:
      * <false/>
    * is equivalent to {@code false} in Java code. - *

    The following atribute is supported: + *

    The following attribute is supported: *

    *
    id *
    the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/FieldElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/FieldElementHandler.java index caa3a1d8ede..69d84bb5939 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/FieldElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/FieldElementHandler.java @@ -43,7 +43,7 @@ import java.lang.reflect.Field; * For example:
      * <field name="id"><int>0</int></field>
    * is equivalent to {@code id = 0} in Java code. - *

    The following atributes are supported: + *

    The following attributes are supported: *

    *
    name *
    the field name @@ -62,7 +62,7 @@ final class FieldElementHandler extends AccessorElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
    *
    name *
    the field name diff --git a/jdk/src/share/classes/com/sun/beans/decoder/FloatElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/FloatElementHandler.java index 0f934e660c1..320f17f020a 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/FloatElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/FloatElementHandler.java @@ -37,7 +37,7 @@ package com.sun.beans.decoder; * <string>-1.23</string> * </method> * which is equivalent to {@code Float.valueOf("-1.23")} in Java code. - *

    The following atribute is supported: + *

    The following attribute is supported: *

    *
    id *
    the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/IntElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/IntElementHandler.java index 0b9634af96b..56473b03de4 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/IntElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/IntElementHandler.java @@ -37,7 +37,7 @@ package com.sun.beans.decoder; * <string>-1</string> * </method> * which is equivalent to {@code Integer.decode("-1")} in Java code. - *

    The following atribute is supported: + *

    The following attribute is supported: *

    *
    id *
    the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/JavaElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/JavaElementHandler.java index 53f30864753..61f3faddaf1 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/JavaElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/JavaElementHandler.java @@ -32,7 +32,7 @@ import java.beans.XMLDecoder; * is evaluated in the context of the decoder itself. * Typically this outer context is used to retrieve the owner of the decoder, * which can be set before reading the archive. - *

    The following atributes are supported: + *

    The following attributes are supported: *

    *
    version *
    the Java version (not supported) @@ -54,7 +54,7 @@ final class JavaElementHandler extends ElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
    *
    version *
    the Java version (not supported) diff --git a/jdk/src/share/classes/com/sun/beans/decoder/LongElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/LongElementHandler.java index 3147f473e0e..3c15008e293 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/LongElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/LongElementHandler.java @@ -37,7 +37,7 @@ package com.sun.beans.decoder; * <string>0xFFFF</string> * </method> * which is equivalent to {@code Long.decode("0xFFFF")} in Java code. - *

    The following atribute is supported: + *

    The following attribute is supported: *

    *
    id *
    the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/MethodElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/MethodElementHandler.java index 73fcb67fa4f..b1357206277 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/MethodElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/MethodElementHandler.java @@ -43,7 +43,7 @@ import sun.reflect.misc.MethodUtil; * <string>10</string> * </method> * is equivalent to {@code Long.valueOf("10")} in Java code. - *

    The following atributes are supported: + *

    The following attributes are supported: *

    *
    name *
    the method name @@ -62,7 +62,7 @@ final class MethodElementHandler extends NewElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
    *
    name *
    the method name diff --git a/jdk/src/share/classes/com/sun/beans/decoder/NewElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/NewElementHandler.java index 18998db4ca1..9cf86dcca44 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/NewElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/NewElementHandler.java @@ -43,7 +43,7 @@ import java.util.List; * <string>10</string> * </new> * is equivalent to {@code new Long("10")} in Java code. - *

    The following atributes are supported: + *

    The following attributes are supported: *

    *
    class *
    the type of object for instantiation @@ -63,7 +63,7 @@ class NewElementHandler extends ElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
    *
    class *
    the type of object for instantiation diff --git a/jdk/src/share/classes/com/sun/beans/decoder/NullElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/NullElementHandler.java index 59cb0e90f89..b47dd7063e9 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/NullElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/NullElementHandler.java @@ -31,7 +31,7 @@ package com.sun.beans.decoder; * For example:
      * <null/>
    * is equivalent to {@code null} in Java code. - *

    The following atribute is supported: + *

    The following attribute is supported: *

    *
    id *
    the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/ObjectElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/ObjectElementHandler.java index 566947183e8..c791e6c722b 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/ObjectElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/ObjectElementHandler.java @@ -33,7 +33,7 @@ import static java.util.Locale.ENGLISH; * This element looks like <void> element, * but its value is always used as an argument for element * that contains this one. - *

    The following atributes are supported: + *

    The following attributes are supported: *

    *
    class *
    the type is used for static methods and fields @@ -64,7 +64,7 @@ class ObjectElementHandler extends NewElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
    *
    class *
    the type is used for static methods and fields diff --git a/jdk/src/share/classes/com/sun/beans/decoder/PropertyElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/PropertyElementHandler.java index 8f4c40cac93..9473d5ceb8c 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/PropertyElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/PropertyElementHandler.java @@ -63,7 +63,7 @@ import sun.reflect.misc.MethodUtil; * <int>0</int> * </method> * which is equivalent to {@code set(0)} in Java code. - *

    The following atributes are supported: + *

    The following attributes are supported: *

    *
    name *
    the property name @@ -85,7 +85,7 @@ final class PropertyElementHandler extends AccessorElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
    *
    name *
    the property name diff --git a/jdk/src/share/classes/com/sun/beans/decoder/ShortElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/ShortElementHandler.java index f86ad3834ea..26c517f489e 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/ShortElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/ShortElementHandler.java @@ -37,7 +37,7 @@ package com.sun.beans.decoder; * <string>200</string> * </method> * which is equivalent to {@code Short.decode("200")} in Java code. - *

    The following atribute is supported: + *

    The following attribute is supported: *

    *
    id *
    the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/StringElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/StringElementHandler.java index bceb7ceb04f..fd6960a4be3 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/StringElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/StringElementHandler.java @@ -40,7 +40,7 @@ package com.sun.beans.decoder; * <string> * <true> * </string> - *

    The following atribute is supported: + *

    The following attribute is supported: *

    *
    id *
    the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/TrueElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/TrueElementHandler.java index f3bed67c7ca..dfb6553b911 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/TrueElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/TrueElementHandler.java @@ -31,7 +31,7 @@ package com.sun.beans.decoder; * For example:
      * <true/>
    * is equivalent to {@code true} in Java code. - *

    The following atribute is supported: + *

    The following attribute is supported: *

    *
    id *
    the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/VarElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/VarElementHandler.java index 2d540fd9949..51a4fa13d4c 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/VarElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/VarElementHandler.java @@ -30,7 +30,7 @@ package com.sun.beans.decoder; * For example:
      * <var id="id1" idref="id2"/>
    * is equivalent to {@code id1 = id2} in Java code. - *

    The following atributes are supported: + *

    The following attributes are supported: *

    *
    idref *
    the identifier to refer to the variable @@ -47,7 +47,7 @@ final class VarElementHandler extends ElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
    *
    idref *
    the identifier to refer to the variable diff --git a/jdk/src/share/classes/com/sun/beans/decoder/VoidElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/VoidElementHandler.java index 63ce32c03f4..232772924ff 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/VoidElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/VoidElementHandler.java @@ -29,7 +29,7 @@ package com.sun.beans.decoder; * This element looks like <object> element, * but its value is not used as an argument for element * that contains this one. - *

    The following atributes are supported: + *

    The following attributes are supported: *

    *
    class *
    the type is used for static methods and fields diff --git a/jdk/src/share/classes/com/sun/crypto/provider/CipherBlockChaining.java b/jdk/src/share/classes/com/sun/crypto/provider/CipherBlockChaining.java index 3ed00e07257..c32aa7feae5 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/CipherBlockChaining.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/CipherBlockChaining.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -135,9 +135,10 @@ class CipherBlockChaining extends FeedbackCipher { * @param plainLen the length of the input data * @param cipher the buffer for the result * @param cipherOffset the offset in cipher + * @return the length of the encrypted data */ - void encrypt(byte[] plain, int plainOffset, int plainLen, - byte[] cipher, int cipherOffset) + int encrypt(byte[] plain, int plainOffset, int plainLen, + byte[] cipher, int cipherOffset) { int i; int endIndex = plainOffset + plainLen; @@ -150,6 +151,7 @@ class CipherBlockChaining extends FeedbackCipher { embeddedCipher.encryptBlock(k, 0, cipher, cipherOffset); System.arraycopy(cipher, cipherOffset, r, 0, blockSize); } + return plainLen; } /** @@ -174,13 +176,14 @@ class CipherBlockChaining extends FeedbackCipher { * @param cipherLen the length of the input data * @param plain the buffer for the result * @param plainOffset the offset in plain + * @return the length of the decrypted data * * @exception IllegalBlockSizeException if input data whose length does * not correspond to the embedded cipher's block size is passed to the * embedded cipher */ - void decrypt(byte[] cipher, int cipherOffset, int cipherLen, - byte[] plain, int plainOffset) + int decrypt(byte[] cipher, int cipherOffset, int cipherLen, + byte[] plain, int plainOffset) { int i; byte[] cipherOrig=null; @@ -195,7 +198,6 @@ class CipherBlockChaining extends FeedbackCipher { // the plaintext result. cipherOrig = cipher.clone(); } - for (; cipherOffset < endIndex; cipherOffset += blockSize, plainOffset += blockSize) { embeddedCipher.decryptBlock(cipher, cipherOffset, k, 0); @@ -208,5 +210,6 @@ class CipherBlockChaining extends FeedbackCipher { System.arraycopy(cipherOrig, cipherOffset, r, 0, blockSize); } } + return cipherLen; } } diff --git a/jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java b/jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java index 7548612242a..dab1b4d6f57 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java @@ -310,49 +310,20 @@ final class CipherCore { * @return the required output buffer size (in bytes) */ int getOutputSize(int inputLen) { - int totalLen = buffered + inputLen; - - // GCM: this call may be for either update() or doFinal(), so have to - // return the larger value of both - // Encryption: based on doFinal value: inputLen + tag - // Decryption: based on update value: inputLen - if (!decrypting && (cipherMode == GCM_MODE)) { - return (totalLen + ((GaloisCounterMode) cipher).getTagLen()); - } - - if (padding == null) { - return totalLen; - } - - if (decrypting) { - return totalLen; - } - - if (unitBytes != blockSize) { - if (totalLen < diffBlocksize) { - return diffBlocksize; - } else { - return (totalLen + blockSize - - ((totalLen - diffBlocksize) % blockSize)); - } - } else { - return totalLen + padding.padLength(totalLen); - } + // estimate based on the maximum + return getOutputSizeByOperation(inputLen, true); } private int getOutputSizeByOperation(int inputLen, boolean isDoFinal) { - int totalLen = 0; + int totalLen = buffered + inputLen + cipher.getBufferedLength(); switch (cipherMode) { case GCM_MODE: - totalLen = buffered + inputLen; if (isDoFinal) { int tagLen = ((GaloisCounterMode) cipher).getTagLen(); - if (decrypting) { - // need to get the actual value from cipher?? - // deduct tagLen - totalLen -= tagLen; - } else { + if (!decrypting) { totalLen += tagLen; + } else { + totalLen -= tagLen; } } if (totalLen < 0) { @@ -360,8 +331,19 @@ final class CipherCore { } break; default: - totalLen = getOutputSize(inputLen); - break; + if (padding != null && !decrypting) { + if (unitBytes != blockSize) { + if (totalLen < diffBlocksize) { + totalLen = diffBlocksize; + } else { + int residue = (totalLen - diffBlocksize) % blockSize; + totalLen += (blockSize - residue); + } + } else { + totalLen += padding.padLength(totalLen); + } + } + break; } return totalLen; } @@ -729,36 +711,52 @@ final class CipherCore { len = (len > 0 ? (len - (len%unitBytes)) : 0); // check output buffer capacity - if ((output == null) || ((output.length - outputOffset) < len)) { + if ((output == null) || + ((output.length - outputOffset) < len)) { throw new ShortBufferException("Output buffer must be " + "(at least) " + len + " bytes long"); } - if (len != 0) { - // there is some work to do - byte[] in = new byte[len]; - - int inputConsumed = len - buffered; - int bufferedConsumed = buffered; - if (inputConsumed < 0) { - inputConsumed = 0; - bufferedConsumed = len; + int outLen = 0; + if (len != 0) { // there is some work to do + if (len <= buffered) { + // all to-be-processed data are from 'buffer' + if (decrypting) { + outLen = cipher.decrypt(buffer, 0, len, output, outputOffset); + } else { + outLen = cipher.encrypt(buffer, 0, len, output, outputOffset); + } + buffered -= len; + if (buffered != 0) { + System.arraycopy(buffer, len, buffer, 0, buffered); + } + } else { // len > buffered + if (buffered == 0) { + // all to-be-processed data are from 'input' + if (decrypting) { + outLen = cipher.decrypt(input, inputOffset, len, output, outputOffset); + } else { + outLen = cipher.encrypt(input, inputOffset, len, output, outputOffset); + } + inputOffset += len; + inputLen -= len; + } else { + // assemble the data using both 'buffer' and 'input' + byte[] in = new byte[len]; + System.arraycopy(buffer, 0, in, 0, buffered); + int inConsumed = len - buffered; + System.arraycopy(input, inputOffset, in, buffered, inConsumed); + buffered = 0; + inputOffset += inConsumed; + inputLen -= inConsumed; + if (decrypting) { + outLen = cipher.decrypt(in, 0, len, output, outputOffset); + } else { + outLen = cipher.encrypt(in, 0, len, output, outputOffset); + } + } } - - if (buffered != 0) { - System.arraycopy(buffer, 0, in, 0, bufferedConsumed); - } - if (inputConsumed > 0) { - System.arraycopy(input, inputOffset, in, - bufferedConsumed, inputConsumed); - } - if (decrypting) { - cipher.decrypt(in, 0, len, output, outputOffset); - } else { - cipher.encrypt(in, 0, len, output, outputOffset); - } - // Let's keep track of how many bytes are needed to make // the total input length a multiple of blocksize when // padding is applied @@ -770,23 +768,14 @@ final class CipherCore { ((len - diffBlocksize) % blockSize); } } - - inputLen -= inputConsumed; - inputOffset += inputConsumed; - outputOffset += len; - buffered -= bufferedConsumed; - if (buffered > 0) { - System.arraycopy(buffer, bufferedConsumed, buffer, 0, - buffered); - } } - // left over again + // Store remaining input into 'buffer' again if (inputLen > 0) { System.arraycopy(input, inputOffset, buffer, buffered, inputLen); + buffered += inputLen; } - buffered += inputLen; - return len; + return outLen; } /** @@ -881,11 +870,24 @@ final class CipherCore { ("Must use either different key or iv for GCM encryption"); } - // calculate the total input length - int totalLen = buffered + inputLen; - int paddedLen = totalLen; - int paddingLen = 0; + int estOutSize = getOutputSizeByOperation(inputLen, true); + // check output buffer capacity. + // if we are decrypting with padding applied, we can perform this + // check only after we have determined how many padding bytes there + // are. + int outputCapacity = output.length - outputOffset; + int minOutSize = (decrypting? (estOutSize - blockSize):estOutSize); + if ((output == null) || (outputCapacity < minOutSize)) { + throw new ShortBufferException("Output buffer must be " + + "(at least) " + minOutSize + " bytes long"); + } + // calculate total input length + int len = buffered + inputLen; + + // calculate padding length + int totalLen = len + cipher.getBufferedLength(); + int paddingLen = 0; // will the total input length be a multiple of blockSize? if (unitBytes != blockSize) { if (totalLen < diffBlocksize) { @@ -898,40 +900,23 @@ final class CipherCore { paddingLen = padding.padLength(totalLen); } - if ((paddingLen > 0) && (paddingLen != blockSize) && - (padding != null) && decrypting) { + if (decrypting && (padding != null) && + (paddingLen > 0) && (paddingLen != blockSize)) { throw new IllegalBlockSizeException ("Input length must be multiple of " + blockSize + " when decrypting with padded cipher"); } - // if encrypting and padding not null, add padding - if (!decrypting && padding != null) { - paddedLen += paddingLen; - } - - // check output buffer capacity. - // if we are decrypting with padding applied, we can perform this - // check only after we have determined how many padding bytes there - // are. - if (output == null) { - throw new ShortBufferException("Output buffer is null"); - } - int outputCapacity = output.length - outputOffset; - - if (((!decrypting) && (outputCapacity < paddedLen)) || - (decrypting && (outputCapacity < (paddedLen - blockSize)))) { - throw new ShortBufferException("Output buffer too short: " - + outputCapacity + " bytes given, " - + paddedLen + " bytes needed"); - } - // prepare the final input avoiding copying if possible byte[] finalBuf = input; int finalOffset = inputOffset; + int finalBufLen = inputLen; if ((buffered != 0) || (!decrypting && padding != null)) { + if (decrypting || padding == null) { + paddingLen = 0; + } + finalBuf = new byte[len + paddingLen]; finalOffset = 0; - finalBuf = new byte[paddedLen]; if (buffered != 0) { System.arraycopy(buffer, 0, finalBuf, 0, buffered); } @@ -939,50 +924,50 @@ final class CipherCore { System.arraycopy(input, inputOffset, finalBuf, buffered, inputLen); } - if (!decrypting && padding != null) { - padding.padWithLen(finalBuf, totalLen, paddingLen); + if (paddingLen != 0) { + padding.padWithLen(finalBuf, (buffered+inputLen), paddingLen); } + finalBufLen = finalBuf.length; } - + int outLen = 0; if (decrypting) { // if the size of specified output buffer is less than // the length of the cipher text, then the current // content of cipher has to be preserved in order for // users to retry the call with a larger buffer in the // case of ShortBufferException. - if (outputCapacity < paddedLen) { + if (outputCapacity < estOutSize) { cipher.save(); } // create temporary output buffer so that only "real" // data bytes are passed to user's output buffer. - byte[] outWithPadding = new byte[totalLen]; - totalLen = finalNoPadding(finalBuf, finalOffset, outWithPadding, - 0, totalLen); + byte[] outWithPadding = new byte[estOutSize]; + outLen = finalNoPadding(finalBuf, finalOffset, outWithPadding, + 0, finalBufLen); if (padding != null) { - int padStart = padding.unpad(outWithPadding, 0, totalLen); + int padStart = padding.unpad(outWithPadding, 0, outLen); if (padStart < 0) { throw new BadPaddingException("Given final block not " + "properly padded"); } - totalLen = padStart; + outLen = padStart; } - if ((output.length - outputOffset) < totalLen) { + if (outputCapacity < outLen) { // restore so users can retry with a larger buffer cipher.restore(); throw new ShortBufferException("Output buffer too short: " - + (output.length-outputOffset) - + " bytes given, " + totalLen + + (outputCapacity) + + " bytes given, " + outLen + " bytes needed"); } - for (int i = 0; i < totalLen; i++) { - output[outputOffset + i] = outWithPadding[i]; - } + // copy the result into user-supplied output buffer + System.arraycopy(outWithPadding, 0, output, outputOffset, outLen); } else { // encrypting try { - totalLen = finalNoPadding(finalBuf, finalOffset, output, - outputOffset, paddedLen); + outLen = finalNoPadding(finalBuf, finalOffset, output, + outputOffset, finalBufLen); } finally { // reset after doFinal() for GCM encryption requireReinit = (cipherMode == GCM_MODE); @@ -994,12 +979,13 @@ final class CipherCore { if (cipherMode != ECB_MODE) { cipher.reset(); } - return totalLen; + return outLen; } private int finalNoPadding(byte[] in, int inOfs, byte[] out, int outOfs, int len) - throws IllegalBlockSizeException, AEADBadTagException { + throws IllegalBlockSizeException, AEADBadTagException, + ShortBufferException { if ((cipherMode != GCM_MODE) && (in == null || len == 0)) { return 0; diff --git a/jdk/src/share/classes/com/sun/crypto/provider/CipherFeedback.java b/jdk/src/share/classes/com/sun/crypto/provider/CipherFeedback.java index a5f74f68266..f8e6115c98f 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/CipherFeedback.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/CipherFeedback.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -150,9 +150,10 @@ final class CipherFeedback extends FeedbackCipher { * @param plainLen the length of the input data * @param cipher the buffer for the result * @param cipherOffset the offset in cipher + * @return the length of the encrypted data */ - void encrypt(byte[] plain, int plainOffset, int plainLen, - byte[] cipher, int cipherOffset) + int encrypt(byte[] plain, int plainOffset, int plainLen, + byte[] cipher, int cipherOffset) { int i, len; len = blockSize - numBytes; @@ -194,6 +195,7 @@ final class CipherFeedback extends FeedbackCipher { } } } + return plainLen; } /** @@ -218,9 +220,10 @@ final class CipherFeedback extends FeedbackCipher { * @param cipherLen the length of the input data * @param plain the buffer for the result * @param plainOffset the offset in plain + * @return the length of the decrypted data */ - void decrypt(byte[] cipher, int cipherOffset, int cipherLen, - byte[] plain, int plainOffset) + int decrypt(byte[] cipher, int cipherOffset, int cipherLen, + byte[] plain, int plainOffset) { int i, len; len = blockSize - numBytes; @@ -268,5 +271,6 @@ final class CipherFeedback extends FeedbackCipher { } } } + return cipherLen; } } diff --git a/jdk/src/share/classes/com/sun/crypto/provider/CounterMode.java b/jdk/src/share/classes/com/sun/crypto/provider/CounterMode.java index d9e936c3bd0..438998e01ce 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/CounterMode.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/CounterMode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 201313, 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 @@ -149,9 +149,10 @@ final class CounterMode extends FeedbackCipher { * @param len the length of the input data * @param out the buffer for the result * @param outOff the offset in cipher + * @return the length of the encrypted data */ - void encrypt(byte[] in, int inOff, int len, byte[] out, int outOff) { - crypt(in, inOff, len, out, outOff); + int encrypt(byte[] in, int inOff, int len, byte[] out, int outOff) { + return crypt(in, inOff, len, out, outOff); } /** @@ -176,9 +177,10 @@ final class CounterMode extends FeedbackCipher { * @param len the length of the input data * @param out the buffer for the result * @param outOff the offset in plain + * @return the length of the decrypted data */ - void decrypt(byte[] in, int inOff, int len, byte[] out, int outOff) { - crypt(in, inOff, len, out, outOff); + int decrypt(byte[] in, int inOff, int len, byte[] out, int outOff) { + return crypt(in, inOff, len, out, outOff); } /** @@ -197,7 +199,8 @@ final class CounterMode extends FeedbackCipher { * keystream generated by encrypting the counter values. Counter values * are encrypted on demand. */ - private void crypt(byte[] in, int inOff, int len, byte[] out, int outOff) { + private int crypt(byte[] in, int inOff, int len, byte[] out, int outOff) { + int result = len; while (len-- > 0) { if (used >= blockSize) { embeddedCipher.encryptBlock(counter, 0, encryptedCounter, 0); @@ -206,5 +209,6 @@ final class CounterMode extends FeedbackCipher { } out[outOff++] = (byte)(in[inOff++] ^ encryptedCounter[used++]); } + return result; } } diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java b/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java index 00baf133ae6..a12e9457b26 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java @@ -58,6 +58,16 @@ extends AlgorithmParameterGeneratorSpi { // The source of randomness private SecureRandom random = null; + private static void checkKeySize(int keysize) + throws InvalidAlgorithmParameterException { + if ((keysize != 2048) && + ((keysize < 512) || (keysize > 1024) || (keysize % 64 != 0))) { + throw new InvalidAlgorithmParameterException( + "Keysize must be multiple of 64 ranging from " + + "512 to 1024 (inclusive), or 2048"); + } + } + /** * Initializes this parameter generator for a certain keysize * and source of randomness. @@ -67,11 +77,11 @@ extends AlgorithmParameterGeneratorSpi { * @param random the source of randomness */ protected void engineInit(int keysize, SecureRandom random) { - if ((keysize < 512) || (keysize > 2048) || (keysize % 64 != 0)) { - throw new InvalidParameterException("Keysize must be multiple " - + "of 64, and can only range " - + "from 512 to 2048 " - + "(inclusive)"); + // Re-uses DSA parameters and thus have the same range + try { + checkKeySize(keysize); + } catch (InvalidAlgorithmParameterException ex) { + throw new InvalidParameterException(ex.getMessage()); } this.primeSize = keysize; this.random = random; @@ -91,31 +101,29 @@ extends AlgorithmParameterGeneratorSpi { protected void engineInit(AlgorithmParameterSpec genParamSpec, SecureRandom random) throws InvalidAlgorithmParameterException { - if (!(genParamSpec instanceof DHGenParameterSpec)) { - throw new InvalidAlgorithmParameterException - ("Inappropriate parameter type"); - } + if (!(genParamSpec instanceof DHGenParameterSpec)) { + throw new InvalidAlgorithmParameterException + ("Inappropriate parameter type"); + } - DHGenParameterSpec dhParamSpec = (DHGenParameterSpec)genParamSpec; + DHGenParameterSpec dhParamSpec = (DHGenParameterSpec)genParamSpec; - primeSize = dhParamSpec.getPrimeSize(); - if ((primeSize<512) || (primeSize>2048) || (primeSize%64 != 0)) { - throw new InvalidAlgorithmParameterException - ("Modulus size must be multiple of 64, and can only range " - + "from 512 to 2048 (inclusive)"); - } + primeSize = dhParamSpec.getPrimeSize(); - exponentSize = dhParamSpec.getExponentSize(); - if (exponentSize <= 0) { - throw new InvalidAlgorithmParameterException - ("Exponent size must be greater than zero"); - } + // Re-uses DSA parameters and thus have the same range + checkKeySize(primeSize); - // Require exponentSize < primeSize - if (exponentSize >= primeSize) { - throw new InvalidAlgorithmParameterException - ("Exponent size must be less than modulus size"); - } + exponentSize = dhParamSpec.getExponentSize(); + if (exponentSize <= 0) { + throw new InvalidAlgorithmParameterException + ("Exponent size must be greater than zero"); + } + + // Require exponentSize < primeSize + if (exponentSize >= primeSize) { + throw new InvalidAlgorithmParameterException + ("Exponent size must be less than modulus size"); + } } /** diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java b/jdk/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java index e3254c4fc34..c87cc1c5d62 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java @@ -271,22 +271,6 @@ javax.crypto.interfaces.DHPrivateKey, Serializable { } } - public String toString() { - String LINE_SEP = System.getProperty("line.separator"); - - StringBuffer strbuf - = new StringBuffer("SunJCE Diffie-Hellman Private Key:" - + LINE_SEP + "x:" + LINE_SEP - + Debug.toHexString(this.x) - + LINE_SEP + "p:" + LINE_SEP - + Debug.toHexString(this.p) - + LINE_SEP + "g:" + LINE_SEP - + Debug.toHexString(this.g)); - if (this.l != 0) - strbuf.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); - return strbuf.toString(); - } - private void parseKeyBits() throws InvalidKeyException { try { DerInputStream in = new DerInputStream(this.key); diff --git a/jdk/src/share/classes/com/sun/crypto/provider/ElectronicCodeBook.java b/jdk/src/share/classes/com/sun/crypto/provider/ElectronicCodeBook.java index abbddd771de..a407b6a50c0 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/ElectronicCodeBook.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/ElectronicCodeBook.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -115,14 +115,15 @@ final class ElectronicCodeBook extends FeedbackCipher { * @param len the length of the input data * @param out the buffer for the result * @param outOff the offset in cipher + * @return the length of the encrypted data */ - void encrypt(byte[] in, int inOff, int len, byte[] out, int outOff) { - while (len >= blockSize) { + int encrypt(byte[] in, int inOff, int len, byte[] out, int outOff) { + for (int i = len; i >= blockSize; i -= blockSize) { embeddedCipher.encryptBlock(in, inOff, out, outOff); - len -= blockSize; inOff += blockSize; outOff += blockSize; } + return len; } /** @@ -147,14 +148,14 @@ final class ElectronicCodeBook extends FeedbackCipher { * @param len the length of the input data * @param out the buffer for the result * @param outOff the offset in plain + * @return the length of the decrypted data */ - void decrypt(byte[] in, int inOff, int len, byte[] out, int outOff) { - while (len >= blockSize) { + int decrypt(byte[] in, int inOff, int len, byte[] out, int outOff) { + for (int i = len; i >= blockSize; i -= blockSize) { embeddedCipher.decryptBlock(in, inOff, out, outOff); - len -= blockSize; inOff += blockSize; outOff += blockSize; } + return len; } - } diff --git a/jdk/src/share/classes/com/sun/crypto/provider/FeedbackCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/FeedbackCipher.java index c27332457f3..8d03913e284 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/FeedbackCipher.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/FeedbackCipher.java @@ -133,9 +133,10 @@ abstract class FeedbackCipher { * @param plainLen the length of the input data * @param cipher the buffer for the encryption result * @param cipherOffset the offset in cipher + * @return the number of bytes placed into cipher */ - abstract void encrypt(byte[] plain, int plainOffset, int plainLen, - byte[] cipher, int cipherOffset); + abstract int encrypt(byte[] plain, int plainOffset, int plainLen, + byte[] cipher, int cipherOffset); /** * Performs encryption operation for the last time. * @@ -154,10 +155,9 @@ abstract class FeedbackCipher { */ int encryptFinal(byte[] plain, int plainOffset, int plainLen, byte[] cipher, int cipherOffset) - throws IllegalBlockSizeException { - encrypt(plain, plainOffset, plainLen, cipher, cipherOffset); - return plainLen; - } + throws IllegalBlockSizeException, ShortBufferException { + return encrypt(plain, plainOffset, plainLen, cipher, cipherOffset); + } /** * Performs decryption operation. * @@ -174,9 +174,10 @@ abstract class FeedbackCipher { * @param cipherLen the length of the input data * @param plain the buffer for the decryption result * @param plainOffset the offset in plain + * @return the number of bytes placed into plain */ - abstract void decrypt(byte[] cipher, int cipherOffset, int cipherLen, - byte[] plain, int plainOffset); + abstract int decrypt(byte[] cipher, int cipherOffset, int cipherLen, + byte[] plain, int plainOffset); /** * Performs decryption operation for the last time. @@ -196,9 +197,9 @@ abstract class FeedbackCipher { */ int decryptFinal(byte[] cipher, int cipherOffset, int cipherLen, byte[] plain, int plainOffset) - throws IllegalBlockSizeException, AEADBadTagException { - decrypt(cipher, cipherOffset, cipherLen, plain, plainOffset); - return cipherLen; + throws IllegalBlockSizeException, AEADBadTagException, + ShortBufferException { + return decrypt(cipher, cipherOffset, cipherLen, plain, plainOffset); } /** @@ -228,4 +229,15 @@ abstract class FeedbackCipher { void updateAAD(byte[] src, int offset, int len) { throw new IllegalStateException("No AAD accepted"); } + + /** + * @return the number of bytes that are buffered internally inside + * this FeedbackCipher instance. + * @since 1.8 + */ + int getBufferedLength() { + // Currently only AEAD cipher impl, e.g. GCM, buffers data + // internally during decryption mode + return 0; + } } diff --git a/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java b/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java index 74d3555cc58..d4cd740af7b 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java @@ -54,7 +54,7 @@ final class GCTR { private byte[] counter; // needed for save/restore calls - private byte[] counterSave; + private byte[] counterSave = null; // NOTE: cipher should already be initialized GCTR(SymmetricCipher cipher, byte[] initialCounterBlk) { @@ -98,17 +98,16 @@ final class GCTR { throw new IllegalBlockSizeException("Negative input size!"); } else if (inLen > 0) { int lastBlockSize = inLen % AES_BLOCK_SIZE; + int completeBlkLen = inLen - lastBlockSize; // process the complete blocks first - update(in, inOfs, inLen - lastBlockSize, out, outOfs); + update(in, inOfs, completeBlkLen, out, outOfs); if (lastBlockSize != 0) { // do the last partial block byte[] encryptedCntr = new byte[AES_BLOCK_SIZE]; aes.encryptBlock(counter, 0, encryptedCntr, 0); - - int processed = inLen - lastBlockSize; for (int n = 0; n < lastBlockSize; n++) { - out[outOfs + processed + n] = - (byte) ((in[inOfs + processed + n] ^ + out[outOfs + completeBlkLen + n] = + (byte) ((in[inOfs + completeBlkLen + n] ^ encryptedCntr[n])); } } @@ -120,12 +119,11 @@ final class GCTR { } /** - * Resets the current counter to its initial value. - * This is used after the doFinal() is called so this object can be - * reused w/o explicit re-initialization. + * Resets the content of this object to when it's first constructed. */ void reset() { System.arraycopy(icb, 0, counter, 0, icb.length); + counterSave = null; } /** diff --git a/jdk/src/share/classes/com/sun/crypto/provider/GaloisCounterMode.java b/jdk/src/share/classes/com/sun/crypto/provider/GaloisCounterMode.java index 2f8b584e2a9..37bf6f41433 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/GaloisCounterMode.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/GaloisCounterMode.java @@ -35,10 +35,12 @@ import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE; * This class represents ciphers in GaloisCounter (GCM) mode. * *

    This mode currently should only be used w/ AES cipher. - * Although no checking is done here, caller should only - * pass AES Cipher to the constructor. + * Although no checking is done, caller should only pass AES + * Cipher to the constructor. * - *

    NOTE: This class does not deal with buffering or padding. + *

    NOTE: Unlike other modes, when used for decryption, this class + * will buffer all processed outputs internally and won't return them + * until the tag has been successfully verified. * * @since 1.8 */ @@ -51,6 +53,9 @@ final class GaloisCounterMode extends FeedbackCipher { private ByteArrayOutputStream aadBuffer = new ByteArrayOutputStream(); private int sizeOfAAD = 0; + // buffer for storing input in decryption, not used for encryption + private ByteArrayOutputStream ibuffer = null; + // in bytes; need to convert to bits (default value 128) when needed private int tagLenBytes = DEFAULT_TAG_LEN; @@ -68,12 +73,14 @@ final class GaloisCounterMode extends FeedbackCipher { // additional variables for save/restore calls private byte[] aadBufferSave = null; private int sizeOfAADSave = 0; + private byte[] ibufferSave = null; private int processedSave = 0; // value must be 16-byte long; used by GCTR and GHASH as well static void increment32(byte[] value) { if (value.length != AES_BLOCK_SIZE) { - throw new RuntimeException("Unexpected counter block length"); + // should never happen + throw new ProviderException("Illegal counter block length"); } // start from last byte and only go over 4 bytes, i.e. total 32 bits int n = value.length - 1; @@ -171,6 +178,9 @@ final class GaloisCounterMode extends FeedbackCipher { if (ghashAllToS != null) ghashAllToS.reset(); processed = 0; sizeOfAAD = 0; + if (ibuffer != null) { + ibuffer.reset(); + } } /** @@ -184,6 +194,9 @@ final class GaloisCounterMode extends FeedbackCipher { null : aadBuffer.toByteArray()); if (gctrPAndC != null) gctrPAndC.save(); if (ghashAllToS != null) ghashAllToS.save(); + if (ibuffer != null) { + ibufferSave = ibuffer.toByteArray(); + } } /** @@ -198,8 +211,12 @@ final class GaloisCounterMode extends FeedbackCipher { aadBuffer.write(aadBufferSave, 0, aadBufferSave.length); } } - if (gctrPAndC != null) gctrPAndC.restore(); - if (ghashAllToS != null) ghashAllToS.restore(); + if (gctrPAndC != null) gctrPAndC.restore(); + if (ghashAllToS != null) ghashAllToS.restore(); + if (ibuffer != null) { + ibuffer.reset(); + ibuffer.write(ibufferSave, 0, ibufferSave.length); + } } /** @@ -261,6 +278,9 @@ final class GaloisCounterMode extends FeedbackCipher { } processed = 0; sizeOfAAD = 0; + if (decrypting) { + ibuffer = new ByteArrayOutputStream(); + } } /** @@ -299,7 +319,7 @@ final class GaloisCounterMode extends FeedbackCipher { // Feed the AAD data to GHASH, pad if necessary void processAAD() { - if (aadBuffer != null) { + if (aadBuffer != null && aadBuffer.size() > 0) { byte[] aad = aadBuffer.toByteArray(); sizeOfAAD = aad.length; aadBuffer = null; @@ -365,13 +385,14 @@ final class GaloisCounterMode extends FeedbackCipher { * @param out the buffer for the result * @param outOfs the offset in out */ - void encrypt(byte[] in, int inOfs, int len, byte[] out, int outOfs) { + int encrypt(byte[] in, int inOfs, int len, byte[] out, int outOfs) { processAAD(); if (len > 0) { gctrPAndC.update(in, inOfs, len, out, outOfs); processed += len; ghashAllToS.update(out, outOfs, len); } + return len; } /** @@ -387,28 +408,28 @@ final class GaloisCounterMode extends FeedbackCipher { * @param outOfs the offset in out * @return the number of bytes placed into the out buffer */ - int encryptFinal(byte[] in, int inOfs, int len, byte[] out, int outOfs) - throws IllegalBlockSizeException { - if (out.length - outOfs < (len + tagLenBytes)) { - throw new RuntimeException("Output buffer too small"); - } + int encryptFinal(byte[] in, int inOfs, int len, byte[] out, int outOfs) + throws IllegalBlockSizeException, ShortBufferException { + if (out.length - outOfs < (len + tagLenBytes)) { + throw new ShortBufferException("Output buffer too small"); + } - processAAD(); - if (len > 0) { - //ByteUtil.dumpArray(Arrays.copyOfRange(in, inOfs, inOfs + len)); - doLastBlock(in, inOfs, len, out, outOfs, true); - } + processAAD(); + if (len > 0) { + doLastBlock(in, inOfs, len, out, outOfs, true); + } - byte[] lengthBlock = getLengthBlock(sizeOfAAD*8, processed*8); - ghashAllToS.update(lengthBlock); - byte[] s = ghashAllToS.digest(); - byte[] sOut = new byte[s.length]; - GCTR gctrForSToTag = new GCTR(embeddedCipher, this.preCounterBlock); - gctrForSToTag.doFinal(s, 0, s.length, sOut, 0); + byte[] lengthBlock = + getLengthBlock(sizeOfAAD*8, processed*8); + ghashAllToS.update(lengthBlock); + byte[] s = ghashAllToS.digest(); + byte[] sOut = new byte[s.length]; + GCTR gctrForSToTag = new GCTR(embeddedCipher, this.preCounterBlock); + gctrForSToTag.doFinal(s, 0, s.length, sOut, 0); - System.arraycopy(sOut, 0, out, (outOfs + len), tagLenBytes); - return (len + tagLenBytes); - } + System.arraycopy(sOut, 0, out, (outOfs + len), tagLenBytes); + return (len + tagLenBytes); + } /** * Performs decryption operation. @@ -432,14 +453,16 @@ final class GaloisCounterMode extends FeedbackCipher { * @param out the buffer for the result * @param outOfs the offset in out */ - void decrypt(byte[] in, int inOfs, int len, byte[] out, int outOfs) { + int decrypt(byte[] in, int inOfs, int len, byte[] out, int outOfs) { processAAD(); - if (len > 0) { // must be at least AES_BLOCK_SIZE bytes long - gctrPAndC.update(in, inOfs, len, out, outOfs); - processed += len; - ghashAllToS.update(in, inOfs, len); + if (len > 0) { + // store internally until decryptFinal is called because + // spec mentioned that only return recovered data after tag + // is successfully verified + ibuffer.write(in, inOfs, len); } + return 0; } /** @@ -458,44 +481,62 @@ final class GaloisCounterMode extends FeedbackCipher { * @param outOfs the offset in plain * @return the number of bytes placed into the out buffer */ - int decryptFinal(byte[] in, int inOfs, int len, - byte[] out, int outOfs) - throws IllegalBlockSizeException, AEADBadTagException { - if (len < tagLenBytes) { - throw new RuntimeException("Input buffer too short - need tag"); - } - if (out.length - outOfs < (len - tagLenBytes)) { - throw new RuntimeException("Output buffer too small"); - } - processAAD(); + int decryptFinal(byte[] in, int inOfs, int len, + byte[] out, int outOfs) + throws IllegalBlockSizeException, AEADBadTagException, + ShortBufferException { + if (len < tagLenBytes) { + throw new AEADBadTagException("Input too short - need tag"); + } + if (out.length - outOfs < ((ibuffer.size() + len) - tagLenBytes)) { + throw new ShortBufferException("Output buffer too small"); + } + processAAD(); + if (len != 0) { + ibuffer.write(in, inOfs, len); + } - int processedOld = processed; - byte[] tag = new byte[tagLenBytes]; - // get the trailing tag bytes from 'in' - System.arraycopy(in, inOfs + len - tagLenBytes, tag, 0, tagLenBytes); - len -= tagLenBytes; + // refresh 'in' to all buffered-up bytes + in = ibuffer.toByteArray(); + inOfs = 0; + len = in.length; + ibuffer.reset(); - if (len > 0) { - doLastBlock(in, inOfs, len, out, outOfs, false); - } + byte[] tag = new byte[tagLenBytes]; + // get the trailing tag bytes from 'in' + System.arraycopy(in, len - tagLenBytes, tag, 0, tagLenBytes); + len -= tagLenBytes; - byte[] lengthBlock = getLengthBlock(sizeOfAAD*8, processed*8); - ghashAllToS.update(lengthBlock); + if (len > 0) { + doLastBlock(in, inOfs, len, out, outOfs, false); + } - byte[] s = ghashAllToS.digest(); - byte[] sOut = new byte[s.length]; - GCTR gctrForSToTag = new GCTR(embeddedCipher, this.preCounterBlock); - gctrForSToTag.doFinal(s, 0, s.length, sOut, 0); - for (int i = 0; i < tagLenBytes; i++) { - if (tag[i] != sOut[i]) { - throw new AEADBadTagException("Tag mismatch!"); - } - } - return len; - } + byte[] lengthBlock = + getLengthBlock(sizeOfAAD*8, processed*8); + ghashAllToS.update(lengthBlock); + + byte[] s = ghashAllToS.digest(); + byte[] sOut = new byte[s.length]; + GCTR gctrForSToTag = new GCTR(embeddedCipher, this.preCounterBlock); + gctrForSToTag.doFinal(s, 0, s.length, sOut, 0); + for (int i = 0; i < tagLenBytes; i++) { + if (tag[i] != sOut[i]) { + throw new AEADBadTagException("Tag mismatch!"); + } + } + return len; + } // return tag length in bytes int getTagLen() { return this.tagLenBytes; } + + int getBufferedLength() { + if (ibuffer == null) { + return 0; + } else { + return ibuffer.size(); + } + } } diff --git a/jdk/src/share/classes/com/sun/crypto/provider/OutputFeedback.java b/jdk/src/share/classes/com/sun/crypto/provider/OutputFeedback.java index f8a34602ac1..ea5890db2e5 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/OutputFeedback.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/OutputFeedback.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -149,9 +149,10 @@ final class OutputFeedback extends FeedbackCipher { * @param plainLen the length of the input data * @param cipher the buffer for the result * @param cipherOffset the offset in cipher + * @return the length of the encrypted data */ - void encrypt(byte[] plain, int plainOffset, int plainLen, - byte[] cipher, int cipherOffset) + int encrypt(byte[] plain, int plainOffset, int plainLen, + byte[] cipher, int cipherOffset) { int i; int len = blockSize - numBytes; @@ -195,6 +196,7 @@ final class OutputFeedback extends FeedbackCipher { System.arraycopy(k, 0, register, len, numBytes); } } + return plainLen; } /** @@ -219,11 +221,12 @@ final class OutputFeedback extends FeedbackCipher { * @param cipherLen the length of the input data * @param plain the buffer for the result * @param plainOffset the offset in plain + * @return the length of the decrypted data */ - void decrypt(byte[] cipher, int cipherOffset, int cipherLen, + int decrypt(byte[] cipher, int cipherOffset, int cipherLen, byte[] plain, int plainOffset) { // OFB encrypt and decrypt are identical - encrypt(cipher, cipherOffset, cipherLen, plain, plainOffset); + return encrypt(cipher, cipherOffset, cipherLen, plain, plainOffset); } } diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java b/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java index 2d06c901942..98f85cf04bd 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java @@ -408,7 +408,7 @@ final class PBECipherCore { * no padding has been requested (only in encryption mode), and the total * input length of the data processed by this cipher is not a multiple of * block size - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ byte[] doFinal(byte[] input, int inputOffset, int inputLen) @@ -448,7 +448,7 @@ final class PBECipherCore { * block size * @exception ShortBufferException if the given output buffer is too small * to hold the result - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ int doFinal(byte[] input, int inputOffset, int inputLen, diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java b/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java index 88296c857d1..d5389ac40ac 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java @@ -408,7 +408,7 @@ final class PBES1Core { * no padding has been requested (only in encryption mode), and the total * input length of the data processed by this cipher is not a multiple of * block size - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ byte[] doFinal(byte[] input, int inputOffset, int inputLen) @@ -448,7 +448,7 @@ final class PBES1Core { * block size * @exception ShortBufferException if the given output buffer is too small * to hold the result - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ int doFinal(byte[] input, int inputOffset, int inputLen, diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java index d448f277dcb..62394e784c2 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java @@ -307,7 +307,7 @@ public final class PBEWithMD5AndDESCipher extends CipherSpi { * no padding has been requested (only in encryption mode), and the total * input length of the data processed by this cipher is not a multiple of * block size - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen) @@ -348,7 +348,7 @@ public final class PBEWithMD5AndDESCipher extends CipherSpi { * block size * @exception ShortBufferException if the given output buffer is too small * to hold the result - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ protected int engineDoFinal(byte[] input, int inputOffset, int inputLen, diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java index d6216a81fb9..978e7b7b778 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java @@ -317,7 +317,7 @@ public final class PBEWithMD5AndTripleDESCipher extends CipherSpi { * no padding has been requested (only in encryption mode), and the total * input length of the data processed by this cipher is not a multiple of * block size - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen) @@ -358,7 +358,7 @@ public final class PBEWithMD5AndTripleDESCipher extends CipherSpi { * block size * @exception ShortBufferException if the given output buffer is too small * to hold the result - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ protected int engineDoFinal(byte[] input, int inputOffset, int inputLen, diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PCBC.java b/jdk/src/share/classes/com/sun/crypto/provider/PCBC.java index aa4758593af..360e1833afb 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PCBC.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PCBC.java @@ -136,8 +136,8 @@ final class PCBC extends FeedbackCipher { * @param cipher the buffer for the result * @param cipherOffset the offset in cipher */ - void encrypt(byte[] plain, int plainOffset, int plainLen, - byte[] cipher, int cipherOffset) + int encrypt(byte[] plain, int plainOffset, int plainLen, + byte[] cipher, int cipherOffset) { int i; int endIndex = plainOffset + plainLen; @@ -152,6 +152,7 @@ final class PCBC extends FeedbackCipher { k[i] = (byte)(plain[i+plainOffset] ^ cipher[i+cipherOffset]); } } + return plainLen; } /** @@ -177,8 +178,8 @@ final class PCBC extends FeedbackCipher { * @param plain the buffer for the result * @param plainOffset the offset in plain */ - void decrypt(byte[] cipher, int cipherOffset, int cipherLen, - byte[] plain, int plainOffset) + int decrypt(byte[] cipher, int cipherOffset, int cipherLen, + byte[] plain, int plainOffset) { int i; int endIndex = cipherOffset + cipherLen; @@ -194,5 +195,6 @@ final class PCBC extends FeedbackCipher { k[i] = (byte)(plain[i+plainOffset] ^ cipher[i+cipherOffset]); } } + return cipherLen; } } diff --git a/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java b/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java index af828e2a651..08e1e2ae737 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java @@ -104,7 +104,7 @@ public final class SunJCE extends Provider { public SunJCE() { /* We are the "SunJCE" provider */ - super("SunJCE", 1.7d, info); + super("SunJCE", 1.8d, info); final String BLOCK_MODES = "ECB|CBC|PCBC|CTR|CTS|CFB|OFB" + "|CFB8|CFB16|CFB24|CFB32|CFB40|CFB48|CFB56|CFB64" + diff --git a/jdk/src/share/classes/com/sun/demo/jvmti/hprof/Tracker.java b/jdk/src/share/classes/com/sun/demo/jvmti/hprof/Tracker.java index f2e33d72454..96950870be2 100644 --- a/jdk/src/share/classes/com/sun/demo/jvmti/hprof/Tracker.java +++ b/jdk/src/share/classes/com/sun/demo/jvmti/hprof/Tracker.java @@ -53,7 +53,10 @@ public class Tracker { public static void ObjectInit(Object obj) { - if ( engaged != 0 ) { + if ( engaged != 0) { + if (obj == null) { + throw new IllegalArgumentException("Null object."); + } nativeObjectInit(Thread.currentThread(), obj); } } @@ -66,7 +69,10 @@ public class Tracker { public static void NewArray(Object obj) { - if ( engaged != 0 ) { + if ( engaged != 0) { + if (obj == null) { + throw new IllegalArgumentException("Null object."); + } nativeNewArray(Thread.currentThread(), obj); } } @@ -82,6 +88,14 @@ public class Tracker { public static void CallSite(int cnum, int mnum) { if ( engaged != 0 ) { + if (cnum < 0) { + throw new IllegalArgumentException("Negative class index"); + } + + if (mnum < 0) { + throw new IllegalArgumentException("Negative method index"); + } + nativeCallSite(Thread.currentThread(), cnum, mnum); } } @@ -95,6 +109,14 @@ public class Tracker { public static void ReturnSite(int cnum, int mnum) { if ( engaged != 0 ) { + if (cnum < 0) { + throw new IllegalArgumentException("Negative class index"); + } + + if (mnum < 0) { + throw new IllegalArgumentException("Negative method index"); + } + nativeReturnSite(Thread.currentThread(), cnum, mnum); } } diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPCompressionTypes.java b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPCompressionTypes.java new file mode 100644 index 00000000000..c61beeeb789 --- /dev/null +++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPCompressionTypes.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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.imageio.plugins.bmp; + +public class BMPCompressionTypes { + + private static final String[] compressionTypeNames = + {"BI_RGB", "BI_RLE8", "BI_RLE4", "BI_BITFIELDS", "BI_JPEG", "BI_PNG"}; + + static int getType(String typeString) { + for (int i = 0; i < compressionTypeNames.length; i++) + if (compressionTypeNames[i].equals(typeString)) + return i; + return 0; + } + + static String getName(int type) { + return compressionTypeNames[type]; + } + + public static String[] getCompressionTypes() { + return compressionTypeNames.clone(); + } +} diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPConstants.java b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPConstants.java index 7934eaf17c0..b99d28484a7 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPConstants.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPConstants.java @@ -47,7 +47,4 @@ public interface BMPConstants { static final int BI_BITFIELDS = 3; static final int BI_JPEG = 4; static final int BI_PNG = 5; - - static final String[] compressionTypeNames = - {"BI_RGB", "BI_RLE8", "BI_RLE4", "BI_BITFIELDS", "BI_JPEG", "BI_PNG"}; } diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java index 94fd920ba31..b8c9a1e2b36 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java @@ -187,15 +187,24 @@ public class BMPImageReader extends ImageReader implements BMPConstants { return 1; } + @Override public int getWidth(int imageIndex) throws IOException { checkIndex(imageIndex); - readHeader(); + try { + readHeader(); + } catch (IllegalArgumentException e) { + throw new IIOException(I18N.getString("BMPImageReader6"), e); + } return width; } public int getHeight(int imageIndex) throws IOException { checkIndex(imageIndex); - readHeader(); + try { + readHeader(); + } catch (IllegalArgumentException e) { + throw new IIOException(I18N.getString("BMPImageReader6"), e); + } return height; } @@ -205,7 +214,18 @@ public class BMPImageReader extends ImageReader implements BMPConstants { } } - public void readHeader() throws IOException { + /** + * Process the image header. + * + * @exception IllegalStateException if source stream is not set. + * + * @exception IOException if image stream is corrupted. + * + * @exception IllegalArgumentException if the image stream does not contain + * a BMP image, or if a sample model instance to describe the + * image can not be created. + */ + protected void readHeader() throws IOException, IllegalArgumentException { if (gotHeader) return; @@ -307,6 +327,9 @@ public class BMPImageReader extends ImageReader implements BMPConstants { case BI_RLE4: // 4-bit RLE compression // Read in the palette + if (bitmapOffset < (size + 14)) { + throw new IIOException(I18N.getString("BMPImageReader7")); + } int numberOfEntries = (int)((bitmapOffset-14-size) / 4); int sizeOfPalette = numberOfEntries * 4; palette = new byte[sizeOfPalette]; @@ -375,7 +398,7 @@ public class BMPImageReader extends ImageReader implements BMPConstants { break; default: throw new - RuntimeException(I18N.getString("BMPImageReader2")); + IIOException(I18N.getString("BMPImageReader2")); } } else if (size == 108 || size == 124) { // Windows 4.x BMP @@ -478,7 +501,7 @@ public class BMPImageReader extends ImageReader implements BMPConstants { } } else { throw new - RuntimeException(I18N.getString("BMPImageReader3")); + IIOException(I18N.getString("BMPImageReader3")); } } @@ -660,7 +683,11 @@ public class BMPImageReader extends ImageReader implements BMPConstants { public Iterator getImageTypes(int imageIndex) throws IOException { checkIndex(imageIndex); - readHeader(); + try { + readHeader(); + } catch (IllegalArgumentException e) { + throw new IIOException(I18N.getString("BMPImageReader6"), e); + } ArrayList list = new ArrayList(1); list.add(new ImageTypeSpecifier(originalColorModel, originalSampleModel)); @@ -675,7 +702,11 @@ public class BMPImageReader extends ImageReader implements BMPConstants { throws IOException { checkIndex(imageIndex); if (metadata == null) { - readHeader(); + try { + readHeader(); + } catch (IllegalArgumentException e) { + throw new IIOException(I18N.getString("BMPImageReader6"), e); + } } return metadata; } @@ -686,7 +717,11 @@ public class BMPImageReader extends ImageReader implements BMPConstants { public boolean isRandomAccessEasy(int imageIndex) throws IOException { checkIndex(imageIndex); - readHeader(); + try { + readHeader(); + } catch (IllegalArgumentException e) { + throw new IIOException(I18N.getString("BMPImageReader6"), e); + } return metadata.compression == BI_RGB; } @@ -705,7 +740,11 @@ public class BMPImageReader extends ImageReader implements BMPConstants { param = getDefaultReadParam(); //read header - readHeader(); + try { + readHeader(); + } catch (IllegalArgumentException e) { + throw new IIOException(I18N.getString("BMPImageReader6"), e); + } sourceRegion = new Rectangle(0, 0, 0, 0); destinationRegion = new Rectangle(0, 0, 0, 0); @@ -817,7 +856,7 @@ public class BMPImageReader extends ImageReader implements BMPConstants { default: throw new - RuntimeException(I18N.getString("BMPImageReader1")); + IIOException(I18N.getString("BMPImageReader1")); } break; @@ -833,7 +872,7 @@ public class BMPImageReader extends ImageReader implements BMPConstants { default: throw new - RuntimeException(I18N.getString("BMPImageReader1")); + IIOException(I18N.getString("BMPImageReader1")); } break; @@ -874,7 +913,7 @@ public class BMPImageReader extends ImageReader implements BMPConstants { default: throw new - RuntimeException(I18N.getString("BMPImageReader1")); + IIOException(I18N.getString("BMPImageReader1")); } case VERSION_4_8_BIT: @@ -890,7 +929,7 @@ public class BMPImageReader extends ImageReader implements BMPConstants { default: throw new - RuntimeException(I18N.getString("BMPImageReader1")); + IIOException(I18N.getString("BMPImageReader1")); } break; diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java index bfed710d1fc..5d1241ec53f 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java @@ -25,7 +25,6 @@ package com.sun.imageio.plugins.bmp; -import java.awt.Point; import java.awt.Rectangle; import java.awt.image.ColorModel; import java.awt.image.ComponentSampleModel; @@ -42,7 +41,6 @@ import java.awt.image.Raster; import java.awt.image.RenderedImage; import java.awt.image.SampleModel; import java.awt.image.SinglePixelPackedSampleModel; -import java.awt.image.WritableRaster; import java.awt.image.BufferedImage; import java.io.IOException; @@ -51,22 +49,16 @@ import java.nio.ByteOrder; import java.util.Iterator; import javax.imageio.IIOImage; -import javax.imageio.IIOException; import javax.imageio.ImageIO; import javax.imageio.ImageTypeSpecifier; import javax.imageio.ImageWriteParam; import javax.imageio.ImageWriter; import javax.imageio.metadata.IIOMetadata; -import javax.imageio.metadata.IIOMetadataNode; -import javax.imageio.metadata.IIOMetadataFormatImpl; -import javax.imageio.metadata.IIOInvalidTreeException; import javax.imageio.spi.ImageWriterSpi; import javax.imageio.stream.ImageOutputStream; import javax.imageio.event.IIOWriteProgressListener; import javax.imageio.event.IIOWriteWarningListener; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; import javax.imageio.plugins.bmp.BMPImageWriteParam; import com.sun.imageio.plugins.common.ImageUtil; @@ -129,7 +121,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { meta.compression = getPreferredCompressionType(imageType); if (param != null && param.getCompressionMode() == ImageWriteParam.MODE_EXPLICIT) { - meta.compression = getCompressionType(param.getCompressionType()); + meta.compression = BMPCompressionTypes.getType(param.getCompressionType()); } meta.bitsPerPixel = (short)imageType.getColorModel().getPixelSize(); return meta; @@ -308,7 +300,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { switch(bmpParam.getCompressionMode()) { case ImageWriteParam.MODE_EXPLICIT: - compressionType = getCompressionType(bmpParam.getCompressionType()); + compressionType = BMPCompressionTypes.getType(bmpParam.getCompressionType()); break; case ImageWriteParam.MODE_COPY_FROM_METADATA: compressionType = bmpImageMetadata.compression; @@ -323,12 +315,12 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { if (!canEncodeImage(compressionType, colorModel, sampleModel)) { throw new IOException("Image can not be encoded with compression type " - + compressionTypeNames[compressionType]); + + BMPCompressionTypes.getName(compressionType)); } byte r[] = null, g[] = null, b[] = null, a[] = null; - if (compressionType == BMPConstants.BI_BITFIELDS) { + if (compressionType == BI_BITFIELDS) { bitsPerPixel = DataBuffer.getDataTypeSize(sampleModel.getDataType()); @@ -372,7 +364,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { // an exception related to unsupported image format throw new IOException("Image can not be encoded with " + "compression type " + - compressionTypeNames[compressionType]); + BMPCompressionTypes.getName(compressionType)); } } writeMaskToPalette(rmask, 0, r, g, b, a); @@ -511,8 +503,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { * Images with any other compression type must be wrote in the * bottom-up layout. */ - if (compressionType == BMPConstants.BI_RGB || - compressionType == BMPConstants.BI_BITFIELDS) + if (compressionType == BI_RGB || + compressionType == BI_BITFIELDS) { isTopDown = bmpParam.isTopDown(); } else { @@ -543,7 +535,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { if (isPalette == true) { // write palette - if (compressionType == BMPConstants.BI_BITFIELDS) { + if (compressionType == BI_BITFIELDS) { // write masks for red, green and blue components. for (int i=0; i<3; i++) { int mask = (a[i]&0xFF) + ((r[i]&0xFF)*0x100) + ((g[i]&0xFF)*0x10000) + ((b[i]&0xFF)*0x1000000); @@ -571,8 +563,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { int l; - if (compressionType == BMPConstants.BI_JPEG || - compressionType == BMPConstants.BI_PNG) { + if (compressionType == BI_JPEG || + compressionType == BI_PNG) { // prepare embedded buffer embedded_stream = new ByteArrayOutputStream(); @@ -657,7 +649,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { pos = sppsm.getOffset(startX, startY); } - if (compressionType == BMPConstants.BI_RGB || compressionType == BMPConstants.BI_BITFIELDS){ + if (compressionType == BI_RGB || compressionType == BI_BITFIELDS){ switch(dataType) { case DataBuffer.TYPE_BYTE: byte[] bdata = @@ -687,7 +679,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { for(int k=0; k 8) { + throw new IIOException("Illegal band size: should be 0 < size <= 8"); + } + } /* * If the process is sequential, and we have restart markers, diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java index b8564176df8..d9723e7ba20 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java @@ -495,8 +495,8 @@ public class JPEGImageWriter extends ImageWriter { // handle <= 8-bit samples. We now check the band sizes and throw // an exception for images, such as USHORT_GRAY, with > 8 bits // per sample. - if (bandSizes[i] > 8) { - throw new IIOException("Sample size must be <= 8"); + if (bandSizes[i] <= 0 || bandSizes[i] > 8) { + throw new IIOException("Illegal band size: should be 0 < size <= 8"); } // 4450894 part 2: We expand IndexColorModel images to full 24- // or 32-bit in grabPixels() for each scanline. For indexed diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java index 6036cb49870..c7b8fd3d0e5 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -278,10 +278,11 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { (JFIFMarkerSegment) findMarkerSegment (JFIFMarkerSegment.class, true); if (jfif == null) { - throw new IIOException - ("ICC APP2 encountered without prior JFIF!"); + newGuy = new MarkerSegment(buffer); + newGuy.loadData(buffer); + } else { + jfif.addICC(buffer); } - jfif.addICC(buffer); // newGuy remains null } else { newGuy = new MarkerSegment(buffer); diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java index fd8d1cd53c1..f38e30f3ae8 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java @@ -28,6 +28,7 @@ package com.sun.imageio.plugins.jpeg; import javax.imageio.metadata.IIOInvalidTreeException; import javax.imageio.metadata.IIOMetadataNode; import javax.imageio.stream.ImageOutputStream; +import javax.imageio.IIOException; import java.io.IOException; @@ -60,6 +61,10 @@ class MarkerSegment implements Cloneable { length = (buffer.buf[buffer.bufPtr++] & 0xff) << 8; length |= buffer.buf[buffer.bufPtr++] & 0xff; length -= 2; // JPEG length includes itself, we don't + + if (length < 0) { + throw new IIOException("Invalid segment length: " + length); + } buffer.bufAvail -= 3; // Now that we know the true length, ensure that we've got it, // or at least a bufferful if length is too big. diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java index c1359e7b09d..904fa73777c 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java @@ -78,7 +78,7 @@ class SOFMarkerSegment extends MarkerSegment { numLines |= buffer.buf[buffer.bufPtr++] & 0xff; samplesPerLine = (buffer.buf[buffer.bufPtr++] & 0xff) << 8; samplesPerLine |= buffer.buf[buffer.bufPtr++] & 0xff; - int numComponents = buffer.buf[buffer.bufPtr++]; + int numComponents = buffer.buf[buffer.bufPtr++] & 0xff; componentSpecs = new ComponentSpec [numComponents]; for (int i = 0; i < numComponents; i++) { componentSpecs[i] = new ComponentSpec(buffer); diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java index e2ab9577dc4..abef6740f74 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java @@ -688,6 +688,21 @@ public class PNGImageReader extends ImageReader { loop: while (true) { int chunkLength = stream.readInt(); int chunkType = stream.readInt(); + int chunkCRC; + + // verify the chunk length + if (chunkLength < 0) { + throw new IIOException("Invalid chunk lenght " + chunkLength); + }; + + try { + stream.mark(); + stream.seek(stream.getStreamPosition() + chunkLength); + chunkCRC = stream.readInt(); + stream.reset(); + } catch (IOException e) { + throw new IIOException("Invalid chunk length " + chunkLength); + } switch (chunkType) { case IDAT_TYPE: @@ -762,7 +777,11 @@ public class PNGImageReader extends ImageReader { break; } - int chunkCRC = stream.readInt(); + // double check whether all chunk data were consumed + if (chunkCRC != stream.readInt()) { + throw new IIOException("Failed to read a chunk of type " + + chunkType); + } stream.flushBefore(stream.getStreamPosition()); } } catch (IOException e) { @@ -1277,6 +1296,16 @@ public class PNGImageReader extends ImageReader { is = new BufferedInputStream(is); this.pixelStream = new DataInputStream(is); + /* + * NB: the PNG spec declares that valid range for width + * and height is [1, 2^31-1], so here we may fail to allocate + * a buffer for destination image due to memory limitation. + * + * However, the recovery strategy for this case should be + * defined on the level of application, so we will not + * try to estimate the required amount of the memory and/or + * handle OOM in any way. + */ theImage = getDestination(param, getImageTypes(0), width, diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java index 1a326db11d9..41392c53a1e 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java @@ -29,12 +29,10 @@ import java.awt.image.ColorModel; import java.awt.image.IndexColorModel; import java.awt.image.SampleModel; import java.util.ArrayList; -import java.util.Iterator; import java.util.StringTokenizer; import javax.imageio.ImageTypeSpecifier; import javax.imageio.metadata.IIOInvalidTreeException; import javax.imageio.metadata.IIOMetadata; -import javax.imageio.metadata.IIOMetadataFormat; import javax.imageio.metadata.IIOMetadataFormatImpl; import javax.imageio.metadata.IIOMetadataNode; import org.w3c.dom.Node; @@ -49,42 +47,42 @@ public class PNGMetadata extends IIOMetadata implements Cloneable { = "com.sun.imageio.plugins.png.PNGMetadataFormat"; // Color types for IHDR chunk - public static final String[] IHDR_colorTypeNames = { + static final String[] IHDR_colorTypeNames = { "Grayscale", null, "RGB", "Palette", "GrayAlpha", null, "RGBAlpha" }; - public static final int[] IHDR_numChannels = { + static final int[] IHDR_numChannels = { 1, 0, 3, 3, 2, 0, 4 }; // Bit depths for IHDR chunk - public static final String[] IHDR_bitDepths = { + static final String[] IHDR_bitDepths = { "1", "2", "4", "8", "16" }; // Compression methods for IHDR chunk - public static final String[] IHDR_compressionMethodNames = { + static final String[] IHDR_compressionMethodNames = { "deflate" }; // Filter methods for IHDR chunk - public static final String[] IHDR_filterMethodNames = { + static final String[] IHDR_filterMethodNames = { "adaptive" }; // Interlace methods for IHDR chunk - public static final String[] IHDR_interlaceMethodNames = { + static final String[] IHDR_interlaceMethodNames = { "none", "adam7" }; // Compression methods for iCCP chunk - public static final String[] iCCP_compressionMethodNames = { + static final String[] iCCP_compressionMethodNames = { "deflate" }; // Compression methods for zTXt chunk - public static final String[] zTXt_compressionMethodNames = { + static final String[] zTXt_compressionMethodNames = { "deflate" }; @@ -95,12 +93,12 @@ public class PNGMetadata extends IIOMetadata implements Cloneable { public static final int PHYS_UNIT_METER = 1; // Unit specifiers for pHYs chunk - public static final String[] unitSpecifierNames = { + static final String[] unitSpecifierNames = { "unknown", "meter" }; // Rendering intents for sRGB chunk - public static final String[] renderingIntentNames = { + static final String[] renderingIntentNames = { "Perceptual", // 0 "Relative colorimetric", // 1 "Saturation", // 2 @@ -109,7 +107,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable { }; // Color space types for Chroma->ColorSpaceType node - public static final String[] colorSpaceTypeNames = { + static final String[] colorSpaceTypeNames = { "GRAY", null, "RGB", "RGB", "GRAY", null, "RGB" }; diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.java b/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.java index 38fb6d78b36..95d572ff7fd 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.java @@ -85,42 +85,42 @@ public class WBMPImageReaderSpi extends ImageReaderSpi { ImageInputStream stream = (ImageInputStream)source; stream.mark(); - int type = stream.readByte(); // TypeField - int fixHeaderField = stream.readByte(); - // check WBMP "header" - if (type != 0 || fixHeaderField != 0) { - // while WBMP reader does not support ext WBMP headers + try { + int type = stream.readByte(); // TypeField + int fixHeaderField = stream.readByte(); + // check WBMP "header" + if (type != 0 || fixHeaderField != 0) { + // while WBMP reader does not support ext WBMP headers + return false; + } + + int width = ReaderUtil.readMultiByteInteger(stream); + int height = ReaderUtil.readMultiByteInteger(stream); + // check image dimension + if (width <= 0 || height <= 0) { + return false; + } + + long dataLength = stream.length(); + if (dataLength == -1) { + // We can't verify that amount of data in the stream + // corresponds to image dimension because we do not know + // the length of the data stream. + // Assuming that wbmp image are used for mobile devices, + // let's introduce an upper limit for image dimension. + // In case if exact amount of raster data is unknown, + // let's reject images with dimension above the limit. + return (width < MAX_WBMP_WIDTH) && (height < MAX_WBMP_HEIGHT); + } + + dataLength -= stream.getStreamPosition(); + + long scanSize = (width / 8) + ((width % 8) == 0 ? 0 : 1); + + return (dataLength == scanSize * height); + } finally { stream.reset(); - return false; } - - int width = ReaderUtil.readMultiByteInteger(stream); - int height = ReaderUtil.readMultiByteInteger(stream); - // check image dimension - if (width <= 0 || height <= 0) { - stream.reset(); - return false; - } - - long dataLength = stream.length(); - if (dataLength == -1) { - // We can't verify that amount of data in the stream - // corresponds to image dimension because we do not know - // the length of the data stream. - // Assuming that wbmp image are used for mobile devices, - // let's introduce an upper limit for image dimension. - // In case if exact amount of raster data is unknown, - // let's reject images with dimension above the limit. - stream.reset(); - return (width < MAX_WBMP_WIDTH) && (height < MAX_WBMP_HEIGHT); - } - - dataLength -= stream.getStreamPosition(); - stream.reset(); - - long scanSize = (width / 8) + ((width % 8) == 0 ? 0 : 1); - - return (dataLength == scanSize * height); } public ImageReader createReaderInstance(Object extension) diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java index be764d09129..367a6ed731b 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java @@ -1041,7 +1041,7 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements } /** - * Rotates the triangle to accomodate the passed in hue. + * Rotates the triangle to accommodate the passed in hue. */ private void setAngleFromHue(float hue) { setHueAngle((1.0 - hue) * Math.PI * 2); diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java index 0cff673711c..df2b7f7cc23 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java @@ -41,6 +41,7 @@ import javax.swing.plaf.basic.BasicDirectoryModel; import javax.swing.table.*; import javax.accessibility.*; +import sun.swing.AbstractFilterComboBoxModel; import sun.swing.SwingUtilities2; import sun.swing.plaf.synth.*; @@ -1328,71 +1329,9 @@ class GTKFileChooserUI extends SynthFileChooserUI { /** * Data model for filter combo-box. */ - protected class FilterComboBoxModel extends AbstractListModel - implements ComboBoxModel, PropertyChangeListener { - protected FileFilter[] filters; - - protected FilterComboBoxModel() { - super(); - filters = getFileChooser().getChoosableFileFilters(); - } - - public void propertyChange(PropertyChangeEvent e) { - String prop = e.getPropertyName(); - if (prop == JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) { - filters = (FileFilter[]) e.getNewValue(); - fireContentsChanged(this, -1, -1); - } else if (prop == JFileChooser.FILE_FILTER_CHANGED_PROPERTY) { - fireContentsChanged(this, -1, -1); - } - } - - public void setSelectedItem(Object filter) { - if (filter != null) { - getFileChooser().setFileFilter((FileFilter) filter); - fireContentsChanged(this, -1, -1); - } - } - - public Object getSelectedItem() { - // Ensure that the current filter is in the list. - // NOTE: we shouldnt' have to do this, since JFileChooser adds - // the filter to the choosable filters list when the filter - // is set. Lets be paranoid just in case someone overrides - // setFileFilter in JFileChooser. - FileFilter currentFilter = getFileChooser().getFileFilter(); - boolean found = false; - if (currentFilter != null) { - for (FileFilter filter : filters) { - if (filter == currentFilter) { - found = true; - } - } - if (found == false) { - getFileChooser().addChoosableFileFilter(currentFilter); - } - } - return getFileChooser().getFileFilter(); - } - - public int getSize() { - if (filters != null) { - return filters.length; - } else { - return 0; - } - } - - public Object getElementAt(int index) { - if (index > getSize() - 1) { - // This shouldn't happen. Try to recover gracefully. - return getFileChooser().getFileFilter(); - } - if (filters != null) { - return filters[index]; - } else { - return null; - } + protected class FilterComboBoxModel extends AbstractFilterComboBoxModel { + protected JFileChooser getFileChooser() { + return GTKFileChooserUI.this.getFileChooser(); } } } diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java index 1fe26b09f31..f615fa78fa8 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java @@ -304,7 +304,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel { table.put("Synth.doNotSetTextAA", true); initResourceBundle(table); - // For compatability with apps expecting certain defaults we'll + // For compatibility with apps expecting certain defaults we'll // populate the table with the values from basic. initSystemColorDefaults(table); initComponentDefaults(table); @@ -332,7 +332,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel { } protected void initComponentDefaults(UIDefaults table) { - // For compatability with apps expecting certain defaults we'll + // For compatibility with apps expecting certain defaults we'll // populate the table with the values from basic. super.initComponentDefaults(table); diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java index 751c2d89a3f..20a384483da 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java @@ -131,7 +131,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { * Returns a SynthPainter that will route the appropriate * calls to a GTKEngine. * - * @param state SynthContext indentifying requestor + * @param state SynthContext identifying requestor * @return SynthPainter */ @Override @@ -204,7 +204,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { /** * Returns the color for the specified state. * - * @param context SynthContext identifying requester + * @param context SynthContext identifying requestor * @param state to get the color for * @param type of the color * @return Color to render with @@ -305,7 +305,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { * insets will be placed in it, otherwise a new Insets object will be * created and returned. * - * @param context SynthContext indentifying requestor + * @param context SynthContext identifying requestor * @param insets Where to place Insets * @return Insets. */ @@ -640,7 +640,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { /** * Convenience method to get a class specific integer value. * - * @param context SynthContext indentifying requestor + * @param context SynthContext identifying requestor * @param key Key identifying class specific value * @param defaultValue Returned if there is no value for the specified * type @@ -660,7 +660,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { /** * Convenience method to get a class specific Insets value. * - * @param context SynthContext indentifying requestor + * @param context SynthContext identifying requestor * @param key Key identifying class specific value * @param defaultValue Returned if there is no value for the specified * type @@ -680,7 +680,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { /** * Convenience method to get a class specific Boolean value. * - * @param context SynthContext indentifying requestor + * @param context SynthContext identifying requestor * @param key Key identifying class specific value * @param defaultValue Returned if there is no value for the specified * type @@ -702,7 +702,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { * to. A Style should NOT assume the opacity will remain this value, the * developer may reset it or override it. * - * @param context SynthContext indentifying requestor + * @param context SynthContext identifying requestor * @return opaque Whether or not the JComponent is opaque. */ @Override @@ -843,7 +843,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { // Is it another kind of value ? if (key != "engine") { - // For backward compatability we'll fallback to the UIManager. + // For backward compatibility we'll fallback to the UIManager. // We don't go to the UIManager for engine as the engine is GTK // specific. Object value = UIManager.get(key); diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties index c4eeded333f..a8985ce605f 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties @@ -41,7 +41,7 @@ FileChooser.saveDialogTitle.textAndMnemonic=Speichern FileChooser.openDialogTitle.textAndMnemonic=\u00D6ffnen FileChooser.pathLabel.textAndMnemonic=Aus&wahl: FileChooser.filterLabel.textAndMnemonic=Filter: -FileChooser.foldersLabel.textAndMnemonic=Or&dner +FileChooser.foldersLabel.textAndMnemonic=O&rdner FileChooser.filesLabel.textAndMnemonic=&Dateien FileChooser.cancelButtonToolTip.textAndMnemonic=Dialogfeld f\u00FCr Dateiauswahl schlie\u00DFen. diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java index 048e76647c4..b821a56abc1 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java @@ -38,6 +38,7 @@ import java.io.File; import java.io.IOException; import java.util.*; import sun.awt.shell.ShellFolder; +import sun.swing.AbstractFilterComboBoxModel; import sun.swing.SwingUtilities2; /** @@ -777,70 +778,9 @@ public class MotifFileChooserUI extends BasicFileChooserUI { /** * Data model for a type-face selection combo-box. */ - protected class FilterComboBoxModel extends AbstractListModel implements ComboBoxModel, - PropertyChangeListener { - protected FileFilter[] filters; - protected FilterComboBoxModel() { - super(); - filters = getFileChooser().getChoosableFileFilters(); - } - - public void propertyChange(PropertyChangeEvent e) { - String prop = e.getPropertyName(); - if(prop.equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY)) { - filters = (FileFilter[]) e.getNewValue(); - fireContentsChanged(this, -1, -1); - } else if (prop.equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) { - fireContentsChanged(this, -1, -1); - } - } - - public void setSelectedItem(Object filter) { - if(filter != null) { - getFileChooser().setFileFilter((FileFilter) filter); - fireContentsChanged(this, -1, -1); - } - } - - public Object getSelectedItem() { - // Ensure that the current filter is in the list. - // NOTE: we shouldnt' have to do this, since JFileChooser adds - // the filter to the choosable filters list when the filter - // is set. Lets be paranoid just in case someone overrides - // setFileFilter in JFileChooser. - FileFilter currentFilter = getFileChooser().getFileFilter(); - boolean found = false; - if(currentFilter != null) { - for (FileFilter filter : filters) { - if (filter == currentFilter) { - found = true; - } - } - if (!found) { - getFileChooser().addChoosableFileFilter(currentFilter); - } - } - return getFileChooser().getFileFilter(); - } - - public int getSize() { - if(filters != null) { - return filters.length; - } else { - return 0; - } - } - - public FileFilter getElementAt(int index) { - if(index > getSize() - 1) { - // This shouldn't happen. Try to recover gracefully. - return getFileChooser().getFileFilter(); - } - if(filters != null) { - return filters[index]; - } else { - return null; - } + protected class FilterComboBoxModel extends AbstractFilterComboBoxModel { + protected JFileChooser getFileChooser() { + return MotifFileChooserUI.this.getFileChooser(); } } diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java index 31cd9fdb45b..a75a35e1ddd 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java @@ -86,19 +86,19 @@ public class MotifInternalFrameTitlePane protected void assembleSystemMenu() { systemMenu = new JPopupMenu(); - JMenuItem mi = systemMenu.add(new JMenuItem(restoreAction)); - mi.setMnemonic('R'); - mi = systemMenu.add(new JMenuItem(moveAction)); - mi.setMnemonic('M'); - mi = systemMenu.add(new JMenuItem(sizeAction)); - mi.setMnemonic('S'); - mi = systemMenu.add(new JMenuItem(iconifyAction)); - mi.setMnemonic('n'); - mi = systemMenu.add(new JMenuItem(maximizeAction)); - mi.setMnemonic('x'); + JMenuItem mi = systemMenu.add(restoreAction); + mi.setMnemonic(getButtonMnemonic("restore")); + mi = systemMenu.add(moveAction); + mi.setMnemonic(getButtonMnemonic("move")); + mi = systemMenu.add(sizeAction); + mi.setMnemonic(getButtonMnemonic("size")); + mi = systemMenu.add(iconifyAction); + mi.setMnemonic(getButtonMnemonic("minimize")); + mi = systemMenu.add(maximizeAction); + mi.setMnemonic(getButtonMnemonic("maximize")); systemMenu.add(new JSeparator()); - mi = systemMenu.add(new JMenuItem(closeAction)); - mi.setMnemonic('C'); + mi = systemMenu.add(closeAction); + mi.setMnemonic(getButtonMnemonic("close")); systemButton = new SystemButton(); systemButton.addActionListener(new ActionListener() { @@ -124,6 +124,14 @@ public class MotifInternalFrameTitlePane }); } + private static int getButtonMnemonic(String button) { + try { + return Integer.parseInt(UIManager.getString( + "InternalFrameTitlePane." + button + "Button.mnemonic")); + } catch (NumberFormatException e) { + return -1; + } + } protected void createButtons() { minimizeButton = new MinimizeButton(); diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties index 43ba5b6d32b..0c177f8b122 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties @@ -30,7 +30,7 @@ FileChooser.pathLabel.textAndMnemonic=&Pfad- oder Ordnername eingeben: FileChooser.filterLabel.textAndMnemonic=Filte&r FileChooser.foldersLabel.textAndMnemonic=Ord&ner FileChooser.filesLabel.textAndMnemonic=Date&ien -FileChooser.enterFileNameLabel.textAndMnemonic=Dateiname ei&ngeben: +FileChooser.enterFileNameLabel.textAndMnemonic=Dateina&me eingeben: FileChooser.enterFolderNameLabel.textAndMnemonic=Ordnernamen eingeben: FileChooser.cancelButtonToolTip.textAndMnemonic=Dialogfeld f\u00FCr Dateiauswahl schlie\u00DFen. diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties index f7e2625e9c9..7090ef5a7c4 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties @@ -24,7 +24,7 @@ FileChooser.saveButton.textAndMnemonic=\uC800\uC7A5 FileChooser.openButton.textAndMnemonic=\uD655\uC778 FileChooser.saveDialogTitle.textAndMnemonic=\uC800\uC7A5 FileChooser.openDialogTitle.textAndMnemonic=\uC5F4\uAE30 -FileChooser.updateButton.textAndMnemonic=\uAC31\uC2E0 +FileChooser.updateButton.textAndMnemonic=\uC5C5\uB370\uC774\uD2B8 FileChooser.helpButton.textAndMnemonic=\uB3C4\uC6C0\uB9D0 FileChooser.pathLabel.textAndMnemonic=\uACBD\uB85C \uB610\uB294 \uD3F4\uB354 \uC774\uB984 \uC785\uB825(&P): FileChooser.filterLabel.textAndMnemonic=\uD544\uD130(&R) @@ -36,5 +36,5 @@ FileChooser.enterFolderNameLabel.textAndMnemonic=\uD3F4\uB354 \uC774\uB984 \uC78 FileChooser.cancelButtonToolTip.textAndMnemonic=\uD30C\uC77C \uC120\uD0DD\uAE30 \uB300\uD654\uC0C1\uC790\uB97C \uC911\uB2E8\uD569\uB2C8\uB2E4. FileChooser.saveButtonToolTip.textAndMnemonic=\uC120\uD0DD\uB41C \uD30C\uC77C\uC744 \uC800\uC7A5\uD569\uB2C8\uB2E4. FileChooser.openButtonToolTip.textAndMnemonic=\uC120\uD0DD\uB41C \uD30C\uC77C\uC744 \uC5FD\uB2C8\uB2E4. -FileChooser.updateButtonToolTip.textAndMnemonic=\uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D\uC744 \uAC31\uC2E0\uD569\uB2C8\uB2E4. +FileChooser.updateButtonToolTip.textAndMnemonic=\uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4. FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser \uB3C4\uC6C0\uB9D0\uC785\uB2C8\uB2E4. diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java index 2e1168199c9..8d40da00013 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java @@ -1193,70 +1193,9 @@ public class WindowsFileChooserUI extends BasicFileChooserUI { /** * Data model for a type-face selection combo-box. */ - protected class FilterComboBoxModel extends AbstractListModel implements ComboBoxModel, - PropertyChangeListener { - protected FileFilter[] filters; - protected FilterComboBoxModel() { - super(); - filters = getFileChooser().getChoosableFileFilters(); - } - - public void propertyChange(PropertyChangeEvent e) { - String prop = e.getPropertyName(); - if(prop == JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) { - filters = (FileFilter[]) e.getNewValue(); - fireContentsChanged(this, -1, -1); - } else if (prop == JFileChooser.FILE_FILTER_CHANGED_PROPERTY) { - fireContentsChanged(this, -1, -1); - } - } - - public void setSelectedItem(Object filter) { - if(filter != null) { - getFileChooser().setFileFilter((FileFilter) filter); - fireContentsChanged(this, -1, -1); - } - } - - public Object getSelectedItem() { - // Ensure that the current filter is in the list. - // NOTE: we shouldnt' have to do this, since JFileChooser adds - // the filter to the choosable filters list when the filter - // is set. Lets be paranoid just in case someone overrides - // setFileFilter in JFileChooser. - FileFilter currentFilter = getFileChooser().getFileFilter(); - boolean found = false; - if(currentFilter != null) { - for (FileFilter filter : filters) { - if (filter == currentFilter) { - found = true; - } - } - if(found == false) { - getFileChooser().addChoosableFileFilter(currentFilter); - } - } - return getFileChooser().getFileFilter(); - } - - public int getSize() { - if(filters != null) { - return filters.length; - } else { - return 0; - } - } - - public FileFilter getElementAt(int index) { - if(index > getSize() - 1) { - // This shouldn't happen. Try to recover gracefully. - return getFileChooser().getFileFilter(); - } - if(filters != null) { - return filters[index]; - } else { - return null; - } + protected class FilterComboBoxModel extends AbstractFilterComboBoxModel { + protected JFileChooser getFileChooser() { + return WindowsFileChooserUI.this.getFileChooser(); } } diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java index 9efb196c537..61090774ccc 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java @@ -45,7 +45,7 @@ public class WindowsGraphicsUtils { /** * Renders a text String in Windows without the mnemonic. - * This is here because the WindowsUI hiearchy doesn't match the Component heirarchy. All + * This is here because the WindowsUI hierarchy doesn't match the Component hierarchy. All * the overriden paintText methods of the ButtonUI delegates will call this static method. *

    * @param g Graphics context diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java index 3e5d313436a..3bc26eb46c3 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -174,7 +174,7 @@ public class WindowsIconFactory implements Serializable XPStyle xp = XPStyle.getXP(); if (xp != null) { Skin skin = xp.getSkin(c, part); - JButton b = (JButton)c; + AbstractButton b = (AbstractButton)c; ButtonModel model = b.getModel(); // Find out if frame is inactive diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java index 715f26ced3d..f0ab1667fa8 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java @@ -326,18 +326,27 @@ public class WindowsInternalFrameTitlePane extends BasicInternalFrameTitlePane { protected void addSystemMenuItems(JPopupMenu menu) { JMenuItem mi = menu.add(restoreAction); - mi.setMnemonic('R'); + mi.setMnemonic(getButtonMnemonic("restore")); mi = menu.add(moveAction); - mi.setMnemonic('M'); + mi.setMnemonic(getButtonMnemonic("move")); mi = menu.add(sizeAction); - mi.setMnemonic('S'); + mi.setMnemonic(getButtonMnemonic("size")); mi = menu.add(iconifyAction); - mi.setMnemonic('n'); + mi.setMnemonic(getButtonMnemonic("minimize")); mi = menu.add(maximizeAction); - mi.setMnemonic('x'); - systemPopupMenu.add(new JSeparator()); + mi.setMnemonic(getButtonMnemonic("maximize")); + menu.add(new JSeparator()); mi = menu.add(closeAction); - mi.setMnemonic('C'); + mi.setMnemonic(getButtonMnemonic("close")); + } + + private static int getButtonMnemonic(String button) { + try { + return Integer.parseInt(UIManager.getString( + "InternalFrameTitlePane." + button + "Button.mnemonic")); + } catch (NumberFormatException e) { + return -1; + } } protected void showSystemMenu(){ diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java index 6213ac1e0c0..20d52c45ddf 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java @@ -2012,7 +2012,7 @@ public class WindowsLookAndFeel extends BasicLookAndFeel * results. *

    * - * @param component Component the error occured in, may be + * @param component Component the error occurred in, may be * null indicating the error condition is * not directly associated with a * Component. diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java index 1df612f08e4..b8a4a801074 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java @@ -50,7 +50,7 @@ import sun.swing.DefaultLookup; *
  • The cursor blinks at about 1/2 second intervals. *
  • The entire value is selected when focus is gained. *
  • Shift-left-arrow and shift-right-arrow extend selection - *
  • Cntrl-left-arrow and cntrl-right-arrow act like home and + *
  • Ctrl-left-arrow and ctrl-right-arrow act like home and * end respectively. * *

    diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java index 9d2a7ce4064..516770df43c 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java @@ -162,7 +162,7 @@ public abstract class WindowsTextUI extends BasicTextUI { * necessarily the region to paint. * @param c the editor * @param view View painting for - * @return region drawing occured in + * @return region drawing occurred in */ public Shape paintLayer(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c, View view) { diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java index 7ecbca05ef2..c0393d3de4a 100644 --- a/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java +++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/Driver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -303,7 +303,7 @@ class Driver { } else { if (!packfile.toLowerCase().endsWith(".pack") && !packfile.toLowerCase().endsWith(".pac")) { - System.err.println(MessageFormat.format(RESOURCE.getString(DriverResource.WIRTE_PACKGZ_FILE),packfile)); + System.err.println(MessageFormat.format(RESOURCE.getString(DriverResource.WRITE_PACKGZ_FILE),packfile)); printUsage(doPack, false, System.err); System.exit(2); } diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/DriverResource.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/DriverResource.java index 050f8d7a263..48a01223720 100644 --- a/jdk/src/share/classes/com/sun/java/util/jar/pack/DriverResource.java +++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/DriverResource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,110 +22,99 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ - package com.sun.java.util.jar.pack; import java.util.ListResourceBundle; public class DriverResource extends ListResourceBundle { - public static final String VERSION ="VERSION"; - public static final String BAD_ARGUMENT ="BAD_ARGUMENT"; - public static final String BAD_OPTION ="BAD_OPTION"; - public static final String BAD_REPACK_OUTPUT="BAD_REPACK_OUTPUT"; - public static final String DETECTED_ZIP_COMMENT="DETECTED_ZIP_COMMENT"; - public static final String SKIP_FOR_REPACKED ="SKIP_FOR_REPACKED"; - public static final String WRITE_PACK_FILE ="WRITE_PACK_FILE"; - public static final String WIRTE_PACKGZ_FILE="WIRTE_PACKGZ_FILE"; - public static final String SKIP_FOR_MOVE_FAILED="SKIP_FOR_MOVE_FAILED"; - public static final String PACK_HELP="PACK_HELP"; - public static final String UNPACK_HELP ="UNPACK_HELP"; - public static final String MORE_INFO = "MORE_INFO"; - public static final String DUPLICATE_OPTION = "DUPLICATE_OPTION"; - public static final String BAD_SPEC = "BAD_SPEC"; - //The following string is duplicate in PACK and UNPACK comment,which was draw out to ruduce translation work. - private static final String PARAMETER_V = " -v, --verbose increase program verbosity"; - private static final String PARAMETER_Q = " -q, --quiet set verbosity to lowest level"; - private static final String PARAMETER_LF = " -l{F}, --log-file={F} output to the given log file, or '-' for System.out"; - private static final String PARAMETER_H = " -?, -h, --help print this message"; - private static final String PARAMETER_VER = " -V, --version print program version"; - private static final String PARAMETER_J = " -J{X} pass option X to underlying Java VM"; - - - //The following are outputs of command 'pack200' and 'unpack200'. - //Don't translate command arguments ,words with a prefix of '-' or '--'. - // - private static final Object[][] resource= { - {VERSION,"{0} version {1}"},//parameter 0:class name;parameter 1: version value - {BAD_ARGUMENT,"Bad argument: {0}"}, - {BAD_OPTION,"Bad option: {0}={1}"},//parameter 0:option name;parameter 1:option value - {BAD_REPACK_OUTPUT,"Bad --repack output: {0}"},//parameter 0:filename - {DETECTED_ZIP_COMMENT,"Detected ZIP comment: {0}"},//parameter 0:comment - {SKIP_FOR_REPACKED,"Skipping because already repacked: {0}"},//parameter 0:filename - {WRITE_PACK_FILE,"To write a *.pack file, specify --no-gzip: {0}"},//parameter 0:filename - {WIRTE_PACKGZ_FILE,"To write a *.pack.gz file, specify --gzip: {0}"},//parameter 0:filename - {SKIP_FOR_MOVE_FAILED,"Skipping unpack because move failed: {0}"},//parameter 0:filename - {PACK_HELP,new String[]{ - "Usage: pack200 [-opt... | --option=value]... x.pack[.gz] y.jar", - "", - "Packing Options", - " -g, --no-gzip output a plain *.pack file with no zipping", - " --gzip (default) post-process the pack output with gzip", - " -G, --strip-debug remove debugging attributes while packing", - " -O, --no-keep-file-order do not transmit file ordering information", - " --keep-file-order (default) preserve input file ordering", - " -S{N}, --segment-limit={N} output segment limit (default N=1Mb)", - " -E{N}, --effort={N} packing effort (default N=5)", - " -H{h}, --deflate-hint={h} transmit deflate hint: true, false, or keep (default)", - " -m{V}, --modification-time={V} transmit modtimes: latest or keep (default)", - " -P{F}, --pass-file={F} transmit the given input element(s) uncompressed", - " -U{a}, --unknown-attribute={a} unknown attribute action: error, strip, or pass (default)", - " -C{N}={L}, --class-attribute={N}={L} (user-defined attribute)", - " -F{N}={L}, --field-attribute={N}={L} (user-defined attribute)", - " -M{N}={L}, --method-attribute={N}={L} (user-defined attribute)", - " -D{N}={L}, --code-attribute={N}={L} (user-defined attribute)", - " -f{F}, --config-file={F} read file F for Pack200.Packer properties", - PARAMETER_V , - PARAMETER_Q , - PARAMETER_LF , - PARAMETER_H , - PARAMETER_VER , - PARAMETER_J, - "", - "Notes:", - " The -P, -C, -F, -M, and -D options accumulate.", - " Example attribute definition: -C SourceFile=RUH .", - " Config. file properties are defined by the Pack200 API.", - " For meaning of -S, -E, -H-, -m, -U values, see Pack200 API.", - " Layout definitions (like RUH) are defined by JSR 200.", - "", - "Repacking mode updates the JAR file with a pack/unpack cycle:", - " pack200 [-r|--repack] [-opt | --option=value]... [repackedy.jar] y.jar\n" - } - }, - {UNPACK_HELP,new String[]{ - "Usage: unpack200 [-opt... | --option=value]... x.pack[.gz] y.jar\n", - "", - "Unpacking Options", - " -H{h}, --deflate-hint={h} override transmitted deflate hint: true, false, or keep (default)", - " -r, --remove-pack-file remove input file after unpacking", - PARAMETER_V , - PARAMETER_Q , - PARAMETER_LF , - PARAMETER_H , - PARAMETER_VER , - PARAMETER_J, - } - }, - - {MORE_INFO,"(For more information, run {0} --help .)"},//parameter 0:command name - {DUPLICATE_OPTION,"duplicate option: {0}"},//parameter 0:option - {BAD_SPEC,"bad spec for {0}: {1}"},//parameter 0:option;parameter 1:specifier - }; - - protected Object[][] getContents() { - return resource; - } + public static final String VERSION = "VERSION"; + public static final String BAD_ARGUMENT = "BAD_ARGUMENT"; + public static final String BAD_OPTION = "BAD_OPTION"; + public static final String BAD_REPACK_OUTPUT = "BAD_REPACK_OUTPUT"; + public static final String DETECTED_ZIP_COMMENT = "DETECTED_ZIP_COMMENT"; + public static final String SKIP_FOR_REPACKED = "SKIP_FOR_REPACKED"; + public static final String WRITE_PACK_FILE = "WRITE_PACK_FILE"; + public static final String WRITE_PACKGZ_FILE = "WRITE_PACKGZ_FILE"; + public static final String SKIP_FOR_MOVE_FAILED = "SKIP_FOR_MOVE_FAILED"; + public static final String PACK_HELP = "PACK_HELP"; + public static final String UNPACK_HELP = "UNPACK_HELP"; + public static final String MORE_INFO = "MORE_INFO"; + public static final String DUPLICATE_OPTION = "DUPLICATE_OPTION"; + public static final String BAD_SPEC = "BAD_SPEC"; + /* + * The following are the output of 'pack200' and 'unpack200' commands. + * Do not translate command arguments and words with a prefix of '-' or '--'. + */ + private static final Object[][] resource = { + {VERSION, "{0} version {1}"}, // parameter 0:class name;parameter 1: version value + {BAD_ARGUMENT, "Bad argument: {0}"}, + {BAD_OPTION, "Bad option: {0}={1}"}, // parameter 0:option name;parameter 1:option value + {BAD_REPACK_OUTPUT, "Bad --repack output: {0}"}, // parameter 0:filename + {DETECTED_ZIP_COMMENT, "Detected ZIP comment: {0}"}, // parameter 0:comment + {SKIP_FOR_REPACKED, "Skipping because already repacked: {0}"}, // parameter 0:filename + {WRITE_PACK_FILE, "To write a *.pack file, specify --no-gzip: {0}"}, // parameter 0:filename + {WRITE_PACKGZ_FILE, "To write a *.pack.gz file, specify --gzip: {0}"}, // parameter 0:filename + {SKIP_FOR_MOVE_FAILED, "Skipping unpack because move failed: {0}"}, // parameter 0:filename + {PACK_HELP, new String[] { + "Usage: pack200 [-opt... | --option=value]... x.pack[.gz] y.jar", + "", + "Packing Options", + " -g, --no-gzip output a plain *.pack file with no zipping", + " --gzip (default) post-process the pack output with gzip", + " -G, --strip-debug remove debugging attributes while packing", + " -O, --no-keep-file-order do not transmit file ordering information", + " --keep-file-order (default) preserve input file ordering", + " -S{N}, --segment-limit={N} output segment limit (default N=1Mb)", + " -E{N}, --effort={N} packing effort (default N=5)", + " -H{h}, --deflate-hint={h} transmit deflate hint: true, false, or keep (default)", + " -m{V}, --modification-time={V} transmit modtimes: latest or keep (default)", + " -P{F}, --pass-file={F} transmit the given input element(s) uncompressed", + " -U{a}, --unknown-attribute={a} unknown attribute action: error, strip, or pass (default)", + " -C{N}={L}, --class-attribute={N}={L} (user-defined attribute)", + " -F{N}={L}, --field-attribute={N}={L} (user-defined attribute)", + " -M{N}={L}, --method-attribute={N}={L} (user-defined attribute)", + " -D{N}={L}, --code-attribute={N}={L} (user-defined attribute)", + " -f{F}, --config-file={F} read file F for Pack200.Packer properties", + " -v, --verbose increase program verbosity", + " -q, --quiet set verbosity to lowest level", + " -l{F}, --log-file={F} output to the given log file, or '-' for System.out", + " -?, -h, --help print this message", + " -V, --version print program version", + " -J{X} pass option X to underlying Java VM", + "", + "Notes:", + " The -P, -C, -F, -M, and -D options accumulate.", + " Example attribute definition: -C SourceFile=RUH .", + " Config. file properties are defined by the Pack200 API.", + " For meaning of -S, -E, -H-, -m, -U values, see Pack200 API.", + " Layout definitions (like RUH) are defined by JSR 200.", + "", + "Repacking mode updates the JAR file with a pack/unpack cycle:", + " pack200 [-r|--repack] [-opt | --option=value]... [repackedy.jar] y.jar\n" + } + }, + {UNPACK_HELP, new String[] { + "Usage: unpack200 [-opt... | --option=value]... x.pack[.gz] y.jar\n", + "", + "Unpacking Options", + " -H{h}, --deflate-hint={h} override transmitted deflate hint: true, false, or keep (default)", + " -r, --remove-pack-file remove input file after unpacking", + " -v, --verbose increase program verbosity", + " -q, --quiet set verbosity to lowest level", + " -l{F}, --log-file={F} output to the given log file, or '-' for System.out", + " -?, -h, --help print this message", + " -V, --version print program version", + " -J{X} pass option X to underlying Java VM" + } + }, + {MORE_INFO, "(For more information, run {0} --help .)"}, // parameter 0:command name + {DUPLICATE_OPTION, "duplicate option: {0}"}, // parameter 0:option + {BAD_SPEC, "bad spec for {0}: {1}"}, // parameter 0:option;parameter 1:specifier + }; + protected Object[][] getContents() { + return resource; + } } diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/DriverResource_ja.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/DriverResource_ja.java new file mode 100644 index 00000000000..de35d5ac0eb --- /dev/null +++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/DriverResource_ja.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2005, 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.java.util.jar.pack; + +import java.util.ListResourceBundle; + +public class DriverResource_ja extends ListResourceBundle { + public static final String VERSION ="VERSION"; + public static final String BAD_ARGUMENT ="BAD_ARGUMENT"; + public static final String BAD_OPTION ="BAD_OPTION"; + public static final String BAD_REPACK_OUTPUT="BAD_REPACK_OUTPUT"; + public static final String DETECTED_ZIP_COMMENT="DETECTED_ZIP_COMMENT"; + public static final String SKIP_FOR_REPACKED ="SKIP_FOR_REPACKED"; + public static final String WRITE_PACK_FILE ="WRITE_PACK_FILE"; + public static final String WIRTE_PACKGZ_FILE="WIRTE_PACKGZ_FILE"; + public static final String SKIP_FOR_MOVE_FAILED="SKIP_FOR_MOVE_FAILED"; + public static final String PACK_HELP="PACK_HELP"; + public static final String UNPACK_HELP ="UNPACK_HELP"; + public static final String MORE_INFO = "MORE_INFO"; + public static final String DUPLICATE_OPTION = "DUPLICATE_OPTION"; + public static final String BAD_SPEC = "BAD_SPEC"; + + //The following string is duplicate in PACK and UNPACK comment,which was draw out to ruduce translation work. + private static final String PARAMETER_V = " -v, --verbose increase program verbosity"; + private static final String PARAMETER_Q = " -q, --quiet set verbosity to lowest level"; + private static final String PARAMETER_LF = " -l{F}, --log-file={F} output to the given log file, or '-' for System.out"; + private static final String PARAMETER_H = " -?, -h, --help print this message"; + private static final String PARAMETER_VER = " -V, --version print program version"; + private static final String PARAMETER_J = " -J{X} pass option X to underlying Java VM"; + + + //The following are outputs of command 'pack200' and 'unpack200'. + //Don't translate command arguments ,words with a prefix of '-' or '--'. + // + private static final Object[][] resource= { + {VERSION,"{0}\u30D0\u30FC\u30B8\u30E7\u30F3{1}"},//parameter 0:class name;parameter 1: version value + {BAD_ARGUMENT,"\u7121\u52B9\u306A\u5F15\u6570: {0}"}, + {BAD_OPTION,"\u7121\u52B9\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0}={1}"},//parameter 0:option name;parameter 1:option value + {BAD_REPACK_OUTPUT,"\u7121\u52B9\u306A--repack\u51FA\u529B: {0}"},//parameter 0:filename + {DETECTED_ZIP_COMMENT,"\u691C\u51FA\u3055\u308C\u305FZIP\u30B3\u30E1\u30F3\u30C8: {0}"},//parameter 0:comment + {SKIP_FOR_REPACKED,"\u3059\u3067\u306B\u518D\u5727\u7E2E\u3055\u308C\u3066\u3044\u308B\u305F\u3081\u30B9\u30AD\u30C3\u30D7\u3057\u3066\u3044\u307E\u3059: {0}"},//parameter 0:filename + {WRITE_PACK_FILE,"*.pack\u30D5\u30A1\u30A4\u30EB\u3092\u66F8\u304D\u8FBC\u3080\u306B\u306F\u3001--no-gzip\u3092\u6307\u5B9A\u3057\u307E\u3059: {0}"},//parameter 0:filename + {WIRTE_PACKGZ_FILE,"*.pack.gz\u30D5\u30A1\u30A4\u30EB\u3092\u66F8\u304D\u8FBC\u3080\u306B\u306F\u3001--gzip\u3092\u6307\u5B9A\u3057\u307E\u3059: {0}"},//parameter 0:filename + {SKIP_FOR_MOVE_FAILED,"\u79FB\u52D5\u304C\u5931\u6557\u3057\u305F\u305F\u3081\u89E3\u51CD\u3092\u30B9\u30AD\u30C3\u30D7\u3057\u3066\u3044\u307E\u3059: {0}"},//parameter 0:filename + {PACK_HELP,new String[]{ + "\u4F7F\u7528\u65B9\u6CD5: pack200 [-opt... | --option=value]... x.pack[.gz] y.jar", + "", + "\u5727\u7E2E\u30AA\u30D7\u30B7\u30E7\u30F3", + " -g\u3001--no-gzip \u30D7\u30EC\u30FC\u30F3\u306A*.pack\u30D5\u30A1\u30A4\u30EB\u3092\u5727\u7E2E\u305B\u305A\u306B\u51FA\u529B\u3057\u307E\u3059", + " --gzip (\u30C7\u30D5\u30A9\u30EB\u30C8)\u5727\u7E2E\u51FA\u529B\u3092gzip\u3067\u5F8C\u51E6\u7406\u3057\u307E\u3059", + " -G\u3001--strip-debug \u5727\u7E2E\u4E2D\u306B\u30C7\u30D0\u30C3\u30B0\u5C5E\u6027\u3092\u524A\u9664\u3057\u307E\u3059", + " -O\u3001--no-keep-file-order \u30D5\u30A1\u30A4\u30EB\u306E\u9806\u5E8F\u4ED8\u3051\u60C5\u5831\u3092\u8EE2\u9001\u3057\u307E\u305B\u3093", + " --keep-file-order (\u30C7\u30D5\u30A9\u30EB\u30C8)\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u9806\u5E8F\u4ED8\u3051\u3092\u4FDD\u6301\u3057\u307E\u3059", + " -S{N}\u3001--segment-limit={N} \u30BB\u30B0\u30E1\u30F3\u30C8\u5236\u9650\u3092\u51FA\u529B\u3057\u307E\u3059(\u30C7\u30D5\u30A9\u30EB\u30C8N=1Mb)", + " -E{N}\u3001--effort={N} \u5727\u7E2E\u306E\u8A66\u884C(\u30C7\u30D5\u30A9\u30EB\u30C8N=5)", + " -H{h}\u3001--deflate-hint={h} \u30C7\u30D5\u30EC\u30FC\u30C8\u30FB\u30D2\u30F3\u30C8\u3092\u8EE2\u9001\u3057\u307E\u3059: true\u3001false\u307E\u305F\u306Fkeep(\u30C7\u30D5\u30A9\u30EB\u30C8)", + " -m{V}\u3001--modification-time={V} \u5909\u66F4\u6642\u9593\u3092\u8EE2\u9001\u3057\u307E\u3059: latest\u307E\u305F\u306Fkeep(\u30C7\u30D5\u30A9\u30EB\u30C8)", + " -P{F}\u3001--pass-file={F} \u6307\u5B9A\u3055\u308C\u305F\u5727\u7E2E\u3055\u308C\u3066\u3044\u306A\u3044\u5165\u529B\u8981\u7D20\u3092\u8EE2\u9001\u3057\u307E\u3059", + " -U{a}\u3001--unknown-attribute={a} \u4E0D\u660E\u306E\u5C5E\u6027\u30A2\u30AF\u30B7\u30E7\u30F3: error\u3001strip\u307E\u305F\u306Fpass(\u30C7\u30D5\u30A9\u30EB\u30C8)", + " -C{N}={L}\u3001--class-attribute={N}={L} (\u30E6\u30FC\u30B6\u30FC\u5B9A\u7FA9\u5C5E\u6027)", + " -F{N}={L}\u3001--field-attribute={N}={L} (\u30E6\u30FC\u30B6\u30FC\u5B9A\u7FA9\u5C5E\u6027)", + " -M{N}={L}\u3001--method-attribute={N}={L} (\u30E6\u30FC\u30B6\u30FC\u5B9A\u7FA9\u5C5E\u6027)", + " -D{N}={L}\u3001--code-attribute={N}={L} (\u30E6\u30FC\u30B6\u30FC\u5B9A\u7FA9\u5C5E\u6027)", + " -f{F}\u3001--config-file={F} Pack200.Packer\u30D7\u30ED\u30D1\u30C6\u30A3\u306B\u30D5\u30A1\u30A4\u30EBF\u3092\u8AAD\u307F\u8FBC\u307F\u307E\u3059", + PARAMETER_V , + PARAMETER_Q , + PARAMETER_LF , + PARAMETER_H , + PARAMETER_VER , + PARAMETER_J, + "", + "\u6CE8\u610F:", + " -P\u3001-C\u3001-F\u3001-M\u304A\u3088\u3073-D\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u7D2F\u7A4D\u3055\u308C\u307E\u3059\u3002", + " \u5C5E\u6027\u5B9A\u7FA9\u306E\u4F8B: -C SourceFile=RUH .", + " Config.\u30D5\u30A1\u30A4\u30EB\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u306F\u3001Pack200 API\u306B\u3088\u3063\u3066\u5B9A\u7FA9\u3055\u308C\u307E\u3059\u3002", + " -S\u3001-E\u3001-H\u3001-m\u3001-U\u306E\u5024\u306E\u610F\u5473\u306F\u3001Pack200 API\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002", + " \u30EC\u30A4\u30A2\u30A6\u30C8\u5B9A\u7FA9(RUH\u306A\u3069)\u306FJSR 200\u306B\u3088\u3063\u3066\u5B9A\u7FA9\u3055\u308C\u307E\u3059\u3002", + "", + "\u518D\u5727\u7E2E\u30E2\u30FC\u30C9\u3067\u306F\u3001JAR\u30D5\u30A1\u30A4\u30EB\u304C\u5727\u7E2E/\u89E3\u51CD\u30B5\u30A4\u30AF\u30EB\u3067\u66F4\u65B0\u3055\u308C\u307E\u3059:", + " pack200 [-r|--repack] [-opt | --option=value]... [repackedy.jar] y.jar\n" + } + }, + {UNPACK_HELP,new String[]{ + "\u4F7F\u7528\u65B9\u6CD5: unpack200 [-opt... | --option=value]... x.pack[.gz] y.jar\n", + "", + "\u89E3\u51CD\u30AA\u30D7\u30B7\u30E7\u30F3", + " -H{h}\u3001--deflate-hint={h} \u8EE2\u9001\u3055\u308C\u305F\u30C7\u30D5\u30EC\u30FC\u30C8\u30FB\u30D2\u30F3\u30C8\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u3059: true\u3001false\u307E\u305F\u306Fkeep(\u30C7\u30D5\u30A9\u30EB\u30C8)", + " -r\u3001--remove-pack-file \u89E3\u51CD\u5F8C\u306B\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u3092\u524A\u9664\u3057\u307E\u3059", + PARAMETER_V , + PARAMETER_Q , + PARAMETER_LF , + PARAMETER_H , + PARAMETER_VER , + PARAMETER_J, + } + }, + + {MORE_INFO,"(\u8A73\u7D30\u306F\u3001{0} --help\u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002)"},//parameter 0:command name + {DUPLICATE_OPTION,"\u91CD\u8907\u30AA\u30D7\u30B7\u30E7\u30F3: {0}"},//parameter 0:option + {BAD_SPEC,"{0}\u306E\u7121\u52B9\u306A\u4ED5\u69D8: {1}"},//parameter 0:option;parameter 1:specifier + }; + + protected Object[][] getContents() { + return resource; + } + + +} diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/DriverResource_zh_CN.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/DriverResource_zh_CN.java new file mode 100644 index 00000000000..25cc710e61f --- /dev/null +++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/DriverResource_zh_CN.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2005, 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.java.util.jar.pack; + +import java.util.ListResourceBundle; + +public class DriverResource_zh_CN extends ListResourceBundle { + public static final String VERSION ="VERSION"; + public static final String BAD_ARGUMENT ="BAD_ARGUMENT"; + public static final String BAD_OPTION ="BAD_OPTION"; + public static final String BAD_REPACK_OUTPUT="BAD_REPACK_OUTPUT"; + public static final String DETECTED_ZIP_COMMENT="DETECTED_ZIP_COMMENT"; + public static final String SKIP_FOR_REPACKED ="SKIP_FOR_REPACKED"; + public static final String WRITE_PACK_FILE ="WRITE_PACK_FILE"; + public static final String WIRTE_PACKGZ_FILE="WIRTE_PACKGZ_FILE"; + public static final String SKIP_FOR_MOVE_FAILED="SKIP_FOR_MOVE_FAILED"; + public static final String PACK_HELP="PACK_HELP"; + public static final String UNPACK_HELP ="UNPACK_HELP"; + public static final String MORE_INFO = "MORE_INFO"; + public static final String DUPLICATE_OPTION = "DUPLICATE_OPTION"; + public static final String BAD_SPEC = "BAD_SPEC"; + + //The following string is duplicate in PACK and UNPACK comment,which was draw out to ruduce translation work. + private static final String PARAMETER_V = " -v, --verbose increase program verbosity"; + private static final String PARAMETER_Q = " -q, --quiet set verbosity to lowest level"; + private static final String PARAMETER_LF = " -l{F}, --log-file={F} output to the given log file, or '-' for System.out"; + private static final String PARAMETER_H = " -?, -h, --help print this message"; + private static final String PARAMETER_VER = " -V, --version print program version"; + private static final String PARAMETER_J = " -J{X} pass option X to underlying Java VM"; + + + //The following are outputs of command 'pack200' and 'unpack200'. + //Don't translate command arguments ,words with a prefix of '-' or '--'. + // + private static final Object[][] resource= { + {VERSION,"{0}\u7248\u672C{1}"},//parameter 0:class name;parameter 1: version value + {BAD_ARGUMENT,"\u9519\u8BEF\u53C2\u6570: {0}"}, + {BAD_OPTION,"\u9519\u8BEF\u9009\u9879: {0}={1}"},//parameter 0:option name;parameter 1:option value + {BAD_REPACK_OUTPUT,"--repack \u8F93\u51FA\u9519\u8BEF: {0}"},//parameter 0:filename + {DETECTED_ZIP_COMMENT,"\u68C0\u6D4B\u5230 ZIP \u6CE8\u91CA: {0}"},//parameter 0:comment + {SKIP_FOR_REPACKED,"\u7531\u4E8E\u5DF2\u91CD\u65B0\u6253\u5305\u800C\u8DF3\u8FC7: {0}"},//parameter 0:filename + {WRITE_PACK_FILE,"\u8981\u5199\u5165 *.pack \u6587\u4EF6, \u8BF7\u6307\u5B9A --no-gzip: {0}"},//parameter 0:filename + {WIRTE_PACKGZ_FILE,"\u8981\u5199\u5165 *.pack.gz \u6587\u4EF6, \u8BF7\u6307\u5B9A --gzip: {0}"},//parameter 0:filename + {SKIP_FOR_MOVE_FAILED,"\u7531\u4E8E\u79FB\u52A8\u5931\u8D25\u800C\u8DF3\u8FC7\u91CD\u65B0\u6253\u5305: {0}"},//parameter 0:filename + {PACK_HELP,new String[]{ + "\u7528\u6CD5: pack200 [-opt... | --option=value]... x.pack[.gz] y.jar", + "", + "\u6253\u5305\u9009\u9879", + " -g, --no-gzip \u8F93\u51FA\u65E0\u683C\u5F0F\u7684 *.pack \u6587\u4EF6, \u4E0D\u538B\u7F29", + " --gzip (\u9ED8\u8BA4\u503C) \u4F7F\u7528 gzip \u5BF9\u6253\u5305\u8FDB\u884C\u540E\u5904\u7406", + " -G, --strip-debug \u6253\u5305\u65F6\u5220\u9664\u8C03\u8BD5\u5C5E\u6027", + " -O, --no-keep-file-order \u4E0D\u4F20\u8F93\u6587\u4EF6\u6392\u5E8F\u4FE1\u606F", + " --keep-file-order (\u9ED8\u8BA4\u503C) \u4FDD\u7559\u8F93\u5165\u6587\u4EF6\u6392\u5E8F", + " -S{N}, --segment-limit={N} \u8F93\u51FA\u6BB5\u9650\u5236 (\u9ED8\u8BA4\u503C N=1Mb)", + " -E{N}, --effort={N} \u6253\u5305\u6548\u679C (\u9ED8\u8BA4\u503C N=5)", + " -H{h}, --deflate-hint={h} \u4F20\u8F93\u538B\u7F29\u63D0\u793A: true, false \u6216 keep (\u9ED8\u8BA4\u503C)", + " -m{V}, --modification-time={V} \u4F20\u8F93 modtimes: latest \u6216 keep (\u9ED8\u8BA4\u503C)", + " -P{F}, --pass-file={F} \u4F20\u8F93\u672A\u89E3\u538B\u7F29\u7684\u7ED9\u5B9A\u8F93\u5165\u5143\u7D20", + " -U{a}, --unknown-attribute={a} \u672A\u77E5\u5C5E\u6027\u64CD\u4F5C: error, strip \u6216 pass (\u9ED8\u8BA4\u503C)", + " -C{N}={L}, --class-attribute={N}={L} (\u7528\u6237\u5B9A\u4E49\u7684\u5C5E\u6027)", + " -F{N}={L}, --field-attribute={N}={L} (\u7528\u6237\u5B9A\u4E49\u7684\u5C5E\u6027)", + " -M{N}={L}, --method-attribute={N}={L} (\u7528\u6237\u5B9A\u4E49\u7684\u5C5E\u6027)", + " -D{N}={L}, --code-attribute={N}={L} (\u7528\u6237\u5B9A\u4E49\u7684\u5C5E\u6027)", + " -f{F}, --config-file={F} \u8BFB\u53D6\u6587\u4EF6 F \u7684 Pack200.Packer \u5C5E\u6027", + PARAMETER_V , + PARAMETER_Q , + PARAMETER_LF , + PARAMETER_H , + PARAMETER_VER , + PARAMETER_J, + "", + "\u6CE8:", + " -P, -C, -F, -M \u548C -D \u9009\u9879\u7D2F\u8BA1\u3002", + " \u793A\u4F8B\u5C5E\u6027\u5B9A\u4E49: -C SourceFile=RUH\u3002", + " Config. \u6587\u4EF6\u5C5E\u6027\u7531 Pack200 API \u5B9A\u4E49\u3002", + " \u6709\u5173 -S, -E, -H-, -m, -U \u503C\u7684\u542B\u4E49, \u8BF7\u53C2\u9605 Pack200 API\u3002", + " \u5E03\u5C40\u5B9A\u4E49 (\u4F8B\u5982 RUH) \u7531 JSR 200 \u5B9A\u4E49\u3002", + "", + "\u91CD\u65B0\u6253\u5305\u6A21\u5F0F\u901A\u8FC7\u6253\u5305/\u89E3\u5305\u5468\u671F\u66F4\u65B0 JAR \u6587\u4EF6:", + " pack200 [-r|--repack] [-opt | --option=value]... [repackedy.jar] y.jar\n" + } + }, + {UNPACK_HELP,new String[]{ + "\u7528\u6CD5: unpack200 [-opt... | --option=value]... x.pack[.gz] y.jar\n", + "", + "\u89E3\u5305\u9009\u9879", + " -H{h}, --deflate-hint={h} \u8986\u76D6\u5DF2\u4F20\u8F93\u7684\u538B\u7F29\u63D0\u793A: true, false \u6216 keep (\u9ED8\u8BA4\u503C)", + " -r, --remove-pack-file \u89E3\u5305\u4E4B\u540E\u5220\u9664\u8F93\u5165\u6587\u4EF6", + PARAMETER_V , + PARAMETER_Q , + PARAMETER_LF , + PARAMETER_H , + PARAMETER_VER , + PARAMETER_J, + } + }, + + {MORE_INFO,"(\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u8FD0\u884C {0} --help\u3002)"},//parameter 0:command name + {DUPLICATE_OPTION,"\u91CD\u590D\u7684\u9009\u9879: {0}"},//parameter 0:option + {BAD_SPEC,"{0}\u7684\u89C4\u8303\u9519\u8BEF: {1}"},//parameter 0:option;parameter 1:specifier + }; + + protected Object[][] getContents() { + return resource; + } + + +} diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java index 3f2f430fb84..2c33866e508 100644 --- a/jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java +++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java @@ -190,7 +190,7 @@ class NativeUnpack { copyInOption(Utils.DEBUG_VERBOSE); copyInOption(Pack200.Unpacker.DEFLATE_HINT); - if (modtime == Constants.NO_MODTIME) // Dont pass KEEP && NOW + if (modtime == Constants.NO_MODTIME) // Don't pass KEEP && NOW copyInOption(Utils.UNPACK_MODIFICATION_TIME); updateProgress(); // reset progress bar for (;;) { diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java index a78c9ae9969..bca629f8008 100644 --- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java +++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java @@ -106,7 +106,7 @@ class PackageWriter extends BandStructure { Set requiredEntries; // for the CP Map backCountTable; // for layout callables - int[][] attrCounts; // count attr. occurences + int[][] attrCounts; // count attr. occurrences void setup() { requiredEntries = new HashSet<>(); diff --git a/jdk/src/share/classes/com/sun/jdi/AbsentInformationException.java b/jdk/src/share/classes/com/sun/jdi/AbsentInformationException.java index 93b0a75e702..31f2f615b01 100644 --- a/jdk/src/share/classes/com/sun/jdi/AbsentInformationException.java +++ b/jdk/src/share/classes/com/sun/jdi/AbsentInformationException.java @@ -31,6 +31,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class AbsentInformationException extends Exception { private static final long serialVersionUID = 4988939309582416373L; diff --git a/jdk/src/share/classes/com/sun/jdi/Accessible.java b/jdk/src/share/classes/com/sun/jdi/Accessible.java index 7eb8dbb154e..4ad4d3b03d8 100644 --- a/jdk/src/share/classes/com/sun/jdi/Accessible.java +++ b/jdk/src/share/classes/com/sun/jdi/Accessible.java @@ -36,6 +36,7 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Accessible { /** diff --git a/jdk/src/share/classes/com/sun/jdi/ArrayReference.java b/jdk/src/share/classes/com/sun/jdi/ArrayReference.java index f450931f66c..87ee9577b9d 100644 --- a/jdk/src/share/classes/com/sun/jdi/ArrayReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ArrayReference.java @@ -39,6 +39,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface ArrayReference extends ObjectReference { /** diff --git a/jdk/src/share/classes/com/sun/jdi/ArrayType.java b/jdk/src/share/classes/com/sun/jdi/ArrayType.java index fb5b2da9a56..fc209fa11b7 100644 --- a/jdk/src/share/classes/com/sun/jdi/ArrayType.java +++ b/jdk/src/share/classes/com/sun/jdi/ArrayType.java @@ -38,6 +38,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface ArrayType extends ReferenceType { /** diff --git a/jdk/src/share/classes/com/sun/jdi/BooleanType.java b/jdk/src/share/classes/com/sun/jdi/BooleanType.java index ae7bbb9532d..adbb49edbbb 100644 --- a/jdk/src/share/classes/com/sun/jdi/BooleanType.java +++ b/jdk/src/share/classes/com/sun/jdi/BooleanType.java @@ -35,5 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface BooleanType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/BooleanValue.java b/jdk/src/share/classes/com/sun/jdi/BooleanValue.java index 02aa89aa3ac..d360e80008e 100644 --- a/jdk/src/share/classes/com/sun/jdi/BooleanValue.java +++ b/jdk/src/share/classes/com/sun/jdi/BooleanValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface BooleanValue extends PrimitiveValue -{ +@jdk.Exported +public interface BooleanValue extends PrimitiveValue { + /** * Returns this BooleanValue as a boolean. * diff --git a/jdk/src/share/classes/com/sun/jdi/Bootstrap.java b/jdk/src/share/classes/com/sun/jdi/Bootstrap.java index e4c0f95679f..ca449dd0252 100644 --- a/jdk/src/share/classes/com/sun/jdi/Bootstrap.java +++ b/jdk/src/share/classes/com/sun/jdi/Bootstrap.java @@ -34,6 +34,7 @@ package com.sun.jdi; * @since 1.3 */ +@jdk.Exported public class Bootstrap extends Object { /** diff --git a/jdk/src/share/classes/com/sun/jdi/ByteType.java b/jdk/src/share/classes/com/sun/jdi/ByteType.java index be8efa866da..87da248a656 100644 --- a/jdk/src/share/classes/com/sun/jdi/ByteType.java +++ b/jdk/src/share/classes/com/sun/jdi/ByteType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface ByteType extends PrimitiveType -{ +@jdk.Exported +public interface ByteType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/ByteValue.java b/jdk/src/share/classes/com/sun/jdi/ByteValue.java index 4e4a8992abe..b7fc08bc786 100644 --- a/jdk/src/share/classes/com/sun/jdi/ByteValue.java +++ b/jdk/src/share/classes/com/sun/jdi/ByteValue.java @@ -33,8 +33,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface ByteValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface ByteValue extends PrimitiveValue, Comparable { + /** * Returns this ByteValue as a byte. * diff --git a/jdk/src/share/classes/com/sun/jdi/CharType.java b/jdk/src/share/classes/com/sun/jdi/CharType.java index 0174c0d3907..cdcf036efc5 100644 --- a/jdk/src/share/classes/com/sun/jdi/CharType.java +++ b/jdk/src/share/classes/com/sun/jdi/CharType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface CharType extends PrimitiveType -{ +@jdk.Exported +public interface CharType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/CharValue.java b/jdk/src/share/classes/com/sun/jdi/CharValue.java index 87a9d44bad5..6909fb96ea7 100644 --- a/jdk/src/share/classes/com/sun/jdi/CharValue.java +++ b/jdk/src/share/classes/com/sun/jdi/CharValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface CharValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface CharValue extends PrimitiveValue, Comparable { + /** * Returns this CharValue as a char. * diff --git a/jdk/src/share/classes/com/sun/jdi/ClassLoaderReference.java b/jdk/src/share/classes/com/sun/jdi/ClassLoaderReference.java index 11edb716c41..8e511d893be 100644 --- a/jdk/src/share/classes/com/sun/jdi/ClassLoaderReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ClassLoaderReference.java @@ -39,6 +39,7 @@ import java.util.List; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface ClassLoaderReference extends ObjectReference { /** diff --git a/jdk/src/share/classes/com/sun/jdi/ClassNotLoadedException.java b/jdk/src/share/classes/com/sun/jdi/ClassNotLoadedException.java index 97732769844..debc3bd47fc 100644 --- a/jdk/src/share/classes/com/sun/jdi/ClassNotLoadedException.java +++ b/jdk/src/share/classes/com/sun/jdi/ClassNotLoadedException.java @@ -67,6 +67,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class ClassNotLoadedException extends Exception { private static final long serialVersionUID = -6242978768444298722L; diff --git a/jdk/src/share/classes/com/sun/jdi/ClassNotPreparedException.java b/jdk/src/share/classes/com/sun/jdi/ClassNotPreparedException.java index 538bc827256..a26f93d4987 100644 --- a/jdk/src/share/classes/com/sun/jdi/ClassNotPreparedException.java +++ b/jdk/src/share/classes/com/sun/jdi/ClassNotPreparedException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class ClassNotPreparedException extends RuntimeException { private static final long serialVersionUID = -6120698967144079642L; public ClassNotPreparedException() diff --git a/jdk/src/share/classes/com/sun/jdi/ClassObjectReference.java b/jdk/src/share/classes/com/sun/jdi/ClassObjectReference.java index f6fa3867fa2..d008379d3a7 100644 --- a/jdk/src/share/classes/com/sun/jdi/ClassObjectReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ClassObjectReference.java @@ -35,6 +35,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface ClassObjectReference extends ObjectReference { /** diff --git a/jdk/src/share/classes/com/sun/jdi/ClassType.java b/jdk/src/share/classes/com/sun/jdi/ClassType.java index 73e94f10de8..73720245d39 100644 --- a/jdk/src/share/classes/com/sun/jdi/ClassType.java +++ b/jdk/src/share/classes/com/sun/jdi/ClassType.java @@ -41,6 +41,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface ClassType extends ReferenceType { /** * Gets the superclass of this class. diff --git a/jdk/src/share/classes/com/sun/jdi/DoubleType.java b/jdk/src/share/classes/com/sun/jdi/DoubleType.java index a585f45bbbe..7898aa4c8b3 100644 --- a/jdk/src/share/classes/com/sun/jdi/DoubleType.java +++ b/jdk/src/share/classes/com/sun/jdi/DoubleType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface DoubleType extends PrimitiveType -{ +@jdk.Exported +public interface DoubleType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/DoubleValue.java b/jdk/src/share/classes/com/sun/jdi/DoubleValue.java index fccff0dbbde..529e23305e9 100644 --- a/jdk/src/share/classes/com/sun/jdi/DoubleValue.java +++ b/jdk/src/share/classes/com/sun/jdi/DoubleValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface DoubleValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface DoubleValue extends PrimitiveValue, Comparable { + /** * Returns this DoubleValue as a double. * diff --git a/jdk/src/share/classes/com/sun/jdi/Field.java b/jdk/src/share/classes/com/sun/jdi/Field.java index fea18a9598e..5e5dff2e9ed 100644 --- a/jdk/src/share/classes/com/sun/jdi/Field.java +++ b/jdk/src/share/classes/com/sun/jdi/Field.java @@ -38,6 +38,7 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Field extends TypeComponent, Comparable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/FloatType.java b/jdk/src/share/classes/com/sun/jdi/FloatType.java index c0de125200b..e0d3d4824b0 100644 --- a/jdk/src/share/classes/com/sun/jdi/FloatType.java +++ b/jdk/src/share/classes/com/sun/jdi/FloatType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface FloatType extends PrimitiveType -{ +@jdk.Exported +public interface FloatType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/FloatValue.java b/jdk/src/share/classes/com/sun/jdi/FloatValue.java index 07937d27663..273451b1406 100644 --- a/jdk/src/share/classes/com/sun/jdi/FloatValue.java +++ b/jdk/src/share/classes/com/sun/jdi/FloatValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface FloatValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface FloatValue extends PrimitiveValue, Comparable { + /** * Returns this FloatValue as a float. * diff --git a/jdk/src/share/classes/com/sun/jdi/IncompatibleThreadStateException.java b/jdk/src/share/classes/com/sun/jdi/IncompatibleThreadStateException.java index 01b7c713692..ccb5c99e52c 100644 --- a/jdk/src/share/classes/com/sun/jdi/IncompatibleThreadStateException.java +++ b/jdk/src/share/classes/com/sun/jdi/IncompatibleThreadStateException.java @@ -32,16 +32,15 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ -public class IncompatibleThreadStateException extends Exception -{ +@jdk.Exported +public class IncompatibleThreadStateException extends Exception { private static final long serialVersionUID = 6199174323414551389L; - public IncompatibleThreadStateException() - { + + public IncompatibleThreadStateException() { super(); } - public IncompatibleThreadStateException(String s) - { + public IncompatibleThreadStateException(String s) { super(s); } } diff --git a/jdk/src/share/classes/com/sun/jdi/InconsistentDebugInfoException.java b/jdk/src/share/classes/com/sun/jdi/InconsistentDebugInfoException.java index a7caff8f579..deaa41e15df 100644 --- a/jdk/src/share/classes/com/sun/jdi/InconsistentDebugInfoException.java +++ b/jdk/src/share/classes/com/sun/jdi/InconsistentDebugInfoException.java @@ -34,6 +34,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class InconsistentDebugInfoException extends RuntimeException { private static final long serialVersionUID = 7964236415376861808L; public InconsistentDebugInfoException() { diff --git a/jdk/src/share/classes/com/sun/jdi/IntegerType.java b/jdk/src/share/classes/com/sun/jdi/IntegerType.java index 03601a5e9f6..8142ed49ec6 100644 --- a/jdk/src/share/classes/com/sun/jdi/IntegerType.java +++ b/jdk/src/share/classes/com/sun/jdi/IntegerType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface IntegerType extends PrimitiveType -{ +@jdk.Exported +public interface IntegerType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/IntegerValue.java b/jdk/src/share/classes/com/sun/jdi/IntegerValue.java index 89b7defaa48..4cdd3520cbb 100644 --- a/jdk/src/share/classes/com/sun/jdi/IntegerValue.java +++ b/jdk/src/share/classes/com/sun/jdi/IntegerValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface IntegerValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface IntegerValue extends PrimitiveValue, Comparable { + /** * Returns this IntegerValue as an int. * diff --git a/jdk/src/share/classes/com/sun/jdi/InterfaceType.java b/jdk/src/share/classes/com/sun/jdi/InterfaceType.java index 94a26e04a8a..e2c28ec24cb 100644 --- a/jdk/src/share/classes/com/sun/jdi/InterfaceType.java +++ b/jdk/src/share/classes/com/sun/jdi/InterfaceType.java @@ -43,6 +43,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface InterfaceType extends ReferenceType { /** * Gets the interfaces directly extended by this interface. diff --git a/jdk/src/share/classes/com/sun/jdi/InternalException.java b/jdk/src/share/classes/com/sun/jdi/InternalException.java index 668a4bcc98c..706bc65810d 100644 --- a/jdk/src/share/classes/com/sun/jdi/InternalException.java +++ b/jdk/src/share/classes/com/sun/jdi/InternalException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class InternalException extends RuntimeException { private static final long serialVersionUID = -9171606393104480607L; private int errorCode; diff --git a/jdk/src/share/classes/com/sun/jdi/InvalidCodeIndexException.java b/jdk/src/share/classes/com/sun/jdi/InvalidCodeIndexException.java index 357f6c5e2a8..bae0b071e43 100644 --- a/jdk/src/share/classes/com/sun/jdi/InvalidCodeIndexException.java +++ b/jdk/src/share/classes/com/sun/jdi/InvalidCodeIndexException.java @@ -34,6 +34,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported @Deprecated public class InvalidCodeIndexException extends RuntimeException { private static final long serialVersionUID = 7416010225133747805L; diff --git a/jdk/src/share/classes/com/sun/jdi/InvalidLineNumberException.java b/jdk/src/share/classes/com/sun/jdi/InvalidLineNumberException.java index acf530cc73f..38a0980a933 100644 --- a/jdk/src/share/classes/com/sun/jdi/InvalidLineNumberException.java +++ b/jdk/src/share/classes/com/sun/jdi/InvalidLineNumberException.java @@ -34,6 +34,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported @Deprecated public class InvalidLineNumberException extends RuntimeException { private static final long serialVersionUID = 4048709912372692875L; diff --git a/jdk/src/share/classes/com/sun/jdi/InvalidStackFrameException.java b/jdk/src/share/classes/com/sun/jdi/InvalidStackFrameException.java index 8bcca8eb269..696d21d4431 100644 --- a/jdk/src/share/classes/com/sun/jdi/InvalidStackFrameException.java +++ b/jdk/src/share/classes/com/sun/jdi/InvalidStackFrameException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class InvalidStackFrameException extends RuntimeException { private static final long serialVersionUID = -1919378296505827922L; public InvalidStackFrameException() { diff --git a/jdk/src/share/classes/com/sun/jdi/InvalidTypeException.java b/jdk/src/share/classes/com/sun/jdi/InvalidTypeException.java index 20d0f488568..9671dfd3b1f 100644 --- a/jdk/src/share/classes/com/sun/jdi/InvalidTypeException.java +++ b/jdk/src/share/classes/com/sun/jdi/InvalidTypeException.java @@ -32,16 +32,15 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public class InvalidTypeException extends Exception -{ +@jdk.Exported +public class InvalidTypeException extends Exception { private static final long serialVersionUID = 2256667231949650806L; - public InvalidTypeException() - { + + public InvalidTypeException() { super(); } - public InvalidTypeException(String s) - { + public InvalidTypeException(String s) { super(s); } } diff --git a/jdk/src/share/classes/com/sun/jdi/InvocationException.java b/jdk/src/share/classes/com/sun/jdi/InvocationException.java index 565a74dbf2f..89e8763b845 100644 --- a/jdk/src/share/classes/com/sun/jdi/InvocationException.java +++ b/jdk/src/share/classes/com/sun/jdi/InvocationException.java @@ -32,19 +32,17 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ -public class InvocationException extends Exception -{ +@jdk.Exported +public class InvocationException extends Exception { private static final long serialVersionUID = 6066780907971918568L; ObjectReference exception; - public InvocationException(ObjectReference exception) - { + public InvocationException(ObjectReference exception) { super("Exception occurred in target VM"); this.exception = exception; } - public ObjectReference exception() - { + public ObjectReference exception() { return exception; } } diff --git a/jdk/src/share/classes/com/sun/jdi/JDIPermission.java b/jdk/src/share/classes/com/sun/jdi/JDIPermission.java index cb69adf7436..ddcb8f7bf6b 100644 --- a/jdk/src/share/classes/com/sun/jdi/JDIPermission.java +++ b/jdk/src/share/classes/com/sun/jdi/JDIPermission.java @@ -78,6 +78,7 @@ package com.sun.jdi; * */ +@jdk.Exported public final class JDIPermission extends java.security.BasicPermission { private static final long serialVersionUID = -6988461416938786271L; /** diff --git a/jdk/src/share/classes/com/sun/jdi/LocalVariable.java b/jdk/src/share/classes/com/sun/jdi/LocalVariable.java index dc74f911129..60fe24aca32 100644 --- a/jdk/src/share/classes/com/sun/jdi/LocalVariable.java +++ b/jdk/src/share/classes/com/sun/jdi/LocalVariable.java @@ -42,6 +42,7 @@ package com.sun.jdi; * @since 1.3 */ +@jdk.Exported public interface LocalVariable extends Mirror, Comparable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/Locatable.java b/jdk/src/share/classes/com/sun/jdi/Locatable.java index a00badf64b0..4cb0ea751e9 100644 --- a/jdk/src/share/classes/com/sun/jdi/Locatable.java +++ b/jdk/src/share/classes/com/sun/jdi/Locatable.java @@ -33,6 +33,7 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Locatable { /** * Returns the {@link Location} of this mirror, if there diff --git a/jdk/src/share/classes/com/sun/jdi/Location.java b/jdk/src/share/classes/com/sun/jdi/Location.java index a2447285b3e..e3fd4c1687d 100644 --- a/jdk/src/share/classes/com/sun/jdi/Location.java +++ b/jdk/src/share/classes/com/sun/jdi/Location.java @@ -86,6 +86,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Location extends Mirror, Comparable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/LongType.java b/jdk/src/share/classes/com/sun/jdi/LongType.java index b27c5d30330..126317c4ecf 100644 --- a/jdk/src/share/classes/com/sun/jdi/LongType.java +++ b/jdk/src/share/classes/com/sun/jdi/LongType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface LongType extends PrimitiveType -{ +@jdk.Exported +public interface LongType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/LongValue.java b/jdk/src/share/classes/com/sun/jdi/LongValue.java index 1dfd41feeb8..1ccd37dfd6b 100644 --- a/jdk/src/share/classes/com/sun/jdi/LongValue.java +++ b/jdk/src/share/classes/com/sun/jdi/LongValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface LongValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface LongValue extends PrimitiveValue, Comparable { + /** * Returns this LongValue as a long. * diff --git a/jdk/src/share/classes/com/sun/jdi/Method.java b/jdk/src/share/classes/com/sun/jdi/Method.java index 2d41b471089..396381f3e7e 100644 --- a/jdk/src/share/classes/com/sun/jdi/Method.java +++ b/jdk/src/share/classes/com/sun/jdi/Method.java @@ -39,6 +39,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Method extends TypeComponent, Locatable, Comparable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/Mirror.java b/jdk/src/share/classes/com/sun/jdi/Mirror.java index d821c4faebf..9660ebdcfe9 100644 --- a/jdk/src/share/classes/com/sun/jdi/Mirror.java +++ b/jdk/src/share/classes/com/sun/jdi/Mirror.java @@ -56,6 +56,7 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/MonitorInfo.java b/jdk/src/share/classes/com/sun/jdi/MonitorInfo.java index fb6557c7461..a35cc403b81 100644 --- a/jdk/src/share/classes/com/sun/jdi/MonitorInfo.java +++ b/jdk/src/share/classes/com/sun/jdi/MonitorInfo.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @since 1.6 */ +@jdk.Exported public interface MonitorInfo extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/NativeMethodException.java b/jdk/src/share/classes/com/sun/jdi/NativeMethodException.java index 311fd1f625c..2db8460d03f 100644 --- a/jdk/src/share/classes/com/sun/jdi/NativeMethodException.java +++ b/jdk/src/share/classes/com/sun/jdi/NativeMethodException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class NativeMethodException extends RuntimeException { private static final long serialVersionUID = 3924951669039469992L; diff --git a/jdk/src/share/classes/com/sun/jdi/ObjectCollectedException.java b/jdk/src/share/classes/com/sun/jdi/ObjectCollectedException.java index 720690dd1da..29da6d9b08b 100644 --- a/jdk/src/share/classes/com/sun/jdi/ObjectCollectedException.java +++ b/jdk/src/share/classes/com/sun/jdi/ObjectCollectedException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class ObjectCollectedException extends RuntimeException { private static final long serialVersionUID = -1928428056197269588L; public ObjectCollectedException() { diff --git a/jdk/src/share/classes/com/sun/jdi/ObjectReference.java b/jdk/src/share/classes/com/sun/jdi/ObjectReference.java index 66e8acf7c47..18710cbab93 100644 --- a/jdk/src/share/classes/com/sun/jdi/ObjectReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ObjectReference.java @@ -55,8 +55,9 @@ import java.util.Map; * @author James McIlree * @since 1.3 */ -public interface ObjectReference extends Value -{ +@jdk.Exported +public interface ObjectReference extends Value { + /** * Gets the {@link ReferenceType} that mirrors the type * of this object. The type may be a subclass or implementor of the diff --git a/jdk/src/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java b/jdk/src/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java index 8c4aae74ef8..e2c9ae79352 100644 --- a/jdk/src/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java +++ b/jdk/src/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java @@ -33,6 +33,7 @@ import java.util.List; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface PathSearchingVirtualMachine extends VirtualMachine { /** * Get the class path for this virtual machine. diff --git a/jdk/src/share/classes/com/sun/jdi/PrimitiveType.java b/jdk/src/share/classes/com/sun/jdi/PrimitiveType.java index ba34a5049a4..3805d6a577d 100644 --- a/jdk/src/share/classes/com/sun/jdi/PrimitiveType.java +++ b/jdk/src/share/classes/com/sun/jdi/PrimitiveType.java @@ -37,5 +37,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface PrimitiveType extends Type { } diff --git a/jdk/src/share/classes/com/sun/jdi/PrimitiveValue.java b/jdk/src/share/classes/com/sun/jdi/PrimitiveValue.java index 0d9442a38a0..6af5a3311fd 100644 --- a/jdk/src/share/classes/com/sun/jdi/PrimitiveValue.java +++ b/jdk/src/share/classes/com/sun/jdi/PrimitiveValue.java @@ -35,8 +35,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface PrimitiveValue extends Value -{ +@jdk.Exported +public interface PrimitiveValue extends Value { + /** * Converts this value to a BooleanValue and returns the result * as a boolean. diff --git a/jdk/src/share/classes/com/sun/jdi/ReferenceType.java b/jdk/src/share/classes/com/sun/jdi/ReferenceType.java index 864e368ea76..96973bca203 100644 --- a/jdk/src/share/classes/com/sun/jdi/ReferenceType.java +++ b/jdk/src/share/classes/com/sun/jdi/ReferenceType.java @@ -77,6 +77,7 @@ import java.util.Map; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface ReferenceType extends Type, Comparable, Accessible { diff --git a/jdk/src/share/classes/com/sun/jdi/ShortType.java b/jdk/src/share/classes/com/sun/jdi/ShortType.java index c7b9e8b04dc..87542a1af23 100644 --- a/jdk/src/share/classes/com/sun/jdi/ShortType.java +++ b/jdk/src/share/classes/com/sun/jdi/ShortType.java @@ -35,5 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface ShortType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/ShortValue.java b/jdk/src/share/classes/com/sun/jdi/ShortValue.java index 771ef562683..c7011c35a20 100644 --- a/jdk/src/share/classes/com/sun/jdi/ShortValue.java +++ b/jdk/src/share/classes/com/sun/jdi/ShortValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface ShortValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface ShortValue extends PrimitiveValue, Comparable { + /** * Returns this ShortValue as a short. * diff --git a/jdk/src/share/classes/com/sun/jdi/StackFrame.java b/jdk/src/share/classes/com/sun/jdi/StackFrame.java index 40c03021ad2..dc78485aaac 100644 --- a/jdk/src/share/classes/com/sun/jdi/StackFrame.java +++ b/jdk/src/share/classes/com/sun/jdi/StackFrame.java @@ -58,8 +58,9 @@ import java.util.Map; * @author James McIlree * @since 1.3 */ -public interface StackFrame extends Mirror, Locatable -{ +@jdk.Exported +public interface StackFrame extends Mirror, Locatable { + /** * Returns the {@link Location} of the current instruction in the frame. * The method for which this frame was created can also be accessed diff --git a/jdk/src/share/classes/com/sun/jdi/StringReference.java b/jdk/src/share/classes/com/sun/jdi/StringReference.java index a149768f18a..e32b442a9de 100644 --- a/jdk/src/share/classes/com/sun/jdi/StringReference.java +++ b/jdk/src/share/classes/com/sun/jdi/StringReference.java @@ -35,8 +35,8 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface StringReference extends ObjectReference -{ +@jdk.Exported +public interface StringReference extends ObjectReference { /** * Returns the StringReference as a String. The returned string * is the equivalent of the mirrored string, but is an entity in the diff --git a/jdk/src/share/classes/com/sun/jdi/ThreadGroupReference.java b/jdk/src/share/classes/com/sun/jdi/ThreadGroupReference.java index 8bf631d7ec4..ca13fc363b5 100644 --- a/jdk/src/share/classes/com/sun/jdi/ThreadGroupReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ThreadGroupReference.java @@ -37,8 +37,9 @@ import java.util.List; * @author James McIlree * @since 1.3 */ -public interface ThreadGroupReference extends ObjectReference -{ +@jdk.Exported +public interface ThreadGroupReference extends ObjectReference { + /** * Returns the name of this thread group. * diff --git a/jdk/src/share/classes/com/sun/jdi/ThreadReference.java b/jdk/src/share/classes/com/sun/jdi/ThreadReference.java index 235ab291f87..a082ddf580e 100644 --- a/jdk/src/share/classes/com/sun/jdi/ThreadReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ThreadReference.java @@ -36,8 +36,8 @@ import java.util.List; * @author James McIlree * @since 1.3 */ -public interface ThreadReference extends ObjectReference -{ +@jdk.Exported +public interface ThreadReference extends ObjectReference { /** Thread status is unknown */ public final int THREAD_STATUS_UNKNOWN =-1; /** Thread has completed execution */ diff --git a/jdk/src/share/classes/com/sun/jdi/Type.java b/jdk/src/share/classes/com/sun/jdi/Type.java index 3f216e5bc44..fdcccd495fa 100644 --- a/jdk/src/share/classes/com/sun/jdi/Type.java +++ b/jdk/src/share/classes/com/sun/jdi/Type.java @@ -127,8 +127,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface Type extends Mirror -{ +@jdk.Exported +public interface Type extends Mirror { + /** * Returns the JNI-style signature for this type. *

    diff --git a/jdk/src/share/classes/com/sun/jdi/TypeComponent.java b/jdk/src/share/classes/com/sun/jdi/TypeComponent.java index 5f2a192803d..5354a675ce7 100644 --- a/jdk/src/share/classes/com/sun/jdi/TypeComponent.java +++ b/jdk/src/share/classes/com/sun/jdi/TypeComponent.java @@ -44,6 +44,7 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface TypeComponent extends Mirror, Accessible { /** diff --git a/jdk/src/share/classes/com/sun/jdi/VMCannotBeModifiedException.java b/jdk/src/share/classes/com/sun/jdi/VMCannotBeModifiedException.java index 36e424bd689..b5f354aedfb 100644 --- a/jdk/src/share/classes/com/sun/jdi/VMCannotBeModifiedException.java +++ b/jdk/src/share/classes/com/sun/jdi/VMCannotBeModifiedException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Jim Holmlund * @since 1.5 */ +@jdk.Exported public class VMCannotBeModifiedException extends UnsupportedOperationException { private static final long serialVersionUID = -4063879815130164009L; public VMCannotBeModifiedException() { diff --git a/jdk/src/share/classes/com/sun/jdi/VMDisconnectedException.java b/jdk/src/share/classes/com/sun/jdi/VMDisconnectedException.java index bf78d851989..888308ca4dd 100644 --- a/jdk/src/share/classes/com/sun/jdi/VMDisconnectedException.java +++ b/jdk/src/share/classes/com/sun/jdi/VMDisconnectedException.java @@ -33,6 +33,7 @@ package com.sun.jdi; * @author Robert Field * @since 1.3 */ +@jdk.Exported public class VMDisconnectedException extends RuntimeException { private static final long serialVersionUID = 2892975269768351637L; diff --git a/jdk/src/share/classes/com/sun/jdi/VMMismatchException.java b/jdk/src/share/classes/com/sun/jdi/VMMismatchException.java index c4e19acabe8..90c0232fd4e 100644 --- a/jdk/src/share/classes/com/sun/jdi/VMMismatchException.java +++ b/jdk/src/share/classes/com/sun/jdi/VMMismatchException.java @@ -33,6 +33,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class VMMismatchException extends RuntimeException { private static final long serialVersionUID = 289169358790459564L; public VMMismatchException() { diff --git a/jdk/src/share/classes/com/sun/jdi/VMOutOfMemoryException.java b/jdk/src/share/classes/com/sun/jdi/VMOutOfMemoryException.java index 1848d22c854..afb8235fb92 100644 --- a/jdk/src/share/classes/com/sun/jdi/VMOutOfMemoryException.java +++ b/jdk/src/share/classes/com/sun/jdi/VMOutOfMemoryException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class VMOutOfMemoryException extends RuntimeException { private static final long serialVersionUID = 71504228548910686L; public VMOutOfMemoryException() { diff --git a/jdk/src/share/classes/com/sun/jdi/Value.java b/jdk/src/share/classes/com/sun/jdi/Value.java index 316f4b8b97b..582f439f701 100644 --- a/jdk/src/share/classes/com/sun/jdi/Value.java +++ b/jdk/src/share/classes/com/sun/jdi/Value.java @@ -168,8 +168,8 @@ package com.sun.jdi; * @since 1.3 */ -public interface Value extends Mirror -{ +@jdk.Exported +public interface Value extends Mirror { /** * Returns the run-time type of this value. * diff --git a/jdk/src/share/classes/com/sun/jdi/VirtualMachine.java b/jdk/src/share/classes/com/sun/jdi/VirtualMachine.java index 38faf903176..096465acbbf 100644 --- a/jdk/src/share/classes/com/sun/jdi/VirtualMachine.java +++ b/jdk/src/share/classes/com/sun/jdi/VirtualMachine.java @@ -70,6 +70,7 @@ import java.util.Map; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface VirtualMachine extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/VirtualMachineManager.java b/jdk/src/share/classes/com/sun/jdi/VirtualMachineManager.java index 5af1776d5fb..a388086c9e0 100644 --- a/jdk/src/share/classes/com/sun/jdi/VirtualMachineManager.java +++ b/jdk/src/share/classes/com/sun/jdi/VirtualMachineManager.java @@ -271,6 +271,7 @@ import java.io.IOException; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface VirtualMachineManager { /** diff --git a/jdk/src/share/classes/com/sun/jdi/VoidType.java b/jdk/src/share/classes/com/sun/jdi/VoidType.java index 4a976e84920..85671b4cee0 100644 --- a/jdk/src/share/classes/com/sun/jdi/VoidType.java +++ b/jdk/src/share/classes/com/sun/jdi/VoidType.java @@ -35,5 +35,6 @@ package com.sun.jdi; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface VoidType extends Type { } diff --git a/jdk/src/share/classes/com/sun/jdi/VoidValue.java b/jdk/src/share/classes/com/sun/jdi/VoidValue.java index 8a8a79e465c..74fee8dfd39 100644 --- a/jdk/src/share/classes/com/sun/jdi/VoidValue.java +++ b/jdk/src/share/classes/com/sun/jdi/VoidValue.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface VoidValue extends Value { /** diff --git a/jdk/src/share/classes/com/sun/jdi/connect/AttachingConnector.java b/jdk/src/share/classes/com/sun/jdi/connect/AttachingConnector.java index 8b846137d57..9343795f846 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/AttachingConnector.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/AttachingConnector.java @@ -35,6 +35,7 @@ import java.io.IOException; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface AttachingConnector extends Connector { /** * Attaches to a running application and and returns a diff --git a/jdk/src/share/classes/com/sun/jdi/connect/Connector.java b/jdk/src/share/classes/com/sun/jdi/connect/Connector.java index e817c446eb4..f6bd8060656 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/Connector.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/Connector.java @@ -45,6 +45,7 @@ import java.io.Serializable; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface Connector { /** * Returns a short identifier for the connector. Connector implementors @@ -91,6 +92,7 @@ public interface Connector { * {@link Connector.IntegerArgument}, * or {@link Connector.SelectedArgument}. */ + @jdk.Exported public interface Argument extends Serializable { /** * Returns a short, unique identifier for the argument. @@ -156,6 +158,7 @@ public interface Connector { * whose value is Boolean. Boolean values are represented * by the localized versions of the strings "true" and "false". */ + @jdk.Exported public interface BooleanArgument extends Argument { /** * Sets the value of the argument. @@ -196,6 +199,7 @@ public interface Connector { * whose value is an integer. Integer values are represented * by their corresponding strings. */ + @jdk.Exported public interface IntegerArgument extends Argument { /** * Sets the value of the argument. @@ -257,6 +261,7 @@ public interface Connector { * Specification for and value of a Connector argument, * whose value is a String. */ + @jdk.Exported public interface StringArgument extends Argument { /** * Performs basic sanity check of argument. @@ -269,6 +274,7 @@ public interface Connector { * Specification for and value of a Connector argument, * whose value is a String selected from a list of choices. */ + @jdk.Exported public interface SelectedArgument extends Argument { /** * Return the possible values for the argument diff --git a/jdk/src/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java b/jdk/src/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java index fd45b15eb3c..27c49744252 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java @@ -36,8 +36,9 @@ import java.util.Collections; * @author Gordon Hirsch * @since 1.3 */ -public class IllegalConnectorArgumentsException extends Exception -{ +@jdk.Exported +public class IllegalConnectorArgumentsException extends Exception { + private static final long serialVersionUID = -3042212603611350941L; List names; diff --git a/jdk/src/share/classes/com/sun/jdi/connect/LaunchingConnector.java b/jdk/src/share/classes/com/sun/jdi/connect/LaunchingConnector.java index 206c8aafa19..dc636ed7e79 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/LaunchingConnector.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/LaunchingConnector.java @@ -35,6 +35,7 @@ import java.io.IOException; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface LaunchingConnector extends Connector { /** * Launches an application and connects to its VM. Properties diff --git a/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java b/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java index b588875c99b..dc46af9ad16 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java @@ -35,6 +35,7 @@ import com.sun.jdi.VirtualMachine; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface ListeningConnector extends Connector { /** * Indicates whether this listening connector supports multiple @@ -69,7 +70,7 @@ public interface ListeningConnector extends Connector { * method). *

    * If arguments contains addressing information. and - * only one conection will be accepted, the {@link #accept accept} method + * only one connection will be accepted, the {@link #accept accept} method * can be called immediately without calling this method. * * @return the address at which the connector is listening diff --git a/jdk/src/share/classes/com/sun/jdi/connect/Transport.java b/jdk/src/share/classes/com/sun/jdi/connect/Transport.java index 266bd8089ab..b271a9692bc 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/Transport.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/Transport.java @@ -42,6 +42,7 @@ import com.sun.jdi.connect.spi.TransportService; // for javadoc * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface Transport { /** * Returns a short identifier for the transport. diff --git a/jdk/src/share/classes/com/sun/jdi/connect/TransportTimeoutException.java b/jdk/src/share/classes/com/sun/jdi/connect/TransportTimeoutException.java index fcfc48cf0d6..9ea50ee1e89 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/TransportTimeoutException.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/TransportTimeoutException.java @@ -54,6 +54,7 @@ package com.sun.jdi.connect; * * @since 1.5 */ +@jdk.Exported public class TransportTimeoutException extends java.io.IOException { private static final long serialVersionUID = 4107035242623365074L; /** diff --git a/jdk/src/share/classes/com/sun/jdi/connect/VMStartException.java b/jdk/src/share/classes/com/sun/jdi/connect/VMStartException.java index 111d48b260c..0163347c2e7 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/VMStartException.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/VMStartException.java @@ -34,8 +34,9 @@ package com.sun.jdi.connect; * @author Gordon Hirsch * @since 1.3 */ -public class VMStartException extends Exception -{ +@jdk.Exported +public class VMStartException extends Exception { + private static final long serialVersionUID = 6408644824640801020L; Process process; diff --git a/jdk/src/share/classes/com/sun/jdi/connect/package-info.java b/jdk/src/share/classes/com/sun/jdi/connect/package-info.java new file mode 100644 index 00000000000..c444b75137a --- /dev/null +++ b/jdk/src/share/classes/com/sun/jdi/connect/package-info.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/** + * This package defines connections between the virtual machine + * using the JDI and the target virtual machine. + * In concert with {@link com.sun.jdi.VirtualMachineManager} + * it is the mechanism for launching, attaching, etc to + * target virtual machines. + *

    + * Methods may be added to the interfaces in the JDI packages in future + * releases. Existing packages may be renamed if the JDI becomes a standard + * extension. + */ + +@jdk.Exported +package com.sun.jdi.connect; diff --git a/jdk/src/share/classes/com/sun/jdi/connect/package.html b/jdk/src/share/classes/com/sun/jdi/connect/package.html deleted file mode 100644 index 7484ce2ca6e..00000000000 --- a/jdk/src/share/classes/com/sun/jdi/connect/package.html +++ /dev/null @@ -1,43 +0,0 @@ - - -com.sun.jdi.connect description - - - - -This package defines -connections between the virtual machine -using the JDI and the target virtual machine. -In concert with {@link com.sun.jdi.VirtualMachineManager} -it is the mechanism for launching, attaching, etc to -target virtual machines. -

    -Methods may be added to the interfaces in the JDI packages in future -releases. Existing packages may be renamed if the JDI becomes a standard -extension. - - diff --git a/jdk/src/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java b/jdk/src/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java index 6c172af97ee..bd0a8c4400c 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java @@ -45,6 +45,7 @@ package com.sun.jdi.connect.spi; * * @since 1.5 */ +@jdk.Exported public class ClosedConnectionException extends java.io.IOException { private static final long serialVersionUID = 3877032124297204774L; /** diff --git a/jdk/src/share/classes/com/sun/jdi/connect/spi/Connection.java b/jdk/src/share/classes/com/sun/jdi/connect/spi/Connection.java index 6d87949abb4..d4b1721af64 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/spi/Connection.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/spi/Connection.java @@ -56,6 +56,7 @@ import java.io.IOException; * @since 1.5 */ +@jdk.Exported public abstract class Connection { /** diff --git a/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java b/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java index 6db4cfea8e9..c3f410e718c 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java @@ -77,6 +77,7 @@ import com.sun.jdi.connect.TransportTimeoutException; * @since 1.5 */ +@jdk.Exported public abstract class TransportService { /** @@ -96,6 +97,7 @@ public abstract class TransportService { /** * The transport service capabilities. */ + @jdk.Exported public static abstract class Capabilities { /** @@ -229,6 +231,7 @@ public abstract class TransportService { * #stopListening stopListening} to stop the transport * service from listening on an address. */ + @jdk.Exported public static abstract class ListenKey { /** @@ -247,7 +250,7 @@ public abstract class TransportService { * * @param address * The address to start listening for connections, - * or null to listen on an address choosen + * or null to listen on an address chosen * by the transport service. * * @return a listen key to be used in subsequent calls to be @@ -263,7 +266,7 @@ public abstract class TransportService { public abstract ListenKey startListening(String address) throws IOException; /** - * Listens on an address choosen by the transport service. + * Listens on an address chosen by the transport service. * *

    This convenience method works as if by invoking {@link * #startListening(String) startListening(null)}.

    diff --git a/jdk/src/share/classes/com/sun/jdi/connect/spi/package-info.java b/jdk/src/share/classes/com/sun/jdi/connect/spi/package-info.java new file mode 100644 index 00000000000..956e28dcff8 --- /dev/null +++ b/jdk/src/share/classes/com/sun/jdi/connect/spi/package-info.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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. + */ + +/** + * This package comprises the interfaces and classes used to + * develop new {@link com.sun.jdi.connect.spi.TransportService} + * implementations. + */ + +@jdk.Exported +package com.sun.jdi.connect.spi; diff --git a/jdk/src/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java b/jdk/src/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java index 1770fca292d..6bee053ffd0 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java @@ -37,5 +37,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface AccessWatchpointEvent extends WatchpointEvent { } diff --git a/jdk/src/share/classes/com/sun/jdi/event/BreakpointEvent.java b/jdk/src/share/classes/com/sun/jdi/event/BreakpointEvent.java index 811e6f7f14a..0fbd9cf3d1e 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/BreakpointEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/BreakpointEvent.java @@ -47,6 +47,6 @@ import java.util.List; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface BreakpointEvent extends LocatableEvent { - } diff --git a/jdk/src/share/classes/com/sun/jdi/event/ClassPrepareEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ClassPrepareEvent.java index 9b57feed2d2..2922ed81435 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ClassPrepareEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ClassPrepareEvent.java @@ -39,6 +39,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ClassPrepareEvent extends Event { /** * Returns the thread in which this event has occurred. diff --git a/jdk/src/share/classes/com/sun/jdi/event/ClassUnloadEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ClassUnloadEvent.java index 8835b1e6e87..1da9da39030 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ClassUnloadEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ClassUnloadEvent.java @@ -39,6 +39,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ClassUnloadEvent extends Event { /** * Returns the name of the class that has been unloaded. diff --git a/jdk/src/share/classes/com/sun/jdi/event/Event.java b/jdk/src/share/classes/com/sun/jdi/event/Event.java index ba005734bb9..92c0217431d 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/Event.java +++ b/jdk/src/share/classes/com/sun/jdi/event/Event.java @@ -43,6 +43,7 @@ import com.sun.jdi.request.EventRequest; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface Event extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/EventIterator.java b/jdk/src/share/classes/com/sun/jdi/event/EventIterator.java index 220a1e417bd..a66fc850a54 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/EventIterator.java +++ b/jdk/src/share/classes/com/sun/jdi/event/EventIterator.java @@ -40,6 +40,7 @@ import java.util.Iterator; * @since 1.3 */ +@jdk.Exported public interface EventIterator extends Iterator { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/EventQueue.java b/jdk/src/share/classes/com/sun/jdi/event/EventQueue.java index 4c966a97942..5dde7462154 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/EventQueue.java +++ b/jdk/src/share/classes/com/sun/jdi/event/EventQueue.java @@ -57,6 +57,7 @@ import com.sun.jdi.*; * @since 1.3 */ +@jdk.Exported public interface EventQueue extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/EventSet.java b/jdk/src/share/classes/com/sun/jdi/event/EventSet.java index 26efafc1899..63efacf2d51 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/EventSet.java +++ b/jdk/src/share/classes/com/sun/jdi/event/EventSet.java @@ -127,6 +127,7 @@ import java.util.Set; * @since 1.3 */ +@jdk.Exported public interface EventSet extends Mirror, Set { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/ExceptionEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ExceptionEvent.java index 89cb4667d17..1a03bb6cdf3 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ExceptionEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ExceptionEvent.java @@ -44,6 +44,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ExceptionEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/LocatableEvent.java b/jdk/src/share/classes/com/sun/jdi/event/LocatableEvent.java index d7f66054e22..66a2070ae19 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/LocatableEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/LocatableEvent.java @@ -36,6 +36,7 @@ import java.util.List; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface LocatableEvent extends Event, Locatable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MethodEntryEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MethodEntryEvent.java index 963b4e6657a..2f48a4a69b9 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MethodEntryEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MethodEntryEvent.java @@ -43,6 +43,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface MethodEntryEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MethodExitEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MethodExitEvent.java index e492cc4d852..7a08790d080 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MethodExitEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MethodExitEvent.java @@ -40,6 +40,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface MethodExitEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java index 32d637d2891..9531ad4ee16 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java @@ -38,6 +38,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ModificationWatchpointEvent extends WatchpointEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java index 9f22f9aa57d..338ac38f25e 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java @@ -40,6 +40,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorContendedEnterEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java index 0b4ba8171f9..1c9835b9634 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java @@ -39,6 +39,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorContendedEnteredEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitEvent.java index 7d3d717526b..d8630df1e7f 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitEvent.java @@ -38,6 +38,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorWaitEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java index f9b14ca3573..b458ad6d68f 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java @@ -38,6 +38,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorWaitedEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/StepEvent.java b/jdk/src/share/classes/com/sun/jdi/event/StepEvent.java index e6a5f7510a5..ebeadfffd7b 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/StepEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/StepEvent.java @@ -46,6 +46,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface StepEvent extends LocatableEvent { - } diff --git a/jdk/src/share/classes/com/sun/jdi/event/ThreadDeathEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ThreadDeathEvent.java index 01f4b04b416..f998e6da724 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ThreadDeathEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ThreadDeathEvent.java @@ -45,6 +45,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ThreadDeathEvent extends Event { /** * Returns the thread which is terminating. diff --git a/jdk/src/share/classes/com/sun/jdi/event/ThreadStartEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ThreadStartEvent.java index 5be5d0ff2e4..7730e9a5225 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ThreadStartEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ThreadStartEvent.java @@ -52,6 +52,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ThreadStartEvent extends Event { /** * Returns the thread which has started. diff --git a/jdk/src/share/classes/com/sun/jdi/event/VMDeathEvent.java b/jdk/src/share/classes/com/sun/jdi/event/VMDeathEvent.java index 7225ae028e1..a6decf00c03 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/VMDeathEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/VMDeathEvent.java @@ -68,5 +68,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface VMDeathEvent extends Event { } diff --git a/jdk/src/share/classes/com/sun/jdi/event/VMDisconnectEvent.java b/jdk/src/share/classes/com/sun/jdi/event/VMDisconnectEvent.java index 8301d78c0f3..55a928c1010 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/VMDisconnectEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/VMDisconnectEvent.java @@ -52,5 +52,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface VMDisconnectEvent extends Event { } diff --git a/jdk/src/share/classes/com/sun/jdi/event/VMStartEvent.java b/jdk/src/share/classes/com/sun/jdi/event/VMStartEvent.java index cf500a28de7..3172bc74aeb 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/VMStartEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/VMStartEvent.java @@ -43,6 +43,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface VMStartEvent extends Event { /** * Returns the initial thread of the VM which has started. diff --git a/jdk/src/share/classes/com/sun/jdi/event/WatchpointEvent.java b/jdk/src/share/classes/com/sun/jdi/event/WatchpointEvent.java index d60908f897e..9cb5d5d4f6f 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/WatchpointEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/WatchpointEvent.java @@ -37,6 +37,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface WatchpointEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/package-info.java b/jdk/src/share/classes/com/sun/jdi/event/package-info.java new file mode 100644 index 00000000000..fa9afe3346a --- /dev/null +++ b/jdk/src/share/classes/com/sun/jdi/event/package-info.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/** + * This package defines JDI events and event processing. + * An {@link com.sun.jdi.event.Event} is always a member of an + * {@link com.sun.jdi.event.EventSet}, which + * is retrieved from the {@link com.sun.jdi.event.EventQueue}. + * Examples of Events include + * {@link com.sun.jdi.event.BreakpointEvent "breakpoints events"}, + * {@link com.sun.jdi.event.ThreadStartEvent "thread creation events"} and + * {@link com.sun.jdi.event.VMDeathEvent "virtual machine death event"}. + * With the exception + * of termination events, all events received must be requested with an + * {@link com.sun.jdi.request.EventRequest "EventRequest"}. The + * {@link com.sun.jdi.request} package defines event requests and event + * request management. + *

    + * Methods may be added to the interfaces in the JDI packages in future + * releases. Existing packages may be renamed if the JDI becomes a standard + * extension. + */ + +@jdk.Exported +package com.sun.jdi.event; diff --git a/jdk/src/share/classes/com/sun/jdi/event/package.html b/jdk/src/share/classes/com/sun/jdi/event/package.html deleted file mode 100644 index 521a8b7c85f..00000000000 --- a/jdk/src/share/classes/com/sun/jdi/event/package.html +++ /dev/null @@ -1,49 +0,0 @@ - - - com.sun.jdi.event description - - - -This package defines JDI events and event processing. -An {@link com.sun.jdi.event.Event} is always a member of an -{@link com.sun.jdi.event.EventSet}, which -is retrieved from the {@link com.sun.jdi.event.EventQueue}. -Examples of Events include -{@link com.sun.jdi.event.BreakpointEvent "breakpoints events"}, -{@link com.sun.jdi.event.ThreadStartEvent "thread creation events"} and -{@link com.sun.jdi.event.VMDeathEvent "virtual machine death event"}. -With the exception -of termination events, all events received must be requested with an -{@link com.sun.jdi.request.EventRequest "EventRequest"}. The -{@link com.sun.jdi.request} package defines event requests and event -request management. -

    -Methods may be added to the interfaces in the JDI packages in future -releases. Existing packages may be renamed if the JDI becomes a standard -extension. - - diff --git a/jdk/src/share/classes/com/sun/jdi/package-info.java b/jdk/src/share/classes/com/sun/jdi/package-info.java new file mode 100644 index 00000000000..00f422fd702 --- /dev/null +++ b/jdk/src/share/classes/com/sun/jdi/package-info.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/** + * This is the core package of the Java Debug + * Interface (JDI), it defines mirrors for values, types, and the target + * VirtualMachine itself - as well bootstrapping facilities. + * {@link com.sun.jdi.VirtualMachine} mirrors the target virtual machine and + * is the origin of all information provided by the JDI. A VirtualMachine + * is typically created by using the + * {@link com.sun.jdi.VirtualMachineManager} to create + * a connection to the target virtual machine (see the + * {@link com.sun.jdi.connect} package). In turn the + * {@link com.sun.jdi.VirtualMachineManager} is typically created by calling + * {@link com.sun.jdi.Bootstrap#virtualMachineManager()}. + *

    + * Most of the methods within this package can throw the unchecked exception + * {@link com.sun.jdi.VMDisconnectedException}. + *

    + * Methods may be added to the interfaces in the JDI packages in future + * releases. Existing packages may be renamed if the JDI becomes a standard + * extension. + */ + +@jdk.Exported +package com.sun.jdi; diff --git a/jdk/src/share/classes/com/sun/jdi/package.html b/jdk/src/share/classes/com/sun/jdi/package.html deleted file mode 100644 index 5aee603d981..00000000000 --- a/jdk/src/share/classes/com/sun/jdi/package.html +++ /dev/null @@ -1,50 +0,0 @@ - - - com.sun.jdi package description - - - -This is the core package of the Java Debug -Interface (JDI), it defines mirrors for values, types, and the target -VirtualMachine itself - as well bootstrapping facilities. -{@link com.sun.jdi.VirtualMachine} mirrors the target virtual machine and -is the origin of all information provided by the JDI. A VirtualMachine -is typically created by using the -{@link com.sun.jdi.VirtualMachineManager} to create -a connection to the target virtual machine (see the -{@link com.sun.jdi.connect} package). In turn the -{@link com.sun.jdi.VirtualMachineManager} is typically created by calling -{@link com.sun.jdi.Bootstrap#virtualMachineManager()}. -

    -Most of the methods within this package can throw the unchecked exception -{@link com.sun.jdi.VMDisconnectedException}. -

    -Methods may be added to the interfaces in the JDI packages in future -releases. Existing packages may be renamed if the JDI becomes a standard -extension. - - diff --git a/jdk/src/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java b/jdk/src/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java index 727614774b5..15915252a98 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java @@ -56,5 +56,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface AccessWatchpointRequest extends WatchpointRequest { } diff --git a/jdk/src/share/classes/com/sun/jdi/request/BreakpointRequest.java b/jdk/src/share/classes/com/sun/jdi/request/BreakpointRequest.java index d31df572854..6d6ee7d2bfe 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/BreakpointRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/BreakpointRequest.java @@ -46,6 +46,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface BreakpointRequest extends EventRequest, Locatable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/ClassPrepareRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ClassPrepareRequest.java index 19f1bfc1e6a..6089292ced4 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ClassPrepareRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ClassPrepareRequest.java @@ -47,6 +47,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ClassPrepareRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/ClassUnloadRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ClassUnloadRequest.java index abad6d319c6..4868b8053ed 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ClassUnloadRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ClassUnloadRequest.java @@ -46,6 +46,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ClassUnloadRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/DuplicateRequestException.java b/jdk/src/share/classes/com/sun/jdi/request/DuplicateRequestException.java index 5de664eb367..b50203481c2 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/DuplicateRequestException.java +++ b/jdk/src/share/classes/com/sun/jdi/request/DuplicateRequestException.java @@ -31,16 +31,15 @@ package com.sun.jdi.request; * @author Robert Field * @since 1.3 */ -public class DuplicateRequestException extends RuntimeException -{ +@jdk.Exported +public class DuplicateRequestException extends RuntimeException { private static final long serialVersionUID = -3719784920313411060L; - public DuplicateRequestException() - { + + public DuplicateRequestException() { super(); } - public DuplicateRequestException(String s) - { + public DuplicateRequestException(String s) { super(s); } } diff --git a/jdk/src/share/classes/com/sun/jdi/request/EventRequest.java b/jdk/src/share/classes/com/sun/jdi/request/EventRequest.java index 9b9138e2c29..8b64f1f2457 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/EventRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/EventRequest.java @@ -78,6 +78,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface EventRequest extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/EventRequestManager.java b/jdk/src/share/classes/com/sun/jdi/request/EventRequestManager.java index e2627de9296..13f03fc5242 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/EventRequestManager.java +++ b/jdk/src/share/classes/com/sun/jdi/request/EventRequestManager.java @@ -44,6 +44,7 @@ import java.util.List; * @since 1.3 */ +@jdk.Exported public interface EventRequestManager extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/ExceptionRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ExceptionRequest.java index e7e06bf26de..ddb5d97d81c 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ExceptionRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ExceptionRequest.java @@ -43,6 +43,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ExceptionRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/InvalidRequestStateException.java b/jdk/src/share/classes/com/sun/jdi/request/InvalidRequestStateException.java index 8bd3292caa3..619f47bd968 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/InvalidRequestStateException.java +++ b/jdk/src/share/classes/com/sun/jdi/request/InvalidRequestStateException.java @@ -35,6 +35,7 @@ package com.sun.jdi.request; * @author Robert Field * @since 1.3 */ +@jdk.Exported public class InvalidRequestStateException extends RuntimeException { private static final long serialVersionUID = -3774632428543322148L; public InvalidRequestStateException() diff --git a/jdk/src/share/classes/com/sun/jdi/request/MethodEntryRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MethodEntryRequest.java index 397e97cbdcb..1d98adec192 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MethodEntryRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MethodEntryRequest.java @@ -44,6 +44,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface MethodEntryRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/MethodExitRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MethodExitRequest.java index c6a4649abaa..e0612903e0e 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MethodExitRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MethodExitRequest.java @@ -44,6 +44,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface MethodExitRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java index 778d5d8ef34..20b5b2320f4 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java @@ -55,5 +55,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ModificationWatchpointRequest extends WatchpointRequest { } diff --git a/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java index b3edd957ed9..864522cef6c 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java @@ -45,6 +45,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorContendedEnterRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java index 0066f868caa..965df47b8ff 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java @@ -45,6 +45,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorContendedEnteredRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitRequest.java index 37ce47f1831..35df22578e4 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitRequest.java @@ -45,6 +45,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorWaitRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java index 9fea543e278..ee4982a4767 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java @@ -45,6 +45,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorWaitedRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/StepRequest.java b/jdk/src/share/classes/com/sun/jdi/request/StepRequest.java index 765fdd02a81..2ea385f45d2 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/StepRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/StepRequest.java @@ -43,6 +43,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface StepRequest extends EventRequest { /** Step into any newly pushed frames */ diff --git a/jdk/src/share/classes/com/sun/jdi/request/ThreadDeathRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ThreadDeathRequest.java index fe9e68a9aca..ac17fa23fc0 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ThreadDeathRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ThreadDeathRequest.java @@ -44,6 +44,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ThreadDeathRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/ThreadStartRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ThreadStartRequest.java index 298da9a3941..596c96b329a 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ThreadStartRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ThreadStartRequest.java @@ -44,6 +44,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ThreadStartRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/VMDeathRequest.java b/jdk/src/share/classes/com/sun/jdi/request/VMDeathRequest.java index c600651c562..86434403439 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/VMDeathRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/VMDeathRequest.java @@ -56,6 +56,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.4 */ +@jdk.Exported public interface VMDeathRequest extends EventRequest { } diff --git a/jdk/src/share/classes/com/sun/jdi/request/WatchpointRequest.java b/jdk/src/share/classes/com/sun/jdi/request/WatchpointRequest.java index cafe61dc40f..9c78f75499c 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/WatchpointRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/WatchpointRequest.java @@ -38,6 +38,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface WatchpointRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/package-info.java b/jdk/src/share/classes/com/sun/jdi/request/package-info.java new file mode 100644 index 00000000000..add151ddce0 --- /dev/null +++ b/jdk/src/share/classes/com/sun/jdi/request/package-info.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/** + * This package is used to request that a JDI + * event be sent under specified conditions. + * With the exception of termination events, which are + * always sent, there is one kind of + * {@link com.sun.jdi.request.EventRequest} for each kind of + * {@link com.sun.jdi.event.Event Event} - for example, + * {@link com.sun.jdi.request.BreakpointRequest} is used to request a + * {@link com.sun.jdi.event.BreakpointEvent BreakpointEvent}. + * Event requests are created by the + * {@link com.sun.jdi.request.EventRequestManager}. + * Events and event processing are defined in the + * {@link com.sun.jdi.event} package. + *

    + * Methods may be added to the interfaces in the JDI packages in future + * releases. Existing packages may be renamed if the JDI becomes a standard + * extension. + */ + +@jdk.Exported +package com.sun.jdi.request; diff --git a/jdk/src/share/classes/com/sun/jdi/request/package.html b/jdk/src/share/classes/com/sun/jdi/request/package.html deleted file mode 100644 index c99c1c8e359..00000000000 --- a/jdk/src/share/classes/com/sun/jdi/request/package.html +++ /dev/null @@ -1,48 +0,0 @@ - - - com.sun.jdi.request description - - - -This package is used to request that a JDI -event be sent under specified conditions. -With the exception of termination events, which are -always sent, there is one kind of -{@link com.sun.jdi.request.EventRequest} for each kind of -{@link com.sun.jdi.event.Event Event} - for example, -{@link com.sun.jdi.request.BreakpointRequest} is used to request a -{@link com.sun.jdi.event.BreakpointEvent BreakpointEvent}. -Event requests are created by the -{@link com.sun.jdi.request.EventRequestManager}. -Events and event processing are defined in the -{@link com.sun.jdi.event} package. -

    -Methods may be added to the interfaces in the JDI packages in future -releases. Existing packages may be renamed if the JDI becomes a standard -extension. - - diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java index c5e00005b87..b6286e5d1c9 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java @@ -1291,7 +1291,7 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory { * ambiguous set. If this set itself corresponds to a constructor, * there is no ambiguity for that pair. In the usual case, one * of the constructors is a superset of the other so the union is - * just the bigger constuctor. + * just the bigger constructor. * * The algorithm here is quadratic in the number of constructors * with a @ConstructorProperties annotation. Typically this corresponds diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java index 0e08177d7f2..06cc19d2894 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java @@ -644,7 +644,7 @@ public class Introspector { /** * Returns the list of "getter" methods for the given class. The list * is ordered so that isXXX methods appear before getXXX methods - this - * is for compatability with the JavaBeans Introspector. + * is for compatibility with the JavaBeans Introspector. */ static List getReadMethods(Class clazz) { // return cached result if available @@ -682,7 +682,7 @@ public class Introspector { * {@code null} if no method is found. */ static Method getReadMethod(Class clazz, String property) { - // first character in uppercase (compatability with JavaBeans) + // first character in uppercase (compatibility with JavaBeans) property = property.substring(0, 1).toUpperCase(Locale.ENGLISH) + property.substring(1); String getMethod = GET_METHOD_PREFIX + property; diff --git a/jdk/src/share/classes/com/sun/jmx/remote/protocol/iiop/IIOPProxyImpl.java b/jdk/src/share/classes/com/sun/jmx/remote/protocol/iiop/IIOPProxyImpl.java index d4171b24282..b0fe91bf728 100644 --- a/jdk/src/share/classes/com/sun/jmx/remote/protocol/iiop/IIOPProxyImpl.java +++ b/jdk/src/share/classes/com/sun/jmx/remote/protocol/iiop/IIOPProxyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009,2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,13 +36,34 @@ import java.rmi.RemoteException; import java.rmi.NoSuchObjectException; import com.sun.jmx.remote.internal.IIOPProxy; +import java.io.SerializablePermission; +import java.security.AccessControlContext; +import java.security.AccessController; +import java.security.Permissions; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.security.ProtectionDomain; /** - * An implementatin of IIOPProxy that simply delegates to the appropriate + * An implementation of IIOPProxy that simply delegates to the appropriate * RMI-IIOP and CORBA APIs. */ public class IIOPProxyImpl implements IIOPProxy { + // special ACC used to initialize the IIOP stub + // the only allowed privilege is SerializablePermission("enableSubclassImplementation") + private static final AccessControlContext STUB_ACC; + + static { + Permissions p = new Permissions(); + p.add(new SerializablePermission("enableSubclassImplementation")); + STUB_ACC = new AccessControlContext( + new ProtectionDomain[]{ + new ProtectionDomain(null, p) + } + ); + } + public IIOPProxyImpl() { } @Override @@ -113,7 +134,24 @@ public class IIOPProxyImpl implements IIOPProxy { } @Override - public Remote toStub(Remote obj) throws NoSuchObjectException { - return PortableRemoteObject.toStub(obj); + public Remote toStub(final Remote obj) throws NoSuchObjectException { + if (System.getSecurityManager() == null) { + return PortableRemoteObject.toStub(obj); + } else { + try { + return AccessController.doPrivileged(new PrivilegedExceptionAction() { + + @Override + public Remote run() throws Exception { + return PortableRemoteObject.toStub(obj); + } + }, STUB_ACC); + } catch (PrivilegedActionException e) { + if (e.getException() instanceof NoSuchObjectException) { + throw (NoSuchObjectException)e.getException(); + } + throw new RuntimeException("Unexpected exception type", e.getException()); + } + } } } diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java b/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java index 75786ffb1b4..d4c67d4e91b 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java @@ -35,7 +35,7 @@ class TokenMgrError extends Error */ /** - * Lexical error occured. + * Lexical error occurred. */ static final int LEXICAL_ERROR = 0; @@ -114,10 +114,10 @@ class TokenMgrError extends Error * token manager to indicate a lexical error. * Parameters : * EOFSeen : indicates if EOF caused the lexicl error - * curLexState : lexical state in which this error occured - * errorLine : line number when the error occured - * errorColumn : column number when the error occured - * errorAfter : prefix that was seen before this error occured + * curLexState : lexical state in which this error occurred + * errorLine : line number when the error occurred + * errorColumn : column number when the error occurred + * errorAfter : prefix that was seen before this error occurred * curchar : the offending character * Note: You can customize the lexical error message by modifying this method. */ diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/SnmpString.java b/jdk/src/share/classes/com/sun/jmx/snmp/SnmpString.java index 9ec7f7cd520..76af600386a 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/SnmpString.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/SnmpString.java @@ -130,7 +130,7 @@ public class SnmpString extends SnmpValue { * @return The value. */ public byte[] byteValue() { - return value ; + return value.clone() ; } /** diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java index ffa64b2f524..5d9b3e54cc4 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java @@ -70,7 +70,7 @@ public class SnmpErrorHandlerAgent extends SnmpMibAgent * @param server The MBean server to register the service with. * @param name The object name. * - * @return The passed name paramter. + * @return The passed name parameter. * * @exception java.lang.Exception */ @@ -99,7 +99,7 @@ public class SnmpErrorHandlerAgent extends SnmpMibAgent * * @param inRequest The SnmpMibRequest object holding the list of variable to be retrieved. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ @Override @@ -147,7 +147,7 @@ public class SnmpErrorHandlerAgent extends SnmpMibAgent * * @param inRequest The SnmpMibRequest object holding the list of variable to be set. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ @Override @@ -165,7 +165,7 @@ public class SnmpErrorHandlerAgent extends SnmpMibAgent * * @param inRequest The SnmpMibRequest object holding the list of variables to be retrieved. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ @Override @@ -190,7 +190,7 @@ public class SnmpErrorHandlerAgent extends SnmpMibAgent * * @param inRequest The SnmpMibRequest object holding the list of variable to be retrieved. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ @Override diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java index df7587404ef..ac9c4bbd54f 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java @@ -476,8 +476,7 @@ public abstract class SnmpMib extends SnmpMibAgent implements Serializable { rootOid[i++]= val.longValue(); } } - return rootOid; - + return rootOid.clone(); } // -------------------------------------------------------------------- diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java index 451fa859df4..86892ee34d9 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java @@ -127,7 +127,7 @@ public abstract class SnmpMibAgent * be retrieved. This list is composed of * SnmpVarBind objects. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ @Override public abstract void get(SnmpMibRequest req) @@ -142,7 +142,7 @@ public abstract class SnmpMibAgent * OIDs from which the next variables should be retrieved. * This list is composed of SnmpVarBind objects. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ @Override public abstract void getNext(SnmpMibRequest req) @@ -166,7 +166,7 @@ public abstract class SnmpMibAgent * following the first nonRepeat variables for which * multiple lexicographic successors are requested. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ @Override public abstract void getBulk(SnmpMibRequest req, int nonRepeat, @@ -184,7 +184,7 @@ public abstract class SnmpMibAgent * be set. This list is composed of * SnmpVarBind objects. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. * Throwing an exception in this method will break the * atomicity of the SET operation. Care must be taken so that * the exception is thrown in the {@link #check(SnmpMibRequest)} @@ -643,7 +643,7 @@ public abstract class SnmpMibAgent * * @return The variable list containing returned values. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ void getBulkWithGetNext(SnmpMibRequest req, int nonRepeat, int maxRepeat) throws SnmpStatusException { diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgentMBean.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgentMBean.java index b057823dc6f..9f48879ac7c 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgentMBean.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgentMBean.java @@ -62,7 +62,7 @@ public interface SnmpMibAgentMBean { * be retrieved. This list is composed of * SnmpVarBind objects. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. * @see SnmpMibAgent#get(SnmpMibRequest) */ public void get(SnmpMibRequest req) throws SnmpStatusException; @@ -75,7 +75,7 @@ public interface SnmpMibAgentMBean { * be retrieved. This list is composed of * SnmpVarBind objects. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. * @see SnmpMibAgent#getNext(SnmpMibRequest) */ public void getNext(SnmpMibRequest req) throws SnmpStatusException; @@ -97,7 +97,7 @@ public interface SnmpMibAgentMBean { * following the first nonRepeat variables for which * multiple lexicographic successors are requested. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. * @see SnmpMibAgent#getBulk(SnmpMibRequest,int,int) */ public void getBulk(SnmpMibRequest req, int nonRepeat, int maxRepeat) @@ -111,7 +111,7 @@ public interface SnmpMibAgentMBean { * be set. This list is composed of * SnmpVarBind objects. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. * @see SnmpMibAgent#set(SnmpMibRequest) */ public void set(SnmpMibRequest req) throws SnmpStatusException; diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java index 29882ce01d4..6050de77d70 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java @@ -119,7 +119,7 @@ public abstract class SnmpMibGroup extends SnmpMibOid // needed... // For instance, the subclass could provide a generated isNestedArc() // method in which the subgroup OID arcs would be hardcoded. - // However, the generic approach was prefered because at this time + // However, the generic approach was preferred because at this time // groups and subgroups are dynamically registered in the MIB. // /** diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java index e0282c6cec0..2edcbde2a40 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java @@ -435,7 +435,7 @@ public abstract class SnmpMibTable extends SnmpMibNode * If the entry is going to be registered, or if ObjectName's are * required, then * {@link com.sun.jmx.snmp.agent.SnmpMibTable#addEntry(SnmpOid, - * ObjectName, Object)} should be prefered. + * ObjectName, Object)} should be preferred. *
    This function is mainly provided for backward compatibility. * *

    @@ -1088,7 +1088,7 @@ public abstract class SnmpMibTable extends SnmpMibNode * @return true if the row can be placed in * notInService state. * - * @exception SnmpStatusException An error occured while trying + * @exception SnmpStatusException An error occurred while trying * to retrieve the row status, and the operation should * be aborted. * @@ -2444,7 +2444,7 @@ public abstract class SnmpMibTable extends SnmpMibNode l1+1,l2); } else if (pos < tablecount) { - // Vector is large enough to accomodate one additional + // Vector is large enough to accommodate one additional // entry. // // Shift vector, making an empty room at `pos' diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java index dbcca12d9ef..bfe2e0fee55 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java @@ -581,7 +581,7 @@ final class SnmpRequestTree { } else if (pos < entrycount) { - // Vectors are large enough to accomodate one additional + // Vectors are large enough to accommodate one additional // entry. // // Shift vectors, making an empty room at `pos' diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpTableSupport.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpTableSupport.java index 8a015ce7c18..950bbce17e1 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpTableSupport.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpTableSupport.java @@ -480,7 +480,7 @@ public abstract class SnmpTableSupport implements SnmpTableEntryFactory, * associated SnmpIndex. *

    * If the entry is going to be registered, then - * {@link com.sun.jmx.snmp.agent.SnmpTableSupport#addEntry(SnmpIndex, ObjectName, Object)} should be prefered. + * {@link com.sun.jmx.snmp.agent.SnmpTableSupport#addEntry(SnmpIndex, ObjectName, Object)} should be preferred. *
    This function is mainly provided for backward compatibility. * * @param index The SnmpIndex built from the given entry. diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServer.java b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServer.java index b2634d8eee1..b0828e21be9 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServer.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServer.java @@ -1248,7 +1248,7 @@ public abstract class CommunicatorServer "of this CommunicatorServer instance has changed."); } - return notifInfos; + return notifInfos.clone(); } /** diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java index 1b42ed4f043..325daa5b990 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java @@ -473,7 +473,7 @@ public interface SnmpAdaptorServerMBean extends CommunicatorServerMBean { * @param specific The specific number of the trap. * @param varBindList A list of SnmpVarBind instances or null. * - * @exception IOException An I/O error occured while sending the trap. + * @exception IOException An I/O error occurred while sending the trap. * @exception SnmpStatusException If the trap exceeds the limit defined by bufferSize. */ public void snmpV1Trap(int generic, int specific, SnmpVarBindList varBindList) throws IOException, SnmpStatusException; @@ -563,7 +563,7 @@ public interface SnmpAdaptorServerMBean extends CommunicatorServerMBean { * @param trapOid The OID identifying the trap. * @param varBindList A list of SnmpVarBind instances or null. * - * @exception IOException An I/O error occured while sending the trap. + * @exception IOException An I/O error occurred while sending the trap. * @exception SnmpStatusException If the trap exceeds the limit defined by bufferSize. */ public void snmpV2Trap(SnmpOid trapOid, SnmpVarBindList varBindList) throws IOException, SnmpStatusException; diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java index 0b60e802270..3fea8fe08ca 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java @@ -559,7 +559,7 @@ class SnmpRequestHandler extends ClientHandler implements SnmpDefinitions { // SnmpPduPacket result= executeSubRequest(req,userData); if (result != null) - // It means that an error occured. The error is already + // It means that an error occurred. The error is already // formatted by the executeSubRequest // method. return result; diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java index 2754975082f..6dc479f242c 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java @@ -52,7 +52,7 @@ class SnmpSubBulkRequestHandler extends SnmpSubRequestHandler { private SnmpAdaptorServer server = null; /** - * The constuctor initialize the subrequest with the whole varbind list contained + * The constructor initialize the subrequest with the whole varbind list contained * in the original request. */ protected SnmpSubBulkRequestHandler(SnmpEngine engine, @@ -68,7 +68,7 @@ class SnmpSubBulkRequestHandler extends SnmpSubRequestHandler { } /** - * The constuctor initialize the subrequest with the whole varbind list contained + * The constructor initialize the subrequest with the whole varbind list contained * in the original request. */ protected SnmpSubBulkRequestHandler(SnmpAdaptorServer server, diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubNextRequestHandler.java b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubNextRequestHandler.java index bb4dd0bfd3b..3ff95f6a001 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubNextRequestHandler.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubNextRequestHandler.java @@ -55,7 +55,7 @@ import com.sun.jmx.snmp.ThreadContext; class SnmpSubNextRequestHandler extends SnmpSubRequestHandler { private SnmpAdaptorServer server = null; /** - * The constuctor initialize the subrequest with the whole varbind + * The constructor initialize the subrequest with the whole varbind * list contained in the original request. */ protected SnmpSubNextRequestHandler(SnmpAdaptorServer server, diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubRequestHandler.java b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubRequestHandler.java index 04f4ca67443..0b981311358 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubRequestHandler.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubRequestHandler.java @@ -99,7 +99,7 @@ class SnmpSubRequestHandler implements SnmpDefinitions, Runnable { } /** - * SNMP V1/V2 The constuctor initialize the subrequest with the whole varbind list contained + * SNMP V1/V2 The constructor initialize the subrequest with the whole varbind list contained * in the original request. */ @SuppressWarnings("unchecked") // cast to NonSyncVector diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java index 0d96af74a9c..9a220b6cd89 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java @@ -568,7 +568,7 @@ public final class Connection implements Runnable { //System.err.println("ldap.abandon: " + ex); } - // Dont expect any response for the abandon request. + // Don't expect any response for the abandon request. } synchronized void abandonOutstandingReqs(Control[] reqCtls) { @@ -623,7 +623,7 @@ public final class Connection implements Runnable { //System.err.println("ldap.unbind: " + ex); } - // Dont expect any response for the unbind request. + // Don't expect any response for the unbind request. } /** diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java b/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java index 0eb1caa420c..994586c3d78 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java @@ -191,7 +191,7 @@ final class Filter { /** * convert character 'c' that represents a hexadecimal digit to an integer. - * if 'c' is not a hexidecimal digit [0-9A-Fa-f], -1 is returned. + * if 'c' is not a hexadecimal digit [0-9A-Fa-f], -1 is returned. * otherwise the converted value is returned. */ private static int hexchar2int( byte c ) { diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java index b861ea0300c..989f39be600 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java @@ -176,7 +176,7 @@ final public class LdapCtx extends ComponentDirContext "com.sun.jndi.ldap.netscape.schemaBugs"; // deprecated private static final String OLD_NETSCAPE_SCHEMA_BUG = - "com.sun.naming.netscape.schemaBugs"; // for backward compatability + "com.sun.naming.netscape.schemaBugs"; // for backward compatibility // Timeout for socket connect private static final String CONNECT_TIMEOUT = diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java index d6ab7310a87..9797aad348f 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java @@ -237,7 +237,7 @@ final public class LdapCtxFactory implements ObjectFactory, InitialContextFactor private static String[] getTypeNames(Class currentClass, Vector v) { getClassesAux(currentClass, v); - Class[] members = currentClass.getInterfaces(); + Class[] members = currentClass.getInterfaces(); for (int i = 0; i < members.length; i++) { getClassesAux(members[i], v); } diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java index 5e2ec66a0da..a2f528b2056 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java @@ -862,7 +862,7 @@ public final class LdapName implements Name { --end; } - // Add back the trailing whitespace with a preceeding '\' + // Add back the trailing whitespace with a preceding '\' // (escaped or unescaped) that was taken off in the above // loop. Whether or not to retain this whitespace is // decided below. @@ -918,7 +918,7 @@ public final class LdapName implements Name { } // Get rid of the unescaped trailing whitespace with the - // preceeding '\' character that was previously added back. + // preceding '\' character that was previously added back. int len = buf.length(); if (isWhitespace(buf.charAt(len - 1)) && esc != (end - 1)) { buf.setLength(len - 1); diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java index b401c0289c9..122253812c6 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java @@ -237,7 +237,7 @@ public final class LdapPoolManager { !socketFactory.equals(LdapCtx.DEFAULT_SSL_FACTORY)) { try { Class socketFactoryClass = Obj.helper.loadClass(socketFactory); - Class[] interfaces = socketFactoryClass.getInterfaces(); + Class[] interfaces = socketFactoryClass.getInterfaces(); for (int i = 0; i < interfaces.length; i++) { if (interfaces[i].getCanonicalName().equals(COMPARATOR)) { foundSockCmp = true; diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java index 9e8854a460c..63e6bd280ba 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java @@ -25,11 +25,12 @@ package com.sun.jndi.ldap; -import java.net.URL; import java.net.URLClassLoader; import java.net.MalformedURLException; +import java.security.AccessControlContext; import java.security.AccessController; import java.security.PrivilegedAction; +import sun.misc.SharedSecrets; final class VersionHelper12 extends VersionHelper { @@ -82,12 +83,16 @@ final class VersionHelper12 extends VersionHelper { } Thread createThread(final Runnable r) { + final AccessControlContext acc = AccessController.getContext(); + // 4290486: doPrivileged is needed to create a thread in + // an environment that restricts "modifyThreadGroup". return AccessController.doPrivileged( - new PrivilegedAction() { - public Thread run() { - return new Thread(r); + new PrivilegedAction() { + public Thread run() { + return SharedSecrets.getJavaLangAccess() + .newThreadWithAcc(r, acc); + } } - } ); } } diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java index 17d1cf08c2f..13b5daa602e 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java @@ -109,7 +109,7 @@ public abstract class PartialCompositeContext implements Context, Resolver { /** * A cheap way of getting the environment. - * Default implemenation is NOT cheap because it simply calls + * Default implementation is NOT cheap because it simply calls * getEnvironment(), which most implementations clone before returning. * Subclass should ALWAYS override this with the cheapest possible way. * The toolkit knows to clone when necessary. diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java index ac6eb40fdcd..d88a7e214e9 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java @@ -82,7 +82,7 @@ public class ContextEnumerator implements NamingEnumeration { return ctx.listBindings(""); } - // Subclass should overrride so that instance is of same type as subclass + // Subclass should override so that instance is of same type as subclass protected ContextEnumerator newEnumerator(Context ctx, int scope, String contextName, boolean returnSelf) throws NamingException { return new ContextEnumerator(ctx, scope, contextName, returnSelf); diff --git a/jdk/src/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java b/jdk/src/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java index 64fb94b3fb8..b27512020d8 100644 --- a/jdk/src/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java +++ b/jdk/src/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java @@ -85,6 +85,7 @@ import sun.management.GarbageCollectionNotifInfoCompositeData; * **/ +@jdk.Exported public class GarbageCollectionNotificationInfo implements CompositeDataView { private final String gcName; diff --git a/jdk/src/share/classes/com/sun/management/GarbageCollectorMXBean.java b/jdk/src/share/classes/com/sun/management/GarbageCollectorMXBean.java index ad9335f94d0..af574caa43f 100644 --- a/jdk/src/share/classes/com/sun/management/GarbageCollectorMXBean.java +++ b/jdk/src/share/classes/com/sun/management/GarbageCollectorMXBean.java @@ -37,6 +37,7 @@ import javax.management.openmbean.CompositeType; * @author Mandy Chung * @since 1.5 */ +@jdk.Exported public interface GarbageCollectorMXBean extends java.lang.management.GarbageCollectorMXBean { diff --git a/jdk/src/share/classes/com/sun/management/GcInfo.java b/jdk/src/share/classes/com/sun/management/GcInfo.java index 5fa897cb1ff..516174a5384 100644 --- a/jdk/src/share/classes/com/sun/management/GcInfo.java +++ b/jdk/src/share/classes/com/sun/management/GcInfo.java @@ -64,6 +64,7 @@ import sun.management.GcInfoBuilder; * @author Mandy Chung * @since 1.5 */ +@jdk.Exported public class GcInfo implements CompositeData, CompositeDataView { private final long index; private final long startTime; diff --git a/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java b/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java index 2fe8835259f..60751b04d0d 100644 --- a/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java +++ b/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java @@ -48,6 +48,7 @@ import java.lang.management.PlatformManagedObject; * * @see ManagementFactory#getPlatformMXBeans(Class) */ +@jdk.Exported public interface HotSpotDiagnosticMXBean extends PlatformManagedObject { /** * Dumps the heap to the outputFile file in the same @@ -66,6 +67,11 @@ public interface HotSpotDiagnosticMXBean extends PlatformManagedObject { * cannot be created, opened, or written to. * @throws UnsupportedOperationException if this operation is not supported. * @throws NullPointerException if outputFile is null. + * @throws SecurityException + * If a security manager exists and its {@link + * java.lang.SecurityManager#checkWrite(java.lang.String)} + * method denies write access to the named file + * or the caller does not have ManagmentPermission("control"). */ public void dumpHeap(String outputFile, boolean live) throws java.io.IOException; diff --git a/jdk/src/share/classes/com/sun/management/OperatingSystemMXBean.java b/jdk/src/share/classes/com/sun/management/OperatingSystemMXBean.java index d20cd3696f1..57075080ff1 100644 --- a/jdk/src/share/classes/com/sun/management/OperatingSystemMXBean.java +++ b/jdk/src/share/classes/com/sun/management/OperatingSystemMXBean.java @@ -39,6 +39,7 @@ package com.sun.management; * @author Mandy Chung * @since 1.5 */ +@jdk.Exported public interface OperatingSystemMXBean extends java.lang.management.OperatingSystemMXBean { diff --git a/jdk/src/share/classes/com/sun/management/ThreadMXBean.java b/jdk/src/share/classes/com/sun/management/ThreadMXBean.java index f5a9a5b9a0d..25a59c41017 100644 --- a/jdk/src/share/classes/com/sun/management/ThreadMXBean.java +++ b/jdk/src/share/classes/com/sun/management/ThreadMXBean.java @@ -38,6 +38,7 @@ import java.util.Map; * @since 6u25 */ +@jdk.Exported public interface ThreadMXBean extends java.lang.management.ThreadMXBean { /** * Returns the total CPU time for each thread whose ID is diff --git a/jdk/src/share/classes/com/sun/management/UnixOperatingSystemMXBean.java b/jdk/src/share/classes/com/sun/management/UnixOperatingSystemMXBean.java index 20f43bf0bbd..00cb3f4af86 100644 --- a/jdk/src/share/classes/com/sun/management/UnixOperatingSystemMXBean.java +++ b/jdk/src/share/classes/com/sun/management/UnixOperatingSystemMXBean.java @@ -32,6 +32,7 @@ package com.sun.management; * @author Mandy Chung * @since 1.5 */ +@jdk.Exported public interface UnixOperatingSystemMXBean extends com.sun.management.OperatingSystemMXBean { diff --git a/jdk/src/share/classes/com/sun/management/VMOption.java b/jdk/src/share/classes/com/sun/management/VMOption.java index ba8e1d06fb9..d79bc5b4d67 100644 --- a/jdk/src/share/classes/com/sun/management/VMOption.java +++ b/jdk/src/share/classes/com/sun/management/VMOption.java @@ -52,6 +52,7 @@ import javax.management.openmbean.CompositeData; * @author Mandy Chung * @since 1.6 */ +@jdk.Exported public class VMOption { private String name; private String value; @@ -64,6 +65,7 @@ public class VMOption { * * @since 1.6 */ + @jdk.Exported public enum Origin { /** * The VM option has not been set and its value diff --git a/jdk/src/share/classes/com/sun/management/package-info.java b/jdk/src/share/classes/com/sun/management/package-info.java new file mode 100644 index 00000000000..75808f5c96f --- /dev/null +++ b/jdk/src/share/classes/com/sun/management/package-info.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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. + */ + +/** + * This package contains Oracle Corporation's platform extension to + * the implementation of the + * + * java.lang.management API and also defines the management + * interface for some other components for the platform. + * + *

    + * All platform MBeans are registered in the platform MBeanServer + * which can be obtained via the + * + * java.lang.management.ManagementFactory.getPlatformMBeanServer + * + * @author Mandy Chung + * @since 1.5 + */ + +@jdk.Exported +package com.sun.management; diff --git a/jdk/src/share/classes/com/sun/management/package.html b/jdk/src/share/classes/com/sun/management/package.html deleted file mode 100644 index c26d4309da6..00000000000 --- a/jdk/src/share/classes/com/sun/management/package.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - -This package contains Oracle Corporation's platform extension to -the implementation of the - -java.lang.management API and also defines the management -interface for some other components for the platform. - -

    -All platform MBeans are registered in the platform MBeanServer -which can be obtained via the - -java.lang.management.ManagementFactory.getPlatformMBeanServer - -@author Mandy Chung -@since 1.5 - - - - - diff --git a/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java b/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java index 104af874ea5..874be7ddb05 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java +++ b/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java @@ -106,7 +106,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice return info; } - /** Open the device from an aplication program. + /** Open the device from an application program. * Setting the open reference count to -1 here prevents Transmitters and Receivers that * opened the the device implicitly from closing it. The only way to close the device after * this call is a call to close(). diff --git a/jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java b/jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java index 93d425e862c..5a96effbbe8 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java @@ -51,15 +51,6 @@ public final class AiffFileReader extends SunFileReader { private static final int MAX_READ_LENGTH = 8; - /** - * Constructs a new AiffParser object. - */ - public AiffFileReader() { - } - - - - // METHODS TO IMPLEMENT AudioFileReader /** @@ -292,9 +283,15 @@ public final class AiffFileReader extends SunFileReader { throw new UnsupportedAudioFileException("Invalid AIFF/COMM chunksize"); } // Read header info. - int channels = dis.readShort(); - dis.readInt(); - int sampleSizeInBits = dis.readShort(); + int channels = dis.readUnsignedShort(); + if (channels <= 0) { + throw new UnsupportedAudioFileException("Invalid number of channels"); + } + dis.readInt(); // numSampleFrames + int sampleSizeInBits = dis.readUnsignedShort(); + if (sampleSizeInBits < 1 || sampleSizeInBits > 32) { + throw new UnsupportedAudioFileException("Invalid AIFF/COMM sampleSize"); + } float sampleRate = (float) read_ieee_extended(dis); chunkRead += (2 + 4 + 2 + 10); @@ -438,7 +435,4 @@ public final class AiffFileReader extends SunFileReader { return f; } - - - } diff --git a/jdk/src/share/classes/com/sun/media/sound/AuFileReader.java b/jdk/src/share/classes/com/sun/media/sound/AuFileReader.java index d755d516efd..a12e461c95d 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AuFileReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/AuFileReader.java @@ -49,13 +49,6 @@ import javax.sound.sampled.UnsupportedAudioFileException; */ public final class AuFileReader extends SunFileReader { - /** - * Constructs a new AuFileReader object. - */ - public AuFileReader() { - } - - // METHODS TO IMPLEMENT AudioFileReader /** @@ -90,7 +83,7 @@ public final class AuFileReader extends SunFileReader { int frameRate = -1; int frameSize = -1; int channels = -1; - int sampleSizeInBits = 0; + final int sampleSizeInBits; int length = 0; int nread = 0; AudioFormat.Encoding encoding = null; @@ -118,6 +111,10 @@ public final class AuFileReader extends SunFileReader { encoding_local = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; sampleRate = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; channels = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; + if (channels <= 0) { + dis.reset(); + throw new UnsupportedAudioFileException("Invalid number of channels"); + } frameRate = sampleRate; @@ -372,7 +369,4 @@ public final class AuFileReader extends SunFileReader { return result; } - - - } diff --git a/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java b/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java index 9a3ef9970ca..d4305523526 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java +++ b/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java @@ -34,7 +34,7 @@ public final class AudioSynthesizerPropertyInfo { /** * Constructs a AudioSynthesizerPropertyInfo object with a given * name and value. The description and choices - * are intialized by null values. + * are initialized by null values. * * @param name the name of the property * @param value the current value or class used for values. diff --git a/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java b/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java index d6556f65f80..698bac9f766 100644 --- a/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java +++ b/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java @@ -378,7 +378,7 @@ final class DirectAudioDevice extends AbstractMixer { protected final boolean isSource; // true for SourceDataLine, false for TargetDataLine protected volatile long bytePosition; protected volatile boolean doIO = false; // true in between start() and stop() calls - protected volatile boolean stoppedWritten = false; // true if a write occured in stopped state + protected volatile boolean stoppedWritten = false; // true if a write occurred in stopped state protected volatile boolean drained = false; // set to true when drain function returns, set to false in write() protected boolean monitoring = false; @@ -642,7 +642,7 @@ final class DirectAudioDevice extends AbstractMixer { public void drain() { noService = true; // additional safeguard against draining forever - // this occured on Solaris 8 x86, probably due to a bug + // this occurred on Solaris 8 x86, probably due to a bug // in the audio driver int counter = 0; long startPos = getLongFramePosition(); diff --git a/jdk/src/share/classes/com/sun/media/sound/JSSecurityManager.java b/jdk/src/share/classes/com/sun/media/sound/JSSecurityManager.java index 280e92aec68..ef34bc4adf9 100644 --- a/jdk/src/share/classes/com/sun/media/sound/JSSecurityManager.java +++ b/jdk/src/share/classes/com/sun/media/sound/JSSecurityManager.java @@ -187,9 +187,18 @@ final class JSSecurityManager { static List getProviders(final Class providerClass) { List p = new ArrayList<>(); - // ServiceLoader creates "lazy" iterator instance, so it doesn't, - // require do be called from privileged section - final Iterator ps = ServiceLoader.load(providerClass).iterator(); + // ServiceLoader creates "lazy" iterator instance, but it ensures that + // next/hasNext run with permissions that are restricted by whatever + // creates the ServiceLoader instance, so it requires to be called from + // privileged section + final PrivilegedAction> psAction = + new PrivilegedAction>() { + @Override + public Iterator run() { + return ServiceLoader.load(providerClass).iterator(); + } + }; + final Iterator ps = AccessController.doPrivileged(psAction); // the iterator's hasNext() method looks through classpath for // the provider class names, so it requires read permissions diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java b/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java index d827770a514..962b4d2537b 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java @@ -37,7 +37,7 @@ import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.SourceDataLine; /** - * SourceDataLine implemention for the SoftMixingMixer. + * SourceDataLine implementation for the SoftMixingMixer. * * @author Karl Helgason */ diff --git a/jdk/src/share/classes/com/sun/media/sound/WaveFileReader.java b/jdk/src/share/classes/com/sun/media/sound/WaveFileReader.java index 9ba6a6b8740..3599fdfab52 100644 --- a/jdk/src/share/classes/com/sun/media/sound/WaveFileReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/WaveFileReader.java @@ -52,13 +52,6 @@ public final class WaveFileReader extends SunFileReader { private static final int MAX_READ_LENGTH = 12; - /** - * Constructs a new WaveFileReader object. - */ - public WaveFileReader() { - } - - /** * Obtains the audio file format of the input stream provided. The stream must * point to valid audio file data. In general, audio file providers may @@ -304,6 +297,9 @@ public final class WaveFileReader extends SunFileReader { } // channels channels = rlshort(dis); nread += 2; + if (channels <= 0) { + throw new UnsupportedAudioFileException("Invalid number of channels"); + } // sample rate. sampleRate = rllong(dis); nread += 4; @@ -316,6 +312,9 @@ public final class WaveFileReader extends SunFileReader { // this is the PCM-specific value bitsPerSample sampleSizeInBits = (int)rlshort(dis); nread += 2; + if (sampleSizeInBits <= 0) { + throw new UnsupportedAudioFileException("Invalid bitsPerSample"); + } // if sampleSizeInBits==8, we need to use PCM_UNSIGNED if ((sampleSizeInBits==8) && encoding.equals(AudioFormat.Encoding.PCM_SIGNED)) @@ -373,5 +372,4 @@ public final class WaveFileReader extends SunFileReader { format, dataLength / format.getFrameSize()); } - } diff --git a/jdk/src/share/classes/com/sun/net/httpserver/Authenticator.java b/jdk/src/share/classes/com/sun/net/httpserver/Authenticator.java index c9a0bc3c5ee..ba4aecb3e17 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/Authenticator.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/Authenticator.java @@ -36,6 +36,7 @@ import java.util.*; * Note. This implies that any caching of credentials or other authentication * information must be done outside of this class. */ +@jdk.Exported public abstract class Authenticator { /** @@ -47,6 +48,7 @@ public abstract class Authenticator { * Indicates an authentication failure. The authentication * attempt has completed. */ + @jdk.Exported public static class Failure extends Result { private int responseCode; @@ -68,6 +70,7 @@ public abstract class Authenticator { * authenticated user principal can be acquired by calling * getPrincipal(). */ + @jdk.Exported public static class Success extends Result { private HttpPrincipal principal; @@ -89,6 +92,7 @@ public abstract class Authenticator { * set any necessary response headers in the given HttpExchange * before returning this Retry object. */ + @jdk.Exported public static class Retry extends Result { private int responseCode; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java b/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java index 60ccd3ab73d..09964d5dced 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java @@ -33,6 +33,7 @@ import java.util.Base64; * to provide an implementation of {@link #checkCredentials(String,String)} * which is called to verify each incoming request. */ +@jdk.Exported public abstract class BasicAuthenticator extends Authenticator { protected String realm; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/Filter.java b/jdk/src/share/classes/com/sun/net/httpserver/Filter.java index 7431453f85e..01fd7b694da 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/Filter.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/Filter.java @@ -39,6 +39,7 @@ import java.util.*; * exchange handler. * @since 1.6 */ +@jdk.Exported public abstract class Filter { protected Filter () {} @@ -48,6 +49,7 @@ public abstract class Filter { * Each filter in the chain is given one of these * so it can invoke the next filter in the chain */ + @jdk.Exported public static class Chain { /* the last element in the chain must invoke the users * handler diff --git a/jdk/src/share/classes/com/sun/net/httpserver/Headers.java b/jdk/src/share/classes/com/sun/net/httpserver/Headers.java index afe3c217d41..7d07d42e8d0 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/Headers.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/Headers.java @@ -33,7 +33,7 @@ import java.util.*; * {@link java.lang.String},{@link java.util.List}<{@link java.lang.String}>>. * The keys are case-insensitive Strings representing the header names and * the value associated with each key is a {@link List}<{@link String}> with one - * element for each occurence of the header name in the request or response. + * element for each occurrence of the header name in the request or response. *

    * For example, if a response header instance contains one key "HeaderName" with two values "value1 and value2" * then this object is output as two header lines: @@ -58,6 +58,7 @@ import java.util.*; * as a header line containing the key but no associated value. * @since 1.6 */ +@jdk.Exported public class Headers implements Map> { HashMap> map; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpContext.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpContext.java index d42833c6689..b145813abb9 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpContext.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpContext.java @@ -40,6 +40,7 @@ import java.util.*; * context can be pre- and post-processed by each Filter in the chain. * @since 1.6 */ +@jdk.Exported public abstract class HttpContext { protected HttpContext () { diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java index 1754fe30bb6..f976ac2040e 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java @@ -65,6 +65,7 @@ import sun.net.www.MessageHeader; * @since 1.6 */ +@jdk.Exported public abstract class HttpExchange { protected HttpExchange () { @@ -169,7 +170,7 @@ public abstract class HttpExchange { * then no response body is being sent. *

    * If the content-length response header has not already been set then - * this is set to the apropriate value depending on the response length parameter. + * this is set to the appropriate value depending on the response length parameter. *

    * This method must be called prior to calling {@link #getResponseBody()}. * @param rCode the response code to send diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpHandler.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpHandler.java index 54c69cb464d..3611d67c429 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpHandler.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpHandler.java @@ -32,6 +32,7 @@ import java.io.IOException; * HTTP exchange is handled by one of these handlers. * @since 1.6 */ +@jdk.Exported public interface HttpHandler { /** * Handle the given request and generate an appropriate response. diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpPrincipal.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpPrincipal.java index 2a2f6e93249..e34eccb173f 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpPrincipal.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpPrincipal.java @@ -33,6 +33,7 @@ import java.security.Principal; * Represents a user authenticated by HTTP Basic or Digest * authentication. */ +@jdk.Exported public class HttpPrincipal implements Principal { private String username, realm; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpServer.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpServer.java index e24b133134d..21dfe413f30 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpServer.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpServer.java @@ -87,6 +87,7 @@ import com.sun.net.httpserver.spi.HttpServerProvider; * @since 1.6 */ +@jdk.Exported public abstract class HttpServer { /** diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java index 2543a157a4d..f15c8a9a84e 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java @@ -67,6 +67,7 @@ import javax.net.ssl.*; * * @since 1.6 */ +@jdk.Exported public class HttpsConfigurator { private SSLContext context; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpsExchange.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpsExchange.java index 807bb51c4d6..1893b1de1fc 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpsExchange.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpsExchange.java @@ -39,6 +39,7 @@ import java.util.*; * @since 1.6 */ +@jdk.Exported public abstract class HttpsExchange extends HttpExchange { protected HttpsExchange () { diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpsParameters.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpsParameters.java index d740c11b52f..70df374dad3 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpsParameters.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpsParameters.java @@ -49,6 +49,7 @@ import javax.net.ssl.SSLParameters; * are used, and any settings made in this object are ignored. * @since 1.6 */ +@jdk.Exported public abstract class HttpsParameters { private String[] cipherSuites; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpsServer.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpsServer.java index dbcdd9f60ba..b4a0a58fef4 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpsServer.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpsServer.java @@ -45,6 +45,7 @@ import com.sun.net.httpserver.spi.*; * @since 1.6 */ +@jdk.Exported public abstract class HttpsServer extends HttpServer { /** diff --git a/jdk/src/share/classes/com/sun/net/httpserver/package-info.java b/jdk/src/share/classes/com/sun/net/httpserver/package-info.java index 859746cb362..ebe76e5fdfe 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/package-info.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/package-info.java @@ -123,4 +123,5 @@

    @since 1.6 */ +@jdk.Exported package com.sun.net.httpserver; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java b/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java index 080420b6285..affd8ab2aa0 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java @@ -40,6 +40,7 @@ import com.sun.net.httpserver.*; * {@link HttpServer} and associated classes. Applications do not normally use * this class. See {@link #provider()} for how providers are found and loaded. */ +@jdk.Exported public abstract class HttpServerProvider { /** diff --git a/jdk/src/share/classes/com/sun/net/httpserver/spi/package-info.java b/jdk/src/share/classes/com/sun/net/httpserver/spi/package-info.java index 9f85747317d..f4d244a9995 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/spi/package-info.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/spi/package-info.java @@ -24,7 +24,8 @@ */ /** - Provides a pluggable service provider interface, which allows the HTTP server - implementation to be replaced with other implementations. -*/ + * Provides a pluggable service provider interface, which allows the HTTP server + * implementation to be replaced with other implementations. + */ +@jdk.Exported package com.sun.net.httpserver.spi; diff --git a/jdk/src/share/classes/com/sun/net/ssl/internal/ssl/Provider.java b/jdk/src/share/classes/com/sun/net/ssl/internal/ssl/Provider.java index b1a08ce6f59..765c2322f1d 100644 --- a/jdk/src/share/classes/com/sun/net/ssl/internal/ssl/Provider.java +++ b/jdk/src/share/classes/com/sun/net/ssl/internal/ssl/Provider.java @@ -41,7 +41,7 @@ public final class Provider extends SunJSSE { super(); } - // prefered constructor to enable FIPS mode at runtime + // preferred constructor to enable FIPS mode at runtime public Provider(java.security.Provider cryptoProvider) { super(cryptoProvider); } diff --git a/jdk/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnectionOldImpl.java b/jdk/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnectionOldImpl.java index 776a84c1459..f4a2a80552e 100644 --- a/jdk/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnectionOldImpl.java +++ b/jdk/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnectionOldImpl.java @@ -404,6 +404,7 @@ public class HttpsURLConnectionOldImpl return delegate.getContent(); } + @SuppressWarnings("rawtypes") public Object getContent(Class[] classes) throws IOException { return delegate.getContent(classes); } diff --git a/jdk/src/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java b/jdk/src/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java index 6240c6c9189..d11cc16fb21 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java @@ -39,6 +39,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public class AbstractNotificationHandler implements NotificationHandler { diff --git a/jdk/src/share/classes/com/sun/nio/sctp/Association.java b/jdk/src/share/classes/com/sun/nio/sctp/Association.java index 965feae3418..01cc82deecc 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/Association.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/Association.java @@ -51,6 +51,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public class Association { private final int associationID; private final int maxInStreams; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java b/jdk/src/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java index 5e8b29d4398..ff41b472d4b 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java @@ -29,6 +29,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public abstract class AssociationChangeNotification implements Notification { @@ -37,6 +38,7 @@ public abstract class AssociationChangeNotification * * @since 1.7 */ + @jdk.Exported public enum AssocChangeEvent { /** diff --git a/jdk/src/share/classes/com/sun/nio/sctp/HandlerResult.java b/jdk/src/share/classes/com/sun/nio/sctp/HandlerResult.java index 7301b45fb0e..42dd17fde42 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/HandlerResult.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/HandlerResult.java @@ -34,6 +34,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public enum HandlerResult { /** * Try to receieve another message or notification. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java b/jdk/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java index b5a4137054d..dec6382b5a1 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java @@ -31,6 +31,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public class IllegalReceiveException extends IllegalStateException { private static final long serialVersionUID = 2296619040988576224L; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java b/jdk/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java index 4088df34687..dc965d626cd 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java @@ -31,6 +31,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public class IllegalUnbindException extends IllegalStateException { private static final long serialVersionUID = -310540883995532224L; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java b/jdk/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java index abe49f24593..c331b25d681 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java @@ -30,6 +30,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public class InvalidStreamException extends IllegalArgumentException { private static final long serialVersionUID = -9172703378046665558L; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java b/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java index 997c6253834..a63f909aa04 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java @@ -56,6 +56,7 @@ import java.net.SocketAddress; * * @since 1.7 */ +@jdk.Exported public abstract class MessageInfo { /** * Initializes a new instance of this class. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/Notification.java b/jdk/src/share/classes/com/sun/nio/sctp/Notification.java index 2436fae7ba7..8c20103735a 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/Notification.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/Notification.java @@ -37,6 +37,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public interface Notification { /** * Returns the association that this notification is applicable to. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/NotificationHandler.java b/jdk/src/share/classes/com/sun/nio/sctp/NotificationHandler.java index f5af2b227e2..f95d9ec5ab3 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/NotificationHandler.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/NotificationHandler.java @@ -49,6 +49,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public interface NotificationHandler { /** * Invoked when a notification is received from the SCTP stack. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java b/jdk/src/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java index d8afdcd957a..e05c8bb0277 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java @@ -32,6 +32,7 @@ import java.net.SocketAddress; * * @since 1.7 */ +@jdk.Exported public abstract class PeerAddressChangeNotification implements Notification { @@ -46,6 +47,7 @@ public abstract class PeerAddressChangeNotification * * @since 1.7 */ + @jdk.Exported public enum AddressChangeEvent { /** * This address is now reachable. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java index 22cf07650f4..52709b07e9d 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java @@ -134,6 +134,7 @@ import java.nio.channels.SelectionKey; * * @since 1.7 */ +@jdk.Exported public abstract class SctpChannel extends AbstractSelectableChannel { diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java index 42e56591e43..79c5efba5cc 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java @@ -134,6 +134,7 @@ import java.nio.channels.SelectionKey; * * @since 1.7 */ +@jdk.Exported public abstract class SctpMultiChannel extends AbstractSelectableChannel { diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java index c96e516ca4d..a1e7a9a4439 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java @@ -68,6 +68,7 @@ import java.nio.channels.spi.AbstractSelectableChannel; * * @since 1.7 */ +@jdk.Exported public abstract class SctpServerChannel extends AbstractSelectableChannel { diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpSocketOption.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpSocketOption.java index 3cccefa4371..783bc56f752 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpSocketOption.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpSocketOption.java @@ -35,4 +35,5 @@ import java.net.SocketOption; * * @see SctpStandardSocketOptions */ +@jdk.Exported public interface SctpSocketOption extends SocketOption { } diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java index 839c73be29b..1ac4c79f5cc 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java @@ -34,6 +34,7 @@ import sun.nio.ch.sctp.SctpStdSocketOption; * * @since 1.7 */ +@jdk.Exported public class SctpStandardSocketOptions { private SctpStandardSocketOptions() {} /** @@ -315,6 +316,7 @@ public class SctpStandardSocketOptions { * * @since 1.7 */ + @jdk.Exported public static class InitMaxStreams { private int maxInStreams; private int maxOutStreams; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SendFailedNotification.java b/jdk/src/share/classes/com/sun/nio/sctp/SendFailedNotification.java index 2c3bc855d11..8178b3ca63b 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SendFailedNotification.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SendFailedNotification.java @@ -37,6 +37,7 @@ import java.net.SocketAddress; * * @since 1.7 */ +@jdk.Exported public abstract class SendFailedNotification implements Notification { /** * Initializes a new instance of this class. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/ShutdownNotification.java b/jdk/src/share/classes/com/sun/nio/sctp/ShutdownNotification.java index 6405752e310..d3556b3a155 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/ShutdownNotification.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/ShutdownNotification.java @@ -32,6 +32,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public abstract class ShutdownNotification implements Notification { /** * Initializes a new instance of this class. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/package-info.java b/jdk/src/share/classes/com/sun/nio/sctp/package-info.java index 7893a4d755f..fe63d18b65b 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/package-info.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/package-info.java @@ -72,4 +72,5 @@ * @since 1.7 */ +@jdk.Exported package com.sun.nio.sctp; diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java index 05c3cdc76cd..3f64cb3a41d 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java @@ -110,7 +110,7 @@ public interface EncryptionMethod { * Returns an iterator over all the additional elements contained in the * EncryptionMethod. * - * @return an Iterator over all the additional infomation + * @return an Iterator over all the additional information * about the EncryptionMethod. */ Iterator getEncryptionMethodInformation(); diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SKI.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SKI.java index e4617daead9..6030c966373 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SKI.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SKI.java @@ -35,7 +35,7 @@ import org.w3c.dom.Element; /** * Handles SubjectKeyIdentifier (SKI) for X.509v3. * - * @see + * @see * Interface X509Extension */ public class XMLX509SKI extends SignatureElementProxy implements XMLX509DataContent { diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java index ece475c983d..ec0e2880ff3 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java @@ -63,7 +63,7 @@ import org.w3c.dom.Text; * * This includes: * - * Constuct a ds:Reference from an {@link org.w3c.dom.Element}. + * Constructs a ds:Reference from an {@link org.w3c.dom.Element}. * *

    Create a new reference

    *
    diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java
    index 490f184c57f..bb7cc03778c 100644
    --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java
    +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java
    @@ -846,7 +846,7 @@ public final class XMLSignature extends SignatureElementProxy {
         }
     
         /**
    -     * Signal wether Manifest should be automatically validated.
    +     * Signal whether Manifest should be automatically validated.
          * Checking the digests in References in a Signature are mandatory, but for
          * References inside a Manifest it is application specific. This boolean is
          * to indicate that the References inside Manifests should be validated.
    diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java
    index cd0967215a7..a3359bdc675 100644
    --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java
    +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java
    @@ -56,7 +56,7 @@ import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverS
      * 
    * * @see Java Tip 42: Write Java apps that work with proxy-based firewalls - * @see SUN J2SE docs for network properties + * @see SUN J2SE docs for network properties * @see The JAVA FAQ Question 9.5: How do I make Java work with a proxy server? */ public class ResolverDirectHTTP extends ResourceResolverSpi { diff --git a/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java b/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java index af0c988b5d1..7a7f693022d 100644 --- a/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java +++ b/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java @@ -41,7 +41,7 @@ import com.sun.rowset.providers.*; /** * The standard implementation of the CachedRowSet interface. * - * See interface defintion for full behaviour and implementation requirements. + * See interface definition for full behavior and implementation requirements. * This reference implementation has made provision for a one-to-one write back * facility and it is curremtly be possible to change the peristence provider * during the life-time of any CachedRowSetImpl. @@ -119,14 +119,14 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern private Vector rvh; /** - * The current postion of the cursor in this CachedRowSetImpl + * The current position of the cursor in this CachedRowSetImpl * object. * @serial */ private int cursorPos; /** - * The current postion of the cursor in this CachedRowSetImpl + * The current position of the cursor in this CachedRowSetImpl * object not counting rows that have been deleted, if any. *

    * For example, suppose that the cursor is on the last row of a rowset @@ -236,7 +236,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern private int startPos; /** - * The integer value indicating the positon from where the page prior to this + * The integer value indicating the position from where the page prior to this * was populated. */ private int startPrev; @@ -3730,7 +3730,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern /* * Each call to internalPrevious may move the cursor - * over multiple rows, the absolute postion moves one one row + * over multiple rows, the absolute position moves one one row */ if (ret == true) --absolutePos; @@ -6265,7 +6265,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern /** * Returns a result set containing the original value of the rowset. The * original value is the state of the CachedRowSetImpl after the - * last population or synchronization (whichever occured most recently) with + * last population or synchronization (whichever occurred most recently) with * the data source. *

    * The cursor is positioned before the first row in the result set. @@ -6300,7 +6300,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern * Returns a result set containing the original value of the current * row only. * The original value is the state of the CachedRowSetImpl after - * the last population or synchronization (whichever occured most recently) + * the last population or synchronization (whichever occurred most recently) * with the data source. * * @return the original result set of the row @@ -9061,7 +9061,7 @@ a /** - * Sets the designated paramter to the given String object. + * Sets the designated parameter to the given String object. * The driver converts this to a SQL NCHAR or * NVARCHAR or LONGNVARCHAR value * (depending on the argument's @@ -9081,7 +9081,7 @@ a /** - * Sets the designated paramter to the given String object. + * Sets the designated parameter to the given String object. * The driver converts this to a SQL NCHAR or * NVARCHAR or LONGNVARCHAR * @param parameterName the name of the column to be set @@ -9421,7 +9421,7 @@ a * if parameterIndex does not correspond * to a parameter marker in the SQL statement, if the length specified * is less than zero or if the number of bytes in the inputstream does not match - * the specfied length. + * the specified length. * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method * * @since 1.6 @@ -9481,7 +9481,7 @@ a * @throws SQLException if parameterIndex does not correspond * to a parameter marker in the SQL statement, or if the length specified * is less than zero; if the number of bytes in the inputstream does not match - * the specfied length; if a database access error occurs or + * the specified length; if a database access error occurs or * this method is called on a closed CallableStatement * @exception SQLFeatureNotSupportedException if the JDBC driver does not support * this method diff --git a/jdk/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java b/jdk/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java index eeda4b7e326..1e60fe8acef 100644 --- a/jdk/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java +++ b/jdk/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java @@ -39,7 +39,7 @@ import com.sun.rowset.internal.*; /** * The standard implementation of the FilteredRowSet interface. See the interface - * defintion for full behaviour and implementation requirements. + * definition for full behavior and implementation requirements. * * @see javax.sql.rowset.Predicate * @author Jonathan Bruce, Amit Handa diff --git a/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java b/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java index 8302c2922c0..45df1b8495e 100644 --- a/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java +++ b/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java @@ -36,7 +36,7 @@ import javax.sql.rowset.*; /** * The standard implementation of the JdbcRowSet interface. See the interface - * defintion for full behavior and implementation requirements. + * definition for full behavior and implementation requirements. * * @author Jonathan Bruce, Amit Handa */ @@ -67,7 +67,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable { private ResultSet rs; /** - * The RowSetMetaDataImpl object that is contructed when + * The RowSetMetaDataImpl object that is constructed when * a ResultSet object is passed to the JdbcRowSet * constructor. This helps in constructing all metadata associated * with the ResultSet object using the setter methods of @@ -3152,7 +3152,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable { * DatabaseMetaData method, this method returns * null. * - * @return the Statment object that produced + * @return the Statement object that produced * this rowset's ResultSet object or null * if the result set was produced some other way * @throws SQLException if a database access error occurs @@ -4748,7 +4748,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable { /** - * Sets the designated paramter to the given String object. + * Sets the designated parameter to the given String object. * The driver converts this to a SQL NCHAR or * NVARCHAR or LONGNVARCHAR value * (depending on the argument's @@ -5883,7 +5883,7 @@ a /** - * Sets the designated paramter to the given String object. + * Sets the designated parameter to the given String object. * The driver converts this to a SQL NCHAR or * NVARCHAR or LONGNVARCHAR * @param parameterName the name of the column to be set @@ -6222,7 +6222,7 @@ a * if parameterIndex does not correspond * to a parameter marker in the SQL statement, if the length specified * is less than zero or if the number of bytes in the inputstream does not match - * the specfied length. + * the specified length. * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method * * @since 1.6 @@ -6283,7 +6283,7 @@ a * @throws SQLException if parameterIndex does not correspond * to a parameter marker in the SQL statement, or if the length specified * is less than zero; if the number of bytes in the inputstream does not match - * the specfied length; if a database access error occurs or + * the specified length; if a database access error occurs or * this method is called on a closed CallableStatement * @exception SQLFeatureNotSupportedException if the JDBC driver does not support * this method diff --git a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_ko.properties b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_ko.properties index 3dd9ee0d1b9..89bbf67ec53 100644 --- a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_ko.properties +++ b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_ko.properties @@ -44,7 +44,7 @@ cachedrowsetimpl.doublefail = {1} \uC5F4\uC758 \uAC12({0})\uC5D0\uC11C getDouble cachedrowsetimpl.dtypemismt = \uB370\uC774\uD130 \uC720\uD615\uC774 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. cachedrowsetimpl.datefail = {1} \uC5F4\uC758 \uAC12({0})\uC5D0\uC11C getDate\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uBCC0\uD658\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. cachedrowsetimpl.timefail = {1} \uC5F4\uC758 \uAC12({0})\uC5D0\uC11C getTime\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uBCC0\uD658\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. -cachedrowsetimpl.posupdate = \uC704\uCE58\uAC00 \uC9C0\uC815\uB41C \uAC31\uC2E0\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.posupdate = \uC704\uCE58\uAC00 \uC9C0\uC815\uB41C \uC5C5\uB370\uC774\uD2B8\uAC00 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. cachedrowsetimpl.unableins = \uC778\uC2A4\uD134\uC2A4\uD654\uD560 \uC218 \uC5C6\uC74C: {0} cachedrowsetimpl.beforefirst = beforeFirst: \uCEE4\uC11C \uC791\uC5C5\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. cachedrowsetimpl.first = \uCC98\uC74C: \uCEE4\uC11C \uC791\uC5C5\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. @@ -110,7 +110,7 @@ jdbcrowsetimpl.matchcols2 = \uC77C\uCE58 \uC5F4\uC740 \uB110 \uB610\uB294 \uBE48 jdbcrowsetimpl.unsetmatch = \uC124\uC815\uC744 \uD574\uC81C\uD558\uB824\uB294 \uC5F4\uC774 \uC124\uC815\uB41C \uC5F4\uACFC \uB2E4\uB985\uB2C8\uB2E4. jdbcrowsetimpl.usecolname = \uC5F4 \uC774\uB984\uC744 unsetMatchColumn\uC758 \uC778\uC218\uB85C \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624. jdbcrowsetimpl.usecolid = \uC5F4 ID\uB97C unsetMatchColumn\uC758 \uC778\uC218\uB85C \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624. -jdbcrowsetimpl.resnotupd = ResultSet\uB97C \uAC31\uC2E0\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +jdbcrowsetimpl.resnotupd = ResultSet\uB97C \uC5C5\uB370\uC774\uD2B8\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. jdbcrowsetimpl.opnotysupp = \uC791\uC5C5\uC774 \uC544\uC9C1 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. jdbcrowsetimpl.featnotsupp = \uAE30\uB2A5\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. @@ -157,7 +157,7 @@ xmlrch.errdel = \uD589\uC744 \uC0AD\uC81C\uD558\uB294 \uC911 \uC624\uB958 \uBC1C xmlrch.errinsert = insert \uD589\uC744 \uC0DD\uC131\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: {0} xmlrch.errinsdel = insdel \uD589\uC744 \uC0DD\uC131\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: {0} xmlrch.errupdate = update \uD589\uC744 \uC0DD\uC131\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: {0} -xmlrch.errupdrow = \uD589\uC744 \uAC31\uC2E0\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: {0} +xmlrch.errupdrow = \uD589\uC744 \uC5C5\uB370\uC774\uD2B8\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: {0} xmlrch.chars = \uBB38\uC790: xmlrch.badvalue = \uC798\uBABB\uB41C \uAC12: \uB110\uC77C \uC218 \uC5C6\uB294 \uC18D\uC131\uC785\uB2C8\uB2E4. xmlrch.badvalue1 = \uC798\uBABB\uB41C \uAC12: \uB110\uC77C \uC218 \uC5C6\uB294 \uBA54\uD0C0 \uB370\uC774\uD130\uC785\uB2C8\uB2E4. diff --git a/jdk/src/share/classes/com/sun/rowset/WebRowSetImpl.java b/jdk/src/share/classes/com/sun/rowset/WebRowSetImpl.java index a7afd4af563..a2d2c438d45 100644 --- a/jdk/src/share/classes/com/sun/rowset/WebRowSetImpl.java +++ b/jdk/src/share/classes/com/sun/rowset/WebRowSetImpl.java @@ -42,7 +42,7 @@ import com.sun.rowset.internal.*; /** * The standard implementation of the WebRowSet interface. See the interface - * defintion for full behaviour and implementation requirements. + * definition for full behavior and implementation requirements. * * @author Jonathan Bruce, Amit Handa */ diff --git a/jdk/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java b/jdk/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java index b237150a701..c78e87415a0 100644 --- a/jdk/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java +++ b/jdk/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java @@ -4109,7 +4109,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver { /** * Returns a result set containing the original value of the rowset. The * original value is the state of the CachedRowSetImpl after the - * last population or synchronization (whichever occured most recently) with + * last population or synchronization (whichever occurred most recently) with * the data source. *

    * The cursor is positioned before the first row in the result set. @@ -4128,7 +4128,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver { * Returns a result set containing the original value of the current * row only. * The original value is the state of the CachedRowSetImpl after - * the last population or synchronization (whichever occured most recently) + * the last population or synchronization (whichever occurred most recently) * with the data source. * * @return the original result set of the row diff --git a/jdk/src/share/classes/com/sun/rowset/package.html b/jdk/src/share/classes/com/sun/rowset/package.html index ca33ecafeb1..abd21b8b9ab 100644 --- a/jdk/src/share/classes/com/sun/rowset/package.html +++ b/jdk/src/share/classes/com/sun/rowset/package.html @@ -74,7 +74,7 @@ can with to other components of the Java platform.

    3.0 Extending the JDBC RowSet Implementations

    The JDBC RowSet reference implementations are provided as non-final -classess so that any developer can extend them to provider additional features +classes so that any developer can extend them to provide additional features while maintaining the core required standard functionality and compatibility. It is anticipated that many vendors and developers will extend the standard feature set to their their particular needs. The website for JDBC Technology will diff --git a/jdk/src/share/classes/com/sun/security/auth/LdapPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/LdapPrincipal.java index 6e067fe723d..e974f2cb833 100644 --- a/jdk/src/share/classes/com/sun/security/auth/LdapPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/LdapPrincipal.java @@ -45,6 +45,7 @@ import javax.naming.ldap.LdapName; * * @since 1.6 */ +@jdk.Exported public final class LdapPrincipal implements Principal, java.io.Serializable { private static final long serialVersionUID = 6820120005580754861L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTDomainPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTDomainPrincipal.java index 9afbfead1a7..e89e565afd0 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTDomainPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTDomainPrincipal.java @@ -45,6 +45,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTDomainPrincipal implements Principal, java.io.Serializable { private static final long serialVersionUID = -4408637351440771220L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTNumericCredential.java b/jdk/src/share/classes/com/sun/security/auth/NTNumericCredential.java index b574f8cde9f..02f9634ef39 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTNumericCredential.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTNumericCredential.java @@ -31,6 +31,7 @@ package com.sun.security.auth; * */ +@jdk.Exported public class NTNumericCredential { private long impersonationToken; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTSid.java b/jdk/src/share/classes/com/sun/security/auth/NTSid.java index 0720c5ec3fb..2c64deb65a6 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTSid.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTSid.java @@ -47,6 +47,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTSid implements Principal, java.io.Serializable { private static final long serialVersionUID = 4412290580770249885L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java index 0182c345dfd..082b9c43379 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java @@ -43,6 +43,7 @@ package com.sun.security.auth; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTSidDomainPrincipal extends NTSid { private static final long serialVersionUID = 5247810785821650912L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java index 66df636ba64..52205c974a0 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java @@ -40,6 +40,7 @@ package com.sun.security.auth; * @see javax.security.auth.Subject * @see com.sun.security.auth.NTSid */ +@jdk.Exported public class NTSidGroupPrincipal extends NTSid { private static final long serialVersionUID = -1373347438636198229L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java index 10055e5c29f..7d3f6663f8b 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java @@ -39,6 +39,7 @@ package com.sun.security.auth; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTSidPrimaryGroupPrincipal extends NTSid { private static final long serialVersionUID = 8011978367305190527L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTSidUserPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTSidUserPrincipal.java index c7f8f9b4afe..b180f52338b 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTSidUserPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTSidUserPrincipal.java @@ -39,6 +39,7 @@ package com.sun.security.auth; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTSidUserPrincipal extends NTSid { private static final long serialVersionUID = -5573239889517749525L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTUserPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTUserPrincipal.java index c5d42486607..405d5538dae 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTUserPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTUserPrincipal.java @@ -41,6 +41,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTUserPrincipal implements Principal, java.io.Serializable { private static final long serialVersionUID = -8737649811939033735L; diff --git a/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java b/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java index 1df34428514..a6402eb68ee 100644 --- a/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java +++ b/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java @@ -215,6 +215,7 @@ import javax.security.auth.Subject; * @see java.security.ProtectionDomain * @see java.security.Security security properties */ +@jdk.Exported(false) @Deprecated public class PolicyFile extends javax.security.auth.Policy { diff --git a/jdk/src/share/classes/com/sun/security/auth/PrincipalComparator.java b/jdk/src/share/classes/com/sun/security/auth/PrincipalComparator.java index 2d8ccde63b3..122a31cd30a 100644 --- a/jdk/src/share/classes/com/sun/security/auth/PrincipalComparator.java +++ b/jdk/src/share/classes/com/sun/security/auth/PrincipalComparator.java @@ -50,6 +50,7 @@ package com.sun.security.auth; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public interface PrincipalComparator { /** * Check if the specified Subject is implied by diff --git a/jdk/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java index 66943aaa71a..bb7e8b8f01c 100644 --- a/jdk/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java @@ -45,6 +45,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported(false) @Deprecated public class SolarisNumericGroupPrincipal implements Principal, diff --git a/jdk/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java index 5623239666e..eff1f3dcedf 100644 --- a/jdk/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java @@ -44,6 +44,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported(false) @Deprecated public class SolarisNumericUserPrincipal implements Principal, diff --git a/jdk/src/share/classes/com/sun/security/auth/SolarisPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/SolarisPrincipal.java index 406692c7687..bd3e8c8067f 100644 --- a/jdk/src/share/classes/com/sun/security/auth/SolarisPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/SolarisPrincipal.java @@ -44,6 +44,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported(false) @Deprecated public class SolarisPrincipal implements Principal, java.io.Serializable { diff --git a/jdk/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java index 5c4260b5ccc..7e63b443156 100644 --- a/jdk/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java @@ -41,6 +41,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class UnixNumericGroupPrincipal implements Principal, java.io.Serializable { diff --git a/jdk/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java index bb15312b602..25811860e13 100644 --- a/jdk/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java @@ -41,6 +41,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class UnixNumericUserPrincipal implements Principal, java.io.Serializable { diff --git a/jdk/src/share/classes/com/sun/security/auth/UnixPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/UnixPrincipal.java index 67d9133ef03..3a8004f24bd 100644 --- a/jdk/src/share/classes/com/sun/security/auth/UnixPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/UnixPrincipal.java @@ -41,6 +41,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class UnixPrincipal implements Principal, java.io.Serializable { private static final long serialVersionUID = -2951667807323493631L; diff --git a/jdk/src/share/classes/com/sun/security/auth/UserPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/UserPrincipal.java index 0b8a9a821ee..a156b473beb 100644 --- a/jdk/src/share/classes/com/sun/security/auth/UserPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/UserPrincipal.java @@ -42,6 +42,7 @@ import java.security.Principal; * * @since 1.6 */ +@jdk.Exported public final class UserPrincipal implements Principal, java.io.Serializable { private static final long serialVersionUID = 892106070870210969L; diff --git a/jdk/src/share/classes/com/sun/security/auth/X500Principal.java b/jdk/src/share/classes/com/sun/security/auth/X500Principal.java index cb48043aea4..d4b7ce26347 100644 --- a/jdk/src/share/classes/com/sun/security/auth/X500Principal.java +++ b/jdk/src/share/classes/com/sun/security/auth/X500Principal.java @@ -49,6 +49,7 @@ import sun.security.x509.X500Name; * class. * @see javax.security.auth.x500.X500Principal */ +@jdk.Exported(false) @Deprecated public class X500Principal implements Principal, java.io.Serializable { diff --git a/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java b/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java index 9f6bd0433c2..a68ad5db678 100644 --- a/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java +++ b/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java @@ -54,6 +54,7 @@ import javax.swing.JTextField; * @see javax.security.auth.callback * @deprecated This class will be removed in a future release. */ +@jdk.Exported(false) @Deprecated public class DialogCallbackHandler implements CallbackHandler { diff --git a/jdk/src/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java b/jdk/src/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java index 004c05da149..6bebfb4f398 100644 --- a/jdk/src/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java +++ b/jdk/src/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java @@ -53,6 +53,7 @@ import sun.security.util.Password; * @see javax.security.auth.callback */ +@jdk.Exported public class TextCallbackHandler implements CallbackHandler { /** diff --git a/jdk/src/share/classes/com/sun/security/auth/callback/package-info.java b/jdk/src/share/classes/com/sun/security/auth/callback/package-info.java new file mode 100644 index 00000000000..61d65688798 --- /dev/null +++ b/jdk/src/share/classes/com/sun/security/auth/callback/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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. + */ + +@jdk.Exported +package com.sun.security.auth.callback; diff --git a/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java b/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java index 3e6dc7da579..53058177ac2 100644 --- a/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java +++ b/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java @@ -83,6 +83,7 @@ import java.net.URI; * @see javax.security.auth.login.LoginContext * @see java.security.Security security properties */ +@jdk.Exported public class ConfigFile extends Configuration { private final sun.security.provider.ConfigFile.Spi spi; diff --git a/jdk/src/share/classes/com/sun/security/auth/login/package-info.java b/jdk/src/share/classes/com/sun/security/auth/login/package-info.java new file mode 100644 index 00000000000..a0b207c5578 --- /dev/null +++ b/jdk/src/share/classes/com/sun/security/auth/login/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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. + */ + +@jdk.Exported +package com.sun.security.auth.login; diff --git a/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java index b6b8660a2e4..35d35cc91d9 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java @@ -151,6 +151,7 @@ import com.sun.security.auth.UnixNumericGroupPrincipal; * * */ +@jdk.Exported public class JndiLoginModule implements LoginModule { private static final ResourceBundle rb = AccessController.doPrivileged( diff --git a/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java index 70f74d65a22..ada7630b463 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java @@ -110,6 +110,7 @@ import sun.security.util.Password; * * */ +@jdk.Exported public class KeyStoreLoginModule implements LoginModule { private static final ResourceBundle rb = AccessController.doPrivileged( diff --git a/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java index cd60c6ac790..c5b26892073 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java @@ -379,6 +379,7 @@ import sun.misc.HexDumpEncoder; * @author Ram Marti */ +@jdk.Exported public class Krb5LoginModule implements LoginModule { // initial state diff --git a/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java index 10fa6b640d8..e2acedecfbc 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java @@ -153,7 +153,7 @@ import com.sun.security.auth.UserPrincipal; * If the attribute cannot be found then the option is ignored. * When this option is supplied and the user has been successfully * authenticated then an additional {@link UserPrincipal} - * is created using the authorization identity and it is assocated with + * is created using the authorization identity and it is associated with * the current {@link Subject}. * *
    useSSL
    @@ -304,6 +304,7 @@ import com.sun.security.auth.UserPrincipal; * * @since 1.6 */ +@jdk.Exported public class LdapLoginModule implements LoginModule { // Use the default classloader for this class to load the prompt strings. diff --git a/jdk/src/share/classes/com/sun/security/auth/module/NTLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/NTLoginModule.java index 4ef208def94..18fb73db7cc 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/NTLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/NTLoginModule.java @@ -57,6 +57,7 @@ import com.sun.security.auth.NTNumericCredential; * * @see javax.security.auth.spi.LoginModule */ +@jdk.Exported public class NTLoginModule implements LoginModule { private NTSystem ntSystem; diff --git a/jdk/src/share/classes/com/sun/security/auth/module/NTSystem.java b/jdk/src/share/classes/com/sun/security/auth/module/NTSystem.java index 51f9a2c688c..502d92a7144 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/NTSystem.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/NTSystem.java @@ -30,6 +30,7 @@ package com.sun.security.auth.module; * security information for the current user. * */ +@jdk.Exported public class NTSystem { private native void getCurrent(boolean debug); diff --git a/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java index 07042b7e3e7..e03eb7a03b1 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java @@ -52,6 +52,7 @@ import com.sun.security.auth.SolarisNumericGroupPrincipal; * UnixLoginModule. * */ +@jdk.Exported(false) @Deprecated public class SolarisLoginModule implements LoginModule { diff --git a/jdk/src/share/classes/com/sun/security/auth/module/SolarisSystem.java b/jdk/src/share/classes/com/sun/security/auth/module/SolarisSystem.java index 622671bd3fb..df4f5278877 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/SolarisSystem.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/SolarisSystem.java @@ -30,6 +30,7 @@ package com.sun.security.auth.module; * UID/GID/groups information for the current user. * */ +@jdk.Exported public class SolarisSystem { private native void getSolarisInfo(); diff --git a/jdk/src/share/classes/com/sun/security/auth/module/UnixLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/UnixLoginModule.java index 00b7d2559a2..3b592671998 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/UnixLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/UnixLoginModule.java @@ -47,6 +47,7 @@ import com.sun.security.auth.UnixNumericGroupPrincipal; * debug messages will be output to the output stream, System.out. * */ +@jdk.Exported public class UnixLoginModule implements LoginModule { // initial state diff --git a/jdk/src/share/classes/com/sun/security/auth/module/UnixSystem.java b/jdk/src/share/classes/com/sun/security/auth/module/UnixSystem.java index b902cc9e36a..804d8c10a1b 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/UnixSystem.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/UnixSystem.java @@ -30,6 +30,7 @@ package com.sun.security.auth.module; * UID/GID/groups information for the current user. * */ +@jdk.Exported public class UnixSystem { private native void getUnixInfo(); diff --git a/jdk/src/share/classes/com/sun/security/auth/module/package-info.java b/jdk/src/share/classes/com/sun/security/auth/module/package-info.java new file mode 100644 index 00000000000..21569670ffe --- /dev/null +++ b/jdk/src/share/classes/com/sun/security/auth/module/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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. + */ + +@jdk.Exported +package com.sun.security.auth.module; diff --git a/jdk/src/share/classes/com/sun/security/auth/package-info.java b/jdk/src/share/classes/com/sun/security/auth/package-info.java new file mode 100644 index 00000000000..3fe7e206fa7 --- /dev/null +++ b/jdk/src/share/classes/com/sun/security/auth/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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. + */ + +@jdk.Exported +package com.sun.security.auth; diff --git a/jdk/src/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java b/jdk/src/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java index afdb880e42e..fdabd190fb8 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java +++ b/jdk/src/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java @@ -28,7 +28,8 @@ package com.sun.security.jgss; /** * Kerberos 5 AuthorizationData entry. */ -final public class AuthorizationDataEntry { +@jdk.Exported +public final class AuthorizationDataEntry { private final int type; private final byte[] data; diff --git a/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSContext.java b/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSContext.java index 3d8935a59e8..798379e0dde 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSContext.java +++ b/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSContext.java @@ -32,6 +32,7 @@ import org.ietf.jgss.*; * functionalities not defined by {@code org.ietf.jgss.GSSContext}, * such as querying context-specific attributes. */ +@jdk.Exported public interface ExtendedGSSContext extends GSSContext { /** * Return the mechanism-specific attribute associated with {@code type}. diff --git a/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java b/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java index 8f09482a7d0..bf44dff65cd 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java +++ b/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java @@ -32,6 +32,7 @@ import org.ietf.jgss.*; * functionalities not defined by {@code org.ietf.jgss.GSSCredential}. * @since 1.8 */ +@jdk.Exported public interface ExtendedGSSCredential extends GSSCredential { /** * Impersonates a principal. In Kerberos, this can be implemented diff --git a/jdk/src/share/classes/com/sun/security/jgss/GSSUtil.java b/jdk/src/share/classes/com/sun/security/jgss/GSSUtil.java index d05582a8c17..50b83da5ebb 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/GSSUtil.java +++ b/jdk/src/share/classes/com/sun/security/jgss/GSSUtil.java @@ -33,6 +33,7 @@ import org.ietf.jgss.GSSCredential; * GSS-API Utilities for using in conjunction with Sun Microsystem's * implementation of Java GSS-API. */ +@jdk.Exported public class GSSUtil { /** diff --git a/jdk/src/share/classes/com/sun/security/jgss/InquireSecContextPermission.java b/jdk/src/share/classes/com/sun/security/jgss/InquireSecContextPermission.java index e07072d5b9c..1e247f9ca07 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/InquireSecContextPermission.java +++ b/jdk/src/share/classes/com/sun/security/jgss/InquireSecContextPermission.java @@ -35,6 +35,7 @@ import java.security.BasicPermission; * *

    The target name is the {@link InquireType} allowed. */ +@jdk.Exported public final class InquireSecContextPermission extends BasicPermission { private static final long serialVersionUID = -7131173349668647297L; diff --git a/jdk/src/share/classes/com/sun/security/jgss/InquireType.java b/jdk/src/share/classes/com/sun/security/jgss/InquireType.java index e69ad1a6ced..c153ccb8c4f 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/InquireType.java +++ b/jdk/src/share/classes/com/sun/security/jgss/InquireType.java @@ -29,6 +29,7 @@ package com.sun.security.jgss; * Attribute types that can be specified as an argument of * {@link com.sun.security.jgss.ExtendedGSSContext#inquireSecContext} */ +@jdk.Exported public enum InquireType { /** * Attribute type for retrieving the session key of an diff --git a/jdk/src/share/classes/com/sun/security/jgss/package-info.java b/jdk/src/share/classes/com/sun/security/jgss/package-info.java new file mode 100644 index 00000000000..b1c82d77387 --- /dev/null +++ b/jdk/src/share/classes/com/sun/security/jgss/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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. + */ + +@jdk.Exported +package com.sun.security.jgss; diff --git a/jdk/src/share/classes/com/sun/security/sasl/Provider.java b/jdk/src/share/classes/com/sun/security/sasl/Provider.java index 8b9c00c8800..986a18758a1 100644 --- a/jdk/src/share/classes/com/sun/security/sasl/Provider.java +++ b/jdk/src/share/classes/com/sun/security/sasl/Provider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,7 +53,7 @@ public final class Provider extends java.security.Provider { " server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5, NTLM)"; public Provider() { - super("SunSASL", 1.7d, info); + super("SunSASL", 1.8d, info); AccessController.doPrivileged(new PrivilegedAction() { public Void run() { diff --git a/jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java b/jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java index 3370de962ec..3b645854b1b 100644 --- a/jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java +++ b/jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java @@ -62,7 +62,7 @@ import javax.security.sasl.*; * LMv2: NTLM v2, LM only * NTLMv2: NTLM v2, NTLM only * If not specified, use system property "ntlm.version". If also - * not specfied, all versions are accepted. + * not specified, all versions are accepted. * * com.sun.security.sasl.ntlm.domain * String, the domain of the server, default is server name (fqdn parameter) diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties index 722d302ef8e..4a8d160c02c 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties @@ -144,12 +144,12 @@ InternalFrame.restoreButtonToolTip=Restore InternalFrame.closeButtonToolTip=Close ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=Restore -InternalFrameTitlePane.moveButton.textAndMnemonic=Move -InternalFrameTitlePane.sizeButton.textAndMnemonic=Size -InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimize -InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximize -InternalFrameTitlePane.closeButton.textAndMnemonic=Close +InternalFrameTitlePane.restoreButton.textAndMnemonic=&Restore +InternalFrameTitlePane.moveButton.textAndMnemonic=&Move +InternalFrameTitlePane.sizeButton.textAndMnemonic=&Size +InternalFrameTitlePane.minimizeButton.textAndMnemonic=Mi&nimize +InternalFrameTitlePane.maximizeButton.textAndMnemonic=Ma&ximize +InternalFrameTitlePane.closeButton.textAndMnemonic=&Close ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties index 1affb2fe589..823abc43130 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=Wiederherstellen InternalFrame.closeButtonToolTip=Schlie\u00DFen ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=Wiederherstellen -InternalFrameTitlePane.moveButton.textAndMnemonic=Verschieben -InternalFrameTitlePane.sizeButton.textAndMnemonic=Gr\u00F6\u00DFe -InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimieren -InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximieren -InternalFrameTitlePane.closeButton.textAndMnemonic=Schlie\u00DFen +InternalFrameTitlePane.restoreButton.textAndMnemonic=Wiede&rherstellen +InternalFrameTitlePane.moveButton.textAndMnemonic=Verschieben(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=Gr\u00F6\u00DFe(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=Mi&nimieren +InternalFrameTitlePane.maximizeButton.textAndMnemonic=Ma&ximieren +InternalFrameTitlePane.closeButton.textAndMnemonic=S&chlie\u00DFen ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties index 2de493e00f6..08c77828759 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=Restaurar InternalFrame.closeButtonToolTip=Cerrar ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=Restaurar -InternalFrameTitlePane.moveButton.textAndMnemonic=Mover -InternalFrameTitlePane.sizeButton.textAndMnemonic=Tama\u00F1o -InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimizar -InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximizar -InternalFrameTitlePane.closeButton.textAndMnemonic=Cerrar +InternalFrameTitlePane.restoreButton.textAndMnemonic=&Restaurar +InternalFrameTitlePane.moveButton.textAndMnemonic=&Mover +InternalFrameTitlePane.sizeButton.textAndMnemonic=Tama\u00F1o(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=Mi&nimizar +InternalFrameTitlePane.maximizeButton.textAndMnemonic=Ma&ximizar +InternalFrameTitlePane.closeButton.textAndMnemonic=&Cerrar ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties index f57feca66b0..902db71f44c 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=Restaurer InternalFrame.closeButtonToolTip=Fermer ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=Restaurer -InternalFrameTitlePane.moveButton.textAndMnemonic=D\u00E9placer -InternalFrameTitlePane.sizeButton.textAndMnemonic=Taille -InternalFrameTitlePane.minimizeButton.textAndMnemonic=R\u00E9duire -InternalFrameTitlePane.maximizeButton.textAndMnemonic=Agrandir -InternalFrameTitlePane.closeButton.textAndMnemonic=Fermer +InternalFrameTitlePane.restoreButton.textAndMnemonic=&Restaurer +InternalFrameTitlePane.moveButton.textAndMnemonic=D\u00E9placer(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=Taille(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=R\u00E9duire(&N) +InternalFrameTitlePane.maximizeButton.textAndMnemonic=Agrandir(&X) +InternalFrameTitlePane.closeButton.textAndMnemonic=Fermer(&C) ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties index 243cf6af566..310d08f7779 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=Ripristina InternalFrame.closeButtonToolTip=Chiudi ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=Ripristina -InternalFrameTitlePane.moveButton.textAndMnemonic=Sposta -InternalFrameTitlePane.sizeButton.textAndMnemonic=Dimensioni -InternalFrameTitlePane.minimizeButton.textAndMnemonic=Riduci a icona -InternalFrameTitlePane.maximizeButton.textAndMnemonic=Ingrandisci -InternalFrameTitlePane.closeButton.textAndMnemonic=Chiudi +InternalFrameTitlePane.restoreButton.textAndMnemonic=&Ripristina +InternalFrameTitlePane.moveButton.textAndMnemonic=Sposta(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=Dimen&sioni +InternalFrameTitlePane.minimizeButton.textAndMnemonic=Riduci a ico&na +InternalFrameTitlePane.maximizeButton.textAndMnemonic=Ingrandisci(&X) +InternalFrameTitlePane.closeButton.textAndMnemonic=&Chiudi ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties index d8adf8cce82..c5314fa25a9 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=\u5FA9\u5143 InternalFrame.closeButtonToolTip=\u9589\u3058\u308B ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=\u5FA9\u5143 -InternalFrameTitlePane.moveButton.textAndMnemonic=\u79FB\u52D5 -InternalFrameTitlePane.sizeButton.textAndMnemonic=\u30B5\u30A4\u30BA -InternalFrameTitlePane.minimizeButton.textAndMnemonic=\u6700\u5C0F\u5316 -InternalFrameTitlePane.maximizeButton.textAndMnemonic=\u6700\u5927\u5316 -InternalFrameTitlePane.closeButton.textAndMnemonic=\u9589\u3058\u308B +InternalFrameTitlePane.restoreButton.textAndMnemonic=\u5FA9\u5143(&R) +InternalFrameTitlePane.moveButton.textAndMnemonic=\u79FB\u52D5(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=\u30B5\u30A4\u30BA(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=\u6700\u5C0F\u5316(&N) +InternalFrameTitlePane.maximizeButton.textAndMnemonic=\u6700\u5927\u5316(&X) +InternalFrameTitlePane.closeButton.textAndMnemonic=\u9589\u3058\u308B(&C) ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties index 86f010204dc..7f313031ba2 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties @@ -46,7 +46,7 @@ FileChooser.saveButton.textAndMnemonic=\uC800\uC7A5(&S) FileChooser.openButton.textAndMnemonic=\uC5F4\uAE30(&O) FileChooser.saveDialogTitle.textAndMnemonic=\uC800\uC7A5 FileChooser.openDialogTitle.textAndMnemonic=\uC5F4\uAE30 -FileChooser.updateButton.textAndMnemonic=\uAC31\uC2E0(&U) +FileChooser.updateButton.textAndMnemonic=\uC5C5\uB370\uC774\uD2B8(&U) FileChooser.helpButton.textAndMnemonic=\uB3C4\uC6C0\uB9D0(&H) FileChooser.directoryOpenButton.textAndMnemonic=\uC5F4\uAE30(&O) @@ -66,7 +66,7 @@ FileChooser.other.newFolder.subsequent=NewFolder.{0} FileChooser.cancelButtonToolTip.textAndMnemonic=\uD30C\uC77C \uC120\uD0DD\uAE30 \uB300\uD654\uC0C1\uC790 \uC911\uB2E8 FileChooser.saveButtonToolTip.textAndMnemonic=\uC120\uD0DD\uB41C \uD30C\uC77C \uC800\uC7A5 FileChooser.openButtonToolTip.textAndMnemonic=\uC120\uD0DD\uB41C \uD30C\uC77C \uC5F4\uAE30 -FileChooser.updateButtonToolTip.textAndMnemonic=\uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D \uAC31\uC2E0 +FileChooser.updateButtonToolTip.textAndMnemonic=\uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D \uC5C5\uB370\uC774\uD2B8 FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser \uB3C4\uC6C0\uB9D0 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=\uC120\uD0DD\uB41C \uB514\uB809\uD1A0\uB9AC \uC5F4\uAE30 @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=\uBCF5\uC6D0 InternalFrame.closeButtonToolTip=\uB2EB\uAE30 ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=\uBCF5\uC6D0 -InternalFrameTitlePane.moveButton.textAndMnemonic=\uC774\uB3D9 -InternalFrameTitlePane.sizeButton.textAndMnemonic=\uD06C\uAE30 -InternalFrameTitlePane.minimizeButton.textAndMnemonic=\uCD5C\uC18C\uD654 -InternalFrameTitlePane.maximizeButton.textAndMnemonic=\uCD5C\uB300\uD654 -InternalFrameTitlePane.closeButton.textAndMnemonic=\uB2EB\uAE30 +InternalFrameTitlePane.restoreButton.textAndMnemonic=\uBCF5\uC6D0(&R) +InternalFrameTitlePane.moveButton.textAndMnemonic=\uC774\uB3D9(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=\uD06C\uAE30(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=\uCD5C\uC18C\uD654(&N) +InternalFrameTitlePane.maximizeButton.textAndMnemonic=\uCD5C\uB300\uD654(&X) +InternalFrameTitlePane.closeButton.textAndMnemonic=\uB2EB\uAE30(&C) ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties index 61b4e122c9d..4f86d4c748e 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=Restaurar InternalFrame.closeButtonToolTip=Fechar ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=Restaurar -InternalFrameTitlePane.moveButton.textAndMnemonic=Mover -InternalFrameTitlePane.sizeButton.textAndMnemonic=Tamanho -InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimizar -InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximizar -InternalFrameTitlePane.closeButton.textAndMnemonic=Fechar +InternalFrameTitlePane.restoreButton.textAndMnemonic=&Restaurar +InternalFrameTitlePane.moveButton.textAndMnemonic=&Mover +InternalFrameTitlePane.sizeButton.textAndMnemonic=Tamanho(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=Mi&nimizar +InternalFrameTitlePane.maximizeButton.textAndMnemonic=Ma&ximizar +InternalFrameTitlePane.closeButton.textAndMnemonic=Fe&char ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties index 2d40e3c849b..27f2498ffd8 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=\u00C5terst\u00E4ll InternalFrame.closeButtonToolTip=St\u00E4ng ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=\u00C5terst\u00E4ll -InternalFrameTitlePane.moveButton.textAndMnemonic=Flytta -InternalFrameTitlePane.sizeButton.textAndMnemonic=Storlek -InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimera -InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximera -InternalFrameTitlePane.closeButton.textAndMnemonic=St\u00E4ng +InternalFrameTitlePane.restoreButton.textAndMnemonic=\u00C5terst\u00E4ll(&R) +InternalFrameTitlePane.moveButton.textAndMnemonic=Flytta(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=&Storlek +InternalFrameTitlePane.minimizeButton.textAndMnemonic=Mi&nimera +InternalFrameTitlePane.maximizeButton.textAndMnemonic=Ma&ximera +InternalFrameTitlePane.closeButton.textAndMnemonic=St\u00E4ng(&C) ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties index 4db5d181ff3..d4c357281f4 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=\u8FD8\u539F InternalFrame.closeButtonToolTip=\u5173\u95ED ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=\u8FD8\u539F -InternalFrameTitlePane.moveButton.textAndMnemonic=\u79FB\u52A8 -InternalFrameTitlePane.sizeButton.textAndMnemonic=\u5927\u5C0F -InternalFrameTitlePane.minimizeButton.textAndMnemonic=\u6700\u5C0F\u5316 -InternalFrameTitlePane.maximizeButton.textAndMnemonic=\u6700\u5927\u5316 -InternalFrameTitlePane.closeButton.textAndMnemonic=\u5173\u95ED +InternalFrameTitlePane.restoreButton.textAndMnemonic=\u8FD8\u539F(&R) +InternalFrameTitlePane.moveButton.textAndMnemonic=\u79FB\u52A8(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=\u5927\u5C0F(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=\u6700\u5C0F\u5316(&N) +InternalFrameTitlePane.maximizeButton.textAndMnemonic=\u6700\u5927\u5316(&X) +InternalFrameTitlePane.closeButton.textAndMnemonic=\u5173\u95ED(&C) ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties index 8112751e397..c26b7a15b4f 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=\u5FA9\u539F InternalFrame.closeButtonToolTip=\u95DC\u9589 ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=\u5FA9\u539F -InternalFrameTitlePane.moveButton.textAndMnemonic=\u79FB\u52D5 -InternalFrameTitlePane.sizeButton.textAndMnemonic=\u5927\u5C0F -InternalFrameTitlePane.minimizeButton.textAndMnemonic=\u6700\u5C0F\u5316 -InternalFrameTitlePane.maximizeButton.textAndMnemonic=\u6700\u5927\u5316 -InternalFrameTitlePane.closeButton.textAndMnemonic=\u95DC\u9589 +InternalFrameTitlePane.restoreButton.textAndMnemonic=\u5FA9\u539F(&R) +InternalFrameTitlePane.moveButton.textAndMnemonic=\u79FB\u52D5(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=\u5927\u5C0F(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=\u6700\u5C0F\u5316(&N) +InternalFrameTitlePane.maximizeButton.textAndMnemonic=\u6700\u5927\u5316(&X) +InternalFrameTitlePane.closeButton.textAndMnemonic=\u95DC\u9589(&C) ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties index 3d799b58a80..1b9b7e217c7 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties @@ -20,8 +20,8 @@ FileChooser.lookInLabel.textAndMnemonic=Leta &i: FileChooser.saveInLabel.textAndMnemonic=Spara i: -FileChooser.fileNameLabel.textAndMnemonic=Fil&namn: -FileChooser.folderNameLabel.textAndMnemonic=Mapp&namn: +FileChooser.fileNameLabel.textAndMnemonic=&Fil: +FileChooser.folderNameLabel.textAndMnemonic=&Mapp: FileChooser.filesOfTypeLabel.textAndMnemonic=Mapp&namn: FileChooser.upFolderToolTip.textAndMnemonic=Upp en niv\u00E5 FileChooser.upFolderAccessibleName=Upp diff --git a/jdk/src/share/classes/com/sun/tools/attach/AgentInitializationException.java b/jdk/src/share/classes/com/sun/tools/attach/AgentInitializationException.java index 5f241b4044b..cee1a519d38 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/AgentInitializationException.java +++ b/jdk/src/share/classes/com/sun/tools/attach/AgentInitializationException.java @@ -40,6 +40,7 @@ package com.sun.tools.attach; * the error returned by the agent's Agent_OnAttach function. * This error code can be obtained by invoking the {@link #returnValue() returnValue} method. */ +@jdk.Exported public class AgentInitializationException extends Exception { /** use serialVersionUID for interoperability */ diff --git a/jdk/src/share/classes/com/sun/tools/attach/AgentLoadException.java b/jdk/src/share/classes/com/sun/tools/attach/AgentLoadException.java index a724d8b4bf2..fa19a5f3e63 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/AgentLoadException.java +++ b/jdk/src/share/classes/com/sun/tools/attach/AgentLoadException.java @@ -36,6 +36,7 @@ package com.sun.tools.attach; * com.sun.tools.attach.VirtualMachine#loadAgentPath loadAgentPath} methods * if the agent, or agent library, cannot be loaded. */ +@jdk.Exported public class AgentLoadException extends Exception { /** use serialVersionUID for interoperability */ diff --git a/jdk/src/share/classes/com/sun/tools/attach/AttachNotSupportedException.java b/jdk/src/share/classes/com/sun/tools/attach/AttachNotSupportedException.java index ac4d1ee6be2..40f86243413 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/AttachNotSupportedException.java +++ b/jdk/src/share/classes/com/sun/tools/attach/AttachNotSupportedException.java @@ -36,6 +36,7 @@ import com.sun.tools.attach.spi.AttachProvider; // for javadoc * AttachProvider.attachVirtualMachine} if the provider attempts to * attach to a Java virtual machine with which it not comptatible. */ +@jdk.Exported public class AttachNotSupportedException extends Exception { /** use serialVersionUID for interoperability */ diff --git a/jdk/src/share/classes/com/sun/tools/attach/AttachPermission.java b/jdk/src/share/classes/com/sun/tools/attach/AttachPermission.java index ca094d658d8..4d05f1e49b6 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/AttachPermission.java +++ b/jdk/src/share/classes/com/sun/tools/attach/AttachPermission.java @@ -79,6 +79,7 @@ package com.sun.tools.attach; * @see com.sun.tools.attach.spi.AttachProvider */ +@jdk.Exported public final class AttachPermission extends java.security.BasicPermission { /** use serialVersionUID for interoperability */ diff --git a/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java b/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java index 29464d88da6..1bea7512147 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java +++ b/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java @@ -102,6 +102,7 @@ import java.io.IOException; * @since 1.6 */ +@jdk.Exported public abstract class VirtualMachine { private AttachProvider provider; private String id; diff --git a/jdk/src/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java b/jdk/src/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java index 9334ea19fc6..3e27fe8489f 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java +++ b/jdk/src/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java @@ -55,6 +55,7 @@ import com.sun.tools.attach.spi.AttachProvider; * * @since 1.6 */ +@jdk.Exported public class VirtualMachineDescriptor { private AttachProvider provider; diff --git a/jdk/src/share/classes/com/sun/tools/attach/package-info.java b/jdk/src/share/classes/com/sun/tools/attach/package-info.java new file mode 100644 index 00000000000..e335725390a --- /dev/null +++ b/jdk/src/share/classes/com/sun/tools/attach/package-info.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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. + */ + +/** + * Provides the API to attach to a JavaTM + * virtual machine. + *

    + * A tool, written in the Java Language, uses this API to attach to a target + * virtual machine (VM) and load its tool agent into the target VM. For + * example, a management console might have a management agent which it uses + * to obtain management information from instrumented objects in a Java + * virtual machine. If the management console is required to manage + * an application that is running in a virtual machine that does not include + * the management agent, then this API can be used to attach to the target + * VM and load the agent. + * + * @since 1.6 + */ + +@jdk.Exported +package com.sun.tools.attach; diff --git a/jdk/src/share/classes/com/sun/tools/attach/package.html b/jdk/src/share/classes/com/sun/tools/attach/package.html deleted file mode 100644 index 8673b110bb3..00000000000 --- a/jdk/src/share/classes/com/sun/tools/attach/package.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - -Provides the API to attach to a JavaTM -virtual machine. - -A tool, written in the Java Language, uses this API to attach to a target -virtual machine (VM) and load its tool agent into the target VM. For -example, a management console might have a management agent which it uses -to obtain management information from instrumented objects in a Java -virtual machine. If the management console is required to manage -an application that is running in a virtual machine that does not include -the management agent, then this API can be used to attach to the target -VM and load the agent. - -@since 1.6 - - - - - - diff --git a/jdk/src/share/classes/com/sun/tools/attach/spi/AttachProvider.java b/jdk/src/share/classes/com/sun/tools/attach/spi/AttachProvider.java index f85daab7706..67f74f707c4 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/spi/AttachProvider.java +++ b/jdk/src/share/classes/com/sun/tools/attach/spi/AttachProvider.java @@ -74,6 +74,7 @@ import java.util.ServiceLoader; * @since 1.6 */ +@jdk.Exported public abstract class AttachProvider { private static final Object lock = new Object(); diff --git a/jdk/src/share/classes/com/sun/tools/attach/spi/package-info.java b/jdk/src/share/classes/com/sun/tools/attach/spi/package-info.java new file mode 100644 index 00000000000..b2c68ebe5a0 --- /dev/null +++ b/jdk/src/share/classes/com/sun/tools/attach/spi/package-info.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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. + */ + + +/** + * Only developers who are defining new attach providers should need to make + * direct use of this package. + * + * @since 1.6 + */ + +@jdk.Exported +package com.sun.tools.attach.spi; diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java b/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java index d63c3bdc6d3..1ab2a5be894 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java @@ -44,7 +44,7 @@ public class TokenMgrError extends Error private static final long serialVersionUID = -6236440836177601522L; /** - * Lexical error occured. + * Lexical error occurred. */ static final int LEXICAL_ERROR = 0; @@ -123,10 +123,10 @@ public class TokenMgrError extends Error * token manager to indicate a lexical error. * Parameters : * EOFSeen : indicates if EOF caused the lexicl error - * curLexState : lexical state in which this error occured - * errorLine : line number when the error occured - * errorColumn : column number when the error occured - * errorAfter : prefix that was seen before this error occured + * curLexState : lexical state in which this error occurred + * errorLine : line number when the error occurred + * errorColumn : column number when the error occurred + * errorAfter : prefix that was seen before this error occurred * curchar : the offending character * Note: You can customize the lexical error message by modifying this method. */ diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java index d44a8fc2ecf..bdf01b8d5c6 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java @@ -84,7 +84,7 @@ class AllClassesQuery extends QueryHandler { lastPackage = pkg; printClass(clazz); if (clazz.getId() != -1) { - out.print(" [" + clazz.getIdString() + "]"); + print(" [" + clazz.getIdString() + "]"); } out.println("
    "); } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java index 1d5782390ce..f13572a22cc 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java @@ -112,12 +112,12 @@ class ClassQuery extends QueryHandler { out.println("

    Instances

    "); printAnchorStart(); - out.print("instances/" + encodeForURL(clazz)); + print("instances/" + encodeForURL(clazz)); out.print("\">"); out.println("Exclude subclasses
    "); printAnchorStart(); - out.print("allInstances/" + encodeForURL(clazz)); + print("allInstances/" + encodeForURL(clazz)); out.print("\">"); out.println("Include subclasses
    "); @@ -126,19 +126,19 @@ class ClassQuery extends QueryHandler { out.println("

    New Instances

    "); printAnchorStart(); - out.print("newInstances/" + encodeForURL(clazz)); + print("newInstances/" + encodeForURL(clazz)); out.print("\">"); out.println("Exclude subclasses
    "); printAnchorStart(); - out.print("allNewInstances/" + encodeForURL(clazz)); + print("allNewInstances/" + encodeForURL(clazz)); out.print("\">"); out.println("Include subclasses
    "); } out.println("

    References summary by Type

    "); printAnchorStart(); - out.print("refsByType/" + encodeForURL(clazz)); + print("refsByType/" + encodeForURL(clazz)); out.print("\">"); out.println("References summary by type"); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java index f86c8caa8e2..f08c9875c67 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java @@ -41,21 +41,17 @@ package com.sun.tools.hat.internal.server; import java.net.Socket; -import java.net.ServerSocket; -import java.net.InetAddress; import java.io.InputStream; import java.io.BufferedInputStream; import java.io.IOException; -import java.io.Writer; import java.io.BufferedWriter; import java.io.PrintWriter; -import java.io.OutputStream; import java.io.OutputStreamWriter; -import java.io.BufferedOutputStream; import com.sun.tools.hat.internal.model.Snapshot; import com.sun.tools.hat.internal.oql.OQLEngine; +import com.sun.tools.hat.internal.util.Misc; public class HttpReader implements Runnable { @@ -87,7 +83,7 @@ public class HttpReader implements Runnable { outputError("Protocol error"); } int data; - StringBuffer queryBuf = new StringBuffer(); + StringBuilder queryBuf = new StringBuilder(); while ((data = in.read()) != -1 && data != ' ') { char ch = (char) data; queryBuf.append(ch); @@ -217,7 +213,7 @@ public class HttpReader implements Runnable { private void outputError(String msg) { out.println(); out.println(""); - out.println(msg); + out.println(Misc.encodeHtml(msg)); out.println(""); } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java index 724b549ca4b..7e87543ef99 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java @@ -102,7 +102,7 @@ class InstancesCountQuery extends QueryHandler { int count = clazz.getInstancesCount(false); print("" + count); printAnchorStart(); - out.print("instances/" + encodeForURL(classes[i])); + print("instances/" + encodeForURL(classes[i])); out.print("\"> "); if (count == 1) { print("instance"); @@ -121,7 +121,7 @@ class InstancesCountQuery extends QueryHandler { } print("("); printAnchorStart(); - out.print("newInstances/" + encodeForURL(classes[i])); + print("newInstances/" + encodeForURL(classes[i])); out.print("\">"); print("" + newInst + " new"); out.print(") "); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java index 6aaa909109a..730d2b7672d 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java @@ -54,10 +54,7 @@ class OQLHelp extends QueryHandler { out.print((char)ch); } } catch (Exception exp) { - out.println(exp.getMessage()); - out.println("
    ");
    -            exp.printStackTrace(out);
    -            out.println("
    "); + printException(exp); } } } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java index 8e5ec5e2894..3e99bbcbb74 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java @@ -32,10 +32,7 @@ package com.sun.tools.hat.internal.server; -import com.sun.tools.hat.internal.model.*; import com.sun.tools.hat.internal.oql.*; -import com.sun.tools.hat.internal.util.ArraySorter; -import com.sun.tools.hat.internal.util.Comparer; /** * This handles Object Query Language (OQL) queries. @@ -68,7 +65,7 @@ class OQLQuery extends QueryHandler { out.println("

    "); out.println(""); out.println("

    "); @@ -91,10 +88,7 @@ class OQLQuery extends QueryHandler { try { out.println(engine.toHtml(o)); } catch (Exception e) { - out.println(e.getMessage()); - out.println("
    ");
    -                             e.printStackTrace(out);
    -                             out.println("
    "); + printException(e); } out.println(""); return false; @@ -102,10 +96,7 @@ class OQLQuery extends QueryHandler { }); out.println(""); } catch (OQLException exp) { - out.println(exp.getMessage()); - out.println("
    ");
    -            exp.printStackTrace(out);
    -            out.println("
    "); + printException(exp); } } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java index deda0f48058..9a6d93de06a 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java @@ -36,6 +36,7 @@ import java.io.PrintWriter; import com.sun.tools.hat.internal.model.*; import com.sun.tools.hat.internal.util.Misc; +import java.io.StringWriter; import java.net.URLEncoder; import java.io.UnsupportedEncodingException; @@ -96,7 +97,7 @@ abstract class QueryHandler { } protected void error(String msg) { - out.println(msg); + println(msg); } protected void printAnchorStart() { @@ -160,7 +161,6 @@ abstract class QueryHandler { out.println("null"); return; } - String name = clazz.getName(); printAnchorStart(); out.print("class/"); print(encodeForURL(clazz)); @@ -208,6 +208,15 @@ abstract class QueryHandler { } } + protected void printException(Throwable t) { + println(t.getMessage()); + out.println("
    ");
    +        StringWriter sw = new StringWriter();
    +        t.printStackTrace(new PrintWriter(sw));
    +        print(sw.toString());
    +        out.println("
    "); + } + protected void printHex(long addr) { if (snapshot.getIdentifierSize() == 4) { out.print(Misc.toHex((int)addr)); @@ -223,4 +232,8 @@ abstract class QueryHandler { protected void print(String str) { out.print(Misc.encodeHtml(str)); } + + protected void println(String str) { + out.println(Misc.encodeHtml(str)); + } } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java index 5e7de9a8866..3337b471590 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java @@ -89,7 +89,7 @@ public class RefsByTypeQuery extends QueryHandler { out.println("

    "); printClass(clazz); if (clazz.getId() != -1) { - out.println("[" + clazz.getIdString() + "]"); + println("[" + clazz.getIdString() + "]"); } out.println("

    "); @@ -125,9 +125,9 @@ public class RefsByTypeQuery extends QueryHandler { JavaClass clazz = classes[i]; out.println(""); out.print(""); - out.print(clazz.getName()); + print(clazz.getName()); out.println(""); out.println(""); out.println(map.get(clazz)); diff --git a/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js b/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js index ec15e15acd6..97e38a79342 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js +++ b/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js @@ -33,7 +33,7 @@ var hatPkg = Packages.com.sun.tools.hat.internal; /** * This is JavaScript interface for heap analysis using HAT - * (Heap Analysis Tool). HAT classes are refered from + * (Heap Analysis Tool). HAT classes are referred from * this file. In particular, refer to classes in hat.model * package. * diff --git a/jdk/src/share/classes/com/sun/tools/jconsole/JConsoleContext.java b/jdk/src/share/classes/com/sun/tools/jconsole/JConsoleContext.java index 0c24061b99f..9c8895f304f 100644 --- a/jdk/src/share/classes/com/sun/tools/jconsole/JConsoleContext.java +++ b/jdk/src/share/classes/com/sun/tools/jconsole/JConsoleContext.java @@ -43,6 +43,7 @@ import javax.swing.event.SwingPropertyChangeSupport; * * @since 1.6 */ +@jdk.Exported public interface JConsoleContext { /** * The {@link ConnectionState ConnectionState} bound property name. @@ -53,6 +54,7 @@ public interface JConsoleContext { * Values for the {@linkplain #CONNECTION_STATE_PROPERTY * ConnectionState} bound property. */ + @jdk.Exported public enum ConnectionState { /** * The connection has been successfully established. diff --git a/jdk/src/share/classes/com/sun/tools/jconsole/JConsolePlugin.java b/jdk/src/share/classes/com/sun/tools/jconsole/JConsolePlugin.java index ab8a969e349..daff88c33af 100644 --- a/jdk/src/share/classes/com/sun/tools/jconsole/JConsolePlugin.java +++ b/jdk/src/share/classes/com/sun/tools/jconsole/JConsolePlugin.java @@ -72,6 +72,7 @@ import javax.swing.SwingWorker; * * @since 1.6 */ +@jdk.Exported public abstract class JConsolePlugin { private volatile JConsoleContext context = null; private List listeners = null; diff --git a/jdk/src/share/classes/com/sun/tools/jconsole/package-info.java b/jdk/src/share/classes/com/sun/tools/jconsole/package-info.java new file mode 100644 index 00000000000..99b52aa3728 --- /dev/null +++ b/jdk/src/share/classes/com/sun/tools/jconsole/package-info.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/** + * This package contains the JConsole API. + * + * @since 1.6 + */ + +@jdk.Exported +package com.sun.tools.jconsole; diff --git a/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java b/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java index 992dacdf018..36f5be2fec1 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java @@ -68,7 +68,7 @@ public class SocketAttachingConnector extends GenericAttachingConnector { transport = new Transport() { public String name() { - return "dt_socket"; // for compatability reasons + return "dt_socket"; // for compatibility reasons } }; diff --git a/jdk/src/share/classes/com/sun/tools/jdi/SocketListeningConnector.java b/jdk/src/share/classes/com/sun/tools/jdi/SocketListeningConnector.java index acfda94d0c6..7931dd9ff72 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/SocketListeningConnector.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/SocketListeningConnector.java @@ -58,7 +58,7 @@ public class SocketListeningConnector extends GenericListeningConnector { transport = new Transport() { public String name() { - return "dt_socket"; // for compatability reasons + return "dt_socket"; // for compatibility reasons } }; } diff --git a/jdk/src/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java b/jdk/src/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java index 20be57c85c4..84a14557b30 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -196,19 +196,7 @@ public class SunCommandLineLauncher extends AbstractLauncher implements Launchin try { if (home.length() > 0) { - /* - * A wrinkle in the environment: - * 64-bit executables are stored under $JAVA_HOME/bin/os_arch - * 32-bit executables are stored under $JAVA_HOME/bin - */ - String os_arch = System.getProperty("os.arch"); - if ("SunOS".equals(System.getProperty("os.name")) && - ("sparcv9".equals(os_arch) || "amd64".equals(os_arch))) { - exePath = home + File.separator + "bin" + File.separator + - os_arch + File.separator + exe; - } else { - exePath = home + File.separator + "bin" + File.separator + exe; - } + exePath = home + File.separator + "bin" + File.separator + exe; } else { exePath = exe; } diff --git a/jdk/src/share/classes/com/sun/tools/jdi/ThreadListener.java b/jdk/src/share/classes/com/sun/tools/jdi/ThreadListener.java index 787539e04bc..d50c8051dad 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/ThreadListener.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/ThreadListener.java @@ -31,7 +31,7 @@ import java.util.EventListener; interface ThreadListener extends EventListener { boolean threadResumable(ThreadAction action); /* - * Not needed for current implemenation, and hard to implement + * Not needed for current implementation, and hard to implement * correctly. (See TargetVM.handleEventCmdSet) * void threadSuspended(ThreadAction action); */ diff --git a/jdk/src/share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java b/jdk/src/share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java index f469827e8d4..5826999458d 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java @@ -62,7 +62,7 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl // This is cached only while this one thread is suspended. Each time // the thread is resumed, we abandon the current cache object and - // create a new intialized one. + // create a new initialized one. private static class LocalCache { JDWP.ThreadReference.Status status = null; List frames = null; diff --git a/jdk/src/share/classes/java/applet/Applet.java b/jdk/src/share/classes/java/applet/Applet.java index ff9389f36f3..2e8e39a19ff 100644 --- a/jdk/src/share/classes/java/applet/Applet.java +++ b/jdk/src/share/classes/java/applet/Applet.java @@ -143,11 +143,11 @@ public class Applet extends Panel { * For example, suppose an applet is contained * within the document: *
    -     *    http://java.sun.com/products/jdk/1.2/index.html
    +     *    http://www.oracle.com/technetwork/java/index.html
          * 
    * The document base is: *
    -     *    http://java.sun.com/products/jdk/1.2/index.html
    +     *    http://www.oracle.com/technetwork/java/index.html
          * 
    * * @return the {@link java.net.URL} of the document that contains this diff --git a/jdk/src/share/classes/java/applet/AppletStub.java b/jdk/src/share/classes/java/applet/AppletStub.java index 0887a586bdc..a1a31ad3cd8 100644 --- a/jdk/src/share/classes/java/applet/AppletStub.java +++ b/jdk/src/share/classes/java/applet/AppletStub.java @@ -54,11 +54,11 @@ public interface AppletStub { * For example, suppose an applet is contained * within the document: *
    -     *    http://java.sun.com/products/jdk/1.2/index.html
    +     *    http://www.oracle.com/technetwork/java/index.html
          * 
    * The document base is: *
    -     *    http://java.sun.com/products/jdk/1.2/index.html
    +     *    http://www.oracle.com/technetwork/java/index.html
          * 
    * * @return the {@link java.net.URL} of the document that contains the diff --git a/jdk/src/share/classes/java/awt/AWTEventMulticaster.java b/jdk/src/share/classes/java/awt/AWTEventMulticaster.java index a5daab688dc..4fc6d52c8c7 100644 --- a/jdk/src/share/classes/java/awt/AWTEventMulticaster.java +++ b/jdk/src/share/classes/java/awt/AWTEventMulticaster.java @@ -998,7 +998,7 @@ public class AWTEventMulticaster implements * If a null listener is specified, this method returns an * empty array. If the specified listener is not an instance of * AWTEventMulticaster, this method returns an array which - * contains only the specified listener. If no such listeners are chanined, + * contains only the specified listener. If no such listeners are chained, * this method returns an empty array. * * @param l the specified java.util.EventListener diff --git a/jdk/src/share/classes/java/awt/AWTKeyStroke.java b/jdk/src/share/classes/java/awt/AWTKeyStroke.java index 8966d753fb7..2cf7a332774 100644 --- a/jdk/src/share/classes/java/awt/AWTKeyStroke.java +++ b/jdk/src/share/classes/java/awt/AWTKeyStroke.java @@ -67,7 +67,7 @@ import java.lang.reflect.Field; public class AWTKeyStroke implements Serializable { static final long serialVersionUID = -6430539691155161871L; - private static Map modifierKeywords; + private static Map modifierKeywords; /** * Associates VK_XXX (as a String) with code (as Integer). This is * done to avoid the overhead of the reflective call to find the @@ -85,8 +85,8 @@ public class AWTKeyStroke implements Serializable { * AWTKeyStroke class. * Must be called under locked AWTKeyStro */ - private static Class getAWTKeyStrokeClass() { - Class clazz = (Class)AppContext.getAppContext().get(AWTKeyStroke.class); + private static Class getAWTKeyStrokeClass() { + Class clazz = (Class)AppContext.getAppContext().get(AWTKeyStroke.class); if (clazz == null) { clazz = AWTKeyStroke.class; AppContext.getAppContext().put(AWTKeyStroke.class, AWTKeyStroke.class); @@ -182,7 +182,7 @@ public class AWTKeyStroke implements Serializable { throw new IllegalArgumentException("subclass cannot be null"); } synchronized (AWTKeyStroke.class) { - Class keyStrokeClass = (Class)AppContext.getAppContext().get(AWTKeyStroke.class); + Class keyStrokeClass = (Class)AppContext.getAppContext().get(AWTKeyStroke.class); if (keyStrokeClass != null && keyStrokeClass.equals(subclass)){ // Already registered return; @@ -229,8 +229,8 @@ public class AWTKeyStroke implements Serializable { */ private static Constructor getCtor(final Class clazz) { - Object ctor = AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { + Constructor ctor = AccessController.doPrivileged(new PrivilegedAction() { + public Constructor run() { try { Constructor ctor = clazz.getDeclaredConstructor((Class[]) null); if (ctor != null) { @@ -249,17 +249,17 @@ public class AWTKeyStroke implements Serializable { private static synchronized AWTKeyStroke getCachedStroke (char keyChar, int keyCode, int modifiers, boolean onKeyRelease) { - Map cache = (Map)AppContext.getAppContext().get(APP_CONTEXT_CACHE_KEY); + Map cache = (Map)AppContext.getAppContext().get(APP_CONTEXT_CACHE_KEY); AWTKeyStroke cacheKey = (AWTKeyStroke)AppContext.getAppContext().get(APP_CONTEXT_KEYSTROKE_KEY); if (cache == null) { - cache = new HashMap(); + cache = new HashMap<>(); AppContext.getAppContext().put(APP_CONTEXT_CACHE_KEY, cache); } if (cacheKey == null) { try { - Class clazz = getAWTKeyStrokeClass(); + Class clazz = getAWTKeyStrokeClass(); cacheKey = (AWTKeyStroke)getCtor(clazz).newInstance((Object[]) null); AppContext.getAppContext().put(APP_CONTEXT_KEYSTROKE_KEY, cacheKey); } catch (InstantiationException e) { @@ -485,11 +485,11 @@ public class AWTKeyStroke implements Serializable { * If typed, pressed or released is not specified, pressed is assumed. Here * are some examples: *
    -     *     "INSERT" => getAWTKeyStroke(KeyEvent.VK_INSERT, 0);
    -     *     "control DELETE" => getAWTKeyStroke(KeyEvent.VK_DELETE, InputEvent.CTRL_MASK);
    -     *     "alt shift X" => getAWTKeyStroke(KeyEvent.VK_X, InputEvent.ALT_MASK | InputEvent.SHIFT_MASK);
    -     *     "alt shift released X" => getAWTKeyStroke(KeyEvent.VK_X, InputEvent.ALT_MASK | InputEvent.SHIFT_MASK, true);
    -     *     "typed a" => getAWTKeyStroke('a');
    +     *     "INSERT" => getAWTKeyStroke(KeyEvent.VK_INSERT, 0);
    +     *     "control DELETE" => getAWTKeyStroke(KeyEvent.VK_DELETE, InputEvent.CTRL_MASK);
    +     *     "alt shift X" => getAWTKeyStroke(KeyEvent.VK_X, InputEvent.ALT_MASK | InputEvent.SHIFT_MASK);
    +     *     "alt shift released X" => getAWTKeyStroke(KeyEvent.VK_X, InputEvent.ALT_MASK | InputEvent.SHIFT_MASK, true);
    +     *     "typed a" => getAWTKeyStroke('a');
          * 
    * * @param s a String formatted as described above @@ -513,7 +513,7 @@ public class AWTKeyStroke implements Serializable { synchronized (AWTKeyStroke.class) { if (modifierKeywords == null) { - Map uninitializedMap = new HashMap(8, 1.0f); + Map uninitializedMap = new HashMap<>(8, 1.0f); uninitializedMap.put("shift", Integer.valueOf(InputEvent.SHIFT_DOWN_MASK |InputEvent.SHIFT_MASK)); @@ -861,12 +861,12 @@ public class AWTKeyStroke implements Serializable { } class VKCollection { - Map code2name; - Map name2code; + Map code2name; + Map name2code; public VKCollection() { - code2name = new HashMap(); - name2code = new HashMap(); + code2name = new HashMap<>(); + name2code = new HashMap<>(); } public synchronized void put(String name, Integer code) { diff --git a/jdk/src/share/classes/java/awt/AlphaComposite.java b/jdk/src/share/classes/java/awt/AlphaComposite.java index 6903e7ec712..9f8b64f2684 100644 --- a/jdk/src/share/classes/java/awt/AlphaComposite.java +++ b/jdk/src/share/classes/java/awt/AlphaComposite.java @@ -197,7 +197,7 @@ import sun.java2d.SunCompositeContext; *

    Performance Considerations

    * *

    - * For performance reasons, it is preferrable that + * For performance reasons, it is preferable that * Raster objects passed to the compose * method of a {@link CompositeContext} object created by the * AlphaComposite class have premultiplied data. diff --git a/jdk/src/share/classes/java/awt/BasicStroke.java b/jdk/src/share/classes/java/awt/BasicStroke.java index 55d59d4224f..5cc466640c2 100644 --- a/jdk/src/share/classes/java/awt/BasicStroke.java +++ b/jdk/src/share/classes/java/awt/BasicStroke.java @@ -88,7 +88,7 @@ import java.lang.annotation.Native; * but also by the transform attribute of the * Graphics2D object. Consider this code: *

    - * // sets the Graphics2D object's Tranform attribute + * // sets the Graphics2D object's Transform attribute * g2d.scale(10, 10); * // sets the Graphics2D object's Stroke attribute * g2d.setStroke(new BasicStroke(1.5f)); diff --git a/jdk/src/share/classes/java/awt/BorderLayout.java b/jdk/src/share/classes/java/awt/BorderLayout.java index 9b8644712ea..8b131c485d3 100644 --- a/jdk/src/share/classes/java/awt/BorderLayout.java +++ b/jdk/src/share/classes/java/awt/BorderLayout.java @@ -69,7 +69,7 @@ import java.util.Hashtable; * components, the latter constants are preferred. *

    * Mixing both absolute and relative positioning constants can lead to - * unpredicable results. If + * unpredictable results. If * you use both types, the relative constants will take precedence. * For example, if you add components using both the NORTH * and PAGE_START constants in a container whose @@ -96,7 +96,7 @@ import java.util.Hashtable; * alt="Diagram of an applet demonstrating BorderLayout. * Each section of the BorderLayout contains a Button corresponding to its position in the layout, one of: * North, West, Center, East, or South." - * ALIGN=center HSPACE=10 VSPACE=7> + * style="float:center; margin: 7px 10px;"> *

    * The code for this applet is as follows: *

    @@ -206,7 +206,7 @@ public class BorderLayout implements LayoutManager2, * * A relative positioning constant, that can be used instead of * north, south, east, west or center. - * mixing the two types of constants can lead to unpredicable results. If + * mixing the two types of constants can lead to unpredictable results. If * you use both types, the relative constants will take precedence. * For example, if you add components using both the NORTH * and BEFORE_FIRST_LINE constants in a container whose diff --git a/jdk/src/share/classes/java/awt/Button.java b/jdk/src/share/classes/java/awt/Button.java index 9fe42d41cbc..83506b6fdb1 100644 --- a/jdk/src/share/classes/java/awt/Button.java +++ b/jdk/src/share/classes/java/awt/Button.java @@ -40,7 +40,7 @@ import javax.accessibility.*; * under the Solaris operating system: *

    * The following context describes the graphic + * style="float:center; margin: 7px 10px;"> *

    * The first view shows the button as it appears normally. * The second view shows the button diff --git a/jdk/src/share/classes/java/awt/CardLayout.java b/jdk/src/share/classes/java/awt/CardLayout.java index 32355efed60..35ee3379267 100644 --- a/jdk/src/share/classes/java/awt/CardLayout.java +++ b/jdk/src/share/classes/java/awt/CardLayout.java @@ -66,7 +66,7 @@ public class CardLayout implements LayoutManager2, * pairs of components and their names. * @see java.util.Vector */ - Vector vector = new Vector(); + Vector vector = new Vector<>(); /* * A pair of Component and String that represents its name. @@ -570,10 +570,10 @@ public class CardLayout implements LayoutManager2, if (f.defaulted("vector")) { // pre-1.4 stream - Hashtable tab = (Hashtable)f.get("tab", null); - vector = new Vector(); + Hashtable tab = (Hashtable)f.get("tab", null); + vector = new Vector<>(); if (tab != null && !tab.isEmpty()) { - for (Enumeration e = tab.keys() ; e.hasMoreElements() ; ) { + for (Enumeration e = tab.keys() ; e.hasMoreElements() ; ) { String key = (String)e.nextElement(); Component comp = (Component)tab.get(key); vector.add(new Card(key, comp)); @@ -594,7 +594,7 @@ public class CardLayout implements LayoutManager2, private void writeObject(ObjectOutputStream s) throws IOException { - Hashtable tab = new Hashtable(); + Hashtable tab = new Hashtable<>(); int ncomponents = vector.size(); for (int i = 0; i < ncomponents; i++) { Card card = (Card)vector.get(i); diff --git a/jdk/src/share/classes/java/awt/Checkbox.java b/jdk/src/share/classes/java/awt/Checkbox.java index f0486f35e45..7568b0c5aee 100644 --- a/jdk/src/share/classes/java/awt/Checkbox.java +++ b/jdk/src/share/classes/java/awt/Checkbox.java @@ -53,7 +53,7 @@ import javax.accessibility.*; * created by this code example: *

    * The following context describes the graphic. + * style="float:center; margin: 7px 10px;"> *

    * The button labeled one is in the "on" state, and the * other two are in the "off" state. In this example, which uses the diff --git a/jdk/src/share/classes/java/awt/CheckboxGroup.java b/jdk/src/share/classes/java/awt/CheckboxGroup.java index e953daabaaa..25b0697f117 100644 --- a/jdk/src/share/classes/java/awt/CheckboxGroup.java +++ b/jdk/src/share/classes/java/awt/CheckboxGroup.java @@ -48,7 +48,7 @@ package java.awt; *

    * Shows three checkboxes, arranged vertically, labeled one, two, and three. Checkbox one is in the on state. + * style="float:center; margin: 7px 10px;"> *

    * @author Sami Shaio * @see java.awt.Checkbox diff --git a/jdk/src/share/classes/java/awt/CheckboxMenuItem.java b/jdk/src/share/classes/java/awt/CheckboxMenuItem.java index ad12d4c29a9..20265c7ad12 100644 --- a/jdk/src/share/classes/java/awt/CheckboxMenuItem.java +++ b/jdk/src/share/classes/java/awt/CheckboxMenuItem.java @@ -44,7 +44,7 @@ import sun.awt.AWTAccessor; *

    * Menu labeled Examples, containing items Basic, Simple, Check, and More Examples. The Check item is a CheckBoxMenuItem instance, in the off state. + * style="float:center; margin: 7px 10px;"> *

    * The item labeled Check shows a check box menu item * in its "off" state. @@ -180,7 +180,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access } /** - * Sets this check box menu item to the specifed state. + * Sets this check box menu item to the specified state. * The boolean value true indicates "on" while * false indicates "off." * diff --git a/jdk/src/share/classes/java/awt/Choice.java b/jdk/src/share/classes/java/awt/Choice.java index e026953b203..b50746205d9 100644 --- a/jdk/src/share/classes/java/awt/Choice.java +++ b/jdk/src/share/classes/java/awt/Choice.java @@ -52,7 +52,7 @@ import javax.accessibility.*; * it appears as follows in its normal state: *

    * The following text describes the graphic + * style="float:center; margin: 7px 10px;"> *

    * In the picture, "Green" is the current choice. * Pushing the mouse button down on the object causes a menu to @@ -418,7 +418,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { * an ItemEvent. The only way to trigger an * ItemEvent is by user interaction. * - * @param pos the positon of the selected item + * @param pos the position of the selected item * @exception IllegalArgumentException if the specified * position is greater than the * number of items or less than zero diff --git a/jdk/src/share/classes/java/awt/Color.java b/jdk/src/share/classes/java/awt/Color.java index 51d46a45f70..464fe987316 100644 --- a/jdk/src/share/classes/java/awt/Color.java +++ b/jdk/src/share/classes/java/awt/Color.java @@ -823,7 +823,7 @@ public class Color implements Paint, java.io.Serializable { *

    * The integer that is returned by HSBtoRGB encodes the * value of a color in bits 0-23 of an integer value that is the same - * format used by the method {@link #getRGB() getRGB}. + * format used by the method {@link #getRGB() getRGB}. * This integer can be supplied as an argument to the * Color constructor that takes a single integer argument. * @param hue the hue component of the color diff --git a/jdk/src/share/classes/java/awt/Component.java b/jdk/src/share/classes/java/awt/Component.java index c3307538f27..bd913cbd50e 100644 --- a/jdk/src/share/classes/java/awt/Component.java +++ b/jdk/src/share/classes/java/awt/Component.java @@ -173,10 +173,10 @@ import sun.util.logging.PlatformLogger; * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most * efficient painting code, see - * Painting in AWT and Swing. + * Painting in AWT and Swing. *

    * For details on the focus subsystem, see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, and the * Focus Specification @@ -276,7 +276,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * @see #getFont * @see #setFont */ - Font font; + volatile Font font; /** * The font which the peer is currently using. @@ -972,6 +972,10 @@ public abstract class Component implements ImageObserver, MenuContainer, public AccessControlContext getAccessControlContext(Component comp) { return comp.getAccessControlContext(); } + + public void revalidateSynchronously(Component comp) { + comp.revalidateSynchronously(); + } }); } @@ -1219,10 +1223,6 @@ public abstract class Component implements ImageObserver, MenuContainer, * be called on the toolkit thread. */ final Toolkit getToolkitImpl() { - ComponentPeer peer = this.peer; - if ((peer != null) && ! (peer instanceof LightweightPeer)){ - return peer.getToolkit(); - } Container parent = this.parent; if (parent != null) { return parent.getToolkitImpl(); @@ -1885,10 +1885,8 @@ public abstract class Component implements ImageObserver, MenuContainer, public void setFont(Font f) { Font oldFont, newFont; synchronized(getTreeLock()) { - synchronized (this) { - oldFont = font; - newFont = font = f; - } + oldFont = font; + newFont = font = f; ComponentPeer peer = this.peer; if (peer != null) { f = getFont(); @@ -2022,7 +2020,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * @return an instance of Point representing * the top-left corner of the component's bounds in the * coordinate space of the screen - * @throws IllegalComponentStateException if the + * @throws IllegalComponentStateException if the * component is not showing on the screen * @see #setLocation * @see #getLocation @@ -2684,7 +2682,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Gets the mininimum size of this component. + * Gets the minimum size of this component. * @return a dimension object indicating this component's minimum size * @see #getPreferredSize * @see LayoutManager @@ -2977,6 +2975,13 @@ public abstract class Component implements ImageObserver, MenuContainer, * @since 1.7 */ public void revalidate() { + revalidateSynchronously(); + } + + /** + * Revalidates the component synchronously. + */ + final void revalidateSynchronously() { synchronized (getTreeLock()) { invalidate(); @@ -3194,7 +3199,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most * efficient painting code, see - * Painting in AWT and Swing. + * Painting in AWT and Swing. * * @param g the graphics context to use for painting * @see #update @@ -3229,7 +3234,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most * efficient painting code, see - * Painting in AWT and Swing. + * Painting in AWT and Swing. * * @param g the specified context to use for updating * @see #paint @@ -3290,7 +3295,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most * efficient painting code, see - * Painting in AWT and Swing. + * Painting in AWT and Swing. * * @see #update(Graphics) @@ -3308,7 +3313,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most * efficient painting code, see - * Painting in AWT and Swing. + * Painting in AWT and Swing. * * @param tm maximum time in milliseconds before update * @see #paint @@ -3330,7 +3335,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most * efficient painting code, see - * Painting in AWT and Swing. + * Painting in AWT and Swing. * * @param x the x coordinate * @param y the y coordinate @@ -3355,7 +3360,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most * efficient painting code, see - * Painting in AWT and Swing. + * Painting in AWT and Swing. * * @param tm maximum time in milliseconds before update * @param x the x coordinate @@ -5247,7 +5252,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the component listeners * registered on this component. * - * @return all of this comonent's ComponentListeners + * @return all ComponentListeners of this component * or an empty array if no component * listeners are currently registered * diff --git a/jdk/src/share/classes/java/awt/Container.java b/jdk/src/share/classes/java/awt/Container.java index 9029417b2ce..a779d72d489 100644 --- a/jdk/src/share/classes/java/awt/Container.java +++ b/jdk/src/share/classes/java/awt/Container.java @@ -75,7 +75,7 @@ import sun.security.action.GetBooleanAction; * (and hence to the bottom of the stacking order). *

    * Note: For details on the focus subsystem, see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, and the * Focus Specification @@ -258,6 +258,12 @@ public class Container extends Component { public void validateUnconditionally(Container cont) { cont.validateUnconditionally(); } + + @Override + public Component findComponentAt(Container cont, int x, int y, + boolean ignoreEnabled) { + return cont.findComponentAt(x, y, ignoreEnabled); + } }); } @@ -953,7 +959,7 @@ public class Container extends Component { * * @param comp the component to be added * @param constraints an object expressing - * layout contraints for this component + * layout constraints for this component * @exception NullPointerException if {@code comp} is {@code null} * @see #addImpl * @see #invalidate @@ -980,7 +986,7 @@ public class Container extends Component { * * * @param comp the component to be added - * @param constraints an object expressing layout contraints for this + * @param constraints an object expressing layout constraints for this * @param index the position in the container's list at which to insert * the component; -1 means insert at the end * component @@ -2651,7 +2657,6 @@ public class Container extends Component { * behavior. Setting 'ignoreEnabled' to 'false' bypasses disabled * Components during the search. This behavior is used by the * lightweight cursor support in sun.awt.GlobalCursorManager. - * The cursor code calls this function directly via native code. * * The addition of this feature is temporary, pending the * adoption of new, public API which exports this feature. diff --git a/jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java b/jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java index 7d36530ce2b..3f53698f7b5 100644 --- a/jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java +++ b/jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java @@ -85,7 +85,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy * list should be reused if possible. */ transient private Container cachedRoot; - transient private List cachedCycle; + transient private List cachedCycle; /* * We suppose to use getFocusTraversalCycle & getComponentIndex methods in order @@ -111,7 +111,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy return cycle.indexOf(aComponent); } - private void enumerateCycle(Container container, List cycle) { + private void enumerateCycle(Container container, List cycle) { if (!(container.isVisible() && container.isDisplayable())) { return; } diff --git a/jdk/src/share/classes/java/awt/DefaultFocusTraversalPolicy.java b/jdk/src/share/classes/java/awt/DefaultFocusTraversalPolicy.java index 0c30fe9b138..ae9dd910ee7 100644 --- a/jdk/src/share/classes/java/awt/DefaultFocusTraversalPolicy.java +++ b/jdk/src/share/classes/java/awt/DefaultFocusTraversalPolicy.java @@ -54,7 +54,7 @@ import java.awt.peer.ComponentPeer; * impact, the focusability of the Component itself. *

    * Please see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, and the * Focus Specification diff --git a/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java b/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java index 7c0c39d8ffa..040e659289a 100644 --- a/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java +++ b/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java @@ -49,7 +49,7 @@ import sun.awt.TimedWindowEvent; * Container's FocusTraversalPolicy. *

    * Please see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, and the * Focus Specification @@ -808,13 +808,13 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { } } boolean stopPostProcessing = false; - java.util.List processors = getKeyEventPostProcessors(); + java.util.List processors = getKeyEventPostProcessors(); if (processors != null) { - for (java.util.Iterator iter = processors.iterator(); + for (java.util.Iterator iter = processors.iterator(); !stopPostProcessing && iter.hasNext(); ) { - stopPostProcessing = (((KeyEventPostProcessor)(iter.next())). - postProcessKeyEvent(e)); + stopPostProcessing = iter.next(). + postProcessKeyEvent(e); } } if (!stopPostProcessing) { @@ -1059,12 +1059,12 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { return true; } - java.util.List dispatchers = getKeyEventDispatchers(); + java.util.List dispatchers = getKeyEventDispatchers(); if (dispatchers != null) { - for (java.util.Iterator iter = dispatchers.iterator(); + for (java.util.Iterator iter = dispatchers.iterator(); iter.hasNext(); ) { - if (((KeyEventDispatcher)(iter.next())). + if (iter.next(). dispatchKeyEvent(ke)) { return true; @@ -1131,7 +1131,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { oppStroke = AWTKeyStroke.getAWTKeyStroke(stroke.getKeyCode(), stroke.getModifiers(), !stroke.isOnKeyRelease()); - Set toTest; + Set toTest; boolean contains, containsOpp; toTest = focusedComponent.getFocusTraversalKeys( @@ -1246,7 +1246,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { * any) should be cancelled. * * @param after the timestamp specified in the call to - * enqueueKeyEvents, or any value < 0 + * enqueueKeyEvents, or any value < 0 * @param untilFocused the Component specified in the call to * enqueueKeyEvents * @see #enqueueKeyEvents diff --git a/jdk/src/share/classes/java/awt/Dialog.java b/jdk/src/share/classes/java/awt/Dialog.java index d27041fd322..b441100d9f2 100644 --- a/jdk/src/share/classes/java/awt/Dialog.java +++ b/jdk/src/share/classes/java/awt/Dialog.java @@ -61,7 +61,7 @@ import java.security.AccessControlException; *

    * The default layout for a dialog is BorderLayout. *

    - * A dialog may have its native decorations (i.e. Frame & Titlebar) turned off + * A dialog may have its native decorations (i.e. Frame & Titlebar) turned off * with setUndecorated. This can only be done while the dialog * is not {@link Component#isDisplayable() displayable}. *

    @@ -338,7 +338,7 @@ public class Dialog extends Window { * * @param owner the owner of the dialog or null if * this dialog has no owner - * @param modal specifes whether dialog blocks user input to other top-level + * @param modal specifies whether dialog blocks user input to other top-level * windows when shown. If false, the dialog is MODELESS; * if true, the modality type property is set to * DEFAULT_MODALITY_TYPE @@ -387,7 +387,7 @@ public class Dialog extends Window { * this dialog has no owner * @param title the title of the dialog or null if this dialog * has no title - * @param modal specifes whether dialog blocks user input to other top-level + * @param modal specifies whether dialog blocks user input to other top-level * windows when shown. If false, the dialog is MODELESS; * if true, the modality type property is set to * DEFAULT_MODALITY_TYPE @@ -416,7 +416,7 @@ public class Dialog extends Window { * has no owner * @param title the title of the dialog or null if this dialog * has no title - * @param modal specifes whether dialog blocks user input to other top-level + * @param modal specifies whether dialog blocks user input to other top-level * windows when shown. If false, the dialog is MODELESS; * if true, the modality type property is set to * DEFAULT_MODALITY_TYPE @@ -488,7 +488,7 @@ public class Dialog extends Window { * dialog has no owner * @param title the title of the dialog or null if this * dialog has no title - * @param modal specifes whether dialog blocks user input to other top-level + * @param modal specifies whether dialog blocks user input to other top-level * windows when shown. If false, the dialog is MODELESS; * if true, the modality type property is set to * DEFAULT_MODALITY_TYPE @@ -519,7 +519,7 @@ public class Dialog extends Window { * dialog has no owner * @param title the title of the dialog or null if this * dialog has no title - * @param modal specifes whether dialog blocks user input to other top-level + * @param modal specifies whether dialog blocks user input to other top-level * windows when shown. If false, the dialog is MODELESS; * if true, the modality type property is set to * DEFAULT_MODALITY_TYPE @@ -764,7 +764,7 @@ public class Dialog extends Window { /** * Indicates whether the dialog is modal. *

    - * This method is obsolete and is kept for backwards compatiblity only. + * This method is obsolete and is kept for backwards compatibility only. * Use {@link #getModalityType getModalityType()} instead. * * @return true if this dialog window is modal; diff --git a/jdk/src/share/classes/java/awt/DisplayMode.java b/jdk/src/share/classes/java/awt/DisplayMode.java index c4bd09530e0..71a5d7e8122 100644 --- a/jdk/src/share/classes/java/awt/DisplayMode.java +++ b/jdk/src/share/classes/java/awt/DisplayMode.java @@ -35,7 +35,7 @@ import java.lang.annotation.Native; * (see {@link GraphicsDevice#isDisplayChangeSupported}). *

    * For more information on full-screen exclusive mode API, see the - * + * * Full-Screen Exclusive Mode API Tutorial. * * @see GraphicsDevice diff --git a/jdk/src/share/classes/java/awt/Event.java b/jdk/src/share/classes/java/awt/Event.java index fc119a0374e..b2a2e6b3f60 100644 --- a/jdk/src/share/classes/java/awt/Event.java +++ b/jdk/src/share/classes/java/awt/Event.java @@ -29,14 +29,14 @@ import java.io.*; /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Event is a platform-independent class that * encapsulates events from the platform's Graphical User * Interface in the Java 1.0 event model. In Java 1.1 * and later versions, the Event class is maintained - * only for backwards compatibilty. The information in this + * only for backwards compatibility. The information in this * class description is provided to assist programmers in * converting Java 1.0 programs to the new event model. *

    @@ -390,7 +390,7 @@ public class Event implements java.io.Serializable { /** * The user has moved the bubble (thumb) in a scroll bar, * moving to an "absolute" position, rather than to - * an offset from the last postion. + * an offset from the last position. */ public static final int SCROLL_ABSOLUTE = 5 + SCROLL_EVENT; @@ -524,7 +524,7 @@ public class Event implements java.io.Serializable { * This field has been replaced by MouseEvent.getClickCount(). * * @serial - * @see java.awt.event.MouseEvent#getClickCount(). + * @see java.awt.event.MouseEvent#getClickCount() */ public int clickCount; @@ -609,7 +609,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Creates an instance of Event with the specified target @@ -660,7 +660,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Creates an instance of Event, with the specified target @@ -681,7 +681,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Creates an instance of Event with the specified @@ -696,7 +696,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Translates this event so that its x and y @@ -717,7 +717,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Checks if the Shift key is down. @@ -733,7 +733,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Checks if the Control key is down. @@ -749,7 +749,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Checks if the Meta key is down. @@ -766,7 +766,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. */ void consume() { @@ -784,7 +784,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. */ boolean isConsumed() { @@ -793,7 +793,7 @@ public class Event implements java.io.Serializable { /* * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Returns the integer key-code associated with the key in this event, @@ -811,7 +811,7 @@ public class Event implements java.io.Serializable { /* * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Returns a new KeyEvent char which corresponds to the int key @@ -828,7 +828,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Returns a string representing the state of this Event. @@ -864,7 +864,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Returns a representation of this event's values as a string. diff --git a/jdk/src/share/classes/java/awt/EventDispatchThread.java b/jdk/src/share/classes/java/awt/EventDispatchThread.java index ab1d3e6f70a..51344658c7e 100644 --- a/jdk/src/share/classes/java/awt/EventDispatchThread.java +++ b/jdk/src/share/classes/java/awt/EventDispatchThread.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,19 +25,11 @@ package java.awt; -import java.awt.event.InputEvent; import java.awt.event.MouseEvent; import java.awt.event.ActionEvent; import java.awt.event.WindowEvent; -import java.lang.reflect.Method; -import java.security.AccessController; -import sun.security.action.GetPropertyAction; -import sun.awt.AWTAutoShutdown; -import sun.awt.SunToolkit; -import sun.awt.AppContext; import java.util.ArrayList; -import java.util.List; import sun.util.logging.PlatformLogger; import sun.awt.dnd.SunDragSourceContextPeer; @@ -67,8 +59,7 @@ class EventDispatchThread extends Thread { private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.EventDispatchThread"); private EventQueue theQueue; - private boolean doDispatch = true; - private volatile boolean shutdown = false; + private volatile boolean doDispatch = true; private static final int ANY_EVENT = -1; @@ -86,24 +77,15 @@ class EventDispatchThread extends Thread { doDispatch = false; } - public void interrupt() { - shutdown = true; - super.interrupt(); - } - public void run() { - while (true) { - try { - pumpEvents(new Conditional() { - public boolean evaluate() { - return true; - } - }); - } finally { - if(getEventQueue().detachDispatchThread(this, shutdown)) { - break; + try { + pumpEvents(new Conditional() { + public boolean evaluate() { + return true; } - } + }); + } finally { + getEventQueue().detachDispatchThread(this); } } @@ -130,8 +112,7 @@ class EventDispatchThread extends Thread { void pumpEventsForFilter(int id, Conditional cond, EventFilter filter) { addEventFilter(filter); doDispatch = true; - shutdown |= isInterrupted(); - while (doDispatch && !shutdown && cond.evaluate()) { + while (doDispatch && !isInterrupted() && cond.evaluate()) { pumpOneEventForFilters(id); } removeEventFilter(filter); @@ -223,12 +204,12 @@ class EventDispatchThread extends Thread { } } catch (ThreadDeath death) { - shutdown = true; + doDispatch = false; throw death; } catch (InterruptedException interruptedException) { - shutdown = true; // AppContext.dispose() interrupts all - // Threads in the AppContext + doDispatch = false; // AppContext.dispose() interrupts all + // Threads in the AppContext } catch (Throwable e) { processException(e); diff --git a/jdk/src/share/classes/java/awt/EventQueue.java b/jdk/src/share/classes/java/awt/EventQueue.java index 76795eb5ed6..af9e1bf08f3 100644 --- a/jdk/src/share/classes/java/awt/EventQueue.java +++ b/jdk/src/share/classes/java/awt/EventQueue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -652,7 +652,7 @@ public class EventQueue { * Dispatches an event. The manner in which the event is * dispatched depends upon the type of the event and the * type of the event's source object: - *

    + *

    * * * @@ -680,7 +680,7 @@ public class EventQueue { * * *
    Event TypeNo action (ignored)
    - *

    + *

    * @param event an instance of java.awt.AWTEvent, * or a subclass of it * @throws NullPointerException if event is null @@ -690,7 +690,10 @@ public class EventQueue { final Object src = event.getSource(); final PrivilegedAction action = new PrivilegedAction() { public Void run() { - if (fwDispatcher == null) { + // In case fwDispatcher is installed and we're already on the + // dispatch thread (e.g. performing DefaultKeyboardFocusManager.sendMessage), + // dispatch the event straight away. + if (fwDispatcher == null || isDispatchThreadImpl()) { dispatchEventImpl(event, src); } else { fwDispatcher.scheduleDispatch(new Runnable() { @@ -1071,7 +1074,7 @@ public class EventQueue { } } - final boolean detachDispatchThread(EventDispatchThread edt, boolean forceDetach) { + final void detachDispatchThread(EventDispatchThread edt) { /* * Minimize discard possibility for non-posted events */ @@ -1087,17 +1090,9 @@ public class EventQueue { pushPopLock.lock(); try { if (edt == dispatchThread) { - /* - * Don't detach the thread if any events are pending. Not - * sure if it's a possible scenario, though. - */ - if (!forceDetach && (peekEvent() != null)) { - return false; - } dispatchThread = null; } AWTAutoShutdown.getInstance().notifyThreadFree(edt); - return true; } finally { pushPopLock.unlock(); } @@ -1156,6 +1151,10 @@ public class EventQueue { if (entry.event instanceof SentEvent) { ((SentEvent)entry.event).dispose(); } + if (entry.event instanceof InvocationEvent) { + AWTAccessor.getInvocationEventAccessor() + .dispose((InvocationEvent)entry.event); + } if (prev == null) { queues[i].head = entry.next; } else { diff --git a/jdk/src/share/classes/java/awt/FileDialog.java b/jdk/src/share/classes/java/awt/FileDialog.java index 3739570abb5..0fc63c7fde4 100644 --- a/jdk/src/share/classes/java/awt/FileDialog.java +++ b/jdk/src/share/classes/java/awt/FileDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -457,9 +457,16 @@ public class FileDialog extends Dialog { * specified file. This file becomes the default file if it is set * before the file dialog window is first shown. *

    + * When the dialog is shown, the specified file is selected. The kind of + * selection depends on the file existence, the dialog type, and the native + * platform. E.g., the file could be highlighted in the file list, or a + * file name editbox could be populated with the file name. + *

    + * This method accepts either a full file path, or a file name with an + * extension if used together with the {@code setDirectory} method. + *

    * Specifying "" as the file is exactly equivalent to specifying - * null - * as the file. + * {@code null} as the file. * * @param file the file being set * @see #getFile diff --git a/jdk/src/share/classes/java/awt/FlowLayout.java b/jdk/src/share/classes/java/awt/FlowLayout.java index 228035d10f1..4675bbc573e 100644 --- a/jdk/src/share/classes/java/awt/FlowLayout.java +++ b/jdk/src/share/classes/java/awt/FlowLayout.java @@ -54,7 +54,7 @@ import java.io.IOException; *

    * Graphic of Layout for Three Buttons + * style="float:center; margin: 7px 10px;"> *

    * Here is the code for this applet: *

    diff --git a/jdk/src/share/classes/java/awt/FocusTraversalPolicy.java b/jdk/src/share/classes/java/awt/FocusTraversalPolicy.java index 6b7f4e97e9d..0d8323bc16e 100644 --- a/jdk/src/share/classes/java/awt/FocusTraversalPolicy.java +++ b/jdk/src/share/classes/java/awt/FocusTraversalPolicy.java @@ -49,7 +49,7 @@ package java.awt; * policy is used to perform the search operation. *

    * Please see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, and the * Focus Specification diff --git a/jdk/src/share/classes/java/awt/Font.java b/jdk/src/share/classes/java/awt/Font.java index 67b09fa2868..c5c400c651b 100644 --- a/jdk/src/share/classes/java/awt/Font.java +++ b/jdk/src/share/classes/java/awt/Font.java @@ -127,7 +127,7 @@ import static sun.font.EAttribute.*; *

    * For a discussion of the relative advantages and disadvantages of using * physical or logical fonts, see the - * Internationalization FAQ + * Internationalization FAQ * document. * *

    Font Faces and Names

    @@ -1334,7 +1334,7 @@ public class Font implements java.io.Serializable * Indicates whether or not this Font object's style is * PLAIN. * @return true if this Font has a - * PLAIN sytle; + * PLAIN style; * false otherwise. * @see java.awt.Font#getStyle * @since JDK1.0 diff --git a/jdk/src/share/classes/java/awt/FontMetrics.java b/jdk/src/share/classes/java/awt/FontMetrics.java index 31f2e764f88..cd6c0fbbaf2 100644 --- a/jdk/src/share/classes/java/awt/FontMetrics.java +++ b/jdk/src/share/classes/java/awt/FontMetrics.java @@ -51,8 +51,8 @@ import java.text.CharacterIterator; *
  • {@link #charsWidth(char[], int, int)} * *

    - * The letter 'p' showing its 'reference point' + * The letter 'p' showing its 'reference point' * Note that the implementations of these methods are * inefficient, so they are usually overridden with more efficient * toolkit-specific implementations. diff --git a/jdk/src/share/classes/java/awt/Frame.java b/jdk/src/share/classes/java/awt/Frame.java index 2513ddb75ef..7a7f02fd862 100644 --- a/jdk/src/share/classes/java/awt/Frame.java +++ b/jdk/src/share/classes/java/awt/Frame.java @@ -83,7 +83,7 @@ import javax.accessibility.*; * Diagram of virtual device encompassing three physical screens and one primary physical screen. The primary physical screen
  * shows (0,0) coords while a different physical screen shows (-80,-100) coords. + * style="float:center; margin: 7px 10px;"> *

    * In such an environment, when calling setLocation, * you must pass a virtual coordinate to this method. Similarly, @@ -265,12 +265,12 @@ public class Frame extends Window implements MenuContainer { * *

    Note that the correct test for frame being fully maximized is *

    -     *     (state & Frame.MAXIMIZED_BOTH) == Frame.MAXIMIZED_BOTH
    +     *     (state & Frame.MAXIMIZED_BOTH) == Frame.MAXIMIZED_BOTH
          * 
    * *

    To test is frame is maximized in some direction use *

    -     *     (state & Frame.MAXIMIZED_BOTH) != 0
    +     *     (state & Frame.MAXIMIZED_BOTH) != 0
          * 
    * * @see #setExtendedState(int) diff --git a/jdk/src/share/classes/java/awt/GradientPaintContext.java b/jdk/src/share/classes/java/awt/GradientPaintContext.java index ac21d52da91..2536fa2cf04 100644 --- a/jdk/src/share/classes/java/awt/GradientPaintContext.java +++ b/jdk/src/share/classes/java/awt/GradientPaintContext.java @@ -41,7 +41,7 @@ class GradientPaintContext implements PaintContext { new DirectColorModel(24, 0x000000ff, 0x0000ff00, 0x00ff0000); static ColorModel cachedModel; - static WeakReference cached; + static WeakReference cached; static synchronized Raster getCachedRaster(ColorModel cm, int w, int h) { if (cm == cachedModel) { @@ -76,7 +76,7 @@ class GradientPaintContext implements PaintContext { } } cachedModel = cm; - cached = new WeakReference(ras); + cached = new WeakReference<>(ras); } double x1; diff --git a/jdk/src/share/classes/java/awt/Graphics.java b/jdk/src/share/classes/java/awt/Graphics.java index abd4b8cc50d..3e2dcb55008 100644 --- a/jdk/src/share/classes/java/awt/Graphics.java +++ b/jdk/src/share/classes/java/awt/Graphics.java @@ -105,7 +105,7 @@ public abstract class Graphics { /** * Constructs a new Graphics object. - * This constructor is the default contructor for a graphics + * This constructor is the default constructor for a graphics * context. *

    * Since Graphics is an abstract class, applications diff --git a/jdk/src/share/classes/java/awt/Graphics2D.java b/jdk/src/share/classes/java/awt/Graphics2D.java index f83bde71a36..c8bb23def69 100644 --- a/jdk/src/share/classes/java/awt/Graphics2D.java +++ b/jdk/src/share/classes/java/awt/Graphics2D.java @@ -305,7 +305,7 @@ import java.util.Map; * aliasing or antialiasing is being used. *

      *
    • Device coordinates are defined to be between device pixels which - * avoids any inconsistent results between aliased and antaliased + * avoids any inconsistent results between aliased and antialiased * rendering. If coordinates were defined to be at a pixel's center, some * of the pixels covered by a shape, such as a rectangle, would only be * half covered. @@ -806,7 +806,7 @@ public abstract class Graphics2D extends Graphics { * @param s the Shape to check for a hit * @param onStroke flag used to choose between testing the * stroked or the filled shape. If the flag is true, the - * Stroke oultine is tested. If the flag is + * Stroke outline is tested. If the flag is * false, the filled Shape is tested. * @return true if there is a hit; false * otherwise. @@ -1162,7 +1162,7 @@ public abstract class Graphics2D extends Graphics { * Component. To change the background * of the Component, use appropriate methods of * the Component. - * @param color the background color that isused in + * @param color the background color that is used in * subsequent calls to clearRect * @see #getBackground * @see java.awt.Graphics#clearRect diff --git a/jdk/src/share/classes/java/awt/GraphicsDevice.java b/jdk/src/share/classes/java/awt/GraphicsDevice.java index c619a2aee19..3c9d4178bd6 100644 --- a/jdk/src/share/classes/java/awt/GraphicsDevice.java +++ b/jdk/src/share/classes/java/awt/GraphicsDevice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,7 +69,7 @@ import sun.awt.SunToolkit; * *

      * For more information on full-screen exclusive mode API, see the - * + * * Full-Screen Exclusive Mode API Tutorial. * * @see GraphicsEnvironment @@ -162,7 +162,7 @@ public abstract class GraphicsDevice { * GraphicsEnvironment. Although there is * no public method to set this String, a programmer can * use the String for debugging purposes. Vendors of - * the JavaTM Runtime Environment can + * the Java™ Runtime Environment can * format the return value of the String. To determine * how to interpret the value of the String, contact the * vendor of your Java Runtime. To find out who the vendor is, from @@ -325,7 +325,14 @@ public abstract class GraphicsDevice { // Note that we use the graphics configuration of the device, // not the window's, because we're setting the fs window for // this device. - Rectangle screenBounds = getDefaultConfiguration().getBounds(); + final GraphicsConfiguration gc = getDefaultConfiguration(); + final Rectangle screenBounds = gc.getBounds(); + if (SunToolkit.isDispatchThreadForAppContext(fullScreenWindow)) { + // Update graphics configuration here directly and do not wait + // asynchronous notification from the peer. Note that + // setBounds() will reset a GC, if it was set incorrectly. + fullScreenWindow.setGraphicsConfiguration(gc); + } fullScreenWindow.setBounds(screenBounds.x, screenBounds.y, screenBounds.width, screenBounds.height); fullScreenWindow.setVisible(true); @@ -334,11 +341,12 @@ public abstract class GraphicsDevice { } /** - * Returns the Window object representing the + * Returns the {@code Window} object representing the * full-screen window if the device is in full-screen mode. * - * @return the full-screen window, or null if the device is - * not in full-screen mode. + * @return the full-screen window, or {@code null} if the device is + * not in full-screen mode. The {@code Window} object can differ + * from the object previously set by {@code setFullScreenWindow}. * @see #setFullScreenWindow(Window) * @since 1.4 */ diff --git a/jdk/src/share/classes/java/awt/GraphicsEnvironment.java b/jdk/src/share/classes/java/awt/GraphicsEnvironment.java index f3d49b78243..8a655ba99b8 100644 --- a/jdk/src/share/classes/java/awt/GraphicsEnvironment.java +++ b/jdk/src/share/classes/java/awt/GraphicsEnvironment.java @@ -95,18 +95,18 @@ public abstract class GraphicsEnvironment { String nm = AccessController.doPrivileged(new GetPropertyAction("java.awt.graphicsenv", null)); try { // long t0 = System.currentTimeMillis(); - Class geCls; + Class geCls; try { // First we try if the bootclassloader finds the requested // class. This way we can avoid to run in a privileged block. - geCls = Class.forName(nm); + geCls = (Class)Class.forName(nm); } catch (ClassNotFoundException ex) { // If the bootclassloader fails, we try again with the // application classloader. ClassLoader cl = ClassLoader.getSystemClassLoader(); - geCls = Class.forName(nm, true, cl); + geCls = (Class)Class.forName(nm, true, cl); } - ge = (GraphicsEnvironment) geCls.newInstance(); + ge = geCls.newInstance(); // long t1 = System.currentTimeMillis(); // System.out.println("GE creation took " + (t1-t0)+ "ms."); if (isHeadless()) { @@ -161,7 +161,7 @@ public abstract class GraphicsEnvironment { private static boolean getHeadlessProperty() { if (headless == null) { java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { + new java.security.PrivilegedAction() { public Object run() { String nm = System.getProperty("java.awt.headless"); @@ -263,7 +263,7 @@ public abstract class GraphicsEnvironment { * available in this GraphicsEnvironment. Typical usage * would be to allow a user to select a particular font. Then, the * application can size the font and set various font attributes by - * calling the deriveFont method on the choosen instance. + * calling the deriveFont method on the chosen instance. *

      * This method provides for the application the most precise control * over which Font instance is used to render text. diff --git a/jdk/src/share/classes/java/awt/GridBagConstraints.java b/jdk/src/share/classes/java/awt/GridBagConstraints.java index c524efd0c63..3651b39be92 100644 --- a/jdk/src/share/classes/java/awt/GridBagConstraints.java +++ b/jdk/src/share/classes/java/awt/GridBagConstraints.java @@ -30,7 +30,7 @@ package java.awt; * GridBagLayout class. * * @author Doug Stein - * @author Bill Spitzak (orignial NeWS & OLIT implementation) + * @author Bill Spitzak (orignial NeWS & OLIT implementation) * @see java.awt.GridBagLayout * @since JDK1.0 */ diff --git a/jdk/src/share/classes/java/awt/GridBagLayout.java b/jdk/src/share/classes/java/awt/GridBagLayout.java index 22cb656ba60..8ac290a7a42 100644 --- a/jdk/src/share/classes/java/awt/GridBagLayout.java +++ b/jdk/src/share/classes/java/awt/GridBagLayout.java @@ -120,17 +120,18 @@ import java.util.Arrays; * Orientation relative values are interpreted relative to the container's * ComponentOrientation property while absolute values * are not. Baseline relative values are calculated relative to the - * baseline. Valid values are: + * baseline. Valid values are: *

      - *

      * - * - * - * + * + * + * * * * * * * - *

      Absolute Values

      Orientation Relative Values

      Baseline Relative Values

      Absolute Values

      Orientation Relative Values

      Baseline Relative Values

      + *
        *
      • GridBagConstraints.NORTH
      • *
      • GridBagConstraints.SOUTH
      • *
      • GridBagConstraints.WEST
      • @@ -140,8 +141,10 @@ import java.util.Arrays; *
      • GridBagConstraints.SOUTHWEST
      • *
      • GridBagConstraints.SOUTHEAST
      • *
      • GridBagConstraints.CENTER (the default)
      • + *
      *
      + *
        *
      • GridBagConstraints.PAGE_START
      • *
      • GridBagConstraints.PAGE_END
      • *
      • GridBagConstraints.LINE_START
      • @@ -150,8 +153,10 @@ import java.util.Arrays; *
      • GridBagConstraints.FIRST_LINE_END
      • *
      • GridBagConstraints.LAST_LINE_START
      • *
      • GridBagConstraints.LAST_LINE_END
      • + *
      *
      + *
        *
      • GridBagConstraints.BASELINE
      • *
      • GridBagConstraints.BASELINE_LEADING
      • *
      • GridBagConstraints.BASELINE_TRAILING
      • @@ -161,9 +166,10 @@ import java.util.Arrays; *
      • GridBagConstraints.BELOW_BASELINE
      • *
      • GridBagConstraints.BELOW_BASELINE_LEADING
      • *
      • GridBagConstraints.BELOW_BASELINE_TRAILING
      • + *
      *

      + * *

      {@link GridBagConstraints#weightx}, * {@link GridBagConstraints#weighty} *
      Used to determine how to distribute space, which is @@ -195,7 +201,7 @@ import java.util.Arrays; * * * The following text describes this graphic (Figure 1). + * alt="The following text describes this graphic (Figure 1)." style="float:center"> * * * This layout consists of three components: @@ -246,13 +252,13 @@ import java.util.Arrays; * left-to-right container and Figure 3 shows the layout for a horizontal, * right-to-left container. *

      - *

      + *
      * * * * * @@ -349,7 +355,7 @@ import java.util.Arrays; *
      *

      * @author Doug Stein - * @author Bill Spitzak (orignial NeWS & OLIT implementation) + * @author Bill Spitzak (orignial NeWS & OLIT implementation) * @see java.awt.GridBagConstraints * @see java.awt.GridBagLayoutInfo * @see java.awt.ComponentOrientation @@ -360,7 +366,7 @@ java.io.Serializable { static final int EMPIRICMULTIPLIER = 2; /** - * This field is no longer used to reserve arrays and keeped for backward + * This field is no longer used to reserve arrays and kept for backward * compatibility. Previously, this was * the maximum number of grid positions (both horizontal and * vertical) that could be laid out by the grid bag layout. @@ -438,7 +444,7 @@ java.io.Serializable { * applied to the gridbag after all of the minimum row * heights have been calculated. * If rowHeights has more elements than the number of - * rows, rowa are added to the gridbag to match + * rows, rows are added to the gridbag to match * the number of elements in rowHeights. * * @serial @@ -527,7 +533,7 @@ java.io.Serializable { * and returns null. * * @param comp the component to be queried - * @return the contraints for the specified component + * @return the constraints for the specified component */ protected GridBagConstraints lookupConstraints(Component comp) { GridBagConstraints constraints = comptable.get(comp); @@ -794,7 +800,7 @@ java.io.Serializable { /** * Lays out the specified container using this grid bag layout. * This method reshapes components in the specified container in - * order to satisfy the contraints of this GridBagLayout + * order to satisfy the constraints of this GridBagLayout * object. *

      * Most applications do not call this method directly. @@ -891,7 +897,7 @@ java.io.Serializable { *

        *
      1. Figure out the dimensions of the layout grid. *
      2. Determine which cells the components occupy. - *
      3. Distribute the weights and min sizes amoung the rows/columns. + *
      4. Distribute the weights and min sizes among the rows/columns. *
      * * This also caches the minsizes for all the children when they are @@ -973,7 +979,7 @@ java.io.Serializable { /** * This method is obsolete and supplied for backwards - * compatability only; new code should call {@link + * compatibility only; new code should call {@link * #getLayoutInfo(java.awt.Container, int) getLayoutInfo} instead. * This method is the same as getLayoutInfo; * refer to getLayoutInfo for details on parameters @@ -1606,7 +1612,7 @@ java.io.Serializable { /** * This method is obsolete and supplied for backwards - * compatability only; new code should call {@link + * compatibility only; new code should call {@link * #adjustForGravity(java.awt.GridBagConstraints, java.awt.Rectangle) * adjustForGravity} instead. * This method is the same as adjustForGravity; @@ -1987,7 +1993,7 @@ java.io.Serializable { /** * This method is obsolete and supplied for backwards - * compatability only; new code should call {@link + * compatibility only; new code should call {@link * #getMinSize(java.awt.Container, GridBagLayoutInfo) getMinSize} instead. * This method is the same as getMinSize; * refer to getMinSize for details on parameters @@ -2027,7 +2033,7 @@ java.io.Serializable { /** * This method is obsolete and supplied for backwards - * compatability only; new code should call {@link + * compatibility only; new code should call {@link * #arrangeGrid(Container) arrangeGrid} instead. * This method is the same as arrangeGrid; * refer to arrangeGrid for details on the @@ -2223,6 +2229,6 @@ java.io.Serializable { } } - // Added for serial backwards compatability (4348425) + // Added for serial backwards compatibility (4348425) static final long serialVersionUID = 8838754796412211005L; } diff --git a/jdk/src/share/classes/java/awt/GridLayout.java b/jdk/src/share/classes/java/awt/GridLayout.java index 204995960d4..596208c3e65 100644 --- a/jdk/src/share/classes/java/awt/GridLayout.java +++ b/jdk/src/share/classes/java/awt/GridLayout.java @@ -55,7 +55,7 @@ package java.awt; * If the container's ComponentOrientation property is horizontal * and right-to-left, the example produces the output shown in Figure 2. *

      - *

      - * The preceeding text describes this graphic (Figure 1). + * The preceding text describes this graphic (Figure 1). * - * The preceeding text describes this graphic (Figure 2). + * The preceding text describes this graphic (Figure 2). *
      Figure 2: Horizontal, Left-to-Right
      + *
      * *
      Shows 6 buttons in rows of 2. Row 1 shows buttons 1 then 2.
@@ -73,7 +73,7 @@ package java.awt;
  *
  * <td>Figure 2: Horizontal, Right-to-Left</td>
  * </tr>
- * </table></center>
+ * </table>
  * <p>
  * When both the number of rows and the number of columns have
  * been set to non-zero values, either by a constructor or
diff --git a/jdk/src/share/classes/java/awt/KeyEventDispatcher.java b/jdk/src/share/classes/java/awt/KeyEventDispatcher.java
index 6d2215e2359..9970ac586e3 100644
--- a/jdk/src/share/classes/java/awt/KeyEventDispatcher.java
+++ b/jdk/src/share/classes/java/awt/KeyEventDispatcher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,6 +51,7 @@ import java.awt.event.KeyEvent;
  * @see KeyboardFocusManager#removeKeyEventDispatcher
  * @since 1.4
  */
+@FunctionalInterface
 public interface KeyEventDispatcher {
 
     /**
diff --git a/jdk/src/share/classes/java/awt/KeyEventPostProcessor.java b/jdk/src/share/classes/java/awt/KeyEventPostProcessor.java
index 12440aa1f95..5a36b9536b1 100644
--- a/jdk/src/share/classes/java/awt/KeyEventPostProcessor.java
+++ b/jdk/src/share/classes/java/awt/KeyEventPostProcessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,6 +54,7 @@ import java.awt.event.KeyEvent;
  * @see KeyboardFocusManager#removeKeyEventPostProcessor
  * @since 1.4
  */
+@FunctionalInterface
 public interface KeyEventPostProcessor {
 
     /**
diff --git a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java
index 51507696cff..0184083ec5c 100644
--- a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java
+++ b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java
@@ -88,7 +88,7 @@ import sun.awt.AWTAccessor;
  * ClassLoader.
  * <p>
  * Please see
- * <a href= + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, and the * Focus Specification @@ -348,7 +348,7 @@ public abstract class KeyboardFocusManager * Component of those Windows that has no such array of its own explicitly * set. */ - private Set[] defaultFocusTraversalKeys = new Set[4]; + private Set[] defaultFocusTraversalKeys = new Set[4]; /** * The current focus cycle root. If the focus owner is itself a focus cycle @@ -376,7 +376,7 @@ public abstract class KeyboardFocusManager * KeyEventDispatchers are registered, this field may be null or refer to * a List of length 0. */ - private java.util.LinkedList keyEventDispatchers; + private java.util.LinkedList keyEventDispatchers; /** * This KeyboardFocusManager's KeyEventPostProcessor chain. The List does @@ -385,12 +385,12 @@ public abstract class KeyboardFocusManager * If no other KeyEventPostProcessors are registered, this field may be * null or refer to a List of length 0. */ - private java.util.LinkedList keyEventPostProcessors; + private java.util.LinkedList keyEventPostProcessors; /** * Maps Windows to those Windows' most recent focus owners. */ - private static java.util.Map mostRecentFocusOwners = new WeakHashMap(); + private static java.util.Map> mostRecentFocusOwners = new WeakHashMap<>(); /** * We cache the permission used to verify that the calling thread is @@ -431,7 +431,7 @@ public abstract class KeyboardFocusManager */ public KeyboardFocusManager() { for (int i = 0; i < TRAVERSAL_KEY_LENGTH; i++) { - Set work_set = new HashSet(); + Set work_set = new HashSet<>(); for (int j = 0; j < defaultFocusTraversalKeyStrokes[i].length; j++) { work_set.add(defaultFocusTraversalKeyStrokes[i][j]); } @@ -590,6 +590,7 @@ public abstract class KeyboardFocusManager * * @see Component#requestFocus() * @see java.awt.event.FocusEvent#FOCUS_LOST + * @since 1.8 */ public void clearFocusOwner() { if (getFocusOwner() != null) { @@ -1125,7 +1126,7 @@ public abstract class KeyboardFocusManager throw new IllegalArgumentException("cannot set null Set of default focus traversal keys"); } - Set oldKeys; + Set oldKeys; synchronized (this) { for (AWTKeyStroke keystroke : keystrokes) { @@ -1153,7 +1154,7 @@ public abstract class KeyboardFocusManager oldKeys = defaultFocusTraversalKeys[id]; defaultFocusTraversalKeys[id] = - Collections.unmodifiableSet(new HashSet(keystrokes)); + Collections.unmodifiableSet(new HashSet<>(keystrokes)); } firePropertyChange(defaultFocusTraversalKeyPropertyNames[id], @@ -1699,7 +1700,7 @@ public abstract class KeyboardFocusManager if (dispatcher != null) { synchronized (this) { if (keyEventDispatchers == null) { - keyEventDispatchers = new java.util.LinkedList(); + keyEventDispatchers = new java.util.LinkedList<>(); } keyEventDispatchers.add(dispatcher); } @@ -1787,7 +1788,7 @@ public abstract class KeyboardFocusManager if (processor != null) { synchronized (this) { if (keyEventPostProcessors == null) { - keyEventPostProcessors = new java.util.LinkedList(); + keyEventPostProcessors = new java.util.LinkedList<>(); } keyEventPostProcessors.add(processor); } @@ -1865,9 +1866,9 @@ public abstract class KeyboardFocusManager // of Component.parent fields. Since WeakHasMap refers to its // values strongly, we need to break the strong link from the // value (component) back to its key (window). - WeakReference weakValue = null; + WeakReference weakValue = null; if (component != null) { - weakValue = new WeakReference(component); + weakValue = new WeakReference<>(component); } mostRecentFocusOwners.put(window, weakValue); } @@ -1906,7 +1907,7 @@ public abstract class KeyboardFocusManager * javax.swing.JComponent.runInputVerifier() using reflection. */ static synchronized Component getMostRecentFocusOwner(Window window) { - WeakReference weakValue = + WeakReference weakValue = (WeakReference)mostRecentFocusOwners.get(window); return weakValue == null ? null : (Component)weakValue.get(); } @@ -2034,7 +2035,7 @@ public abstract class KeyboardFocusManager * oldest timestamp (if any) should be cancelled. * * @param after the timestamp specified in the call to - * enqueueKeyEvents, or any value < 0 + * enqueueKeyEvents, or any value < 0 * @param untilFocused the Component specified in the call to * enqueueKeyEvents * @see #enqueueKeyEvents @@ -2649,11 +2650,11 @@ public abstract class KeyboardFocusManager Component lastFocusOwner = null; Component currentFocusOwner = null; - for (Iterator iter = localLightweightRequests.iterator(); iter.hasNext(); ) { + for (Iterator iter = localLightweightRequests.iterator(); iter.hasNext(); ) { currentFocusOwner = manager.getGlobalFocusOwner(); LightweightFocusRequest lwFocusRequest = - (LightweightFocusRequest)iter.next(); + iter.next(); /* * WARNING: This is based on DKFM's logic solely! @@ -2662,7 +2663,7 @@ public abstract class KeyboardFocusManager * only if we have the last request to dispatch. If the last request * fails, focus will be restored to either the component of the last * previously succedded request, or to to the focus owner that was - * before this clearing proccess. + * before this clearing process. */ if (!iter.hasNext()) { disableRestoreFocus = false; @@ -2978,12 +2979,12 @@ public abstract class KeyboardFocusManager if (hwFocusRequest != null) { heavyweightRequests.removeFirst(); if (hwFocusRequest.lightweightRequests != null) { - for (Iterator lwIter = hwFocusRequest.lightweightRequests. + for (Iterator lwIter = hwFocusRequest.lightweightRequests. iterator(); lwIter.hasNext(); ) { manager.dequeueKeyEvents - (-1, ((LightweightFocusRequest)lwIter.next()). + (-1, lwIter.next(). component); } } @@ -3063,8 +3064,8 @@ public abstract class KeyboardFocusManager // Accessor to private field isProxyActive of KeyEvent private static boolean isProxyActiveImpl(KeyEvent e) { if (proxyActive == null) { - proxyActive = (Field) AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { + proxyActive = AccessController.doPrivileged(new PrivilegedAction() { + public Field run() { Field field = null; try { field = KeyEvent.class.getDeclaredField("isProxyActive"); diff --git a/jdk/src/share/classes/java/awt/Label.java b/jdk/src/share/classes/java/awt/Label.java index c5f174a757f..1772875d5ff 100644 --- a/jdk/src/share/classes/java/awt/Label.java +++ b/jdk/src/share/classes/java/awt/Label.java @@ -46,7 +46,7 @@ import javax.accessibility.*; * produces the following labels: *

      * Two labels: 'Hi There!' and 'Another label' + * style="float:center; margin: 7px 10px;"> * * @author Sami Shaio * @since JDK1.0 diff --git a/jdk/src/share/classes/java/awt/LinearGradientPaint.java b/jdk/src/share/classes/java/awt/LinearGradientPaint.java index ffb5c9b2d09..f4af6026da2 100644 --- a/jdk/src/share/classes/java/awt/LinearGradientPaint.java +++ b/jdk/src/share/classes/java/awt/LinearGradientPaint.java @@ -94,7 +94,8 @@ import java.beans.ConstructorProperties; * of the three cycle methods: *

      *

      - * + * image showing the output of the example code *
      * * @see java.awt.Paint diff --git a/jdk/src/share/classes/java/awt/List.java b/jdk/src/share/classes/java/awt/List.java index 92a1867d882..b3be9aeaf2e 100644 --- a/jdk/src/share/classes/java/awt/List.java +++ b/jdk/src/share/classes/java/awt/List.java @@ -61,7 +61,7 @@ import javax.accessibility.*; * scrolling list: *

      * Shows a list containing: Venus, Earth, JavaSoft, and Mars. Javasoft is selected. + * alt="Shows a list containing: Venus, Earth, JavaSoft, and Mars. Javasoft is selected." style="float:center; margin: 7px 10px;"> *

      * If the List allows multiple selections, then clicking on * an item that is already selected deselects it. In the preceding @@ -797,7 +797,7 @@ public class List extends Component implements ItemSelectable, Accessible { } /** - * Gets the minumum dimensions for a list with the specified + * Gets the minimum dimensions for a list with the specified * number of rows. * @param rows number of rows in the list * @return the minimum dimensions for displaying this scrolling list @@ -1164,7 +1164,7 @@ public class List extends Component implements ItemSelectable, Accessible { /* * Serialization support. Since the value of the selected - * field isn't neccessarily up to date we sync it up with the + * field isn't necessarily up to date, we sync it up with the * peer before serializing. */ diff --git a/jdk/src/share/classes/java/awt/MediaTracker.java b/jdk/src/share/classes/java/awt/MediaTracker.java index 9b8ba3cfb23..23ec3577274 100644 --- a/jdk/src/share/classes/java/awt/MediaTracker.java +++ b/jdk/src/share/classes/java/awt/MediaTracker.java @@ -744,7 +744,7 @@ public class MediaTracker implements java.io.Serializable { * All instances of Image being tracked * under the specified ID are removed regardless of scale. * @param image the image to be removed - * @param id the tracking ID frrom which to remove the image + * @param id the tracking ID from which to remove the image * @see java.awt.MediaTracker#removeImage(java.awt.Image) * @see java.awt.MediaTracker#removeImage(java.awt.Image, int, int, int) * @since JDK1.1 diff --git a/jdk/src/share/classes/java/awt/MenuBar.java b/jdk/src/share/classes/java/awt/MenuBar.java index bd0a7d890c0..2c494ade097 100644 --- a/jdk/src/share/classes/java/awt/MenuBar.java +++ b/jdk/src/share/classes/java/awt/MenuBar.java @@ -43,9 +43,9 @@ import javax.accessibility.*; * This is what a menu bar might look like: *

      * + * style="float:center; margin: 7px 10px;"> *

      * A menu bar handles keyboard shortcuts for menu items, passing them * along to its child menus. diff --git a/jdk/src/share/classes/java/awt/MenuComponent.java b/jdk/src/share/classes/java/awt/MenuComponent.java index 4895fdc9548..8718821daaa 100644 --- a/jdk/src/share/classes/java/awt/MenuComponent.java +++ b/jdk/src/share/classes/java/awt/MenuComponent.java @@ -402,7 +402,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets this component's locking object (the object that owns the thread - * sychronization monitor) for AWT component-tree and layout + * synchronization monitor) for AWT component-tree and layout * operations. * @return this component's locking object */ @@ -686,7 +686,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets the Cursor of this object. * - * @return the Curso, if supported, of the object; + * @return the Cursor, if supported, of the object; * otherwise, null */ public Cursor getCursor() { diff --git a/jdk/src/share/classes/java/awt/MenuItem.java b/jdk/src/share/classes/java/awt/MenuItem.java index 4838d187a89..b660e20d96d 100644 --- a/jdk/src/share/classes/java/awt/MenuItem.java +++ b/jdk/src/share/classes/java/awt/MenuItem.java @@ -42,8 +42,8 @@ import sun.awt.AWTAccessor; *

      * This picture of a menu bar shows five menu items: * The following text describes this graphic. - *
      + * style="float:center; margin: 7px 10px;"> + *
      * The first two items are simple menu items, labeled * "Basic" and "Simple". * Following these two items is a separator, which is itself diff --git a/jdk/src/share/classes/java/awt/MultipleGradientPaintContext.java b/jdk/src/share/classes/java/awt/MultipleGradientPaintContext.java index edf6bd8267b..cdff1907d95 100644 --- a/jdk/src/share/classes/java/awt/MultipleGradientPaintContext.java +++ b/jdk/src/share/classes/java/awt/MultipleGradientPaintContext.java @@ -81,7 +81,7 @@ abstract class MultipleGradientPaintContext implements PaintContext { protected float a00, a01, a10, a11, a02, a12; /** - * This boolean specifies wether we are in simple lookup mode, where an + * This boolean specifies whether we are in simple lookup mode, where an * input value between 0 and 1 may be used to directly index into a single * array of gradient colors. If this boolean value is false, then we have * to use a 2-step process where we have to determine which gradient array diff --git a/jdk/src/share/classes/java/awt/Polygon.java b/jdk/src/share/classes/java/awt/Polygon.java index 08a545b78bc..5e649da6d76 100644 --- a/jdk/src/share/classes/java/awt/Polygon.java +++ b/jdk/src/share/classes/java/awt/Polygon.java @@ -246,7 +246,7 @@ public class Polygon implements Shape, java.io.Serializable { } /* - * Resizes the bounding box to accomodate the specified coordinates. + * Resizes the bounding box to accommodate the specified coordinates. * @param x, y the specified coordinates */ void updateBounds(int x, int y) { diff --git a/jdk/src/share/classes/java/awt/PopupMenu.java b/jdk/src/share/classes/java/awt/PopupMenu.java index 0e700638240..70ece5970ed 100644 --- a/jdk/src/share/classes/java/awt/PopupMenu.java +++ b/jdk/src/share/classes/java/awt/PopupMenu.java @@ -150,7 +150,7 @@ public class PopupMenu extends Menu { * @exception IllegalArgumentException if this PopupMenu * has a non-Component parent * @exception IllegalArgumentException if the origin is not in the - * parent's heirarchy + * parent's hierarchy * @exception RuntimeException if the parent is not showing on screen */ public void show(Component origin, int x, int y) { diff --git a/jdk/src/share/classes/java/awt/RadialGradientPaint.java b/jdk/src/share/classes/java/awt/RadialGradientPaint.java index c9cc43a8e32..5fd08734f14 100644 --- a/jdk/src/share/classes/java/awt/RadialGradientPaint.java +++ b/jdk/src/share/classes/java/awt/RadialGradientPaint.java @@ -80,14 +80,16 @@ import java.beans.ConstructorProperties; * from the focus point. The following figure shows that the distance AB * is equal to the distance BC, and the distance AD is equal to the distance DE. *

      - * + * image showing the
+ * distance AB=BC, and AD=DE *
      * If the gradient and graphics rendering transforms are uniformly scaled and * the user sets the focus so that it coincides with the center of the circle, * the gradient color proportions are equal for any line drawn from the center. * The following figure shows the distances AB, BC, AD, and DE. They are all equal. *
      - * + * image showing the
+ * distance of AB, BC, AD, and DE are all equal *
      * Note that some minor variations in distances may occur due to sampling at * the granularity of a pixel. @@ -117,7 +119,8 @@ import java.beans.ConstructorProperties; * (centered) focus for each of the three cycle methods: *

      *

      - * + * image showing the
+ * output of the sameple code *
      * *

      @@ -141,7 +144,8 @@ import java.beans.ConstructorProperties; * focus for each of the three cycle methods: *

      *

      - * + * image showing the
+ * output of the sample code *
      * * @see java.awt.Paint diff --git a/jdk/src/share/classes/java/awt/RenderingHints.java b/jdk/src/share/classes/java/awt/RenderingHints.java index 48cf9e11d32..42386797055 100644 --- a/jdk/src/share/classes/java/awt/RenderingHints.java +++ b/jdk/src/share/classes/java/awt/RenderingHints.java @@ -101,7 +101,7 @@ public class RenderingHints // - the integer key of the Key // It is theoretically possible for 2 distinct keys to collide // along all 3 of those attributes in the context of multiple - // class loaders, but that occurence will be extremely rare and + // class loaders, but that occurrence will be extremely rare and // we account for that possibility below in the recordIdentity // method by slightly relaxing our uniqueness guarantees if we // end up in that situation. @@ -729,7 +729,7 @@ public class RenderingHints * from one side of a sample to the other. * As the image is scaled down, more image pixels have their * color samples represented in the resulting output since each - * output pixel recieves color information from up to 4 image + * output pixel receives color information from up to 4 image * pixels. * * @see #KEY_INTERPOLATION diff --git a/jdk/src/share/classes/java/awt/ScrollPane.java b/jdk/src/share/classes/java/awt/ScrollPane.java index bb27de0ce98..626fed6c0b1 100644 --- a/jdk/src/share/classes/java/awt/ScrollPane.java +++ b/jdk/src/share/classes/java/awt/ScrollPane.java @@ -247,7 +247,7 @@ public class ScrollPane extends Container implements Accessible { * component is removed and the new one is added. * @param comp the component to be added * @param constraints not applicable - * @param index position of child component (must be <= 0) + * @param index position of child component (must be <= 0) */ protected final void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock()) { @@ -425,8 +425,8 @@ public class ScrollPane extends Container implements Accessible { /** * Determine the size to allocate the child component. - * If the viewport area is bigger than the childs - * preferred size then the child is allocated enough + * If the viewport area is bigger than the preferred size + * of the child then the child is allocated enough * to fill the viewport, otherwise the child is given * it's preferred size. */ diff --git a/jdk/src/share/classes/java/awt/ScrollPaneAdjustable.java b/jdk/src/share/classes/java/awt/ScrollPaneAdjustable.java index f9c08b39fbf..be3ad5fec6a 100644 --- a/jdk/src/share/classes/java/awt/ScrollPaneAdjustable.java +++ b/jdk/src/share/classes/java/awt/ScrollPaneAdjustable.java @@ -220,7 +220,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { * This method is public for this class to properly implement * Adjustable interface. * - * @throws AWTError Always throws an error when called. + * @throws AWTError Always throws an error when called. */ public void setMinimum(int min) { throw new AWTError(SCROLLPANE_ONLY); @@ -237,7 +237,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { * This method is public for this class to properly implement * Adjustable interface. * - * @throws AWTError Always throws an error when called. + * @throws AWTError Always throws an error when called. */ public void setMaximum(int max) { throw new AWTError(SCROLLPANE_ONLY); @@ -274,7 +274,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { * This method is public for this class to properly implement * Adjustable interface. * - * @throws AWTError Always throws an error when called. + * @throws AWTError Always throws an error when called. */ public void setVisibleAmount(int v) { throw new AWTError(SCROLLPANE_ONLY); @@ -336,7 +336,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { * the AdjustementEvent with specified type and value. * * @param v the new value of the scrollbar - * @param type the type of the scrolling operation occured + * @param type the type of the scrolling operation occurred */ private void setTypedValue(int v, int type) { v = Math.max(v, minimum); diff --git a/jdk/src/share/classes/java/awt/Scrollbar.java b/jdk/src/share/classes/java/awt/Scrollbar.java index b6a581d96a8..9849480719d 100644 --- a/jdk/src/share/classes/java/awt/Scrollbar.java +++ b/jdk/src/share/classes/java/awt/Scrollbar.java @@ -42,7 +42,7 @@ import javax.accessibility.*; * the red, green, and blue components of a color: *

      * Image shows 3 vertical sliders, side-by-side. + * style="float:center; margin: 7px 10px;"> *

      * Each scroll bar in this example could be created with * code similar to the following: @@ -60,7 +60,7 @@ import javax.accessibility.*; *

      * Image shows horizontal slider with starting range of 0 and ending range of 300. The slider thumb is labeled 60. + * style="float:center; margin: 7px 10px;"> *

      * The value range represented by the bubble in this example * is the visible amount. The horizontal scroll bar @@ -295,7 +295,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * Constructs a new vertical scroll bar. * The default properties of the scroll bar are listed in * the following table: - *

      + *

      * * * @@ -715,6 +715,9 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * The unit increment must be greater than zero. * Attepts to set the unit increment to a value lower than 1 * will result in a value of 1 being set. + *

      + * In some operating systems, this property + * can be ignored by the underlying controls. * * @param v the amount by which to increment or decrement * the scroll bar's value @@ -752,6 +755,9 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * scroll bar, generally through a mouse or keyboard gesture * that the scroll bar receives as an adjustment event. * The unit increment must be greater than zero. + *

      + * In some operating systems, this property + * can be ignored by the underlying controls. * * @return the unit increment of this scroll bar * @see java.awt.Scrollbar#setUnitIncrement diff --git a/jdk/src/share/classes/java/awt/SequencedEvent.java b/jdk/src/share/classes/java/awt/SequencedEvent.java index b57cde2683f..0ae8dad64db 100644 --- a/jdk/src/share/classes/java/awt/SequencedEvent.java +++ b/jdk/src/share/classes/java/awt/SequencedEvent.java @@ -49,7 +49,7 @@ class SequencedEvent extends AWTEvent implements ActiveEvent { private static final int ID = java.awt.event.FocusEvent.FOCUS_LAST + 1; - private static final LinkedList list = new LinkedList(); + private static final LinkedList list = new LinkedList<>(); private final AWTEvent nested; private AppContext appContext; diff --git a/jdk/src/share/classes/java/awt/Shape.java b/jdk/src/share/classes/java/awt/Shape.java index e478ea7f3d8..8015d4593de 100644 --- a/jdk/src/share/classes/java/awt/Shape.java +++ b/jdk/src/share/classes/java/awt/Shape.java @@ -269,7 +269,7 @@ public interface Shape { * Tests if the interior of the Shape entirely contains * the specified rectangular area. All coordinates that lie inside * the rectangular area must lie within the Shape for the - * entire rectanglar area to be considered contained within the + * entire rectangular area to be considered contained within the * Shape. *

      * The {@code Shape.contains()} method allows a {@code Shape} diff --git a/jdk/src/share/classes/java/awt/SystemTray.java b/jdk/src/share/classes/java/awt/SystemTray.java index 444f85fa320..20ba912870c 100644 --- a/jdk/src/share/classes/java/awt/SystemTray.java +++ b/jdk/src/share/classes/java/awt/SystemTray.java @@ -63,8 +63,8 @@ import sun.awt.AWTAccessor; * *

      The following code snippet demonstrates how to access * and customize the system tray: - * *

      + * 
        *     {@link TrayIcon} trayIcon = null;
        *     if (SystemTray.isSupported()) {
        *         // get the SystemTray instance
      @@ -109,8 +109,8 @@ import sun.awt.AWTAccessor;
        *         trayIcon.{@link TrayIcon#setImage(java.awt.Image) setImage}(updatedImage);
        *     }
        *     // ...
      - * 
      * + * * * @since 1.6 * @see TrayIcon @@ -361,7 +361,7 @@ public class SystemTray { /** * Adds a {@code PropertyChangeListener} to the list of listeners for the * specific property. The following properties are currently supported: - *

      + *

      *

      Property
      * * @@ -384,7 +384,7 @@ public class SystemTray { * The property is accessed by the {@link #getSystemTray} method. * *
      Property
      - *

      + *

      * The {@code listener} listens to property changes only in this context. *

      * If {@code listener} is {@code null}, no exception is thrown diff --git a/jdk/src/share/classes/java/awt/TextArea.java b/jdk/src/share/classes/java/awt/TextArea.java index 8b16d9ec61d..6fc979f2835 100644 --- a/jdk/src/share/classes/java/awt/TextArea.java +++ b/jdk/src/share/classes/java/awt/TextArea.java @@ -42,7 +42,7 @@ import javax.accessibility.*; * The following image shows the appearance of a text area: *

      * A TextArea showing the word 'Hello!' + * style="float:center; margin: 7px 10px;"> *

      * This text area could be created by the following line of code: *

      diff --git a/jdk/src/share/classes/java/awt/TextComponent.java b/jdk/src/share/classes/java/awt/TextComponent.java index 483657fd4ce..4b72de8d638 100644 --- a/jdk/src/share/classes/java/awt/TextComponent.java +++ b/jdk/src/share/classes/java/awt/TextComponent.java @@ -822,37 +822,6 @@ public class TextComponent extends Component implements Accessible { // Accessibility support //////////////// - - /** - * - */ - int getIndexAtPoint(Point p) { - return -1; -/* To be fully implemented in a future release - if (peer == null) { - return -1; - } - TextComponentPeer peer = (TextComponentPeer)this.peer; - return peer.getIndexAtPoint(p.x, p.y); -*/ - } - - - /** - * - */ - Rectangle getCharacterBounds(int i) { - return null; -/* To be fully implemented in a future release - if (peer == null) { - return null; - } - TextComponentPeer peer = (TextComponentPeer)this.peer; - return peer.getCharacterBounds(i); -*/ - } - - /** * Gets the AccessibleContext associated with this TextComponent. * For text components, the AccessibleContext takes the form of an @@ -963,7 +932,7 @@ public class TextComponent extends Component implements Accessible { * @return the zero-based index of the character under Point p. */ public int getIndexAtPoint(Point p) { - return TextComponent.this.getIndexAtPoint(p); + return -1; } /** @@ -972,17 +941,17 @@ public class TextComponent extends Component implements Accessible { * coordinates. If the index is invalid a null rectangle * is returned. * - * @param i the index into the String >= 0 + * @param i the index into the String >= 0 * @return the screen coordinates of the character's bounding box */ public Rectangle getCharacterBounds(int i) { - return TextComponent.this.getCharacterBounds(i); + return null; } /** * Returns the number of characters (valid indicies) * - * @return the number of characters >= 0 + * @return the number of characters >= 0 */ public int getCharCount() { return TextComponent.this.getText().length(); @@ -1018,7 +987,7 @@ public class TextComponent extends Component implements Accessible { * Return 0 if the text is empty, or the caret position * if no selection. * - * @return the index into the text of the start of the selection >= 0 + * @return the index into the text of the start of the selection >= 0 */ public int getSelectionStart() { return TextComponent.this.getSelectionStart(); @@ -1031,7 +1000,7 @@ public class TextComponent extends Component implements Accessible { * Return 0 if the text is empty, or the caret position * if no selection. * - * @return the index into teh text of the end of the selection >= 0 + * @return the index into the text of the end of the selection >= 0 */ public int getSelectionEnd() { return TextComponent.this.getSelectionEnd(); @@ -1056,7 +1025,7 @@ public class TextComponent extends Component implements Accessible { * * @param part the AccessibleText.CHARACTER, AccessibleText.WORD, * or AccessibleText.SENTENCE to retrieve - * @param index an index within the text >= 0 + * @param index an index within the text >= 0 * @return the letter, word, or sentence, * null for an invalid index or part */ @@ -1122,7 +1091,7 @@ public class TextComponent extends Component implements Accessible { * * @param part the AccessibleText.CHARACTER, AccessibleText.WORD, * or AccessibleText.SENTENCE to retrieve - * @param index an index within the text >= 0 + * @param index an index within the text >= 0 * @return the letter, word, or sentence, null for an invalid * index or part */ @@ -1175,7 +1144,7 @@ public class TextComponent extends Component implements Accessible { * * @param part the AccessibleText.CHARACTER, AccessibleText.WORD, * or AccessibleText.SENTENCE to retrieve - * @param index an index within the text >= 0 + * @param index an index within the text >= 0 * @return the letter, word, or sentence, null for an invalid index * or part */ diff --git a/jdk/src/share/classes/java/awt/TextField.java b/jdk/src/share/classes/java/awt/TextField.java index 7c0e528f5f7..85eaba2d17b 100644 --- a/jdk/src/share/classes/java/awt/TextField.java +++ b/jdk/src/share/classes/java/awt/TextField.java @@ -42,7 +42,7 @@ import javax.accessibility.*; * display the predefined text "Hello". *

      * The preceding text describes this image. + * style="float:center; margin: 7px 10px;"> *

      * Here is the code that produces these four text fields: *

      @@ -405,7 +405,7 @@ public class TextField extends TextComponent { } /** - * Gets the minumum dimensions for a text field with + * Gets the minimum dimensions for a text field with * the specified number of columns. * @param columns the number of columns in * this text field. @@ -430,7 +430,7 @@ public class TextField extends TextComponent { } /** - * Gets the minumum dimensions for this text field. + * Gets the minimum dimensions for this text field. * @return the minimum dimensions for * displaying this text field. * @since JDK1.1 @@ -503,7 +503,7 @@ public class TextField extends TextComponent { * * @see #addActionListener * @see #removeActionListener - * @see java.awt.event#ActionListener + * @see java.awt.event.ActionListener * @since 1.4 */ public synchronized ActionListener[] getActionListeners() { diff --git a/jdk/src/share/classes/java/awt/TexturePaintContext.java b/jdk/src/share/classes/java/awt/TexturePaintContext.java index a6d2e04615d..359071e1015 100644 --- a/jdk/src/share/classes/java/awt/TexturePaintContext.java +++ b/jdk/src/share/classes/java/awt/TexturePaintContext.java @@ -73,11 +73,11 @@ abstract class TexturePaintContext implements PaintContext { WritableRaster raster = bufImg.getRaster(); ColorModel cm = bufImg.getColorModel(); int maxw = devBounds.width; - Object val = hints.get(hints.KEY_INTERPOLATION); + Object val = hints.get(RenderingHints.KEY_INTERPOLATION); boolean filter = (val == null - ? (hints.get(hints.KEY_RENDERING) == hints.VALUE_RENDER_QUALITY) - : (val != hints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR)); + ? (hints.get(RenderingHints.KEY_RENDERING) == RenderingHints.VALUE_RENDER_QUALITY) + : (val != RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR)); if (raster instanceof IntegerInterleavedRaster && (!filter || isFilterableDCM(cm))) { @@ -234,8 +234,8 @@ abstract class TexturePaintContext implements PaintContext { return outRas; } - private static WeakReference xrgbRasRef; - private static WeakReference argbRasRef; + private static WeakReference xrgbRasRef; + private static WeakReference argbRasRef; synchronized static WritableRaster makeRaster(ColorModel cm, Raster srcRas, @@ -278,13 +278,13 @@ abstract class TexturePaintContext implements PaintContext { return; } if (xrgbmodel == cm) { - xrgbRasRef = new WeakReference(outRas); + xrgbRasRef = new WeakReference<>(outRas); } else if (argbmodel == cm) { - argbRasRef = new WeakReference(outRas); + argbRasRef = new WeakReference<>(outRas); } } - private static WeakReference byteRasRef; + private static WeakReference byteRasRef; synchronized static WritableRaster makeByteRaster(Raster srcRas, int w, int h) @@ -307,7 +307,7 @@ abstract class TexturePaintContext implements PaintContext { if (outRas == null) { return; } - byteRasRef = new WeakReference(outRas); + byteRasRef = new WeakReference<>(outRas); } public abstract WritableRaster makeRaster(int w, int h); diff --git a/jdk/src/share/classes/java/awt/Toolkit.java b/jdk/src/share/classes/java/awt/Toolkit.java index 32f0adab3bc..dcc1fa15b4e 100644 --- a/jdk/src/share/classes/java/awt/Toolkit.java +++ b/jdk/src/share/classes/java/awt/Toolkit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,6 +56,7 @@ import sun.awt.HeadlessToolkit; import sun.awt.NullComponentPeer; import sun.awt.PeerEvent; import sun.awt.SunToolkit; +import sun.awt.AWTAccessor; import sun.security.util.SecurityConstants; import sun.util.CoreResourceBundleControl; @@ -82,7 +83,7 @@ import sun.util.CoreResourceBundleControl; *

      *

    • Moving the focus from one component to another. *
      For more information, see - * Timing + * Timing * Focus Transfers, a section in * The Swing * Tutorial. @@ -467,7 +468,7 @@ public abstract class Toolkit { GraphicsEnvironment.checkHeadless(); } -/** + /** * Controls whether the layout of Containers is validated dynamically * during resizing, or statically, after resizing is complete. * Use {@code isDynamicLayoutActive()} to detect if this feature enabled @@ -497,9 +498,12 @@ public abstract class Toolkit { * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.4 */ - public void setDynamicLayout(boolean dynamic) + public void setDynamicLayout(final boolean dynamic) throws HeadlessException { GraphicsEnvironment.checkHeadless(); + if (this != getDefaultToolkit()) { + getDefaultToolkit().setDynamicLayout(dynamic); + } } /** @@ -1239,7 +1243,8 @@ public abstract class Toolkit { } /** - * Emits an audio beep. + * Emits an audio beep depending on native system settings and hardware + * capabilities. * @since JDK1.1 */ public abstract void beep(); @@ -1452,7 +1457,7 @@ public abstract class Toolkit { *

      Note that multi-frame images are invalid and may cause this * method to hang. * - * @param cursor the image to display when the cursor is actived + * @param cursor the image to display when the cursor is activated * @param hotSpot the X and Y of the large cursor's hot spot; the * hotSpot values must be less than the Dimension returned by * getBestCursorSize @@ -1598,6 +1603,12 @@ public abstract class Toolkit { * here, so that only one copy is maintained. */ private static ResourceBundle resources; + private static ResourceBundle platformResources; + + // called by platform toolkit + private static void setPlatformResources(ResourceBundle bundle) { + platformResources = bundle; + } /** * Initialize JNI field and method ids @@ -1646,6 +1657,14 @@ public abstract class Toolkit { } static { + AWTAccessor.setToolkitAccessor( + new AWTAccessor.ToolkitAccessor() { + @Override + public void setPlatformResources(ResourceBundle bundle) { + Toolkit.setPlatformResources(bundle); + } + }); + java.security.AccessController.doPrivileged( new java.security.PrivilegedAction() { public Void run() { @@ -1673,6 +1692,15 @@ public abstract class Toolkit { * This method returns defaultValue if the property is not found. */ public static String getProperty(String key, String defaultValue) { + // first try platform specific bundle + if (platformResources != null) { + try { + return platformResources.getString(key); + } + catch (MissingResourceException e) {} + } + + // then shared one if (resources != null) { try { return resources.getString(key); @@ -1781,8 +1809,7 @@ public abstract class Toolkit { // This property should never be cached if (propertyName.equals("awt.dynamicLayoutSupported")) { - value = lazilyLoadDesktopProperty(propertyName); - return value; + return getDefaultToolkit().lazilyLoadDesktopProperty(propertyName); } value = desktopProperties.get(propertyName); diff --git a/jdk/src/share/classes/java/awt/WaitDispatchSupport.java b/jdk/src/share/classes/java/awt/WaitDispatchSupport.java index 1cfd24a1416..c9a671838a9 100644 --- a/jdk/src/share/classes/java/awt/WaitDispatchSupport.java +++ b/jdk/src/share/classes/java/awt/WaitDispatchSupport.java @@ -224,8 +224,8 @@ class WaitDispatchSupport implements SecondaryLoop { // starts. Thus, the enter() method will not hang. // // Event pump should be privileged. See 6300270. - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { + AccessController.doPrivileged(new PrivilegedAction() { + public Void run() { run.run(); return null; } diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java index c10a3b277a8..ceb901a3c4b 100644 --- a/jdk/src/share/classes/java/awt/Window.java +++ b/jdk/src/share/classes/java/awt/Window.java @@ -85,7 +85,7 @@ import sun.util.logging.PlatformLogger; *

      * Diagram shows virtual device containing 4 physical screens. Primary physical screen shows coords (0,0), other screen shows (-80,-100). + * style="float:center; margin: 7px 10px;"> *

      * In such an environment, when calling {@code setLocation}, * you must pass a virtual coordinate to this method. Similarly, @@ -226,6 +226,7 @@ public class Window extends Container implements Accessible { boolean syncLWRequests = false; transient boolean beforeFirstShow = true; private transient boolean disposing = false; + transient WindowDisposerRecord disposerRecord = null; static final int OPENED = 0x01; @@ -437,18 +438,28 @@ public class Window extends Container implements Accessible { transient Object anchor = new Object(); static class WindowDisposerRecord implements sun.java2d.DisposerRecord { - final WeakReference owner; + WeakReference owner; final WeakReference weakThis; final WeakReference context; + WindowDisposerRecord(AppContext context, Window victim) { - owner = new WeakReference(victim.getOwner()); weakThis = victim.weakThis; this.context = new WeakReference(context); } + + public void updateOwner() { + Window victim = weakThis.get(); + owner = (victim == null) + ? null + : new WeakReference(victim.getOwner()); + } + public void dispose() { - Window parent = owner.get(); - if (parent != null) { - parent.removeOwnedWindow(weakThis); + if (owner != null) { + Window parent = owner.get(); + if (parent != null) { + parent.removeOwnedWindow(weakThis); + } } AppContext ac = context.get(); if (null != ac) { @@ -502,6 +513,8 @@ public class Window extends Container implements Accessible { } modalExclusionType = Dialog.ModalExclusionType.NO_EXCLUDE; + disposerRecord = new WindowDisposerRecord(appContext, this); + sun.java2d.Disposer.addRecord(anchor, disposerRecord); SunToolkit.checkAndSetPolicy(this); } @@ -617,11 +630,16 @@ public class Window extends Container implements Accessible { this.parent = owner; if (owner != null) { owner.addOwnedWindow(weakThis); + if (owner.isAlwaysOnTop()) { + try { + setAlwaysOnTop(true); + } catch (SecurityException ignore) { + } + } } - // Fix for 6758673: this call is moved here from init(gc), because // WindowDisposerRecord requires a proper value of parent field. - Disposer.addRecord(anchor, new WindowDisposerRecord(appContext, this)); + disposerRecord.updateOwner(); } /** @@ -1022,7 +1040,9 @@ public class Window extends Container implements Accessible { closeSplashScreen(); Dialog.checkShouldBeBlocked(this); super.show(); - locationByPlatform = false; + synchronized (getTreeLock()) { + this.locationByPlatform = false; + } for (int i = 0; i < ownedWindowList.size(); i++) { Window child = ownedWindowList.elementAt(i).get(); if ((child != null) && child.showWithParent) { @@ -1075,7 +1095,6 @@ public class Window extends Container implements Accessible { * Hide this Window, its subcomponents, and all of its owned children. * The Window and its subcomponents can be made visible again * with a call to {@code show}. - *

      * @see #show * @see #dispose * @deprecated As of JDK version 1.5, replaced by @@ -1096,6 +1115,9 @@ public class Window extends Container implements Accessible { modalBlocker.unblockWindow(this); } super.hide(); + synchronized (getTreeLock()) { + this.locationByPlatform = false; + } } final void clearMostRecentFocusOwnerOnHide() { @@ -1634,7 +1656,7 @@ public class Window extends Container implements Accessible { * effect until it is hidden and then shown again. * * @param exclusionType the modal exclusion type for this window; a {@code null} - * value is equivivalent to {@link Dialog.ModalExclusionType#NO_EXCLUDE + * value is equivalent to {@link Dialog.ModalExclusionType#NO_EXCLUDE * NO_EXCLUDE} * @throws SecurityException if the calling thread does not have permission * to set the modal exclusion property to the window with the given @@ -2057,7 +2079,7 @@ public class Window extends Container implements Accessible { } /** - * Processes window focus event occuring on this window by + * Processes window focus event occurring on this window by * dispatching them to any registered WindowFocusListener objects. * NOTE: this method will not be called unless window focus events * are enabled for this window. This happens when one of the @@ -2092,7 +2114,7 @@ public class Window extends Container implements Accessible { } /** - * Processes window state event occuring on this window by + * Processes window state event occurring on this window by * dispatching them to any registered {@code WindowStateListener} * objects. * NOTE: this method will not be called unless window state events @@ -2169,20 +2191,18 @@ public class Window extends Container implements Accessible { * When the window is later shown, it will be always-on-top. * *

      When this method is called on a window with a value of - * {@code false} the always-on-top state is set to normal. The - * window remains in the top-most position but it`s z-order can be - * changed as for any other window. Calling this method with a value - * of {@code false} on a window that has a normal state has no - * effect. Setting the always-on-top state to false has no effect on - * the relative z-order of the windows if there are no other - * always-on-top windows. + * {@code false} the always-on-top state is set to normal. It may also + * cause an unspecified, platform-dependent change in the z-order of + * top-level windows, but other always-on-top windows will remain in + * top-most position. Calling this method with a value of {@code false} + * on a window that has a normal state has no effect. * *

      Note: some platforms might not support always-on-top * windows. To detect if always-on-top windows are supported by the * current platform, use {@link Toolkit#isAlwaysOnTopSupported()} and * {@link Window#isAlwaysOnTopSupported()}. If always-on-top mode - * isn't supported by the toolkit or for this window, calling this - * method has no effect. + * isn't supported for this window or this window's toolkit does not + * support always-on-top windows, calling this method has no effect. *

      * If a SecurityManager is installed, the calling thread must be * granted the AWTPermission "setWindowAlwaysOnTop" in @@ -2195,11 +2215,13 @@ public class Window extends Container implements Accessible { * windows * @throws SecurityException if the calling thread does not have * permission to set the value of always-on-top property + * * @see #isAlwaysOnTop * @see #toFront * @see #toBack * @see AWTPermission * @see #isAlwaysOnTopSupported + * @see #getToolkit * @see Toolkit#isAlwaysOnTopSupported * @since 1.5 */ @@ -2225,6 +2247,15 @@ public class Window extends Container implements Accessible { } firePropertyChange("alwaysOnTop", oldAlwaysOnTop, alwaysOnTop); } + for (WeakReference ref : ownedWindowList) { + Window window = ref.get(); + if (window != null) { + try { + window.setAlwaysOnTop(alwaysOnTop); + } catch (SecurityException ignore) { + } + } + } } /** @@ -2232,11 +2263,13 @@ public class Window extends Container implements Accessible { * window. Some platforms may not support always-on-top windows, some * may support only some kinds of top-level windows; for example, * a platform may not support always-on-top modal dialogs. - * @return {@code true}, if the always-on-top mode is - * supported by the toolkit and for this window, - * {@code false}, if always-on-top mode is not supported - * for this window or toolkit doesn't support always-on-top windows. + * + * @return {@code true}, if the always-on-top mode is supported for + * this window and this window's toolkit supports always-on-top windows, + * {@code false} otherwise + * * @see #setAlwaysOnTop(boolean) + * @see #getToolkit * @see Toolkit#isAlwaysOnTopSupported * @since 1.6 */ @@ -2775,6 +2808,7 @@ public class Window extends Container implements Accessible { void connectOwnedWindow(Window child) { child.parent = this; addOwnedWindow(child.weakThis); + child.disposerRecord.updateOwner(); } private void addToWindowList() { @@ -2937,15 +2971,16 @@ public class Window extends Container implements Accessible { weakThis = new WeakReference<>(this); anchor = new Object(); - sun.java2d.Disposer.addRecord(anchor, new WindowDisposerRecord(appContext, this)); + disposerRecord = new WindowDisposerRecord(appContext, this); + sun.java2d.Disposer.addRecord(anchor, disposerRecord); addToWindowList(); initGC(null); + ownedWindowList = new Vector<>(); } private void deserializeResources(ObjectInputStream s) throws ClassNotFoundException, IOException, HeadlessException { - ownedWindowList = new Vector<>(); if (windowSerializedDataVersion < 2) { // Translate old-style focus tracking to new model. For 1.4 and @@ -3373,27 +3408,27 @@ public class Window extends Container implements Accessible { * this property of the Window. *

      * For example, after the following code is executed: - *

      + *
            * setLocationByPlatform(true);
            * setVisible(true);
            * boolean flag = isLocationByPlatform();
      -     * 
      + * * The window will be shown at platform's default location and * {@code flag} will be {@code false}. *

      * In the following sample: - *

      + *
            * setLocationByPlatform(true);
            * setLocation(10, 10);
            * boolean flag = isLocationByPlatform();
            * setVisible(true);
      -     * 
      + * * The window will be shown at (10, 10) and {@code flag} will be * {@code false}. * * @param locationByPlatform {@code true} if this Window should appear * at the default location, {@code false} if at the current location - * @throws {@code IllegalComponentStateException} if the window + * @throws IllegalComponentStateException if the window * is showing on screen and locationByPlatform is {@code true}. * @see #setLocation * @see #isShowing @@ -3641,7 +3676,7 @@ public class Window extends Container implements Accessible { * and either the {@code UnsupportedOperationException} or {@code * IllegalComponentStateException} will be thrown. *

      - * The tranlucency levels of individual pixels may also be effected by the + * The translucency levels of individual pixels may also be effected by the * alpha component of their color (see {@link Window#setBackground(Color)}) and the * opacity value (see {@link #setOpacity(float)}). See {@link * GraphicsDevice.WindowTranslucency} for more details. @@ -3712,7 +3747,7 @@ public class Window extends Container implements Accessible { *

      * If the windowing system supports the {@link * GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT PERPIXEL_TRANSLUCENT} - * tranclucency, the alpha component of the given background color + * translucency, the alpha component of the given background color * may effect the mode of operation for this window: it indicates whether * this window must be opaque (alpha equals {@code 1.0f}) or per-pixel translucent * (alpha is less than {@code 1.0f}). If the given background color is diff --git a/jdk/src/share/classes/java/awt/color/package.html b/jdk/src/share/classes/java/awt/color/package.html index 8b82f8e59eb..13ab17419a3 100644 --- a/jdk/src/share/classes/java/awt/color/package.html +++ b/jdk/src/share/classes/java/awt/color/package.html @@ -25,6 +25,7 @@ + Provides classes for color spaces. It contains an diff --git a/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java b/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java index acbc0fe659d..90789edc97c 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java +++ b/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java @@ -30,6 +30,9 @@ import java.nio.*; import java.util.*; import sun.awt.datatransfer.DataTransferer; +import sun.reflect.misc.ReflectUtil; + +import static sun.security.util.SecurityConstants.GET_CLASSLOADER_PERMISSION; /** * A {@code DataFlavor} provides meta information about data. {@code DataFlavor} @@ -90,7 +93,7 @@ import sun.awt.datatransfer.DataTransferer; * the same results. *

      * For more information on the using data transfer with Swing see - * the + * the * How to Use Drag and Drop and Data Transfer, * section in Java Tutorial. * @@ -101,7 +104,7 @@ import sun.awt.datatransfer.DataTransferer; public class DataFlavor implements Externalizable, Cloneable { private static final long serialVersionUID = 8367026044764648243L; - private static final Class ioInputStreamClass = java.io.InputStream.class; + private static final Class ioInputStreamClass = InputStream.class; /** * Tries to load a class from: the bootstrap loader, the system loader, @@ -116,33 +119,39 @@ public class DataFlavor implements Externalizable, Cloneable { ClassLoader fallback) throws ClassNotFoundException { - ClassLoader systemClassLoader = (ClassLoader) - java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { - ClassLoader cl = Thread.currentThread(). - getContextClassLoader(); - return (cl != null) - ? cl - : ClassLoader.getSystemClassLoader(); - } - }); - + ReflectUtil.checkPackageAccess(className); try { - return Class.forName(className, true, systemClassLoader); - } catch (ClassNotFoundException e2) { - if (fallback != null) { - return Class.forName(className, true, fallback); - } else { - throw new ClassNotFoundException(className); + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(GET_CLASSLOADER_PERMISSION); } + ClassLoader loader = ClassLoader.getSystemClassLoader(); + try { + // bootstrap class loader and system class loader if present + return Class.forName(className, true, loader); + } + catch (ClassNotFoundException exception) { + // thread context class loader if and only if present + loader = Thread.currentThread().getContextClassLoader(); + if (loader != null) { + try { + return Class.forName(className, true, loader); + } + catch (ClassNotFoundException e) { + // fallback to user's class loader + } + } + } + } catch (SecurityException exception) { + // ignore secured class loaders } + return Class.forName(className, true, fallback); } /* * private initializer */ - static private DataFlavor createConstant(Class rc, String prn) { + static private DataFlavor createConstant(Class rc, String prn) { try { return new DataFlavor(rc, prn); } catch (Exception e) { @@ -314,7 +323,7 @@ public class DataFlavor implements Externalizable, Cloneable { * @exception NullPointerException if either primaryType, * subType or representationClass is null */ - private DataFlavor(String primaryType, String subType, MimeTypeParameterList params, Class representationClass, String humanPresentableName) { + private DataFlavor(String primaryType, String subType, MimeTypeParameterList params, Class representationClass, String humanPresentableName) { super(); if (primaryType == null) { throw new NullPointerException("primaryType"); @@ -331,7 +340,7 @@ public class DataFlavor implements Externalizable, Cloneable { params.set("class", representationClass.getName()); if (humanPresentableName == null) { - humanPresentableName = (String)params.get("humanPresentableName"); + humanPresentableName = params.get("humanPresentableName"); if (humanPresentableName == null) humanPresentableName = primaryType + "/" + subType; @@ -454,7 +463,7 @@ public class DataFlavor implements Externalizable, Cloneable { /** * Constructs a DataFlavor from a mimeType string. - * The string can specify a "class=" + * The string can specify a "class=<fully specified Java class name>" * parameter to create a DataFlavor with the desired * representation class. If the string does not contain "class=" parameter, * java.io.InputStream is used as default. @@ -732,7 +741,7 @@ public class DataFlavor implements Externalizable, Cloneable { return bestFlavor; } - private static Comparator textFlavorComparator; + private static Comparator textFlavorComparator; static class TextFlavorComparator extends DataTransferer.DataFlavorComparator { @@ -1438,6 +1447,6 @@ public class DataFlavor implements Externalizable, Cloneable { /** Java class of objects this DataFlavor represents **/ - private Class representationClass; + private Class representationClass; } // class DataFlavor diff --git a/jdk/src/share/classes/java/awt/datatransfer/FlavorMap.java b/jdk/src/share/classes/java/awt/datatransfer/FlavorMap.java index e5041073401..6bfbd510fce 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/FlavorMap.java +++ b/jdk/src/share/classes/java/awt/datatransfer/FlavorMap.java @@ -30,7 +30,7 @@ import java.util.Map; /** * A two-way Map between "natives" (Strings), which correspond to platform- - * specfic data formats, and "flavors" (DataFlavors), which corerspond to + * specific data formats, and "flavors" (DataFlavors), which correspond to * platform-independent MIME types. FlavorMaps need not be symmetric, but * typically are. * diff --git a/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java b/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java index 80947d9ea6f..2ef30747632 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java +++ b/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java @@ -33,7 +33,7 @@ import java.util.Set; /** - * An object that encapsualtes the parameter list of a MimeType + * An object that encapsulates the parameter list of a MimeType * as defined in RFC 2045 and 2046. * * @author jeff.dunn@eng.sun.com @@ -44,13 +44,13 @@ class MimeTypeParameterList implements Cloneable { * Default constructor. */ public MimeTypeParameterList() { - parameters = new Hashtable(); + parameters = new Hashtable<>(); } public MimeTypeParameterList(String rawdata) throws MimeTypeParseException { - parameters = new Hashtable(); + parameters = new Hashtable<>(); // now parse rawdata parse(rawdata); @@ -59,10 +59,10 @@ class MimeTypeParameterList implements Cloneable { public int hashCode() { int code = Integer.MAX_VALUE/45; // "random" value for empty lists String paramName = null; - Enumeration enum_ = this.getNames(); + Enumeration enum_ = this.getNames(); while (enum_.hasMoreElements()) { - paramName = (String)enum_.nextElement(); + paramName = enum_.nextElement(); code += paramName.hashCode(); code += this.get(paramName).hashCode(); } @@ -87,14 +87,14 @@ class MimeTypeParameterList implements Cloneable { String name = null; String thisValue = null; String thatValue = null; - Set entries = parameters.entrySet(); - Iterator iterator = entries.iterator(); - Map.Entry entry = null; + Set> entries = parameters.entrySet(); + Iterator> iterator = entries.iterator(); + Map.Entry entry = null; while (iterator.hasNext()) { - entry = (Map.Entry)iterator.next(); - name = (String)entry.getKey(); - thisValue = (String)entry.getValue(); - thatValue = (String)that.parameters.get(name); + entry = iterator.next(); + name = entry.getKey(); + thisValue = entry.getValue(); + thatValue = that.parameters.get(name); if ((thisValue == null) || (thatValue == null)) { // both null -> equal, only one null -> not equal if (thisValue != thatValue) { @@ -250,7 +250,7 @@ class MimeTypeParameterList implements Cloneable { * is no current association. */ public String get(String name) { - return (String)parameters.get(name.trim().toLowerCase()); + return parameters.get(name.trim().toLowerCase()); } /** @@ -271,7 +271,7 @@ class MimeTypeParameterList implements Cloneable { /** * Retrieve an enumeration of all the names in this list. */ - public Enumeration getNames() { + public Enumeration getNames() { return parameters.keys(); } @@ -279,15 +279,15 @@ class MimeTypeParameterList implements Cloneable { // Heuristic: 8 characters per field StringBuilder buffer = new StringBuilder(parameters.size() * 16); - Enumeration keys = parameters.keys(); + Enumeration keys = parameters.keys(); while(keys.hasMoreElements()) { buffer.append("; "); - String key = (String)keys.nextElement(); + String key = keys.nextElement(); buffer.append(key); buffer.append('='); - buffer.append(quote((String)parameters.get(key))); + buffer.append(quote(parameters.get(key))); } return buffer.toString(); @@ -307,7 +307,7 @@ class MimeTypeParameterList implements Cloneable { return newObj; } - private Hashtable parameters; + private Hashtable parameters; // below here be scary parsing related things diff --git a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java index fe69767dd33..1258881c1e8 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java +++ b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java @@ -70,7 +70,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { /** * System singleton which maps a thread's ClassLoader to a SystemFlavorMap. */ - private static final WeakHashMap flavorMaps = new WeakHashMap(); + private static final WeakHashMap flavorMaps = new WeakHashMap<>(); /** * Copied from java.util.Properties. @@ -139,7 +139,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * native Strings. * Do not use the field directly, use getFlavorToNative() instead. */ - private final Map flavorToNative = new HashMap(); + private final Map> flavorToNative = new HashMap<>(); /** * Accessor to flavorToNative map. Since we use lazy initialization we must @@ -148,7 +148,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * * @return flavorToNative */ - private synchronized Map getFlavorToNative() { + private synchronized Map> getFlavorToNative() { if (!isMapInitialized) { initSystemFlavorMap(); } @@ -164,13 +164,13 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * Caches the result of getNativesForFlavor(). Maps DataFlavors to * SoftReferences which reference Lists of String natives. */ - private Map getNativesForFlavorCache = new HashMap(); + private Map>> getNativesForFlavorCache = new HashMap<>(); /** * Caches the result getFlavorsForNative(). Maps String natives to * SoftReferences which reference Lists of DataFlavors. */ - private Map getFlavorsForNativeCache = new HashMap(); + private Map>> getFlavorsForNativeCache = new HashMap<>(); /** * Dynamic mapping generation used for text mappings should not be applied @@ -193,7 +193,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { FlavorMap fm; synchronized(flavorMaps) { - fm = (FlavorMap)flavorMaps.get(contextClassLoader); + fm = flavorMaps.get(contextClassLoader); if (fm == null) { fm = new SystemFlavorMap(); flavorMaps.put(contextClassLoader, fm); @@ -520,10 +520,10 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * the appropriate Map location, but rather will be appended to a List * stored in that location. */ - private void store(Object hashed, Object listed, Map map) { - List list = (List)map.get(hashed); + private void store(H hashed, L listed, Map> map) { + List list = map.get(hashed); if (list == null) { - list = new ArrayList(1); + list = new ArrayList<>(1); map.put(hashed, list); } if (!list.contains(listed)) { @@ -537,17 +537,17 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * case, a new DataFlavor is synthesized, stored, and returned, if and * only if the specified native is encoded as a Java MIME type. */ - private List nativeToFlavorLookup(String nat) { + private List nativeToFlavorLookup(String nat) { List flavors = getNativeToFlavor().get(nat); if (nat != null && !disabledMappingGenerationKeys.contains(nat)) { DataTransferer transferer = DataTransferer.getInstance(); if (transferer != null) { - List platformFlavors = + List platformFlavors = transferer.getPlatformMappingsForNative(nat); if (!platformFlavors.isEmpty()) { if (flavors != null) { - platformFlavors.removeAll(new HashSet(flavors)); + platformFlavors.removeAll(new HashSet<>(flavors)); // Prepending the platform-specific mappings ensures // that the flavors added with // addFlavorForUnencodedNative() are at the end of @@ -573,15 +573,15 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { } if (flavor != null) { - flavors = new ArrayList(1); + flavors = new ArrayList<>(1); getNativeToFlavor().put(nat, flavors); flavors.add(flavor); getFlavorsForNativeCache.remove(nat); getFlavorsForNativeCache.remove(null); - List natives = (List)getFlavorToNative().get(flavor); + List natives = getFlavorToNative().get(flavor); if (natives == null) { - natives = new ArrayList(1); + natives = new ArrayList<>(1); getFlavorToNative().put(flavor, natives); } natives.add(nat); @@ -590,7 +590,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { } } - return (flavors != null) ? flavors : new ArrayList(0); + return (flavors != null) ? flavors : new ArrayList<>(0); } /** @@ -601,18 +601,18 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * encoding the DataFlavor's MIME type. Otherwise an empty List is returned * and 'flavorToNative' remains unaffected. */ - private List flavorToNativeLookup(final DataFlavor flav, - final boolean synthesize) { - List natives = (List)getFlavorToNative().get(flav); + private List flavorToNativeLookup(final DataFlavor flav, + final boolean synthesize) { + List natives = getFlavorToNative().get(flav); if (flav != null && !disabledMappingGenerationKeys.contains(flav)) { DataTransferer transferer = DataTransferer.getInstance(); if (transferer != null) { - List platformNatives = + List platformNatives = transferer.getPlatformMappingsForFlavor(flav); if (!platformNatives.isEmpty()) { if (natives != null) { - platformNatives.removeAll(new HashSet(natives)); + platformNatives.removeAll(new HashSet<>(natives)); // Prepend the platform-specific mappings to ensure // that the natives added with // addUnencodedNativeForFlavor() are at the end of @@ -627,7 +627,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { if (natives == null) { if (synthesize) { String encoded = encodeDataFlavor(flav); - natives = new ArrayList(1); + natives = new ArrayList<>(1); getFlavorToNative().put(flav, natives); natives.add(encoded); getNativesForFlavorCache.remove(flav); @@ -635,14 +635,14 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { List flavors = getNativeToFlavor().get(encoded); if (flavors == null) { - flavors = new ArrayList(1); + flavors = new ArrayList<>(1); getNativeToFlavor().put(encoded, flavors); } flavors.add(flav); getFlavorsForNativeCache.remove(encoded); getFlavorsForNativeCache.remove(null); } else { - natives = new ArrayList(0); + natives = new ArrayList<>(0); } } @@ -675,21 +675,21 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { * @since 1.4 */ public synchronized List getNativesForFlavor(DataFlavor flav) { - List retval = null; + List retval = null; // Check cache, even for null flav - SoftReference ref = (SoftReference)getNativesForFlavorCache.get(flav); + SoftReference> ref = getNativesForFlavorCache.get(flav); if (ref != null) { - retval = (List)ref.get(); + retval = ref.get(); if (retval != null) { // Create a copy, because client code can modify the returned // list. - return new ArrayList(retval); + return new ArrayList<>(retval); } } if (flav == null) { - retval = new ArrayList(getNativeToFlavor().keySet()); + retval = new ArrayList<>(getNativeToFlavor().keySet()); } else if (disabledMappingGenerationKeys.contains(flav)) { // In this case we shouldn't synthesize a native for this flavor, // since its mappings were explicitly specified. @@ -699,7 +699,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { // For text/* flavors, flavor-to-native mappings specified in // flavormap.properties are stored per flavor's base type. if ("text".equals(flav.getPrimaryType())) { - retval = (List)getFlavorToNative().get(flav.mimeType.getBaseType()); + retval = getAllNativesForType(flav.mimeType.getBaseType()); if (retval != null) { // To prevent the List stored in the map from modification. retval = new ArrayList(retval); @@ -707,15 +707,15 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { } // Also include text/plain natives, but don't duplicate Strings - List textPlainList = (List)getFlavorToNative().get(TEXT_PLAIN_BASE_TYPE); + List textPlainList = getAllNativesForType(TEXT_PLAIN_BASE_TYPE); if (textPlainList != null && !textPlainList.isEmpty()) { // To prevent the List stored in the map from modification. // This also guarantees that removeAll() is supported. - textPlainList = new ArrayList(textPlainList); + textPlainList = new ArrayList<>(textPlainList); if (retval != null && !retval.isEmpty()) { // Use HashSet to get constant-time performance for search. - textPlainList.removeAll(new HashSet(retval)); + textPlainList.removeAll(new HashSet<>(retval)); retval.addAll(textPlainList); } else { retval = textPlainList; @@ -728,7 +728,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { // In this branch it is guaranteed that natives explicitly // listed for flav's MIME type were added with // addUnencodedNativeForFlavor(), so they have lower priority. - List explicitList = + List explicitList = flavorToNativeLookup(flav, !SYNTHESIZE_IF_NOT_FOUND); // flavorToNativeLookup() never returns null. @@ -736,14 +736,14 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { if (!explicitList.isEmpty()) { // To prevent the List stored in the map from modification. // This also guarantees that removeAll() is supported. - explicitList = new ArrayList(explicitList); + explicitList = new ArrayList<>(explicitList); // Use HashSet to get constant-time performance for search. - explicitList.removeAll(new HashSet(retval)); + explicitList.removeAll(new HashSet<>(retval)); retval.addAll(explicitList); } } } else if (DataTransferer.isFlavorNoncharsetTextType(flav)) { - retval = (List)getFlavorToNative().get(flav.mimeType.getBaseType()); + retval = getAllNativesForType(flav.mimeType.getBaseType()); if (retval == null || retval.isEmpty()) { retval = flavorToNativeLookup(flav, SYNTHESIZE_IF_NOT_FOUND); @@ -751,7 +751,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { // In this branch it is guaranteed that natives explicitly // listed for flav's MIME type were added with // addUnencodedNativeForFlavor(), so they have lower priority. - List explicitList = + List explicitList = flavorToNativeLookup(flav, !SYNTHESIZE_IF_NOT_FOUND); // flavorToNativeLookup() never returns null. @@ -759,10 +759,10 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { if (!explicitList.isEmpty()) { // To prevent the List stored in the map from modification. // This also guarantees that add/removeAll() are supported. - retval = new ArrayList(retval); - explicitList = new ArrayList(explicitList); + retval = new ArrayList<>(retval); + explicitList = new ArrayList<>(explicitList); // Use HashSet to get constant-time performance for search. - explicitList.removeAll(new HashSet(retval)); + explicitList.removeAll(new HashSet<>(retval)); retval.addAll(explicitList); } } @@ -770,9 +770,9 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { retval = flavorToNativeLookup(flav, SYNTHESIZE_IF_NOT_FOUND); } - getNativesForFlavorCache.put(flav, new SoftReference(retval)); + getNativesForFlavorCache.put(flav, new SoftReference<>(retval)); // Create a copy, because client code can modify the returned list. - return new ArrayList(retval); + return new ArrayList<>(retval); } /** @@ -809,11 +809,11 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { public synchronized List getFlavorsForNative(String nat) { // Check cache, even for null nat - SoftReference ref = (SoftReference)getFlavorsForNativeCache.get(nat); + SoftReference> ref = getFlavorsForNativeCache.get(nat); if (ref != null) { - ArrayList retval = (ArrayList)ref.get(); + List retval = ref.get(); if (retval != null) { - return (List)retval.clone(); + return new ArrayList<>(retval); } } @@ -859,16 +859,15 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { } - final ArrayList arrayList = new ArrayList(returnValue); - getFlavorsForNativeCache.put(nat, new SoftReference(arrayList)); - return (List)arrayList.clone(); + final List arrayList = new ArrayList<>(returnValue); + getFlavorsForNativeCache.put(nat, new SoftReference<>(arrayList)); + return new ArrayList<>(arrayList); } - private static LinkedHashSet convertMimeTypeToDataFlavors( + private static Set convertMimeTypeToDataFlavors( final String baseType) { - final LinkedHashSet returnValue = - new LinkedHashSet(); + final Set returnValue = new LinkedHashSet<>(); String subType = null; @@ -1009,11 +1008,11 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { flavor_list.toArray(flavors); } - HashMap retval = new HashMap(flavors.length, 1.0f); - for (int i = 0; i < flavors.length; i++) { - List natives = getNativesForFlavor(flavors[i]); - String nat = (natives.isEmpty()) ? null : (String)natives.get(0); - retval.put(flavors[i], nat); + Map retval = new HashMap<>(flavors.length, 1.0f); + for (DataFlavor flavor : flavors) { + List natives = getNativesForFlavor(flavor); + String nat = (natives.isEmpty()) ? null : natives.get(0); + retval.put(flavor, nat); } return retval; @@ -1054,12 +1053,11 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { native_list.toArray(natives); } - HashMap retval = new HashMap(natives.length, 1.0f); - for (int i = 0; i < natives.length; i++) { - List flavors = getFlavorsForNative(natives[i]); - DataFlavor flav = (flavors.isEmpty()) - ? null : (DataFlavor)flavors.get(0); - retval.put(natives[i], flav); + Map retval = new HashMap<>(natives.length, 1.0f); + for (String aNative : natives) { + List flavors = getFlavorsForNative(aNative); + DataFlavor flav = (flavors.isEmpty())? null : flavors.get(0); + retval.put(aNative, flav); } return retval; @@ -1091,9 +1089,9 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { throw new NullPointerException("null arguments not permitted"); } - List natives = (List)getFlavorToNative().get(flav); + List natives = getFlavorToNative().get(flav); if (natives == null) { - natives = new ArrayList(1); + natives = new ArrayList<>(1); getFlavorToNative().put(flav, natives); } else if (natives.contains(nat)) { return; @@ -1138,8 +1136,8 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { } getFlavorToNative().remove(flav); - for (int i = 0; i < natives.length; i++) { - addUnencodedNativeForFlavor(flav, natives[i]); + for (String aNative : natives) { + addUnencodedNativeForFlavor(flav, aNative); } disabledMappingGenerationKeys.add(flav); // Clear the cache to handle the case of empty natives. @@ -1171,9 +1169,9 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { throw new NullPointerException("null arguments not permitted"); } - List flavors = (List)getNativeToFlavor().get(nat); + List flavors = getNativeToFlavor().get(nat); if (flavors == null) { - flavors = new ArrayList(1); + flavors = new ArrayList<>(1); getNativeToFlavor().put(nat, flavors); } else if (flavors.contains(flav)) { return; @@ -1217,8 +1215,8 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { } getNativeToFlavor().remove(nat); - for (int i = 0; i < flavors.length; i++) { - addFlavorForUnencodedNative(nat, flavors[i]); + for (DataFlavor flavor : flavors) { + addFlavorForUnencodedNative(nat, flavor); } disabledMappingGenerationKeys.add(nat); // Clear the cache to handle the case of empty flavors. @@ -1321,4 +1319,18 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { ? new DataFlavor(retval_str) : null; } + + private List getAllNativesForType(String type) { + List retval = null; + for (DataFlavor dataFlavor : convertMimeTypeToDataFlavors(type)) { + List natives = getFlavorToNative().get(dataFlavor); + if (natives != null && !natives.isEmpty()) { + if (retval == null) { + retval = new ArrayList<>(); + } + retval.addAll(natives); + } + } + return retval; + } } diff --git a/jdk/src/share/classes/java/awt/datatransfer/Transferable.java b/jdk/src/share/classes/java/awt/datatransfer/Transferable.java index 56377da82a9..3c5219ddb1d 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/Transferable.java +++ b/jdk/src/share/classes/java/awt/datatransfer/Transferable.java @@ -32,7 +32,7 @@ import java.io.IOException; * for a transfer operation. *

      * For information on using data transfer with Swing, see - * + * * How to Use Drag and Drop and Data Transfer, * a section in The Java Tutorial, for more information. * diff --git a/jdk/src/share/classes/java/awt/datatransfer/package.html b/jdk/src/share/classes/java/awt/datatransfer/package.html index a16e0090889..f33946cac58 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/package.html +++ b/jdk/src/share/classes/java/awt/datatransfer/package.html @@ -25,6 +25,7 @@ + Provides interfaces and classes for transferring data diff --git a/jdk/src/share/classes/java/awt/dnd/DragGestureListener.java b/jdk/src/share/classes/java/awt/dnd/DragGestureListener.java index 76b719bf70b..5da844c80b4 100644 --- a/jdk/src/share/classes/java/awt/dnd/DragGestureListener.java +++ b/jdk/src/share/classes/java/awt/dnd/DragGestureListener.java @@ -50,8 +50,8 @@ import java.util.EventListener; /** * This method is invoked by the {@code DragGestureRecognizer} * when the {@code DragGestureRecognizer} detects a platform-dependent - * drag initiating gesture. To intiate the drag and drop operation, - * if approtiate, {@link DragGestureEvent#startDrag startDrag()} method on + * drag initiating gesture. To initiate the drag and drop operation, + * if appropriate, {@link DragGestureEvent#startDrag startDrag()} method on * the {@code DragGestureEvent} has to be invoked. *

      * @see java.awt.dnd.DragGestureRecognizer diff --git a/jdk/src/share/classes/java/awt/dnd/DragGestureRecognizer.java b/jdk/src/share/classes/java/awt/dnd/DragGestureRecognizer.java index 1f1b9a3f488..331f085a3d3 100644 --- a/jdk/src/share/classes/java/awt/dnd/DragGestureRecognizer.java +++ b/jdk/src/share/classes/java/awt/dnd/DragGestureRecognizer.java @@ -46,7 +46,7 @@ import java.io.Serializable; *

      * The appropriate DragGestureRecognizer * subclass instance is obtained from the - * {@link DragSource} asssociated with + * {@link DragSource} associated with * a particular Component, or from the Toolkit object via its * {@link java.awt.Toolkit#createDragGestureRecognizer createDragGestureRecognizer()} * method. @@ -114,7 +114,7 @@ public abstract class DragGestureRecognizer implements Serializable { * @param dgl the DragGestureRecognizer * to notify when a drag gesture is detected *

      - * @throws IllegalArgumentException + * @throws IllegalArgumentException * if ds is null. */ @@ -157,7 +157,7 @@ public abstract class DragGestureRecognizer implements Serializable { * @param sa the set (logical OR) of the DnDConstants * that this Drag and Drop operation will support *

      - * @throws IllegalArgumentException + * @throws IllegalArgumentException * if ds is null. */ @@ -185,7 +185,7 @@ public abstract class DragGestureRecognizer implements Serializable { * the DragGestureRecognizer * is not associated with any Component. *

      - * @throws IllegalArgumentException + * @throws IllegalArgumentException * if ds is null. */ @@ -202,7 +202,7 @@ public abstract class DragGestureRecognizer implements Serializable { * DragGestureRecognizer will * use to process the Drag and Drop operation *

      - * @throws IllegalArgumentException + * @throws IllegalArgumentException * if ds is null. */ @@ -332,7 +332,7 @@ public abstract class DragGestureRecognizer implements Serializable { * @param dgl the DragGestureListener to unregister * from this DragGestureRecognizer *

      - * @throws IllegalArgumentException if + * @throws IllegalArgumentException if * dgl is not (equal to) the currently registered DragGestureListener. */ diff --git a/jdk/src/share/classes/java/awt/dnd/DragSource.java b/jdk/src/share/classes/java/awt/dnd/DragSource.java index bceedda646b..d44733b71d8 100644 --- a/jdk/src/share/classes/java/awt/dnd/DragSource.java +++ b/jdk/src/share/classes/java/awt/dnd/DragSource.java @@ -676,7 +676,7 @@ public class DragSource implements Serializable { * FooListeners on this * DragSource, or an empty array if no such listeners * have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if listenerType * doesn't specify a class or interface that implements * java.util.EventListener * diff --git a/jdk/src/share/classes/java/awt/dnd/DragSourceContext.java b/jdk/src/share/classes/java/awt/dnd/DragSourceContext.java index 77fc0e49c43..dd2a4150a85 100644 --- a/jdk/src/share/classes/java/awt/dnd/DragSourceContext.java +++ b/jdk/src/share/classes/java/awt/dnd/DragSourceContext.java @@ -63,7 +63,7 @@ import java.util.TooManyListenersException; * itself between the platform and the * listeners provided by the initiator of the drag operation. *

      - * + * * By default, {@code DragSourceContext} sets the cursor as appropriate * for the current state of the drag and drop operation. For example, if * the user has chosen {@linkplain DnDConstants#ACTION_MOVE the move action}, @@ -474,7 +474,7 @@ public class DragSourceContext protected synchronized void updateCurrentCursor(int sourceAct, int targetAct, int status) { - // if the cursor has been previously set then dont do any defaults + // if the cursor has been previously set then don't do any defaults // processing. if (useCustomCursor) { diff --git a/jdk/src/share/classes/java/awt/dnd/DragSourceDragEvent.java b/jdk/src/share/classes/java/awt/dnd/DragSourceDragEvent.java index 4ca92d86c07..315fa3c680d 100644 --- a/jdk/src/share/classes/java/awt/dnd/DragSourceDragEvent.java +++ b/jdk/src/share/classes/java/awt/dnd/DragSourceDragEvent.java @@ -47,9 +47,9 @@ import java.awt.event.InputEvent; * source and the drop action selected by the user. The user can select a drop * action by pressing modifier keys during the drag operation: *

      - *   Ctrl + Shift -> ACTION_LINK
      - *   Ctrl         -> ACTION_COPY
      - *   Shift        -> ACTION_MOVE
      + *   Ctrl + Shift -> ACTION_LINK
      + *   Ctrl         -> ACTION_COPY
      + *   Shift        -> ACTION_MOVE
        * 
      * If the user selects a drop action, the user drop action is one of * DnDConstants that represents the selected drop action if this @@ -103,7 +103,7 @@ public class DragSourceDragEvent extends DragSourceEvent { * in one event. Use of the extended modifiers is * preferred. * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if dsc is null. * * @see java.awt.event.InputEvent * @see DragSourceEvent#getLocation @@ -154,7 +154,7 @@ public class DragSourceDragEvent extends DragSourceEvent { * @param x the horizontal coordinate for the cursor location * @param y the vertical coordinate for the cursor location * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if dsc is null. * * @see java.awt.event.InputEvent * @since 1.4 diff --git a/jdk/src/share/classes/java/awt/dnd/DragSourceDropEvent.java b/jdk/src/share/classes/java/awt/dnd/DragSourceDropEvent.java index 25a7051f0a2..e1116bc68d5 100644 --- a/jdk/src/share/classes/java/awt/dnd/DragSourceDropEvent.java +++ b/jdk/src/share/classes/java/awt/dnd/DragSourceDropEvent.java @@ -63,7 +63,7 @@ public class DragSourceDropEvent extends DragSourceEvent { * @param action the drop action * @param success a boolean indicating if the drop was successful * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if dsc is null. * * @see DragSourceEvent#getLocation */ @@ -91,7 +91,7 @@ public class DragSourceDropEvent extends DragSourceEvent { * @param x the horizontal coordinate for the cursor location * @param y the vertical coordinate for the cursor location * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if dsc is null. * * @since 1.4 */ @@ -112,7 +112,7 @@ public class DragSourceDropEvent extends DragSourceEvent { * * @param dsc the DragSourceContext * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if dsc is null. * * @see DragSourceEvent#getLocation */ diff --git a/jdk/src/share/classes/java/awt/dnd/DragSourceEvent.java b/jdk/src/share/classes/java/awt/dnd/DragSourceEvent.java index f2616b06a3a..05e29f53a45 100644 --- a/jdk/src/share/classes/java/awt/dnd/DragSourceEvent.java +++ b/jdk/src/share/classes/java/awt/dnd/DragSourceEvent.java @@ -38,7 +38,7 @@ import java.util.EventObject; * over, or exits a drop site, when the drop action changes, and when the drag * ends. The location for the generated DragSourceEvent specifies * the mouse cursor location in screen coordinates at the moment this event - * occured. + * occurred. *

      * In a multi-screen environment without a virtual device, the cursor location is * specified in the coordinate system of the initiator @@ -71,7 +71,7 @@ public class DragSourceEvent extends EventObject { /** * The horizontal coordinate for the cursor location at the moment this - * event occured if the cursor location is specified for this event; + * event occurred if the cursor location is specified for this event; * otherwise zero. * * @serial @@ -80,7 +80,7 @@ public class DragSourceEvent extends EventObject { /** * The vertical coordinate for the cursor location at the moment this event - * occured if the cursor location is specified for this event; + * occurred if the cursor location is specified for this event; * otherwise zero. * * @serial @@ -96,7 +96,7 @@ public class DragSourceEvent extends EventObject { * * @param dsc the DragSourceContext * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if dsc is null. * * @see #getLocation */ @@ -117,7 +117,7 @@ public class DragSourceEvent extends EventObject { * @param x the horizontal coordinate for the cursor location * @param y the vertical coordinate for the cursor location * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if dsc is null. * * @since 1.4 */ @@ -141,7 +141,7 @@ public class DragSourceEvent extends EventObject { /** * This method returns a Point indicating the cursor - * location in screen coordinates at the moment this event occured, or + * location in screen coordinates at the moment this event occurred, or * null if the cursor location is not specified for this * event. * @@ -159,7 +159,7 @@ public class DragSourceEvent extends EventObject { /** * This method returns the horizontal coordinate of the cursor location in - * screen coordinates at the moment this event occured, or zero if the + * screen coordinates at the moment this event occurred, or zero if the * cursor location is not specified for this event. * * @return an integer indicating the horizontal coordinate of the cursor @@ -172,7 +172,7 @@ public class DragSourceEvent extends EventObject { /** * This method returns the vertical coordinate of the cursor location in - * screen coordinates at the moment this event occured, or zero if the + * screen coordinates at the moment this event occurred, or zero if the * cursor location is not specified for this event. * * @return an integer indicating the vertical coordinate of the cursor diff --git a/jdk/src/share/classes/java/awt/dnd/DropTarget.java b/jdk/src/share/classes/java/awt/dnd/DropTarget.java index b167b8e63d8..0480ba5f67e 100644 --- a/jdk/src/share/classes/java/awt/dnd/DropTarget.java +++ b/jdk/src/share/classes/java/awt/dnd/DropTarget.java @@ -305,7 +305,7 @@ public class DropTarget implements DropTargetListener, Serializable { *

      * @param dtl The new DropTargetListener *

      - * @throws TooManyListenersException if a + * @throws TooManyListenersException if a * DropTargetListener is already added to this * DropTarget. */ @@ -351,6 +351,8 @@ public class DropTarget implements DropTargetListener, Serializable { * @see #isActive */ public synchronized void dragEnter(DropTargetDragEvent dtde) { + isDraggingInside = true; + if (!active) return; if (dtListener != null) { @@ -421,6 +423,8 @@ public class DropTarget implements DropTargetListener, Serializable { * @see #isActive */ public synchronized void dragExit(DropTargetEvent dte) { + isDraggingInside = false; + if (!active) return; if (dtListener != null && active) dtListener.dragExit(dte); @@ -444,6 +448,8 @@ public class DropTarget implements DropTargetListener, Serializable { * @see #isActive */ public synchronized void drop(DropTargetDropEvent dtde) { + isDraggingInside = false; + clearAutoscroll(); if (dtListener != null && active) @@ -533,6 +539,12 @@ public class DropTarget implements DropTargetListener, Serializable { ((DropTargetPeer)nativePeer).removeDropTarget(this); componentPeer = nativePeer = null; + + synchronized (this) { + if (isDraggingInside) { + dragExit(new DropTargetEvent(getDropTargetContext())); + } + } } /** @@ -600,7 +612,7 @@ public class DropTarget implements DropTargetListener, Serializable { dropTargetContext = (DropTargetContext)f.get("dropTargetContext", null); } catch (IllegalArgumentException e) { - // Pre-1.4 support. 'dropTargetContext' was previoulsy transient + // Pre-1.4 support. 'dropTargetContext' was previously transient } if (dropTargetContext == null) { dropTargetContext = createDropTargetContext(); @@ -777,7 +789,7 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * update autoscrolling with current cursor locn + * update autoscrolling with current cursor location *

      * @param dragCursorLocn the Point */ @@ -832,7 +844,7 @@ public class DropTarget implements DropTargetListener, Serializable { int actions = DnDConstants.ACTION_COPY_OR_MOVE; /** - * true if the DropTarget is accepting Drag & Drop operations. + * true if the DropTarget is accepting Drag & Drop operations. * * @serial */ @@ -855,4 +867,9 @@ public class DropTarget implements DropTargetListener, Serializable { */ private transient FlavorMap flavorMap; + + /* + * If the dragging is currently inside this drop target + */ + private transient boolean isDraggingInside; } diff --git a/jdk/src/share/classes/java/awt/dnd/DropTargetDragEvent.java b/jdk/src/share/classes/java/awt/dnd/DropTargetDragEvent.java index a315a6d5463..f74d0410664 100644 --- a/jdk/src/share/classes/java/awt/dnd/DropTargetDragEvent.java +++ b/jdk/src/share/classes/java/awt/dnd/DropTargetDragEvent.java @@ -49,9 +49,9 @@ import java.util.List; * source and the drop action selected by the user. The user can select a drop * action by pressing modifier keys during the drag operation: *

      - *   Ctrl + Shift -> ACTION_LINK
      - *   Ctrl         -> ACTION_COPY
      - *   Shift        -> ACTION_MOVE
      + *   Ctrl + Shift -> ACTION_LINK
      + *   Ctrl         -> ACTION_COPY
      + *   Shift        -> ACTION_MOVE
        * 
      * If the user selects a drop action, the user drop action is one of * DnDConstants that represents the selected drop action if this @@ -88,11 +88,11 @@ public class DropTargetDragEvent extends DropTargetEvent { * @param srcActions The source drop actions * * @throws NullPointerException if cursorLocn is null - * @throws IllegalArgumentException if dropAction is not one of + * @throws IllegalArgumentException if dropAction is not one of * DnDConstants. - * @throws IllegalArgumentException if srcActions is not + * @throws IllegalArgumentException if srcActions is not * a bitwise mask of DnDConstants. - * @throws IllegalArgumentException if dtc is null. + * @throws IllegalArgumentException if dtc is null. */ public DropTargetDragEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions) { diff --git a/jdk/src/share/classes/java/awt/dnd/DropTargetDropEvent.java b/jdk/src/share/classes/java/awt/dnd/DropTargetDropEvent.java index 2b36069d8ea..cb6ff209255 100644 --- a/jdk/src/share/classes/java/awt/dnd/DropTargetDropEvent.java +++ b/jdk/src/share/classes/java/awt/dnd/DropTargetDropEvent.java @@ -48,9 +48,9 @@ import java.util.List; * source and the drop action selected by the user. The user can select a drop * action by pressing modifier keys during the drag operation: *
      - *   Ctrl + Shift -> ACTION_LINK
      - *   Ctrl         -> ACTION_COPY
      - *   Shift        -> ACTION_MOVE
      + *   Ctrl + Shift -> ACTION_LINK
      + *   Ctrl         -> ACTION_COPY
      + *   Shift        -> ACTION_MOVE
        * 
      * If the user selects a drop action, the user drop action is one of * DnDConstants that represents the selected drop action if this @@ -92,13 +92,13 @@ public class DropTargetDropEvent extends DropTargetEvent { * @param dropAction the user drop action. * @param srcActions the source drop actions. * - * @throws NullPointerException + * @throws NullPointerException * if cursorLocn is null - * @throws IllegalArgumentException if dropAction is not one of - * DnDConstants. - * @throws IllegalArgumentException if srcActions is not - * a bitwise mask of DnDConstants. - * @throws IllegalArgumentException if dtc is null. + * @throws IllegalArgumentException + * if dropAction is not one of DnDConstants. + * @throws IllegalArgumentException + * if srcActions is not a bitwise mask of DnDConstants. + * @throws IllegalArgumentException if dtc is null. */ public DropTargetDropEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions) { @@ -136,13 +136,12 @@ public class DropTargetDropEvent extends DropTargetEvent { * @param srcActions the source drop actions. * @param isLocal True if the source is in the same JVM as the target * - * @throws NullPointerException if cursorLocn is - * null - * @throws IllegalArgumentException if dropAction is not one of - * DnDConstants. - * @throws IllegalArgumentException if srcActions is not - * a bitwise mask of DnDConstants. - * @throws IllegalArgumentException if dtc is null. + * @throws NullPointerException + * if cursorLocn is null + * @throws IllegalArgumentException + * if dropAction is not one of DnDConstants. + * @throws IllegalArgumentException if srcActions is not a bitwise mask of DnDConstants. + * @throws IllegalArgumentException if dtc is null. */ public DropTargetDropEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions, boolean isLocal) { diff --git a/jdk/src/share/classes/java/awt/dnd/InvalidDnDOperationException.java b/jdk/src/share/classes/java/awt/dnd/InvalidDnDOperationException.java index 72a81fc75b8..37bf2cb8e1b 100644 --- a/jdk/src/share/classes/java/awt/dnd/InvalidDnDOperationException.java +++ b/jdk/src/share/classes/java/awt/dnd/InvalidDnDOperationException.java @@ -29,7 +29,7 @@ package java.awt.dnd; * This exception is thrown by various methods in the java.awt.dnd package. * It is usually thrown to indicate that the target in question is unable * to undertake the requested operation that the present time, since the - * undrelying DnD system is not in the appropriate state. + * underlying DnD system is not in the appropriate state. * * @since 1.2 */ diff --git a/jdk/src/share/classes/java/awt/dnd/package.html b/jdk/src/share/classes/java/awt/dnd/package.html index b39c069b0c5..f2df34617bd 100644 --- a/jdk/src/share/classes/java/awt/dnd/package.html +++ b/jdk/src/share/classes/java/awt/dnd/package.html @@ -25,6 +25,7 @@ + Drag and Drop is a direct manipulation gesture found in many Graphical @@ -51,18 +52,18 @@ states (not entirely sequentially): associated with some presentation element (Component) in the GUI, to initiate a Drag and Drop of some potentially Transferable data. -

      +

    • 1 or more DropTarget(s) come into/go out of existence, associated with presentation elements in the GUI (Components), potentially capable of consuming Transferable data types. -

      +

    • A DragGestureRecognizer is obtained from the DragSource and is associated with a Component in order to track and identify any Drag initiating gesture by the user over the Component. -

      +

    • A user makes a Drag gesture over the Component, which the registered DragGestureRecognizer detects, and notifies its @@ -76,13 +77,13 @@ contains the abstract class MouseDragGestureRecognizer for recognizing mouse device gestures. Other abstract subclasses may be provided by the platform to support other input devices or particular Component class semantics. -

      +

    • The DragGestureListener causes the DragSource to initiate the Drag and Drop operation on behalf of the user, perhaps animating the GUI Cursor and/or rendering an Image of the item(s) that are the subject of the operation. -

      +

    • As the user gestures navigate over Component(s) in the GUI with associated DropTarget(s), the DragSource @@ -111,11 +112,11 @@ as follows: